summaryrefslogtreecommitdiff
path: root/efl/elementary/efl.elementary_naviframe.pxi
blob: 23b9efff4895206b75801a55091ea5ba4b95808d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# Copyright (c) 2008-2009 Simon Busch
# Copyright (c) 2010-2010 ProFUSION embedded systems
#
# This file is part of python-elementary.
#
# python-elementary is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# python-elementary is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with python-elementary.  If not, see <http://www.gnu.org/licenses/>.
#


cdef class NaviframeItem(ObjectItem):

    def item_pop_to(self):
        _METHOD_DEPRECATED(self, "pop_to")
        elm_naviframe_item_pop_to(self.item)

    def pop_to(self):
        elm_naviframe_item_pop_to(self.item)

    def item_promote(self):
        _METHOD_DEPRECATED(self, "promote")
        elm_naviframe_item_promote(self.item)

    def promote(self):
        elm_naviframe_item_promote(self.item)

    def style_set(self, style):
        elm_naviframe_item_style_set(self.item, _cfruni(style))

    def style_get(self):
        return _ctouni(elm_naviframe_item_style_get(self.item))

    property style:
        def __get__(self):
            return _ctouni(elm_naviframe_item_style_get(self.item))
        def __set__(self, style):
            elm_naviframe_item_style_set(self.item, _cfruni(style))

    def title_visible_set(self, visible):
        elm_naviframe_item_title_visible_set(self.item, visible)

    def title_visible_get(self):
        return bool(elm_naviframe_item_title_visible_get(self.item))

    property title_visible:
        def __get__(self):
            return bool(elm_naviframe_item_title_visible_get(self.item))
        def __set__(self, visible):
            elm_naviframe_item_title_visible_set(self.item, visible)


cdef class Naviframe(LayoutClass):

    def __init__(self, evasObject parent):
        self._set_obj(elm_naviframe_add(parent.obj))

    def item_push(self, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
        cdef NaviframeItem ret = NaviframeItem()
        cdef Elm_Object_Item *item

        item = elm_naviframe_item_push(self.obj, _cfruni(title_label),
                                       prev_btn.obj if prev_btn else NULL,
                                       next_btn.obj if next_btn else NULL,
                                       content.obj if content else NULL,
                                       _cfruni(item_style) if item_style else NULL)
        if item != NULL:
            ret._set_obj(item)
            return ret
        else:
            return None

    def item_insert_before(self, NaviframeItem before, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
        cdef NaviframeItem ret = NaviframeItem()
        cdef Elm_Object_Item *item

        item = elm_naviframe_item_insert_before(self.obj, before.item, _cfruni(title_label), prev_btn.obj, next_btn.obj, content.obj, _cfruni(item_style))
        if item != NULL:
            ret._set_obj(item)
            return ret
        else:
            return None

    def item_insert_after(self, NaviframeItem after, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
        cdef NaviframeItem ret = NaviframeItem()
        cdef Elm_Object_Item *item

        item = elm_naviframe_item_insert_after(self.obj, after.item, _cfruni(title_label), prev_btn.obj, next_btn.obj, content.obj, _cfruni(item_style))
        if item != NULL:
            ret._set_obj(item)
            return ret
        else:
            return None

    def item_pop(self):
        return object_from_instance(elm_naviframe_item_pop(self.obj))

    def content_preserve_on_pop_set(self, preserve):
        elm_naviframe_content_preserve_on_pop_set(self.obj, preserve)

    def content_preserve_on_pop_get(self):
        return bool(elm_naviframe_content_preserve_on_pop_get(self.obj))

    property content_preserve_on_pop:
        def __get__(self):
            return bool(elm_naviframe_content_preserve_on_pop_get(self.obj))
        def __set__(self, preserve):
            elm_naviframe_content_preserve_on_pop_set(self.obj, preserve)

    def top_item_get(self):
        return _object_item_to_python(elm_naviframe_top_item_get(self.obj))

    property top_item:
        def __get__(self):
            return _object_item_to_python(elm_naviframe_top_item_get(self.obj))

    def bottom_item_get(self):
        return _object_item_to_python(elm_naviframe_bottom_item_get(self.obj))

    property bottom_item:
        def __get__(self):
            return _object_item_to_python(elm_naviframe_bottom_item_get(self.obj))

    def prev_btn_auto_pushed_set(self, auto_pushed):
        elm_naviframe_prev_btn_auto_pushed_set(self.obj, auto_pushed)

    def prev_btn_auto_pushed_get(self):
        return bool(elm_naviframe_prev_btn_auto_pushed_get(self.obj))

    property prev_btn_auto_pushed:
        def __get__(self):
            return bool(elm_naviframe_prev_btn_auto_pushed_get(self.obj))
        def __set__(self, auto_pushed):
            elm_naviframe_prev_btn_auto_pushed_set(self.obj, auto_pushed)

    def items_get(self):
        return _object_item_list_to_python(elm_naviframe_items_get(self.obj))

    property items:
        def __get__(self):
            return _object_item_list_to_python(elm_naviframe_items_get(self.obj))

    def event_enabled_set(self, enabled):
        elm_naviframe_event_enabled_set(self.obj, enabled)

    def event_enabled_get(self):
        return bool(elm_naviframe_event_enabled_get(self.obj))

    property event_enabled:
        def __get__(self):
            return bool(elm_naviframe_event_enabled_get(self.obj))
        def __set__(self, enabled):
            elm_naviframe_event_enabled_set(self.obj, enabled)

    def item_simple_push(self, evasObject content):
        cdef NaviframeItem ret = NaviframeItem()
        cdef Elm_Object_Item *item

        item = elm_naviframe_item_simple_push(self.obj, content.obj)
        if item != NULL:
            ret._set_obj(item)
            return ret
        else:
            return None

    def item_simple_promote(self, evasObject content):
        elm_naviframe_item_simple_promote(self.obj, content.obj)

    def callback_transition_finished_add(self, func, *args, **kwargs):
        self._callback_add("transition,finished", func, *args, **kwargs)

    def callback_transition_finished_del(self, func):
        self._callback_del("transition,finished", func)

    def callback_title_clicked_add(self, func, *args, **kwargs):
        self._callback_add("title,clicked", func, *args, **kwargs)

    def callback_title_clicked_del(self, func):
        self._callback_del("title,clicked", func)


_object_mapping_register("elm_naviframe", Naviframe)