summaryrefslogtreecommitdiff
path: root/libopie2/opieui/okeyconfigwidget.h
authorzecke <zecke>2004-04-01 19:59:29 (UTC)
committer zecke <zecke>2004-04-01 19:59:29 (UTC)
commit7804289bee604cd1e299f4911fa18dcfda37352f (patch) (side-by-side diff)
treeb36f3c14e11b7d89d9093999ad7503cc26d4aba8 /libopie2/opieui/okeyconfigwidget.h
parent79e746cae433ca33bbe138ff4ad2704d13215e88 (diff)
downloadopie-7804289bee604cd1e299f4911fa18dcfda37352f.zip
opie-7804289bee604cd1e299f4911fa18dcfda37352f.tar.gz
opie-7804289bee604cd1e299f4911fa18dcfda37352f.tar.bz2
Finally only two checks left and it is done
Capture keys
Diffstat (limited to 'libopie2/opieui/okeyconfigwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/okeyconfigwidget.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libopie2/opieui/okeyconfigwidget.h b/libopie2/opieui/okeyconfigwidget.h
index 8d2a1ef..9e26719 100644
--- a/libopie2/opieui/okeyconfigwidget.h
+++ b/libopie2/opieui/okeyconfigwidget.h
@@ -1,53 +1,55 @@
/*
* Copyright (C) 2004
* LGPL v2 zecke@handhelds.org
*/
#ifndef ODP_KEY_CONFIG_WIDGET_H
#define ODP_KEY_CONFIG_WIDGET_H
#include <opie2/oconfig.h>
#include <opie2/odevice.h>
#include <qstring.h>
#include <qpixmap.h>
#include <qcstring.h>
#include <qhbox.h>
#include <qvaluelist.h>
class QKeyEvent;
class QLabel;
class QPushButton;
class QListViewItem;
class QRadioButton;
+class QTimer;
namespace Opie {
namespace Ui {
namespace Private {
class OKeyConfigWidgetPrivate;
typedef QValueList<OKeyConfigWidgetPrivate> OKeyConfigWidgetPrivateList;
+ class OKeyListViewItem;
}
class OListViewItem;
class OListView;
/**
* \brief small class representing a Key with possible modifiers
* This class holds information about key code and possible
* modifier state. That is the lowest level of the key input
* functions.
* There are also static methods to get special keys.
* OKeyPair will be used with \see OKeyConfigItem
*
* @since 1.2
*/
class OKeyPair {
public:
typedef QValueList<OKeyPair> List;
OKeyPair( int key = -1, int modifier = -1);
~OKeyPair();
bool operator==( const OKeyPair& );
bool operator!=( const OKeyPair& );
bool isEmpty()const;
@@ -230,80 +232,89 @@ public:
/**
* Immediate Apply the change directly to the underlying OKeyConfigManager
* Queue Save all items and then apply when you save()
*/
enum ChangeMode { Imediate, Queue };
OKeyConfigWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~OKeyConfigWidget();
void setChangeMode( enum ChangeMode );
ChangeMode changeMode()const;
void insert( const QString& name, OKeyConfigManager* );
void load();
void save();
private slots:
void slotListViewItem( QListViewItem* );
void slotNoKey();
void slotDefaultKey();
void slotCustomKey();
void slotConfigure();
private:
+ void updateItem( Opie::Ui::Private::OKeyListViewItem* man,
+ const OKeyPair& newItem);
void initUi();
Opie::Ui::OListView *m_view;
Opie::Ui::Private::OKeyConfigWidgetPrivateList m_list;
QLabel *m_lbl;
QPushButton *m_btn;
QRadioButton *m_def, *m_cus, *m_none;
QWidget* m_box;
ChangeMode m_mode;
class Private;
Private *d;
};
/**
* This is a small dialog that allows you to
* capture a key sequence.
* If you want it to close after a key was captured you
* can use this code snippet.
*
* \code
* OKeyChooserConfigDialog diag(0,0,true);
* connect(&diag,SIGNAL(keyCaptured()),
* this,SLOT(accept()));
* if( QPEApplication::execDialog(&diag) == QDialog::Accept ){
* take_the_key_and_do_something
* }
*
* \endcode
*
*/
class OKeyChooserConfigDialog : public QDialog {
Q_OBJECT
public:
OKeyChooserConfigDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
~OKeyChooserConfigDialog();
OKeyPair keyPair()const;
protected:
void keyPressEvent( QKeyEvent* );
void keyReleaseEvent( QKeyEvent* );
signals:
void keyCaptured();
+private slots:
+ void slotTimeUp();
+
private:
+ QTimer *m_timer;
+ QLabel *m_lbl;
+ bool m_virtKey : 1;
OKeyPair m_keyPair;
+ int m_key, m_mod;
class Private;
Private *d;
};
}
}
#endif