author | clem <clem> | 2004-10-07 14:45:31 (UTC) |
---|---|---|
committer | clem <clem> | 2004-10-07 14:45:31 (UTC) |
commit | 6f940f13c32faedef26d23dd931946225d101457 (patch) (unidiff) | |
tree | c18695dadf8925013b40f1a96344279f280e2c5e | |
parent | 627c27e2559b3b67983b37912170ddc5bca84b1b (diff) | |
download | opie-6f940f13c32faedef26d23dd931946225d101457.zip opie-6f940f13c32faedef26d23dd931946225d101457.tar.gz opie-6f940f13c32faedef26d23dd931946225d101457.tar.bz2 |
fixed typo chanegd -> changed in doxygen comment
-rw-r--r-- | libopie/otabwidget.h | 2 | ||||
-rw-r--r-- | libopie2/opieui/otabwidget.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libopie/otabwidget.h b/libopie/otabwidget.h index acb9223..047eaa1 100644 --- a/libopie/otabwidget.h +++ b/libopie/otabwidget.h | |||
@@ -1,285 +1,285 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | 4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OTABWIDGET_H | 32 | #ifndef OTABWIDGET_H |
33 | #define OTABWIDGET_H | 33 | #define OTABWIDGET_H |
34 | 34 | ||
35 | #include "otabinfo.h" | 35 | #include "otabinfo.h" |
36 | 36 | ||
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include <qlist.h> | 38 | #include <qlist.h> |
39 | 39 | ||
40 | class OTabBar; | 40 | class OTabBar; |
41 | class QComboBox; | 41 | class QComboBox; |
42 | class QPixmap; | 42 | class QPixmap; |
43 | class QTabBar; | 43 | class QTabBar; |
44 | class QWidgetStack; | 44 | class QWidgetStack; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * @class OTabWidget | 47 | * @class OTabWidget |
48 | * @brief The OTabWidget class provides a stack of widgets. | 48 | * @brief The OTabWidget class provides a stack of widgets. |
49 | * | 49 | * |
50 | * OTabWidget is a derivation of TrollTech's QTabWidget which provides | 50 | * OTabWidget is a derivation of TrollTech's QTabWidget which provides |
51 | * a stack of widgets. Widgets can be selected using either a tab bar or | 51 | * a stack of widgets. Widgets can be selected using either a tab bar or |
52 | * drop down list box. | 52 | * drop down list box. |
53 | * | 53 | * |
54 | * The normal way to use OTabWidget is to do the following in the | 54 | * The normal way to use OTabWidget is to do the following in the |
55 | * constructor: | 55 | * constructor: |
56 | * - Create a OTabWidget. | 56 | * - Create a OTabWidget. |
57 | * - Create a QWidget for each of the pages in the control, insert | 57 | * - Create a QWidget for each of the pages in the control, insert |
58 | * children into it, set up geometry management for it, and use addTab() | 58 | * children into it, set up geometry management for it, and use addTab() |
59 | * to add the widget. | 59 | * to add the widget. |
60 | */ | 60 | */ |
61 | class OTabWidget : public QWidget | 61 | class OTabWidget : public QWidget |
62 | { | 62 | { |
63 | Q_OBJECT | 63 | Q_OBJECT |
64 | public: | 64 | public: |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * @enum TabStyle | 67 | * @enum TabStyle |
68 | * @brief Defines how the widget selection control is displayed. | 68 | * @brief Defines how the widget selection control is displayed. |
69 | * | 69 | * |
70 | * Valid values: | 70 | * Valid values: |
71 | * - Global: use globally selected options (qpe.conf - TabStyle & TabPosition) | 71 | * - Global: use globally selected options (qpe.conf - TabStyle & TabPosition) |
72 | * - TextTab: Tabbed widget selection with text labels | 72 | * - TextTab: Tabbed widget selection with text labels |
73 | * - IconTab: Tabbed widget selection with icon labels, text label for active widget | 73 | * - IconTab: Tabbed widget selection with icon labels, text label for active widget |
74 | * (similar to Opie launcher) | 74 | * (similar to Opie launcher) |
75 | * - TextList: Drop down list widget selection with text labels | 75 | * - TextList: Drop down list widget selection with text labels |
76 | * - IconList: Drop down list widget selection with icon & text labels | 76 | * - IconList: Drop down list widget selection with icon & text labels |
77 | */ | 77 | */ |
78 | enum TabStyle { Global, TextTab, IconTab, TextList, IconList }; | 78 | enum TabStyle { Global, TextTab, IconTab, TextList, IconList }; |
79 | 79 | ||
80 | /** | 80 | /** |
81 | * @enum TabPosition | 81 | * @enum TabPosition |
82 | * @brief Defines where the widget selection control is drawn. | 82 | * @brief Defines where the widget selection control is drawn. |
83 | * | 83 | * |
84 | * Valid values: | 84 | * Valid values: |
85 | * - Top: Widget selection control is drawn above widgets | 85 | * - Top: Widget selection control is drawn above widgets |
86 | * - Bottom: Widget selection control is drawn below widgets | 86 | * - Bottom: Widget selection control is drawn below widgets |
87 | */ | 87 | */ |
88 | enum TabPosition { Top, Bottom }; | 88 | enum TabPosition { Top, Bottom }; |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * @fn OTabWidget( QWidget *parent = 0, const char *name = 0, TabStyle s = Global, TabPosition p = Top ) | 91 | * @fn OTabWidget( QWidget *parent = 0, const char *name = 0, TabStyle s = Global, TabPosition p = Top ) |
92 | * @brief Object constructor. | 92 | * @brief Object constructor. |
93 | * | 93 | * |
94 | * @param parent Pointer to parent of this control. | 94 | * @param parent Pointer to parent of this control. |
95 | * @param name Name of control. | 95 | * @param name Name of control. |
96 | * @param s Style of widget selection control. | 96 | * @param s Style of widget selection control. |
97 | * @param p Position of the widget selection control. | 97 | * @param p Position of the widget selection control. |
98 | * | 98 | * |
99 | * Constructs a new OTabWidget control with parent and name. The style and position parameters | 99 | * Constructs a new OTabWidget control with parent and name. The style and position parameters |
100 | * determine how the widget selection control will be displayed. | 100 | * determine how the widget selection control will be displayed. |
101 | */ | 101 | */ |
102 | // FIXME WFlags? -zecke | 102 | // FIXME WFlags? -zecke |
103 | OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top ); | 103 | OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top ); |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * @fn ~OTabWidget() | 106 | * @fn ~OTabWidget() |
107 | * @brief Object destructor. | 107 | * @brief Object destructor. |
108 | */ | 108 | */ |
109 | ~OTabWidget(); | 109 | ~OTabWidget(); |
110 | 110 | ||
111 | /** | 111 | /** |
112 | * @fn addTab( QWidget *child, const QString &icon, const QString &label ) | 112 | * @fn addTab( QWidget *child, const QString &icon, const QString &label ) |
113 | * @brief Add new widget to control. | 113 | * @brief Add new widget to control. |
114 | * | 114 | * |
115 | * @param child Widget control. | 115 | * @param child Widget control. |
116 | * @param icon Path to icon. | 116 | * @param icon Path to icon. |
117 | * @param label Text label. | 117 | * @param label Text label. |
118 | */ | 118 | */ |
119 | void addTab( QWidget *, const QString &, const QString & ); | 119 | void addTab( QWidget *, const QString &, const QString & ); |
120 | 120 | ||
121 | /** | 121 | /** |
122 | * @fn removePage( QWidget *widget ) | 122 | * @fn removePage( QWidget *widget ) |
123 | * @brief Remove widget from control. Does not delete widget. | 123 | * @brief Remove widget from control. Does not delete widget. |
124 | * | 124 | * |
125 | * @param widget Widget control to be removed. | 125 | * @param widget Widget control to be removed. |
126 | */ | 126 | */ |
127 | /* ### Page vs. Tab.. yes the widget is a Page but then is addTab wrong -zecke */ | 127 | /* ### Page vs. Tab.. yes the widget is a Page but then is addTab wrong -zecke */ |
128 | void removePage( QWidget * ); | 128 | void removePage( QWidget * ); |
129 | 129 | ||
130 | /** | 130 | /** |
131 | * @fn changeTab( QWidget *widget, const QString &icon, const QString &label ) | 131 | * @fn changeTab( QWidget *widget, const QString &icon, const QString &label ) |
132 | * @brief Change text and/or icon for existing tab | 132 | * @brief Change text and/or icon for existing tab |
133 | * | 133 | * |
134 | * @param child Widget control. | 134 | * @param child Widget control. |
135 | * @param icon Path to icon. | 135 | * @param icon Path to icon. |
136 | * @param label Text label. | 136 | * @param label Text label. |
137 | */ | 137 | */ |
138 | void changeTab( QWidget *, const QString &, const QString & ); | 138 | void changeTab( QWidget *, const QString &, const QString & ); |
139 | 139 | ||
140 | /** | 140 | /** |
141 | * @fn tabStyle()const | 141 | * @fn tabStyle()const |
142 | * @brief Returns current widget selection control style. | 142 | * @brief Returns current widget selection control style. |
143 | */ | 143 | */ |
144 | TabStyle tabStyle() const; | 144 | TabStyle tabStyle() const; |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * @fn setTabStyle( TabStyle s ) | 147 | * @fn setTabStyle( TabStyle s ) |
148 | * @brief Set the current widget selection control style. | 148 | * @brief Set the current widget selection control style. |
149 | * | 149 | * |
150 | * @param s New style to be used. | 150 | * @param s New style to be used. |
151 | */ | 151 | */ |
152 | void setTabStyle( TabStyle ); | 152 | void setTabStyle( TabStyle ); |
153 | 153 | ||
154 | /** | 154 | /** |
155 | * @fn tabPosition()const | 155 | * @fn tabPosition()const |
156 | * @brief Returns current widget selection control position. | 156 | * @brief Returns current widget selection control position. |
157 | */ | 157 | */ |
158 | TabPosition tabPosition() const; | 158 | TabPosition tabPosition() const; |
159 | 159 | ||
160 | /** | 160 | /** |
161 | * @fn setTabPosition( TabPosition p ) | 161 | * @fn setTabPosition( TabPosition p ) |
162 | * @brief Set the current widget selection control position. | 162 | * @brief Set the current widget selection control position. |
163 | * | 163 | * |
164 | * @param p New position of widget selection control. | 164 | * @param p New position of widget selection control. |
165 | */ | 165 | */ |
166 | void setTabPosition( TabPosition ); | 166 | void setTabPosition( TabPosition ); |
167 | 167 | ||
168 | /** | 168 | /** |
169 | * @fn setCurrentTab( QWidget *childwidget ) | 169 | * @fn setCurrentTab( QWidget *childwidget ) |
170 | * @brief Selects and brings to top the desired widget by using widget pointer. | 170 | * @brief Selects and brings to top the desired widget by using widget pointer. |
171 | * | 171 | * |
172 | * @param childwidget Widget to select. | 172 | * @param childwidget Widget to select. |
173 | */ | 173 | */ |
174 | void setCurrentTab( QWidget * ); | 174 | void setCurrentTab( QWidget * ); |
175 | 175 | ||
176 | /** | 176 | /** |
177 | * @fn setCurrentTab( const QString &tabname ) | 177 | * @fn setCurrentTab( const QString &tabname ) |
178 | * @brief Selects and brings to top the desired widget, by using label. | 178 | * @brief Selects and brings to top the desired widget, by using label. |
179 | * | 179 | * |
180 | * @param tabname Text label for widget to select. | 180 | * @param tabname Text label for widget to select. |
181 | */ | 181 | */ |
182 | void setCurrentTab( const QString & ); | 182 | void setCurrentTab( const QString & ); |
183 | 183 | ||
184 | /** | 184 | /** |
185 | * @fn setCurrentTab( int ) | 185 | * @fn setCurrentTab( int ) |
186 | * @brief Selects and brings to top the desired widget, by using id. | 186 | * @brief Selects and brings to top the desired widget, by using id. |
187 | * | 187 | * |
188 | * @param tab id for widget to select. | 188 | * @param tab id for widget to select. |
189 | */ | 189 | */ |
190 | void setCurrentTab(int); | 190 | void setCurrentTab(int); |
191 | 191 | ||
192 | /** | 192 | /** |
193 | * @fn sizeHint()const | 193 | * @fn sizeHint()const |
194 | * @brief Reimplemented for internal purposes. | 194 | * @brief Reimplemented for internal purposes. |
195 | */ | 195 | */ |
196 | QSize sizeHint() const; | 196 | QSize sizeHint() const; |
197 | 197 | ||
198 | /** | 198 | /** |
199 | * @fn currentTab( ) | 199 | * @fn currentTab( ) |
200 | * @brief returns current tab id. | 200 | * @brief returns current tab id. |
201 | */ | 201 | */ |
202 | // ### make const | 202 | // ### make const |
203 | int currentTab()/* const */; | 203 | int currentTab()/* const */; |
204 | /** | 204 | /** |
205 | * @brief returns the current page of the active tab | 205 | * @brief returns the current page of the active tab |
206 | * | 206 | * |
207 | * @since 1.2 | 207 | * @since 1.2 |
208 | */ | 208 | */ |
209 | QWidget* currentWidget()const; | 209 | QWidget* currentWidget()const; |
210 | 210 | ||
211 | protected: | 211 | protected: |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * @fn resizeEvent( QResizeEvent * ) | 214 | * @fn resizeEvent( QResizeEvent * ) |
215 | * @brief Reimplemented for internal purposes. | 215 | * @brief Reimplemented for internal purposes. |
216 | */ | 216 | */ |
217 | void resizeEvent( QResizeEvent * ); | 217 | void resizeEvent( QResizeEvent * ); |
218 | 218 | ||
219 | private: | 219 | private: |
220 | OTabInfoList tabs; | 220 | OTabInfoList tabs; |
221 | OTabInfo *currTab; | 221 | OTabInfo *currTab; |
222 | 222 | ||
223 | TabStyle tabBarStyle; | 223 | TabStyle tabBarStyle; |
224 | TabPosition tabBarPosition; | 224 | TabPosition tabBarPosition; |
225 | 225 | ||
226 | QWidgetStack *tabBarStack; | 226 | QWidgetStack *tabBarStack; |
227 | OTabBar *tabBar; | 227 | OTabBar *tabBar; |
228 | QComboBox *tabList; | 228 | QComboBox *tabList; |
229 | 229 | ||
230 | QWidgetStack *widgetStack; | 230 | QWidgetStack *widgetStack; |
231 | class Private; | 231 | class Private; |
232 | Private* d; | 232 | Private* d; |
233 | 233 | ||
234 | /** | 234 | /** |
235 | * @fn loadSmooth( const QString &name ) | 235 | * @fn loadSmooth( const QString &name ) |
236 | * @brief Loads icon for widget. | 236 | * @brief Loads icon for widget. |
237 | * | 237 | * |
238 | * @param name Name of icon image file. | 238 | * @param name Name of icon image file. |
239 | */ | 239 | */ |
240 | QPixmap loadSmooth( const QString & ); | 240 | QPixmap loadSmooth( const QString & ); |
241 | 241 | ||
242 | /** | 242 | /** |
243 | * @fn selectTab( OTabInfo *tab ) | 243 | * @fn selectTab( OTabInfo *tab ) |
244 | * @brief Internal function to select desired widget. | 244 | * @brief Internal function to select desired widget. |
245 | * | 245 | * |
246 | * @param tab Pointer to data for widget. | 246 | * @param tab Pointer to data for widget. |
247 | */ | 247 | */ |
248 | void selectTab( OTabInfo * ); | 248 | void selectTab( OTabInfo * ); |
249 | 249 | ||
250 | /** | 250 | /** |
251 | * @fn setUpLayout() | 251 | * @fn setUpLayout() |
252 | * @brief Internal function to adjust layout. | 252 | * @brief Internal function to adjust layout. |
253 | */ | 253 | */ |
254 | void setUpLayout(); | 254 | void setUpLayout(); |
255 | 255 | ||
256 | 256 | ||
257 | signals: | 257 | signals: |
258 | /** | 258 | /** |
259 | * @fn currentChanegd( QWidget *widget ) | 259 | * @fn currentChanged( QWidget *widget ) |
260 | * @brief This signal is emitted whenever the widget has changed. | 260 | * @brief This signal is emitted whenever the widget has changed. |
261 | * | 261 | * |
262 | * @param widget Pointer to new current widget. | 262 | * @param widget Pointer to new current widget. |
263 | */ | 263 | */ |
264 | void currentChanged( QWidget * ); | 264 | void currentChanged( QWidget * ); |
265 | 265 | ||
266 | private slots: | 266 | private slots: |
267 | 267 | ||
268 | /** | 268 | /** |
269 | * @fn slotTabBarSelected( int id ) | 269 | * @fn slotTabBarSelected( int id ) |
270 | * @brief Slot which is called when a tab is selected. | 270 | * @brief Slot which is called when a tab is selected. |
271 | * | 271 | * |
272 | * @param id ID of widget selected. | 272 | * @param id ID of widget selected. |
273 | */ | 273 | */ |
274 | void slotTabBarSelected( int ); | 274 | void slotTabBarSelected( int ); |
275 | 275 | ||
276 | /** | 276 | /** |
277 | * @fn slotTabListSelected( int index ) | 277 | * @fn slotTabListSelected( int index ) |
278 | * @brief Slot which is called when a drop down selection is made. | 278 | * @brief Slot which is called when a drop down selection is made. |
279 | * | 279 | * |
280 | * @param id Index of widget selected. | 280 | * @param id Index of widget selected. |
281 | */ | 281 | */ |
282 | void slotTabListSelected( int ); | 282 | void slotTabListSelected( int ); |
283 | }; | 283 | }; |
284 | 284 | ||
285 | #endif | 285 | #endif |
diff --git a/libopie2/opieui/otabwidget.h b/libopie2/opieui/otabwidget.h index 6a64b7d..b3423e8 100644 --- a/libopie2/opieui/otabwidget.h +++ b/libopie2/opieui/otabwidget.h | |||
@@ -1,292 +1,292 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) 2002 Dan Williams <williamsdr@acm.org> | 3 | Copyright (C) 2002 Dan Williams <williamsdr@acm.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
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 | 30 | ||
31 | #ifndef OTABWIDGET_H | 31 | #ifndef OTABWIDGET_H |
32 | #define OTABWIDGET_H | 32 | #define OTABWIDGET_H |
33 | 33 | ||
34 | /* OPIE */ | 34 | /* OPIE */ |
35 | #include <opie2/otabinfo.h> | 35 | #include <opie2/otabinfo.h> |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qwidget.h> | 38 | #include <qwidget.h> |
39 | #include <qlist.h> | 39 | #include <qlist.h> |
40 | 40 | ||
41 | 41 | ||
42 | class QComboBox; | 42 | class QComboBox; |
43 | class QPixmap; | 43 | class QPixmap; |
44 | class QTabBar; | 44 | class QTabBar; |
45 | class QWidgetStack; | 45 | class QWidgetStack; |
46 | 46 | ||
47 | namespace Opie { | 47 | namespace Opie { |
48 | namespace Ui { | 48 | namespace Ui { |
49 | 49 | ||
50 | class OTabBar; | 50 | class OTabBar; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * @class OTabWidget | 53 | * @class OTabWidget |
54 | * @brief The OTabWidget class provides a stack of widgets. | 54 | * @brief The OTabWidget class provides a stack of widgets. |
55 | * | 55 | * |
56 | * OTabWidget is a derivation of TrollTech's QTabWidget which provides | 56 | * OTabWidget is a derivation of TrollTech's QTabWidget which provides |
57 | * a stack of widgets. Widgets can be selected using either a tab bar or | 57 | * a stack of widgets. Widgets can be selected using either a tab bar or |
58 | * drop down list box. | 58 | * drop down list box. |
59 | * | 59 | * |
60 | * The normal way to use OTabWidget is to do the following in the | 60 | * The normal way to use OTabWidget is to do the following in the |
61 | * constructor: | 61 | * constructor: |
62 | * - Create a OTabWidget. | 62 | * - Create a OTabWidget. |
63 | * - Create a QWidget for each of the pages in the control, insert | 63 | * - Create a QWidget for each of the pages in the control, insert |
64 | * children into it, set up geometry management for it, and use addTab() | 64 | * children into it, set up geometry management for it, and use addTab() |
65 | * to add the widget. | 65 | * to add the widget. |
66 | */ | 66 | */ |
67 | class OTabWidget : public QWidget | 67 | class OTabWidget : public QWidget |
68 | { | 68 | { |
69 | Q_OBJECT | 69 | Q_OBJECT |
70 | 70 | ||
71 | public: | 71 | public: |
72 | /** | 72 | /** |
73 | * @enum TabStyle | 73 | * @enum TabStyle |
74 | * @brief Defines how the widget selection control is displayed. | 74 | * @brief Defines how the widget selection control is displayed. |
75 | * | 75 | * |
76 | * Valid values: | 76 | * Valid values: |
77 | * - Global: use globally selected options (qpe.conf - TabStyle & TabPosition) | 77 | * - Global: use globally selected options (qpe.conf - TabStyle & TabPosition) |
78 | * - TextTab: Tabbed widget selection with text labels | 78 | * - TextTab: Tabbed widget selection with text labels |
79 | * - IconTab: Tabbed widget selection with icon labels, text label for active widget | 79 | * - IconTab: Tabbed widget selection with icon labels, text label for active widget |
80 | * (similar to Opie launcher) | 80 | * (similar to Opie launcher) |
81 | * - TextList: Drop down list widget selection with text labels | 81 | * - TextList: Drop down list widget selection with text labels |
82 | * - IconList: Drop down list widget selection with icon & text labels | 82 | * - IconList: Drop down list widget selection with icon & text labels |
83 | */ | 83 | */ |
84 | enum TabStyle { Global, TextTab, IconTab, TextList, IconList }; | 84 | enum TabStyle { Global, TextTab, IconTab, TextList, IconList }; |
85 | 85 | ||
86 | /** | 86 | /** |
87 | * @enum TabPosition | 87 | * @enum TabPosition |
88 | * @brief Defines where the widget selection control is drawn. | 88 | * @brief Defines where the widget selection control is drawn. |
89 | * | 89 | * |
90 | * Valid values: | 90 | * Valid values: |
91 | * - Top: Widget selection control is drawn above widgets | 91 | * - Top: Widget selection control is drawn above widgets |
92 | * - Bottom: Widget selection control is drawn below widgets | 92 | * - Bottom: Widget selection control is drawn below widgets |
93 | */ | 93 | */ |
94 | enum TabPosition { Top, Bottom }; | 94 | enum TabPosition { Top, Bottom }; |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * @fn OTabWidget( QWidget *parent = 0, const char *name = 0, TabStyle s = Global, TabPosition p = Top ) | 97 | * @fn OTabWidget( QWidget *parent = 0, const char *name = 0, TabStyle s = Global, TabPosition p = Top ) |
98 | * @brief Object constructor. | 98 | * @brief Object constructor. |
99 | * | 99 | * |
100 | * @param parent Pointer to parent of this control. | 100 | * @param parent Pointer to parent of this control. |
101 | * @param name Name of control. | 101 | * @param name Name of control. |
102 | * @param s Style of widget selection control. | 102 | * @param s Style of widget selection control. |
103 | * @param p Position of the widget selection control. | 103 | * @param p Position of the widget selection control. |
104 | * | 104 | * |
105 | * Constructs a new OTabWidget control with parent and name. The style and position parameters | 105 | * Constructs a new OTabWidget control with parent and name. The style and position parameters |
106 | * determine how the widget selection control will be displayed. | 106 | * determine how the widget selection control will be displayed. |
107 | */ | 107 | */ |
108 | OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top ); | 108 | OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top ); |
109 | 109 | ||
110 | /** | 110 | /** |
111 | * @fn ~OTabWidget() | 111 | * @fn ~OTabWidget() |
112 | * @brief Object destructor. | 112 | * @brief Object destructor. |
113 | */ | 113 | */ |
114 | ~OTabWidget(); | 114 | ~OTabWidget(); |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * @fn addTab( QWidget *child, const QString &icon, const QString &label ) | 117 | * @fn addTab( QWidget *child, const QString &icon, const QString &label ) |
118 | * @brief Add new widget to control. | 118 | * @brief Add new widget to control. |
119 | * | 119 | * |
120 | * @param child Widget control. | 120 | * @param child Widget control. |
121 | * @param icon Path to icon. | 121 | * @param icon Path to icon. |
122 | * @param label Text label. | 122 | * @param label Text label. |
123 | */ | 123 | */ |
124 | void addTab( QWidget *, const QString &, const QString & ); | 124 | void addTab( QWidget *, const QString &, const QString & ); |
125 | 125 | ||
126 | /** | 126 | /** |
127 | * @fn removePage( QWidget *widget ) | 127 | * @fn removePage( QWidget *widget ) |
128 | * @brief Remove widget from control. Does not delete widget. | 128 | * @brief Remove widget from control. Does not delete widget. |
129 | * | 129 | * |
130 | * @param widget Widget control to be removed. | 130 | * @param widget Widget control to be removed. |
131 | */ | 131 | */ |
132 | void removePage( QWidget * ); | 132 | void removePage( QWidget * ); |
133 | 133 | ||
134 | /** | 134 | /** |
135 | * @fn changeTab( QWidget *widget, const QString &icon, const QString &label ) | 135 | * @fn changeTab( QWidget *widget, const QString &icon, const QString &label ) |
136 | * @brief Change text and/or icon for existing tab | 136 | * @brief Change text and/or icon for existing tab |
137 | * | 137 | * |
138 | * @param child Widget control. | 138 | * @param child Widget control. |
139 | * @param icon Path to icon. | 139 | * @param icon Path to icon. |
140 | * @param label Text label. | 140 | * @param label Text label. |
141 | */ | 141 | */ |
142 | void changeTab( QWidget *, const QString &, const QString & ); | 142 | void changeTab( QWidget *, const QString &, const QString & ); |
143 | 143 | ||
144 | /** | 144 | /** |
145 | * @fn tabStyle()const | 145 | * @fn tabStyle()const |
146 | * @brief Returns current widget selection control style. | 146 | * @brief Returns current widget selection control style. |
147 | */ | 147 | */ |
148 | TabStyle tabStyle() const; | 148 | TabStyle tabStyle() const; |
149 | 149 | ||
150 | /** | 150 | /** |
151 | * @fn setTabStyle( TabStyle s ) | 151 | * @fn setTabStyle( TabStyle s ) |
152 | * @brief Set the current widget selection control style. | 152 | * @brief Set the current widget selection control style. |
153 | * | 153 | * |
154 | * @param s New style to be used. | 154 | * @param s New style to be used. |
155 | */ | 155 | */ |
156 | void setTabStyle( TabStyle ); | 156 | void setTabStyle( TabStyle ); |
157 | 157 | ||
158 | /** | 158 | /** |
159 | * @fn tabPosition()const | 159 | * @fn tabPosition()const |
160 | * @brief Returns current widget selection control position. | 160 | * @brief Returns current widget selection control position. |
161 | */ | 161 | */ |
162 | TabPosition tabPosition() const; | 162 | TabPosition tabPosition() const; |
163 | 163 | ||
164 | /** | 164 | /** |
165 | * @fn setTabPosition( TabPosition p ) | 165 | * @fn setTabPosition( TabPosition p ) |
166 | * @brief Set the current widget selection control position. | 166 | * @brief Set the current widget selection control position. |
167 | * | 167 | * |
168 | * @param p New position of widget selection control. | 168 | * @param p New position of widget selection control. |
169 | */ | 169 | */ |
170 | void setTabPosition( TabPosition ); | 170 | void setTabPosition( TabPosition ); |
171 | 171 | ||
172 | /** | 172 | /** |
173 | * @fn setCurrentTab( QWidget *childwidget ) | 173 | * @fn setCurrentTab( QWidget *childwidget ) |
174 | * @brief Selects and brings to top the desired widget by using widget pointer. | 174 | * @brief Selects and brings to top the desired widget by using widget pointer. |
175 | * | 175 | * |
176 | * @param childwidget Widget to select. | 176 | * @param childwidget Widget to select. |
177 | */ | 177 | */ |
178 | void setCurrentTab( QWidget * ); | 178 | void setCurrentTab( QWidget * ); |
179 | 179 | ||
180 | /** | 180 | /** |
181 | * @fn setCurrentTab( const QString &tabname ) | 181 | * @fn setCurrentTab( const QString &tabname ) |
182 | * @brief Selects and brings to top the desired widget, by using label. | 182 | * @brief Selects and brings to top the desired widget, by using label. |
183 | * | 183 | * |
184 | * @param tabname Text label for widget to select. | 184 | * @param tabname Text label for widget to select. |
185 | */ | 185 | */ |
186 | void setCurrentTab( const QString & ); | 186 | void setCurrentTab( const QString & ); |
187 | 187 | ||
188 | /** | 188 | /** |
189 | * @fn setCurrentTab( int ) | 189 | * @fn setCurrentTab( int ) |
190 | * @brief Selects and brings to top the desired widget, by using id. | 190 | * @brief Selects and brings to top the desired widget, by using id. |
191 | * | 191 | * |
192 | * @param tab id for widget to select. | 192 | * @param tab id for widget to select. |
193 | */ | 193 | */ |
194 | void setCurrentTab(int); | 194 | void setCurrentTab(int); |
195 | 195 | ||
196 | /** | 196 | /** |
197 | * @fn sizeHint()const | 197 | * @fn sizeHint()const |
198 | * @brief Reimplemented for internal purposes. | 198 | * @brief Reimplemented for internal purposes. |
199 | */ | 199 | */ |
200 | QSize sizeHint() const; | 200 | QSize sizeHint() const; |
201 | 201 | ||
202 | /** | 202 | /** |
203 | * @fn currentTab( ) | 203 | * @fn currentTab( ) |
204 | * @brief returns current tab id. | 204 | * @brief returns current tab id. |
205 | */ | 205 | */ |
206 | // ### make const | 206 | // ### make const |
207 | int currentTab()/* const */; | 207 | int currentTab()/* const */; |
208 | /** | 208 | /** |
209 | * @brief returns the current page of the active tab | 209 | * @brief returns the current page of the active tab |
210 | * | 210 | * |
211 | * @since 1.2 | 211 | * @since 1.2 |
212 | */ | 212 | */ |
213 | QWidget* currentWidget()const; | 213 | QWidget* currentWidget()const; |
214 | 214 | ||
215 | protected: | 215 | protected: |
216 | 216 | ||
217 | /** | 217 | /** |
218 | * @fn resizeEvent( QResizeEvent * ) | 218 | * @fn resizeEvent( QResizeEvent * ) |
219 | * @brief Reimplemented for internal purposes. | 219 | * @brief Reimplemented for internal purposes. |
220 | */ | 220 | */ |
221 | void resizeEvent( QResizeEvent * ); | 221 | void resizeEvent( QResizeEvent * ); |
222 | 222 | ||
223 | private: | 223 | private: |
224 | OTabInfoList tabs; | 224 | OTabInfoList tabs; |
225 | OTabInfo *currTab; | 225 | OTabInfo *currTab; |
226 | 226 | ||
227 | TabStyle tabBarStyle; | 227 | TabStyle tabBarStyle; |
228 | TabPosition tabBarPosition; | 228 | TabPosition tabBarPosition; |
229 | 229 | ||
230 | QWidgetStack *tabBarStack; | 230 | QWidgetStack *tabBarStack; |
231 | OTabBar *tabBar; | 231 | OTabBar *tabBar; |
232 | QComboBox *tabList; | 232 | QComboBox *tabList; |
233 | 233 | ||
234 | QWidgetStack *widgetStack; | 234 | QWidgetStack *widgetStack; |
235 | class Private; | 235 | class Private; |
236 | Private* d; | 236 | Private* d; |
237 | 237 | ||
238 | /** | 238 | /** |
239 | * @fn loadSmooth( const QString &name ) | 239 | * @fn loadSmooth( const QString &name ) |
240 | * @brief Loads icon for widget. | 240 | * @brief Loads icon for widget. |
241 | * | 241 | * |
242 | * @param name Name of icon image file. | 242 | * @param name Name of icon image file. |
243 | */ | 243 | */ |
244 | QPixmap loadSmooth( const QString & ); | 244 | QPixmap loadSmooth( const QString & ); |
245 | 245 | ||
246 | /** | 246 | /** |
247 | * @fn selectTab( OTabInfo *tab ) | 247 | * @fn selectTab( OTabInfo *tab ) |
248 | * @brief Internal function to select desired widget. | 248 | * @brief Internal function to select desired widget. |
249 | * | 249 | * |
250 | * @param tab Pointer to data for widget. | 250 | * @param tab Pointer to data for widget. |
251 | */ | 251 | */ |
252 | void selectTab( OTabInfo * ); | 252 | void selectTab( OTabInfo * ); |
253 | 253 | ||
254 | /** | 254 | /** |
255 | * @fn setUpLayout() | 255 | * @fn setUpLayout() |
256 | * @brief Internal function to adjust layout. | 256 | * @brief Internal function to adjust layout. |
257 | */ | 257 | */ |
258 | void setUpLayout(); | 258 | void setUpLayout(); |
259 | 259 | ||
260 | 260 | ||
261 | signals: | 261 | signals: |
262 | /** | 262 | /** |
263 | * @fn currentChanegd( QWidget *widget ) | 263 | * @fn currentChanged( QWidget *widget ) |
264 | * @brief This signal is emitted whenever the widget has changed. | 264 | * @brief This signal is emitted whenever the widget has changed. |
265 | * | 265 | * |
266 | * @param widget Pointer to new current widget. | 266 | * @param widget Pointer to new current widget. |
267 | */ | 267 | */ |
268 | void currentChanged( QWidget * ); | 268 | void currentChanged( QWidget * ); |
269 | 269 | ||
270 | private slots: | 270 | private slots: |
271 | 271 | ||
272 | /** | 272 | /** |
273 | * @fn slotTabBarSelected( int id ) | 273 | * @fn slotTabBarSelected( int id ) |
274 | * @brief Slot which is called when a tab is selected. | 274 | * @brief Slot which is called when a tab is selected. |
275 | * | 275 | * |
276 | * @param id ID of widget selected. | 276 | * @param id ID of widget selected. |
277 | */ | 277 | */ |
278 | void slotTabBarSelected( int ); | 278 | void slotTabBarSelected( int ); |
279 | 279 | ||
280 | /** | 280 | /** |
281 | * @fn slotTabListSelected( int index ) | 281 | * @fn slotTabListSelected( int index ) |
282 | * @brief Slot which is called when a drop down selection is made. | 282 | * @brief Slot which is called when a drop down selection is made. |
283 | * | 283 | * |
284 | * @param id Index of widget selected. | 284 | * @param id Index of widget selected. |
285 | */ | 285 | */ |
286 | void slotTabListSelected( int ); | 286 | void slotTabListSelected( int ); |
287 | }; | 287 | }; |
288 | 288 | ||
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | #endif | 292 | #endif |