summaryrefslogtreecommitdiff
path: root/libopie2
authorzecke <zecke>2004-03-23 23:59:36 (UTC)
committer zecke <zecke>2004-03-23 23:59:36 (UTC)
commitc8acbf192ca4aa64ed66306ca872cb3860590b3c (patch) (side-by-side diff)
treead81a8681bd755185e8ba4e3fbded2f1869c1607 /libopie2
parent6a1e8a9f03d8b552a51ab0b45ec5b1959af6eb73 (diff)
downloadopie-c8acbf192ca4aa64ed66306ca872cb3860590b3c.zip
opie-c8acbf192ca4aa64ed66306ca872cb3860590b3c.tar.gz
opie-c8acbf192ca4aa64ed66306ca872cb3860590b3c.tar.bz2
Update....
Start the Slave Add the Iface for OKeyConfigWidget
Diffstat (limited to 'libopie2') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/okeyconfigwidget.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/libopie2/opieui/okeyconfigwidget.h b/libopie2/opieui/okeyconfigwidget.h
new file mode 100644
index 0000000..d76ea46
--- a/dev/null
+++ b/libopie2/opieui/okeyconfigwidget.h
@@ -0,0 +1,96 @@
+#ifndef ODP_KEY_CONFIG_WIDGET_H
+#define ODP_KEY_CONFIG_WIDGET_H
+
+#include <opie2/oconfig.h>
+
+#include <qstring.h>
+#include <qpixmap.h>
+#include <qbytearray.h>
+#include <qhbox.h>
+#include <qvaluelist.h>
+
+class QKeyEvent;
+
+namespace Opie {
+namespace Ui {
+
+class OKeyConfigItem {
+ friend class OKeyConfigManager;
+public:
+ typedef QValueList<OKeyConfigItem> OKeyConfigItemList;
+ OKeyConfigItem( const QString& text = QString::null , const QCString& config_key = QCString(),
+ const QPixmap& symbol = QPixmap(),
+ int key = 0, int mod = 0,
+ int default_key = 0, int default_modified = 0 );
+ ~OKeyConfigItem();
+
+ QString text()const;
+ QPixmap pixmap()const;
+ int key()const;
+ int modifier()const;
+ int defaultKey()const;
+ int defaultModifier()const;
+
+ void setText( const QString& text );
+ void setPixmap( const QPixmap& );
+ void setKey( int );
+ void setModied( int );
+ void setDefaultKey( int );
+ void setDefaultModifier( int );
+
+ bool isConfigured()const;
+ bool isEmpty()const;
+private:
+ QString m_text;
+ QCString m_config;
+ QPixmap m_pix;
+ int m_key;
+ int m_mod;
+ int m_defKey;
+ int m_defMod;
+ class Private;
+ Private *d;
+};
+
+
+class OKeyConfig : public QObject {
+ Q_OBJECT
+public:
+ OKeyConfig(Opie::Core::OConfig *conf = 0, bool grabkeyboard);
+ ~OKeyConfig();
+
+ void load();
+ void save();
+
+ OKeyConfigItem handleKeyEvent( QKeyEvent* );
+ QString handleKeyEventString( QKeyEvent* );
+
+ void addKeyConfig( const OKeyConfigItem& );
+ void removeKeyConfig( const OKeyConfigItem& );
+signals:
+ void keyConfigChanged( OKeyConfig* );
+
+private:
+ OKeyConfigItemList m_keys;
+};
+
+
+class OKeyConfigWidget : public QHBox {
+ Q_OBJECT
+public:
+ enum ChangeMode { Imediate, Queu };
+ OKeyConfigWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ OKeyConfigWidget( OKeyConfig *, QWidget* parent = 0, const char* = 0, WFlags = 0 );
+ ~OKeyConfigWidget();
+
+ void setChangeMode( enum ChangeMode );
+ ChangeMode changeMode()const;
+
+ void reload();
+};
+
+}
+}
+
+
+#endif