Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

okeyconfigwidget.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004
00003  * LGPL v2  zecke@handhelds.org
00004  */
00005 
00006 
00007 #ifndef ODP_KEY_CONFIG_WIDGET_H
00008 #define ODP_KEY_CONFIG_WIDGET_H
00009 
00010 #include <opie2/okeyconfigmanager.h>
00011 
00012 #include <qhbox.h>
00013 #include <qdialog.h>
00014 
00015 
00016 class QKeyEvent;
00017 class QLabel;
00018 class QPushButton;
00019 class QListViewItem;
00020 class QRadioButton;
00021 class QTimer;
00022 
00023 namespace Opie {
00024 namespace Ui {
00025 namespace Internal {
00026     class OKeyConfigWidgetPrivate;
00027     typedef QValueList<OKeyConfigWidgetPrivate> OKeyConfigWidgetPrivateList;
00028     class OKeyListViewItem;
00029 }
00030     class OListViewItem;
00031     class OListView;
00032 
00033 
00048 class OKeyConfigWidget : public QWidget {
00049     Q_OBJECT
00050 
00051 public:
00056     enum ChangeMode { Imediate, Queue };
00057     OKeyConfigWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00058     virtual ~OKeyConfigWidget();
00059 
00060     void setChangeMode( enum ChangeMode );
00061     ChangeMode changeMode()const;
00062 
00063     void insert( const QString& name, Opie::Core::OKeyConfigManager* );
00064 
00065     void load();
00066     void save();
00067 
00068 protected slots:
00069     void slotListViewItem(  QListViewItem* );
00070     void slotNoKey();
00071     void slotDefaultKey();
00072     void slotCustomKey();
00073     void slotConfigure();
00074 
00075 private:
00076     static bool sanityCheck(  Opie::Ui::Internal::OKeyListViewItem* man,
00077                               const Opie::Core::OKeyPair& newItem );
00078     void updateItem( Opie::Ui::Internal::OKeyListViewItem* man,
00079                      const Opie::Core::OKeyPair& newItem);
00080     void initUi();
00081     Opie::Ui::OListView *m_view;
00082     Opie::Ui::Internal::OKeyConfigWidgetPrivateList m_list;
00083     QLabel *m_lbl;
00084     QPushButton *m_btn;
00085     QRadioButton *m_def, *m_cus, *m_none;
00086     QWidget* m_box;
00087     ChangeMode m_mode;
00088     class Private;
00089     Private *d;
00090 };
00091 
00092 
00110 class OKeyChooserConfigDialog : public QDialog {
00111     Q_OBJECT
00112 public:
00113     OKeyChooserConfigDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
00114     ~OKeyChooserConfigDialog();
00115 
00116     Opie::Core::OKeyPair keyPair()const;
00117 
00118 protected:
00119     void keyPressEvent( QKeyEvent* );
00120     void keyReleaseEvent( QKeyEvent* );
00121 
00122 signals:
00123     void keyCaptured();
00124 
00125 private slots:
00126     void  slotTimeUp();
00127 
00128 private:
00129     QTimer *m_timer;
00130     QLabel *m_lbl;
00131     bool m_virtKey : 1;
00132     Opie::Core::OKeyPair m_keyPair;
00133     int m_key, m_mod;
00134     class Private;
00135     Private *d;
00136 };
00137 
00138 }
00139 }
00140 
00141 
00142 #endif

Generated on Sat Nov 5 16:16:26 2005 for OPIE by  doxygen 1.4.2