Changeset View
Changeset View
Standalone View
Standalone View
src/kstatusnotifieritemprivate_p.h
Show All 23 Lines | |||||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QString> | 25 | #include <QString> | ||
26 | #include <QMovie> | 26 | #include <QMovie> | ||
27 | #include <QSystemTrayIcon> | 27 | #include <QSystemTrayIcon> | ||
28 | #include <QWheelEvent> | 28 | #include <QWheelEvent> | ||
29 | #include <QEventLoopLocker> | 29 | #include <QEventLoopLocker> | ||
30 | 30 | | |||
31 | #include "kstatusnotifieritem.h" | 31 | #include "kstatusnotifieritem.h" | ||
32 | | ||||
33 | #ifdef QT_DBUS_LIB | ||||
32 | #include "kstatusnotifieritemdbus_p.h" | 34 | #include "kstatusnotifieritemdbus_p.h" | ||
33 | 35 | | |||
34 | #include "statusnotifierwatcher_interface.h" | 36 | #include "statusnotifierwatcher_interface.h" | ||
35 | #include "notifications_interface.h" | 37 | #include "notifications_interface.h" | ||
38 | #endif | ||||
39 | | ||||
36 | 40 | | |||
37 | class KSystemTrayIcon; | 41 | class KSystemTrayIcon; | ||
38 | class QMenu; | 42 | class QMenu; | ||
39 | class QAction; | 43 | class QAction; | ||
40 | 44 | | |||
41 | // this class is needed because we can't just put an event filter on it: | 45 | // this class is needed because we can't just put an event filter on it: | ||
42 | // the events that are passed to QSystemTrayIcon are done so in a way that | 46 | // the events that are passed to QSystemTrayIcon are done so in a way that | ||
43 | // bypasses the usual event filtering mechanisms *sigh* | 47 | // bypasses the usual event filtering mechanisms *sigh* | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 109 | public: | |||
115 | void minimizeRestore(); | 119 | void minimizeRestore(); | ||
116 | void minimizeRestore(bool show); | 120 | void minimizeRestore(bool show); | ||
117 | void hideMenu(); | 121 | void hideMenu(); | ||
118 | void setLegacyMode(bool legacy); | 122 | void setLegacyMode(bool legacy); | ||
119 | void checkForRegisteredHosts(); | 123 | void checkForRegisteredHosts(); | ||
120 | void legacyWheelEvent(int delta); | 124 | void legacyWheelEvent(int delta); | ||
121 | void legacyActivated(QSystemTrayIcon::ActivationReason reason); | 125 | void legacyActivated(QSystemTrayIcon::ActivationReason reason); | ||
122 | 126 | | |||
123 | KDbusImageStruct imageToStruct(const QImage &image); | | |||
124 | KDbusImageVector iconToVector(const QIcon &icon); | | |||
125 | bool checkVisibility(QPoint pos, bool perform = true); | 127 | bool checkVisibility(QPoint pos, bool perform = true); | ||
126 | 128 | | |||
127 | static const int s_protocolVersion; | 129 | static const int s_protocolVersion; | ||
128 | 130 | | |||
129 | KStatusNotifierItem *q; | 131 | KStatusNotifierItem *q; | ||
130 | 132 | | |||
133 | #ifdef QT_DBUS_LIB | ||||
134 | KDbusImageStruct imageToStruct(const QImage &image); | ||||
135 | KDbusImageVector iconToVector(const QIcon &icon); | ||||
136 | | ||||
137 | KDbusImageVector serializedIcon; | ||||
138 | KDbusImageVector serializedAttentionIcon; | ||||
139 | KDbusImageVector serializedOverlayIcon; | ||||
140 | KDbusImageVector serializedToolTipIcon; | ||||
141 | | ||||
142 | | ||||
143 | org::kde::StatusNotifierWatcher *statusNotifierWatcher = nullptr; | ||||
144 | org::freedesktop::Notifications *notificationsClient = nullptr; | ||||
145 | | ||||
146 | KStatusNotifierItemDBus *statusNotifierItemDBus; | ||||
147 | #endif | ||||
148 | | ||||
131 | KStatusNotifierItem::ItemCategory category; | 149 | KStatusNotifierItem::ItemCategory category; | ||
132 | QString id; | 150 | QString id; | ||
133 | QString title; | 151 | QString title; | ||
134 | KStatusNotifierItem::ItemStatus status; | 152 | KStatusNotifierItem::ItemStatus status; | ||
135 | 153 | | |||
136 | QString iconName; | 154 | QString iconName; | ||
137 | KDbusImageVector serializedIcon; | | |||
138 | QIcon icon; | 155 | QIcon icon; | ||
139 | 156 | | |||
140 | QString overlayIconName; | 157 | QString overlayIconName; | ||
141 | KDbusImageVector serializedOverlayIcon; | | |||
142 | QIcon overlayIcon; | 158 | QIcon overlayIcon; | ||
143 | 159 | | |||
144 | QString attentionIconName; | 160 | QString attentionIconName; | ||
145 | QIcon attentionIcon; | 161 | QIcon attentionIcon; | ||
146 | KDbusImageVector serializedAttentionIcon; | | |||
147 | QString movieName; | 162 | QString movieName; | ||
148 | QPointer<QMovie> movie; | 163 | QPointer<QMovie> movie; | ||
149 | 164 | | |||
150 | QString toolTipIconName; | 165 | QString toolTipIconName; | ||
151 | KDbusImageVector serializedToolTipIcon; | | |||
152 | QIcon toolTipIcon; | 166 | QIcon toolTipIcon; | ||
153 | QString toolTipTitle; | 167 | QString toolTipTitle; | ||
154 | QString toolTipSubTitle; | 168 | QString toolTipSubTitle; | ||
155 | QString iconThemePath; | 169 | QString iconThemePath; | ||
156 | QString menuObjectPath; | 170 | QString menuObjectPath; | ||
171 | KStatusNotifierLegacyIcon *systemTrayIcon; | ||||
157 | 172 | | |||
158 | QMenu *menu; | 173 | QMenu *menu; | ||
159 | QHash<QString, QAction *> actionCollection; | 174 | QHash<QString, QAction *> actionCollection; | ||
160 | QWidget *associatedWidget; | 175 | QWidget *associatedWidget; | ||
161 | QPoint associatedWidgetPos; | 176 | QPoint associatedWidgetPos; | ||
162 | QAction *titleAction; | 177 | QAction *titleAction; | ||
163 | org::kde::StatusNotifierWatcher *statusNotifierWatcher; | | |||
164 | org::freedesktop::Notifications *notificationsClient; | | |||
165 | 178 | | |||
166 | KStatusNotifierLegacyIcon *systemTrayIcon; | | |||
167 | KStatusNotifierItemDBus *statusNotifierItemDBus; | | |||
168 | 179 | | |||
169 | // Ensure that closing the last KMainWindow doesn't exit the application | 180 | // Ensure that closing the last KMainWindow doesn't exit the application | ||
170 | // if a system tray icon is still present. | 181 | // if a system tray icon is still present. | ||
171 | QEventLoopLocker eventLoopLocker; | 182 | QEventLoopLocker eventLoopLocker; | ||
172 | 183 | | |||
173 | bool hasQuit : 1; | 184 | bool hasQuit : 1; | ||
174 | bool onAllDesktops : 1; | 185 | bool onAllDesktops : 1; | ||
175 | bool standardActionsEnabled : 1; | 186 | bool standardActionsEnabled : 1; | ||
176 | }; | 187 | }; | ||
177 | 188 | | |||
178 | #endif | 189 | #endif |