#include </home/clem/local/src/opie/libopie2/opiecore/okeyconfigmanager.h>
Collaboration diagram for Opie::Core::OKeyConfigManager:

Public Types | |
| enum | EventMask { MaskPressed = 0x1, MaskReleased = 0x2 } |
Public Slots | |
| virtual void | load () |
| virtual void | save () |
| void | handleWidget (QWidget *) |
Signals | |
| void | actionActivated (QWidget *, QKeyEvent *, const Opie::Core::OKeyConfigItem &) |
| void | actionActivated (QWidget *par, QKeyEvent *key) |
Public Member Functions | |
| OKeyConfigManager (Opie::Core::OConfig *conf=0, const QString &group=QString::null, const OKeyPair::List &block=OKeyPair::List(), bool grabkeyboard=false, QObject *par=0, const char *name=0) | |
| c'tor The Constructor for a OKeyConfigManager | |
| virtual | ~OKeyConfigManager () |
| virtual OKeyConfigItem | handleKeyEvent (QKeyEvent *) |
| int | handleKeyEventId (QKeyEvent *) |
| void | addKeyConfig (const OKeyConfigItem &) |
| void | removeKeyConfig (const OKeyConfigItem &) |
| void | clearKeyConfig () |
| void | addToBlackList (const OKeyPair &) |
| void | removeFromBlackList (const OKeyPair &) |
| void | clearBlackList () |
| OKeyPair::List | blackList () const |
| bool | eventFilter (QObject *, QEvent *) |
| void | setEventMask (uint aMask) |
| uint | eventMask () const |
| bool | testEventMask (uint aMask) |
| void | addEventMask (uint aMask) |
| void | clearEventMask (uint aMask) |
| OKeyConfigItem::List | keyConfigList () const |
Private Types | |
| typedef QMap< int, OKeyConfigItem::List > | OKeyMapConfigPrivate |
Private Member Functions | |
| OKeyConfigItem::List | keyList (int) |
Private Attributes | |
| OKeyConfigItem::List | m_keys |
| QValueList< QWidget * > | m_widgets |
| Opie::Core::OConfig * | m_conf |
| QString | m_group |
| OKeyPair::List | m_blackKeys |
| bool | m_grab: 1 |
| OKeyMapConfigPrivate * | m_map |
| Private * | d |
| uint | m_event_mask |
Again if you want to extend it and I missed a virtual, tell me so I can improve (zecke@handhelds.org)
Definition at line 143 of file okeyconfigmanager.h.
|
|
Definition at line 144 of file okeyconfigmanager.h. |
|
|
Definition at line 147 of file okeyconfigmanager.h. |
|
||||||||||||||||||||||||||||
|
c'tor The Constructor for a OKeyConfigManager You can use this manager in multiple ways. Either make it handle QKeyEvents. The EventMask is set to OKeyConfigManager::MaskReleased by default.
Opie::Core::Config conf = oApp->config(); Opie::Core::OKeyPairList blackList; blackList.append(Opie::Core::OKeyPair::leftArrowKey()); blackList.append(Opie::Core::OKeyPair::rightArrowKey()); Opie::Core::OKeyConfigManager *manager = new Opie::Core::OKeyConfigManager(conf,"key_actions",blackList, false); QListView *view = new QListView(); manager->handleWidget(view); manager->addKeyConfig( Opie::Core::OKeyPair::returnKey()); manager->load(); connect(manager,SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Core::OKeyConfigItem&)), this,SLOT(slotHandleKey(QWidget*,QKeyEvent*,const Opie::Core::OKeyConfigItem&))); .... void update(){ QDialog diag(true); QHBoxLayout *lay = new QHBoxLayout(&diag); Opie::Ui::OKeyConfigWidget *wid = new Opie::Ui::OKeyConfigWidget(manager,&diag); wid->setChangeMode(Opie::Ui::OKeyConfigWidget::Queu); lay->addWidget(wid); if(QPEApplication::execDialog( &diag)== QDialog::Accepted){ wid->save(); } } .... MyListView::keyPressEvent( QKeyEvent* e ){ Opie::Ui::OKeyConfigItem item = manager->handleKeyEvent(e); if(!item.isEmpty() ){ switch(item.id()){ case My_Delete_Key: break; } } }
Definition at line 477 of file okeyconfigmanager.cpp. References QPEApplication::grabKeyboard(), m_event_mask, m_grab, and MaskReleased. |
|
|
Destructor Definition at line 493 of file okeyconfigmanager.cpp. References m_grab, m_map, and QPEApplication::ungrabKeyboard(). |
|
||||||||||||
|
This Signal correspondents to the OKeyConfigItem slot and object
|
|
||||||||||||||||
|
The Signals are triggered on KeyPress and KeyRelease! You can check the isDown of the QKeyEvent
Referenced by eventFilter(). |
|
|
Add the event mask flag aMask.
Definition at line 258 of file okeyconfigmanager.h. References m_event_mask. |
|
|
Add Key Config to the List of items Definition at line 609 of file okeyconfigmanager.cpp. References QValueList< T >::append(), m_keys, and m_map. Referenced by ImageView::initKeys(), imageinfo::initKeys(), PIconView::initKeys(), IRCHistoryLineEdit::keyConfigInstance(), Opie::Ui::OKeyConfigWidget::save(), and TestMainWindow::TestMainWindow(). |
|
|
Add this OKeyPair to the blackList. Internal lists will be destroyed
Definition at line 645 of file okeyconfigmanager.cpp. References QValueList< T >::append(), m_blackKeys, and m_map. |
|
|
Return a copy of the blackList
Definition at line 680 of file okeyconfigmanager.cpp. References m_blackKeys. |
|
|
Clear the blackList Definition at line 667 of file okeyconfigmanager.cpp. References QValueList< T >::clear(), m_blackKeys, and m_map. |
|
|
Clears the event mask flag aMask.
Definition at line 263 of file okeyconfigmanager.h. References m_event_mask. |
|
|
Clears the complete list Definition at line 626 of file okeyconfigmanager.cpp. References QValueList< T >::clear(), m_keys, and m_map. |
|
||||||||||||
|
For internal use only.
Definition at line 697 of file okeyconfigmanager.cpp. References actionActivated(), handleKeyEvent(), Opie::Core::OKeyConfigItem::isEmpty(), KeyPress, KeyRelease, MaskPressed, MaskReleased, Opie::Core::OKeyConfigItem::object(), Opie::Core::OKeyConfigItem::slot(), testEventMask(), and wid. |
|
|
Returns the event mask flags set. aMask is a combination of OKeyConfigManager::EventMask
Definition at line 273 of file okeyconfigmanager.h. References m_event_mask. |
|
|
This is function uses a QMap internally but you can have the same keycode with different modifier key. The behaviour is undefined if you add a OKeyConfigItem with same keycode and modifier key. The GUI takes care that a user can't cofigure two keys. Make sure you call e->ignore if you don't want to handle this event Definition at line 568 of file okeyconfigmanager.cpp. References QValueList< T >::begin(), QValueList< T >::end(), Opie::Core::Internal::fixupKeys(), QValueList< T >::isEmpty(), keyList(), and mod. Referenced by eventFilter(), handleKeyEventId(), and TestMainWindow::keyPressEvent(). |
|
|
Return the associated id of the item or -1 if no item matched the key
Definition at line 602 of file okeyconfigmanager.cpp. References handleKeyEvent(). Referenced by TestMainWindow::keyPressEvent(). |
|
|
Ask the Manager to handle KeyEvents for you. All handled keys will emit a QSignal and return true that it handled the keyevent Definition at line 690 of file okeyconfigmanager.cpp. Referenced by ImageView::initKeys(), imageinfo::initKeys(), and PIconView::initKeys(). |
|
|
Definition at line 634 of file okeyconfigmanager.cpp. References m_keys. |
|
|
For internal use only.
Definition at line 731 of file okeyconfigmanager.cpp. References add, QValueList< T >::begin(), QValueList< T >::end(), Opie::Core::OKeyPair::keycode(), m_blackKeys, m_keys, m_map, and Opie::Core::OKeyPair::modifier(). Referenced by handleKeyEvent(). |
|
|
Load the Configuration from the OConfig If a Key is restricted but was in the config we will make it be the empty key paur We will change the group but restore to the previous.
Definition at line 507 of file okeyconfigmanager.cpp. References QValueList< T >::begin(), QValueList< T >::contains(), Opie::Core::OKeyPair::emptyKey(), QValueList< T >::end(), m_blackKeys, m_conf, m_group, m_keys, m_map, mod, and Config::readNumEntry(). Referenced by ImageView::initKeys(), imageinfo::initKeys(), PIconView::initKeys(), and IRCHistoryLineEdit::keyConfigInstance(). |
|
|
Remove this OKeyPair from the black List Internal lists will be destroyed
Definition at line 658 of file okeyconfigmanager.cpp. References m_blackKeys, m_map, and QValueList< T >::remove(). |
|
|
Remove the Key from the Config. Internal lists will be destroyed and rebuild on demand later Definition at line 618 of file okeyconfigmanager.cpp. References m_keys, m_map, and QValueList< T >::remove(). Referenced by Opie::Ui::OKeyConfigWidget::save(). |
|
|
We will save the current configuration to the OConfig. We will change the group but restore to the previous Definition at line 534 of file okeyconfigmanager.cpp. References QValueList< T >::begin(), QValueList< T >::end(), Opie::Core::OKeyPair::keycode(), m_conf, m_group, m_keys, Opie::Core::OKeyPair::modifier(), Config::write(), and Config::writeEntry(). Referenced by PIconView::~PIconView(), and TestMainWindow::~TestMainWindow(). |
|
|
Sets the event mask flags aMask. aMask is a combination of OKeyConfigManager::EventMask
Definition at line 268 of file okeyconfigmanager.h. References m_event_mask. Referenced by ImageView::initKeys(). |
|
|
Test if the event mask flag aMask is set.
Definition at line 253 of file okeyconfigmanager.h. References m_event_mask. Referenced by eventFilter(). |
|
|
Definition at line 248 of file okeyconfigmanager.h. |
|
|
Definition at line 245 of file okeyconfigmanager.h. Referenced by addToBlackList(), blackList(), clearBlackList(), keyList(), load(), and removeFromBlackList(). |
|
|
Definition at line 243 of file okeyconfigmanager.h. |
|
|
Definition at line 250 of file okeyconfigmanager.h. Referenced by addEventMask(), clearEventMask(), eventMask(), OKeyConfigManager(), setEventMask(), and testEventMask(). |
|
|
Definition at line 246 of file okeyconfigmanager.h. Referenced by OKeyConfigManager(), and ~OKeyConfigManager(). |
|
|
Definition at line 244 of file okeyconfigmanager.h. |
|
|
Definition at line 241 of file okeyconfigmanager.h. Referenced by addKeyConfig(), clearKeyConfig(), keyConfigList(), keyList(), load(), removeKeyConfig(), and save(). |
|
|
Definition at line 247 of file okeyconfigmanager.h. Referenced by addKeyConfig(), addToBlackList(), clearBlackList(), clearKeyConfig(), keyList(), load(), removeFromBlackList(), removeKeyConfig(), and ~OKeyConfigManager(). |
|
|
Definition at line 242 of file okeyconfigmanager.h. |
1.4.2