| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef DBUSMENUEXPORTERPRIVATE_P_H |
| 22 |
#define DBUSMENUEXPORTERPRIVATE_P_H |
| 23 |
|
| 24 |
|
| 25 |
#include "dbusmenuexporter.h" |
| 26 |
#include "dbusmenutypes_p.h" |
| 27 |
|
| 28 |
|
| 29 |
#include <QtCore/QHash> |
| 30 |
#include <QtCore/QMap> |
| 31 |
#include <QtCore/QSet> |
| 32 |
#include <QtCore/QVariant> |
| 33 |
|
| 34 |
class QMenu; |
| 35 |
|
| 36 |
class DBusMenuExporterDBus; |
| 37 |
|
| 38 |
class DBusMenuExporterPrivate |
| 39 |
{ |
| 40 |
public: |
| 41 |
DBusMenuExporter *q; |
| 42 |
|
| 43 |
QString m_objectPath; |
| 44 |
|
| 45 |
DBusMenuExporterDBus *m_dbusObject; |
| 46 |
|
| 47 |
QMenu *m_rootMenu; |
| 48 |
QHash<QAction *, QVariantMap> m_actionProperties; |
| 49 |
QMap<int, QAction *> m_actionForId; |
| 50 |
QMap<QAction *, int> m_idForAction; |
| 51 |
int m_nextId; |
| 52 |
uint m_revision; |
| 53 |
bool m_emittedLayoutUpdatedOnce; |
| 54 |
|
| 55 |
QSet<int> m_itemUpdatedIds; |
| 56 |
QTimer *m_itemUpdatedTimer; |
| 57 |
|
| 58 |
QSet<int> m_layoutUpdatedIds; |
| 59 |
QTimer *m_layoutUpdatedTimer; |
| 60 |
|
| 61 |
int idForAction(QAction *action) const; |
| 62 |
void addMenu(QMenu *menu, int parentId); |
| 63 |
QVariantMap propertiesForAction(QAction *action) const; |
| 64 |
QVariantMap propertiesForKMenuTitleAction(QAction *action_) const; |
| 65 |
QVariantMap propertiesForSeparatorAction(QAction *action) const; |
| 66 |
QVariantMap propertiesForStandardAction(QAction *action) const; |
| 67 |
QMenu *menuForId(int id) const; |
| 68 |
void fillLayoutItem(DBusMenuLayoutItem *item, QMenu *menu, int id, int depth, const QStringList &propertyNames); |
| 69 |
|
| 70 |
void addAction(QAction *action, int parentId); |
| 71 |
void updateAction(QAction *action); |
| 72 |
void removeAction(QAction *action, int parentId); |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
void removeActionInternal(QObject *action); |
| 82 |
|
| 83 |
void emitLayoutUpdated(int id); |
| 84 |
|
| 85 |
void insertIconProperty(QVariantMap* map, QAction *action) const; |
| 86 |
|
| 87 |
void collapseSeparators(QMenu*); |
| 88 |
}; |
| 89 |
|
| 90 |
|
| 91 |
#endif |