aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src/qdbusactiongroup.h
diff options
context:
space:
mode:
authorNick Dedekind <nicholas.dedekind@gmail.com>2013-08-08 16:12:57 +0100
committerNick Dedekind <nicholas.dedekind@gmail.com>2013-08-08 16:12:57 +0100
commitc6cb726c5694f8a35711a48a7bf5e2a6723aeba8 (patch)
tree509f5b5c2cf1223274034721a611c55c5039b0ab /libqmenumodel/src/qdbusactiongroup.h
parent52b17007596bcd29ec0fe01468d28fddfcc18785 (diff)
downloadqmenumodel-c6cb726c5694f8a35711a48a7bf5e2a6723aeba8.tar.gz
qmenumodel-c6cb726c5694f8a35711a48a7bf5e2a6723aeba8.tar.bz2
qmenumodel-c6cb726c5694f8a35711a48a7bf5e2a6723aeba8.zip
Glib callbacks send events through qt.
Diffstat (limited to 'libqmenumodel/src/qdbusactiongroup.h')
-rw-r--r--libqmenumodel/src/qdbusactiongroup.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/libqmenumodel/src/qdbusactiongroup.h b/libqmenumodel/src/qdbusactiongroup.h
index 0292a8f..dde33a4 100644
--- a/libqmenumodel/src/qdbusactiongroup.h
+++ b/libqmenumodel/src/qdbusactiongroup.h
@@ -24,6 +24,7 @@
#include <QObject>
#include <QVariant>
+#include <QEvent>
class QStateAction;
@@ -69,6 +70,8 @@ protected:
virtual void serviceAppear(GDBusConnection *connection);
virtual void serviceVanish(GDBusConnection *connection);
+ virtual bool event(QEvent* e);
+
private:
GActionGroup *m_actionGroup;
int m_signalActionAddId;
@@ -89,4 +92,33 @@ private:
static void onActionStateChanged(GDBusActionGroup *ag, gchar *name, GVariant *value, gpointer data);
};
-#endif
+class DBusActionEvent : public QEvent
+{
+public:
+ QString name;
+
+protected:
+ DBusActionEvent(const QString& name, QEvent::Type type);
+};
+
+class DBusActionVisiblityEvent : public DBusActionEvent
+{
+public:
+ static const QEvent::Type eventType;
+ DBusActionVisiblityEvent(const QString& name, bool visible);
+
+ bool visible;
+};
+
+
+class DBusActionStateEvent : public DBusActionEvent
+{
+public:
+ static const QEvent::Type eventType;
+
+ DBusActionStateEvent(const QString& name, const QVariant& state);
+
+ QVariant state;
+};
+
+#endif // QDBUSACTIONGROUP_H