summaryrefslogtreecommitdiff
path: root/efl/elementary/efl.elementary_clock.pxi
blob: f9a2f590f7c939d32246d1c68f0c09ffeac3af43 (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
# Copyright (c) 2008-2009 Simon Busch
#
# 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 Clock(LayoutClass):

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

    def time_set(self, hours, minutes, seconds):
        elm_clock_time_set(self.obj, hours, minutes, seconds)

    def time_get(self):
        cdef int hrs, min, sec

        elm_clock_time_get(self.obj, &hrs, &min, &sec)
        return (hrs, min, sec)

    property time:
        def __get__(self):
            cdef int hrs, min, sec
            elm_clock_time_get(self.obj, &hrs, &min, &sec)
            return (hrs, min, sec)

        def __set__(self, value):
            cdef int hrs, min, sec
            hrs, min, sec = value
            elm_clock_time_set(self.obj, hrs, min, sec)

    def edit_set(self, edit):
        elm_clock_edit_set(self.obj, edit)

    def edit_get(self, edit):
        return bool(elm_clock_edit_get(self.obj))

    property edit:
        def __get__(self):
            return bool(elm_clock_edit_get(self.obj))

        def __set__(self, edit):
            elm_clock_edit_set(self.obj, edit)

    def edit_mode_set(self, mode):
        elm_clock_edit_mode_set(self.obj, mode)

    def edit_mode_get(self):
        return elm_clock_edit_mode_get(self.obj)

    property edit_mode:
        def __get__(self):
            return elm_clock_edit_mode_get(self.obj)

        def __set__(self, mode):
            elm_clock_edit_mode_set(self.obj, mode)

    def show_am_pm_set(self, am_pm):
        elm_clock_show_am_pm_set(self.obj, am_pm)

    def show_am_pm_get(self):
        return elm_clock_show_am_pm_get(self.obj)

    property show_am_pm:
        def __get__(self):
            return elm_clock_show_am_pm_get(self.obj)

        def __set__(self, am_pm):
            elm_clock_show_am_pm_set(self.obj, am_pm)

    def show_seconds_set(self, seconds):
        elm_clock_show_seconds_set(self.obj, seconds)

    def show_seconds_get(self):
        return elm_clock_show_seconds_get(self.obj)

    property show_seconds:
        def __get__(self):
            return elm_clock_show_seconds_get(self.obj)

        def __set__(self, seconds):
            elm_clock_show_seconds_set(self.obj, seconds)

    def first_interval_set(self, interval):
        elm_clock_first_interval_set(self.obj, interval)

    def first_interval_get(self):
        return elm_clock_first_interval_get(self.obj)

    property first_interval:
        def __get__(self):
            return elm_clock_first_interval_get(self.obj)

        def __set__(self, interval):
            elm_clock_first_interval_set(self.obj, interval)

    def callback_changed_add(self, func, *args, **kwargs):
        self._callback_add("changed", func, *args, **kwargs)

    def callback_changed_del(self, func):
        self._callback_del("changed", func)


_object_mapping_register("elm_clock", Clock)