diff options
author | Nick Dedekind <nicholas.dedekind@gmail.com> | 2013-08-08 16:12:57 +0100 |
---|---|---|
committer | Nick Dedekind <nicholas.dedekind@gmail.com> | 2013-08-08 16:12:57 +0100 |
commit | c6cb726c5694f8a35711a48a7bf5e2a6723aeba8 (patch) | |
tree | 509f5b5c2cf1223274034721a611c55c5039b0ab /libqmenumodel/src/qdbusactiongroup.h | |
parent | 52b17007596bcd29ec0fe01468d28fddfcc18785 (diff) | |
download | qmenumodel-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.h | 34 |
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 |