-rw-r--r-- | libopie2/opiecore/okeyfilter.cpp | 8 | ||||
-rw-r--r-- | libopie2/opieui/big-screen/omodalhelper.h | 2 | ||||
-rw-r--r-- | libopie2/opieui/otabinfo.h | 5 |
3 files changed, 5 insertions, 10 deletions
diff --git a/libopie2/opiecore/okeyfilter.cpp b/libopie2/opiecore/okeyfilter.cpp index a517333..61b7909 100644 --- a/libopie2/opiecore/okeyfilter.cpp +++ b/libopie2/opiecore/okeyfilter.cpp | |||
@@ -1,98 +1,98 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | =. Copyright (C) 2004 Rajko 'Alwin' Albrecht <alwin@handhelds.org> | 3 | =. Copyright (C) 2004 Rajko 'Alwin' Albrecht <alwin@handhelds.org> |
4 | .=l. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 4 | .=l. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This program is free software; you can | 6 | _;:, .> :=|. This program is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This program is distributed in the hope that | 13 | .i_,=:_. -<s. This program is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
18 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Library General Public License for more |
19 | ++= -. .` .: details. | 19 | ++= -. .` .: details. |
20 | : = ...= . :.=- | 20 | : = ...= . :.=- |
21 | -. .:....=;==+<; You should have received a copy of the GNU | 21 | -. .:....=;==+<; You should have received a copy of the GNU |
22 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = Library General Public License along with |
23 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` this library; see the file COPYING.LIB. |
24 | If not, write to the Free Software Foundation, | 24 | If not, write to the Free Software Foundation, |
25 | Inc., 59 Temple Place - Suite 330, | 25 | Inc., 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "okeyfilter.h" | 29 | #include "okeyfilter.h" |
30 | #include "device/odevice.h" | 30 | #include "device/odevice.h" |
31 | #include "odebug.h" | 31 | #include "odebug.h" |
32 | 32 | ||
33 | namespace Opie { | 33 | namespace Opie { |
34 | namespace Core { | 34 | namespace Core { |
35 | 35 | ||
36 | class OKeyFilterPrivate:public OKeyFilter, QWSServer::KeyboardFilter | 36 | class OKeyFilterPrivate:public OKeyFilter, QWSServer::KeyboardFilter |
37 | { | 37 | { |
38 | static QValueList<QWSServer::KeyboardFilter*> filterList; | 38 | static QValueList<QWSServer::KeyboardFilter*> filterList; |
39 | static QValueList<QWSServer::KeyboardFilter*> preFilterList; | 39 | static QValueList<QWSServer::KeyboardFilter*> preFilterList; |
40 | protected: | 40 | protected: |
41 | OKeyFilterPrivate(const OKeyFilterPrivate&):OKeyFilter(),QWSServer::KeyboardFilter(){}; | 41 | OKeyFilterPrivate(const OKeyFilterPrivate&):OKeyFilter(),QWSServer::KeyboardFilter(){}; |
42 | virtual void addPreHandler(QWSServer::KeyboardFilter*); | 42 | virtual void addPreHandler(QWSServer::KeyboardFilter* aFilter); |
43 | virtual void remPreHandler(QWSServer::KeyboardFilter*); | 43 | virtual void remPreHandler(QWSServer::KeyboardFilter* aFilter); |
44 | 44 | ||
45 | public: | 45 | public: |
46 | OKeyFilterPrivate(); | 46 | OKeyFilterPrivate(); |
47 | virtual ~OKeyFilterPrivate(); | 47 | virtual ~OKeyFilterPrivate(); |
48 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 48 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
49 | virtual void addHandler(QWSServer::KeyboardFilter*); | 49 | virtual void addHandler(QWSServer::KeyboardFilter* aFilter); |
50 | virtual void remHandler(QWSServer::KeyboardFilter*); | 50 | virtual void remHandler(QWSServer::KeyboardFilter* aFilter); |
51 | }; | 51 | }; |
52 | 52 | ||
53 | QValueList<QWSServer::KeyboardFilter*> OKeyFilterPrivate::filterList; | 53 | QValueList<QWSServer::KeyboardFilter*> OKeyFilterPrivate::filterList; |
54 | QValueList<QWSServer::KeyboardFilter*> OKeyFilterPrivate::preFilterList; | 54 | QValueList<QWSServer::KeyboardFilter*> OKeyFilterPrivate::preFilterList; |
55 | 55 | ||
56 | OKeyFilter::OKeyFilter() | 56 | OKeyFilter::OKeyFilter() |
57 | { | 57 | { |
58 | } | 58 | } |
59 | 59 | ||
60 | OKeyFilter::~OKeyFilter() | 60 | OKeyFilter::~OKeyFilter() |
61 | { | 61 | { |
62 | } | 62 | } |
63 | 63 | ||
64 | OKeyFilter* OKeyFilter::inst() | 64 | OKeyFilter* OKeyFilter::inst() |
65 | { | 65 | { |
66 | static OKeyFilter*ofilter = 0; | 66 | static OKeyFilter*ofilter = 0; |
67 | if (!ofilter) { | 67 | if (!ofilter) { |
68 | ofilter = new OKeyFilterPrivate; | 68 | ofilter = new OKeyFilterPrivate; |
69 | } | 69 | } |
70 | return ofilter; | 70 | return ofilter; |
71 | } | 71 | } |
72 | 72 | ||
73 | bool OKeyFilterPrivate::filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) | 73 | bool OKeyFilterPrivate::filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) |
74 | { | 74 | { |
75 | QValueList<QWSServer::KeyboardFilter*>::Iterator iter; | 75 | QValueList<QWSServer::KeyboardFilter*>::Iterator iter; |
76 | for (iter=preFilterList.begin();iter!=preFilterList.end();++iter) { | 76 | for (iter=preFilterList.begin();iter!=preFilterList.end();++iter) { |
77 | if ((*iter)->filter(unicode,keycode,modifiers,isPress,autoRepeat)) { | 77 | if ((*iter)->filter(unicode,keycode,modifiers,isPress,autoRepeat)) { |
78 | return true; | 78 | return true; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | for (iter=filterList.begin();iter!=filterList.end();++iter) { | 81 | for (iter=filterList.begin();iter!=filterList.end();++iter) { |
82 | if ((*iter)->filter(unicode,keycode,modifiers,isPress,autoRepeat)) { | 82 | if ((*iter)->filter(unicode,keycode,modifiers,isPress,autoRepeat)) { |
83 | return true; | 83 | return true; |
84 | } | 84 | } |
85 | } | 85 | } |
86 | return false; | 86 | return false; |
87 | } | 87 | } |
88 | 88 | ||
89 | void OKeyFilterPrivate::addHandler(QWSServer::KeyboardFilter*aF) | 89 | void OKeyFilterPrivate::addHandler(QWSServer::KeyboardFilter*aF) |
90 | { | 90 | { |
91 | if (!aF) return; | 91 | if (!aF) return; |
92 | if (filterList.find(aF)!=filterList.end()) { | 92 | if (filterList.find(aF)!=filterList.end()) { |
93 | return; | 93 | return; |
94 | } | 94 | } |
95 | odebug << "adding a keyboard filter handler"<<oendl; | 95 | odebug << "adding a keyboard filter handler"<<oendl; |
96 | filterList.append(aF); | 96 | filterList.append(aF); |
97 | } | 97 | } |
98 | 98 | ||
diff --git a/libopie2/opieui/big-screen/omodalhelper.h b/libopie2/opieui/big-screen/omodalhelper.h index 096cec4..ed6fee3 100644 --- a/libopie2/opieui/big-screen/omodalhelper.h +++ b/libopie2/opieui/big-screen/omodalhelper.h | |||
@@ -191,97 +191,97 @@ public: | |||
191 | OModalQueuedDialog(QDialog *mainWidget); | 191 | OModalQueuedDialog(QDialog *mainWidget); |
192 | ~OModalQueuedDialog(); | 192 | ~OModalQueuedDialog(); |
193 | 193 | ||
194 | QDialog* centerDialog()const; | 194 | QDialog* centerDialog()const; |
195 | 195 | ||
196 | void setQueueBarEnabled( bool = true ); | 196 | void setQueueBarEnabled( bool = true ); |
197 | void setRecord( int record, int count ); | 197 | void setRecord( int record, int count ); |
198 | 198 | ||
199 | signals: | 199 | signals: |
200 | void next(); | 200 | void next(); |
201 | void prev(); | 201 | void prev(); |
202 | 202 | ||
203 | private: | 203 | private: |
204 | OModalQueueBar *m_bar; | 204 | OModalQueueBar *m_bar; |
205 | QDialog *m_center; | 205 | QDialog *m_center; |
206 | }; | 206 | }; |
207 | 207 | ||
208 | 208 | ||
209 | /* | 209 | /* |
210 | * Tcpp Template Implementation | 210 | * Tcpp Template Implementation |
211 | */ | 211 | */ |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * This is the simple Template c'tor. It takes the mode | 214 | * This is the simple Template c'tor. It takes the mode |
215 | * this helper should operate in and the parent object. | 215 | * this helper should operate in and the parent object. |
216 | * This helper will be deleted when the parent gets deleted | 216 | * This helper will be deleted when the parent gets deleted |
217 | * or you delete it yourself. | 217 | * or you delete it yourself. |
218 | * | 218 | * |
219 | * @param mode The mode this dialog should be in | 219 | * @param mode The mode this dialog should be in |
220 | * @param parent The parent QObject of this helper. | 220 | * @param parent The parent QObject of this helper. |
221 | */ | 221 | */ |
222 | template<class Dialog, class Record, typename Id> | 222 | template<class Dialog, class Record, typename Id> |
223 | OModalHelper<Dialog, Record, Id>::OModalHelper( enum Mode mode, QObject* parent ) | 223 | OModalHelper<Dialog, Record, Id>::OModalHelper( enum Mode mode, QObject* parent ) |
224 | { | 224 | { |
225 | m_disabled = false; | 225 | m_disabled = false; |
226 | m_mode = mode; | 226 | m_mode = mode; |
227 | m_signal = new OModalHelperSignal( this, parent ); | 227 | m_signal = new OModalHelperSignal( this, parent ); |
228 | m_controler = new OModalHelperControler( this, m_signal ); | 228 | m_controler = new OModalHelperControler( this, m_signal ); |
229 | } | 229 | } |
230 | 230 | ||
231 | 231 | ||
232 | /** | 232 | /** |
233 | * This functions looks for your record and sees if it is | 233 | * This functions looks for your record and sees if it is |
234 | * handled with this helper. Note that done records | 234 | * handled with this helper. Note that done records |
235 | * will not be returned. | 235 | * will not be returned. |
236 | * | 236 | * |
237 | * @return true if the record is currenlty edited otherwise false | 237 | * @return true if the record is currenlty edited otherwise false |
238 | * | 238 | * |
239 | * @param Id The id which might be handled | 239 | * @param id The id which might be handled |
240 | */ | 240 | */ |
241 | template<class Dialog, class Record, typename Id> | 241 | template<class Dialog, class Record, typename Id> |
242 | bool OModalHelper<Dialog, Record, Id>::handles( Id id )const | 242 | bool OModalHelper<Dialog, Record, Id>::handles( Id id )const |
243 | { | 243 | { |
244 | if ( m_transactions.isEmpty() ) | 244 | if ( m_transactions.isEmpty() ) |
245 | return false; | 245 | return false; |
246 | 246 | ||
247 | TransactionMap::ConstIterator it = m_transactions.begin(); | 247 | TransactionMap::ConstIterator it = m_transactions.begin(); |
248 | for ( ; it != m_transactions.end(); ++it ) | 248 | for ( ; it != m_transactions.end(); ++it ) |
249 | if ( it.data() == id ) | 249 | if ( it.data() == id ) |
250 | return true; | 250 | return true; |
251 | 251 | ||
252 | return false; | 252 | return false; |
253 | } | 253 | } |
254 | 254 | ||
255 | 255 | ||
256 | /** | 256 | /** |
257 | * just like handles( Id ) but returns the TransactionId | 257 | * just like handles( Id ) but returns the TransactionId |
258 | */ | 258 | */ |
259 | template<class Dialog, class Record, typename Id> | 259 | template<class Dialog, class Record, typename Id> |
260 | TransactionID OModalHelper<Dialog, Record, Id>::transactionID( Id id)const | 260 | TransactionID OModalHelper<Dialog, Record, Id>::transactionID( Id id)const |
261 | { | 261 | { |
262 | if ( m_transactions.isEmpty() || !m_ids.contains( id ) ) | 262 | if ( m_transactions.isEmpty() || !m_ids.contains( id ) ) |
263 | return 0; | 263 | return 0; |
264 | 264 | ||
265 | TransactionMap::ConstIterator it = m_transactions.begin(); | 265 | TransactionMap::ConstIterator it = m_transactions.begin(); |
266 | for ( ; it != m_transactions.end(); ++it ) | 266 | for ( ; it != m_transactions.end(); ++it ) |
267 | if ( it.data() == id ) | 267 | if ( it.data() == id ) |
268 | return it.key(); | 268 | return it.key(); |
269 | 269 | ||
270 | return 0; | 270 | return 0; |
271 | } | 271 | } |
272 | 272 | ||
273 | /** | 273 | /** |
274 | * If you're requested to flush your data and you do not want | 274 | * If you're requested to flush your data and you do not want |
275 | * to call cancel with this method you can disable and enabled | 275 | * to call cancel with this method you can disable and enabled |
276 | * all dialogs. | 276 | * all dialogs. |
277 | * The state gets saved so if you want to handle a new record the dialog | 277 | * The state gets saved so if you want to handle a new record the dialog |
278 | * will be disabled as well. | 278 | * will be disabled as well. |
279 | * | 279 | * |
280 | * @param sus If true setDisabled(TRUE) will be called otherwise FALSE | 280 | * @param sus If true setDisabled(TRUE) will be called otherwise FALSE |
281 | */ | 281 | */ |
282 | template<class Dialog, class Record, typename Id> | 282 | template<class Dialog, class Record, typename Id> |
283 | void OModalHelper<Dialog, Record, Id>::suspend(bool sus) | 283 | void OModalHelper<Dialog, Record, Id>::suspend(bool sus) |
284 | { | 284 | { |
285 | m_disabled = sus; | 285 | m_disabled = sus; |
286 | if (m_mode == New ) | 286 | if (m_mode == New ) |
287 | for (DialogMap::Iterator it = m_editing.begin(); it != m_editing.end(); ++it ) | 287 | for (DialogMap::Iterator it = m_editing.begin(); it != m_editing.end(); ++it ) |
diff --git a/libopie2/opieui/otabinfo.h b/libopie2/opieui/otabinfo.h index 426c45a..d6d5abf 100644 --- a/libopie2/opieui/otabinfo.h +++ b/libopie2/opieui/otabinfo.h | |||
@@ -15,101 +15,96 @@ | |||
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 OTABINFO_H | 32 | #ifndef OTABINFO_H |
33 | #define OTABINFO_H | 33 | #define OTABINFO_H |
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qlist.h> | 36 | #include <qlist.h> |
37 | #include <qstring.h> | 37 | #include <qstring.h> |
38 | 38 | ||
39 | class QWidget; | 39 | class QWidget; |
40 | 40 | ||
41 | namespace Opie{ | 41 | namespace Opie{ |
42 | namespace Ui { | 42 | namespace Ui { |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * @class OTabInfo | 45 | * @class OTabInfo |
46 | * @brief The OTabInfo class is used internally by OTabWidget to keep track | 46 | * @brief The OTabInfo class is used internally by OTabWidget to keep track |
47 | * of widgets added to the control. | 47 | * of widgets added to the control. |
48 | * | 48 | * |
49 | * OTabInfo provides the following information about a widget added to an | 49 | * OTabInfo provides the following information about a widget added to an |
50 | * OTabWidget control: | 50 | * OTabWidget control: |
51 | * | 51 | * |
52 | * ID - integer tab bar ID | 52 | * ID - integer tab bar ID |
53 | * Control - QWidget pointer to child widget | 53 | * Control - QWidget pointer to child widget |
54 | * Label - QString text label for OTabWidget selection control | 54 | * Label - QString text label for OTabWidget selection control |
55 | * Icon - QString name of icon file | 55 | * Icon - QString name of icon file |
56 | */ | 56 | */ |
57 | class OTabInfo | 57 | class OTabInfo |
58 | { | 58 | { |
59 | public: | 59 | public: |
60 | /** | 60 | /** |
61 | * @fn OTabInfo() | 61 | * @fn OTabInfo() |
62 | * @brief Object constructor. | 62 | * @brief Object constructor. |
63 | * | ||
64 | * @param parent Pointer to parent of this control. | ||
65 | * @param name Name of control. | ||
66 | * @param s Style of widget selection control. | ||
67 | * @param p Position of the widget selection control. | ||
68 | */ | 63 | */ |
69 | OTabInfo() : i( -1 ), c( 0 ), p( 0 ), l( QString::null ) {} | 64 | OTabInfo() : i( -1 ), c( 0 ), p( 0 ), l( QString::null ) {} |
70 | 65 | ||
71 | /** | 66 | /** |
72 | * @fn OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) | 67 | * @fn OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) |
73 | * @brief Object constructor. | 68 | * @brief Object constructor. |
74 | * | 69 | * |
75 | * @param id TabBar identifier for widget. | 70 | * @param id TabBar identifier for widget. |
76 | * @param control QWidget pointer to widget. | 71 | * @param control QWidget pointer to widget. |
77 | * @param icon QString name of icon file. | 72 | * @param icon QString name of icon file. |
78 | * @param label QString text label for OTabWidget selection control. | 73 | * @param label QString text label for OTabWidget selection control. |
79 | */ | 74 | */ |
80 | OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) | 75 | OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) |
81 | : i( id ), c( control ), p( icon ), l( label ) {} | 76 | : i( id ), c( control ), p( icon ), l( label ) {} |
82 | 77 | ||
83 | /** | 78 | /** |
84 | * @fn id()const | 79 | * @fn id()const |
85 | * @brief Returns TabBar ID. | 80 | * @brief Returns TabBar ID. |
86 | */ | 81 | */ |
87 | int id() const { return i; } | 82 | int id() const { return i; } |
88 | 83 | ||
89 | /** | 84 | /** |
90 | * @fn label()const | 85 | * @fn label()const |
91 | * @brief Returns text label for widget. | 86 | * @brief Returns text label for widget. |
92 | */ | 87 | */ |
93 | const QString &label() const { return l; } | 88 | const QString &label() const { return l; } |
94 | 89 | ||
95 | /** | 90 | /** |
96 | * @fn setLabel( const QString &label ) | 91 | * @fn setLabel( const QString &label ) |
97 | * @brief Set label for tab. | 92 | * @brief Set label for tab. |
98 | * | 93 | * |
99 | * @param label QString text label for OTabWidget selection control. | 94 | * @param label QString text label for OTabWidget selection control. |
100 | */ | 95 | */ |
101 | void setLabel( const QString &label ) { l = label; } | 96 | void setLabel( const QString &label ) { l = label; } |
102 | 97 | ||
103 | /** | 98 | /** |
104 | * @fn control()const | 99 | * @fn control()const |
105 | * @brief Returns pointer to widget. | 100 | * @brief Returns pointer to widget. |
106 | */ | 101 | */ |
107 | QWidget *control() const { return c; } | 102 | QWidget *control() const { return c; } |
108 | 103 | ||
109 | /** | 104 | /** |
110 | * @fn icon()const | 105 | * @fn icon()const |
111 | * @brief Returns name of icon file. | 106 | * @brief Returns name of icon file. |
112 | */ | 107 | */ |
113 | const QString &icon() const { return p; } | 108 | const QString &icon() const { return p; } |
114 | 109 | ||
115 | /** | 110 | /** |