summaryrefslogtreecommitdiff
path: root/libopie2
Unidiff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/okeyconfigmanager.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/libopie2/opiecore/okeyconfigmanager.h b/libopie2/opiecore/okeyconfigmanager.h
index b861675..d0a6247 100644
--- a/libopie2/opiecore/okeyconfigmanager.h
+++ b/libopie2/opiecore/okeyconfigmanager.h
@@ -127,41 +127,48 @@ private:
127 * This is the Manager for KeyActions. 127 * This is the Manager for KeyActions.
128 * You can say from which config and group to read data, to grab the 128 * You can say from which config and group to read data, to grab the
129 * keyboard to handle hardware keys, you can supply a blacklist of 129 * keyboard to handle hardware keys, you can supply a blacklist of
130 * keys which should not be used by allowed to be used. 130 * keys which should not be used by allowed to be used.
131 * You can even pass this manager to a Widget to do the configuration for you. 131 * You can even pass this manager to a Widget to do the configuration for you.
132 * You need to add OKeyConfigItem for your keys and then issue a load() to 132 * You need to add OKeyConfigItem for your keys and then issue a load() to
133 * read the Key information. 133 * read the Key information.
134 * You can either handle the QKeyEvent yourself and ask this class if it is 134 * You can either handle the QKeyEvent yourself and ask this class if it is
135 * handled by your action and let give you the action. Or you can install 135 * handled by your action and let give you the action. Or you can install
136 * the event filter and get a signal. 136 * the event filter and get a signal.
137 * You need to load and save yourself! 137 * You need to load and save yourself!
138 * 138 *
139 * Again if you want to extend it and I missed a virtual, tell me so I can improve (zecke@handhelds.org)
140 *
139 * @since 1.1.2 141 * @since 1.1.2
140 */ 142 */
141class OKeyConfigManager : public QObject { 143class OKeyConfigManager : public QObject {
142 Q_OBJECT 144 Q_OBJECT
143 typedef QMap<int, OKeyConfigItem::List> OKeyMapConfigPrivate; 145 typedef QMap<int, OKeyConfigItem::List> OKeyMapConfigPrivate;
144public: 146public:
147 enum EventMask {
148 MaskPressed = 0x1,
149 MaskReleased = 0x2,
150 };
151
145 OKeyConfigManager(Opie::Core::OConfig *conf = 0, 152 OKeyConfigManager(Opie::Core::OConfig *conf = 0,
146 const QString& group = QString::null, 153 const QString& group = QString::null,
147 const OKeyPair::List &block = OKeyPair::List(), 154 const OKeyPair::List &block = OKeyPair::List(),
148 bool grabkeyboard = false, QObject * par = 0, 155 bool grabkeyboard = false, QObject * par = 0,
149 const char* name = 0 ); 156 const char* name = 0 );
150 ~OKeyConfigManager(); 157 virtual ~OKeyConfigManager();
151 158
152 void load(); 159 virtual void load();
153 void save(); 160 virtual void save();
154 161
155 OKeyConfigItem handleKeyEvent( QKeyEvent* ); 162 virtual OKeyConfigItem handleKeyEvent( QKeyEvent* );
156 int handleKeyEventId( QKeyEvent* ); 163 int handleKeyEventId( QKeyEvent* );
157 164
158 void addKeyConfig( const OKeyConfigItem& ); 165 void addKeyConfig( const OKeyConfigItem& );
159 void removeKeyConfig( const OKeyConfigItem& ); 166 void removeKeyConfig( const OKeyConfigItem& );
160 void clearKeyConfig(); 167 void clearKeyConfig();
161 168
162 void addToBlackList( const OKeyPair& ); 169 void addToBlackList( const OKeyPair& );
163 void removeFromBlackList( const OKeyPair& ); 170 void removeFromBlackList( const OKeyPair& );
164 void clearBlackList(); 171 void clearBlackList();
165 OKeyPair::List blackList()const; 172 OKeyPair::List blackList()const;
166 173
167 void handleWidget( QWidget* ); 174 void handleWidget( QWidget* );
@@ -202,28 +209,24 @@ public:
202 void addEventMask(uint aMask); 209 void addEventMask(uint aMask);
203 /** 210 /**
204 * Clears the event mask flag aMask. 211 * Clears the event mask flag aMask.
205 * 212 *
206 * @param aMask is one of OKeyConfigManager::EventMask 213 * @param aMask is one of OKeyConfigManager::EventMask
207 * 214 *
208 * @see eventMask(), testEventMask(), addEventMask(), setEventMask() 215 * @see eventMask(), testEventMask(), addEventMask(), setEventMask()
209 */ 216 */
210 void clearEventMask(uint aMask); 217 void clearEventMask(uint aMask);
211 218
212 OKeyConfigItem::List keyConfigList()const; 219 OKeyConfigItem::List keyConfigList()const;
213 220
214 enum EventMask {
215 MaskPressed = 0x1,
216 MaskReleased = 0x2,
217 };
218signals: 221signals:
219 /** 222 /**
220 * The Signals are triggered on KeyPress and KeyRelease! 223 * The Signals are triggered on KeyPress and KeyRelease!
221 * You can check the isDown of the QKeyEvent 224 * You can check the isDown of the QKeyEvent
222 * @see QKeyEvent 225 * @see QKeyEvent
223 */ 226 */
224 void actionActivated( QWidget*, QKeyEvent*, const Opie::Core::OKeyConfigItem& ); 227 void actionActivated( QWidget*, QKeyEvent*, const Opie::Core::OKeyConfigItem& );
225 228
226 /** 229 /**
227 * This Signal correspondents to the OKeyConfigItem slot 230 * This Signal correspondents to the OKeyConfigItem slot
228 * and object 231 * and object
229 * 232 *