Diffstat (limited to 'libopie2/opieui/otimepicker.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/otimepicker.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libopie2/opieui/otimepicker.h b/libopie2/opieui/otimepicker.h index 2da7773..01bb557 100644 --- a/libopie2/opieui/otimepicker.h +++ b/libopie2/opieui/otimepicker.h | |||
@@ -11,73 +11,72 @@ | |||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef OTIMEPICKER_H | 30 | #ifndef OTIMEPICKER_H |
31 | #define OTIMEPICKER_H | 31 | #define OTIMEPICKER_H |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/oclickablelabel.h> | 34 | #include <opie2/oclickablelabel.h> |
35 | #include "otimepickerbase.h" | 35 | #include <opie2/otimepickerbase.h> |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qwidget.h> | 38 | #include <qwidget.h> |
39 | #include <qvaluelist.h> | 39 | #include <qvaluelist.h> |
40 | #include <qdatetime.h> | 40 | #include <qdatetime.h> |
41 | #include <qdialog.h> | 41 | #include <qdialog.h> |
42 | 42 | ||
43 | using namespace Opie; | ||
44 | 43 | ||
45 | // namespace Opie | 44 | namespace Opie { |
46 | // { | 45 | namespace Ui { |
47 | 46 | ||
48 | /** | 47 | /** |
49 | * A class to pick time. It uses clickable labels | 48 | * A class to pick time. It uses clickable labels |
50 | * internally to allow a quick selection of a time. | 49 | * internally to allow a quick selection of a time. |
51 | * A time can be selected by two clicks of a user | 50 | * A time can be selected by two clicks of a user |
52 | * | 51 | * |
53 | * @short A widget to quickly pick a QTime | 52 | * @short A widget to quickly pick a QTime |
54 | * @version 1.0 | 53 | * @version 1.0 |
55 | * @see QWidget | 54 | * @see QWidget |
56 | * @see QTime | 55 | * @see QTime |
57 | * @author Hakan Ardo, Stefan Eilers | 56 | * @author Hakan Ardo, Stefan Eilers |
58 | */ | 57 | */ |
59 | class OTimePicker: public QWidget | 58 | class OTimePicker : public QWidget |
60 | { | 59 | { |
61 | Q_OBJECT | 60 | Q_OBJECT |
62 | 61 | ||
63 | public: | 62 | public: |
64 | OTimePicker(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); | 63 | OTimePicker(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); |
65 | 64 | ||
66 | public slots: | 65 | public slots: |
67 | void setHour(int h); | 66 | void setHour(int h); |
68 | void setMinute(int m); | 67 | void setMinute(int m); |
69 | void setTime( const QTime& ); | 68 | void setTime( const QTime& ); |
70 | void setTime( int h, int m ); | 69 | void setTime( int h, int m ); |
71 | 70 | ||
72 | public: | 71 | public: |
73 | QTime time()const; | 72 | QTime time()const; |
74 | 73 | ||
75 | private: | 74 | private: |
76 | QValueList<OClickableLabel *> hourLst; | 75 | QValueList<OClickableLabel *> hourLst; |
77 | QValueList<OClickableLabel *> minuteLst; | 76 | QValueList<OClickableLabel *> minuteLst; |
78 | QTime tm; | 77 | QTime tm; |
79 | struct Private; | 78 | struct Private; |
80 | Private *d; | 79 | Private *d; |
81 | 80 | ||
82 | private slots: | 81 | private slots: |
83 | void slotHour(bool b); | 82 | void slotHour(bool b); |
@@ -93,33 +92,41 @@ signals: | |||
93 | /** | 92 | /** |
94 | * | 93 | * |
95 | * @short A small dialog to pick a time | 94 | * @short A small dialog to pick a time |
96 | * @version 1.0 | 95 | * @version 1.0 |
97 | * @author Stefan Eilers | 96 | * @author Stefan Eilers |
98 | * | 97 | * |
99 | **/ | 98 | **/ |
100 | 99 | ||
101 | class OTimePickerDialog: public OTimePickerDialogBase | 100 | class OTimePickerDialog: public OTimePickerDialogBase |
102 | { | 101 | { |
103 | Q_OBJECT | 102 | Q_OBJECT |
104 | 103 | ||
105 | public: | 104 | public: |
106 | OTimePickerDialog ( QWidget* parent = 0, const char* name = NULL, WFlags fl = 0 ); | 105 | OTimePickerDialog ( QWidget* parent = 0, const char* name = NULL, WFlags fl = 0 ); |
107 | ~OTimePickerDialog() { }; | 106 | ~OTimePickerDialog() { }; |
108 | 107 | ||
109 | QTime time()const; | 108 | QTime time()const; |
110 | 109 | ||
111 | public slots: | 110 | public slots: |
112 | void setTime( const QTime& time ); | 111 | void setTime( const QTime& time ); |
113 | void setHour( const QString& hour ); | 112 | void setHour( const QString& hour ); |
114 | void setMinute( const QString& minute ); | 113 | void setMinute( const QString& minute ); |
115 | 114 | ||
116 | private: | 115 | private: |
116 | OTimePicker *m_timePicker; | ||
117 | QTime m_time; | 117 | QTime m_time; |
118 | class Private; | 118 | class Private; |
119 | Private* d; | 119 | Private* d; |
120 | }; | 120 | }; |
121 | 121 | ||
122 | // }; | 122 | } |
123 | } | ||
123 | 124 | ||
125 | /* for Qt2 */ | ||
126 | #if ( QT_VERSION-0 >= 0x030000 ) | ||
127 | #error "Fix the UI File to use namespaces" | ||
128 | #else | ||
129 | typedef Opie::Ui::OTimePicker OUIOTimePicker; | ||
130 | #endif | ||
124 | #endif | 131 | #endif |
125 | 132 | ||