00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEYACTIONMANAGER_H
00022 #define KEYACTIONMANAGER_H
00023
00024 #include <QObject>
00025 #include "keyaction.h"
00026 #include "qimsyskeysequence.h"
00027 #include "namespace.h"
00028
00029 namespace ja_JP
00030 {
00031
00032 struct KeyActionData {
00033 State state;
00034 QimsysKeySequence key;
00035 KeyAction *action;
00036 bool user;
00037 };
00038
00039 class KeyActionDataList : public QList<KeyActionData>
00040 {
00041 public:
00042 KeyActionDataList();
00043 KeyActionDataList(const QString &fileName);
00044 ~KeyActionDataList();
00045 KeyActionDataList &operator=(const KeyActionDataList &other);
00046
00047 void merge(const KeyActionDataList &other);
00048
00049 const QString &fileName() const;
00050
00051 void read(const QString &fileName);
00052 void save() const;
00053
00054 private:
00055 class Private;
00056 Private *d;
00057 };
00058
00059 class KeyActionManager : public QObject
00060 {
00061 Q_OBJECT
00062 public:
00063 static KeyActionManager *instance();
00064 private:
00065 KeyActionManager(QObject *parent = 0);
00066 public:
00067 ~KeyActionManager();
00068
00069 void addAction(KeyAction *action);
00070 const KeyActionList &actions() const;
00071 const KeyActionDataList &list() const;
00072 void setList(const KeyActionDataList &list);
00073 KeyAction *action(const QString &name) const;
00074
00075 signals:
00076 void listChanged(const KeyActionDataList &list);
00077
00078 private:
00079 class Private;
00080 Private *d;
00081 };
00082
00083 }
00084 #endif // KEYACTIONMANAGER_H