| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtGui module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | /* |
| 41 | This file was originally created by qdbusxml2cpp version 0.8 |
| 42 | Command line was: |
| 43 | qdbusxml2cpp -a statusnotifieritem ../../3rdparty/dbus-ifaces/org.kde.StatusNotifierItem.xml |
| 44 | |
| 45 | However it is maintained manually. |
| 46 | |
| 47 | It is also not part of the public API. This header file may change from |
| 48 | version to version without notice, or even be removed. |
| 49 | */ |
| 50 | |
| 51 | #ifndef QSTATUSNOTIFIERITEMADAPTER_P_H |
| 52 | #define QSTATUSNOTIFIERITEMADAPTER_P_H |
| 53 | |
| 54 | // |
| 55 | // W A R N I N G |
| 56 | // ------------- |
| 57 | // |
| 58 | // This file is not part of the Qt API. It exists purely as an |
| 59 | // implementation detail. This header file may change from version to |
| 60 | // version without notice, or even be removed. |
| 61 | // |
| 62 | // We mean it. |
| 63 | // |
| 64 | |
| 65 | #include <QtGui/private/qtguiglobal_p.h> |
| 66 | |
| 67 | QT_REQUIRE_CONFIG(systemtrayicon); |
| 68 | |
| 69 | #include <QtCore/QObject> |
| 70 | #include <QtDBus/QtDBus> |
| 71 | |
| 72 | #include "qdbustraytypes_p.h" |
| 73 | |
| 74 | QT_BEGIN_NAMESPACE |
| 75 | class QDBusTrayIcon; |
| 76 | |
| 77 | /* |
| 78 | Adaptor class for interface org.kde.StatusNotifierItem |
| 79 | see http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/ |
| 80 | (also http://www.notmart.org/misc/statusnotifieritem/) |
| 81 | */ |
| 82 | class QStatusNotifierItemAdaptor: public QDBusAbstractAdaptor |
| 83 | { |
| 84 | Q_OBJECT |
| 85 | Q_CLASSINFO("D-Bus Interface" , "org.kde.StatusNotifierItem" ) |
| 86 | Q_CLASSINFO("D-Bus Introspection" , "" |
| 87 | " <interface name=\"org.kde.StatusNotifierItem\">\n" |
| 88 | " <property access=\"read\" type=\"s\" name=\"Category\"/>\n" |
| 89 | " <property access=\"read\" type=\"s\" name=\"Id\"/>\n" |
| 90 | " <property access=\"read\" type=\"s\" name=\"Title\"/>\n" |
| 91 | " <property access=\"read\" type=\"s\" name=\"Status\"/>\n" |
| 92 | " <property access=\"read\" type=\"i\" name=\"WindowId\"/>\n" |
| 93 | " <property access=\"read\" type=\"s\" name=\"IconThemePath\"/>\n" |
| 94 | " <property access=\"read\" type=\"o\" name=\"Menu\"/>\n" |
| 95 | " <property access=\"read\" type=\"b\" name=\"ItemIsMenu\"/>\n" |
| 96 | " <property access=\"read\" type=\"s\" name=\"IconName\"/>\n" |
| 97 | " <property access=\"read\" type=\"a(iiay)\" name=\"IconPixmap\">\n" |
| 98 | " <annotation value=\"QXdgDBusImageVector\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n" |
| 99 | " </property>\n" |
| 100 | " <property access=\"read\" type=\"s\" name=\"OverlayIconName\"/>\n" |
| 101 | " <property access=\"read\" type=\"a(iiay)\" name=\"OverlayIconPixmap\">\n" |
| 102 | " <annotation value=\"QXdgDBusImageVector\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n" |
| 103 | " </property>\n" |
| 104 | " <property access=\"read\" type=\"s\" name=\"AttentionIconName\"/>\n" |
| 105 | " <property access=\"read\" type=\"a(iiay)\" name=\"AttentionIconPixmap\">\n" |
| 106 | " <annotation value=\"QXdgDBusImageVector\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n" |
| 107 | " </property>\n" |
| 108 | " <property access=\"read\" type=\"s\" name=\"AttentionMovieName\"/>\n" |
| 109 | " <property access=\"read\" type=\"(sa(iiay)ss)\" name=\"ToolTip\">\n" |
| 110 | " <annotation value=\"QXdgDBusToolTipStruct\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n" |
| 111 | " </property>\n" |
| 112 | " <method name=\"ContextMenu\">\n" |
| 113 | " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n" |
| 114 | " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n" |
| 115 | " </method>\n" |
| 116 | " <method name=\"Activate\">\n" |
| 117 | " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n" |
| 118 | " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n" |
| 119 | " </method>\n" |
| 120 | " <method name=\"SecondaryActivate\">\n" |
| 121 | " <arg direction=\"in\" type=\"i\" name=\"x\"/>\n" |
| 122 | " <arg direction=\"in\" type=\"i\" name=\"y\"/>\n" |
| 123 | " </method>\n" |
| 124 | " <method name=\"Scroll\">\n" |
| 125 | " <arg direction=\"in\" type=\"i\" name=\"delta\"/>\n" |
| 126 | " <arg direction=\"in\" type=\"s\" name=\"orientation\"/>\n" |
| 127 | " </method>\n" |
| 128 | " <signal name=\"NewTitle\"/>\n" |
| 129 | " <signal name=\"NewIcon\"/>\n" |
| 130 | " <signal name=\"NewAttentionIcon\"/>\n" |
| 131 | " <signal name=\"NewOverlayIcon\"/>\n" |
| 132 | " <signal name=\"NewMenu\"/>\n" |
| 133 | " <signal name=\"NewToolTip\"/>\n" |
| 134 | " <signal name=\"NewStatus\">\n" |
| 135 | " <arg type=\"s\" name=\"status\"/>\n" |
| 136 | " </signal>\n" |
| 137 | " </interface>\n" |
| 138 | "" ) |
| 139 | public: |
| 140 | QStatusNotifierItemAdaptor(QDBusTrayIcon *parent); |
| 141 | virtual ~QStatusNotifierItemAdaptor(); |
| 142 | |
| 143 | public: // PROPERTIES |
| 144 | Q_PROPERTY(QString AttentionIconName READ attentionIconName) |
| 145 | QString attentionIconName() const; |
| 146 | |
| 147 | Q_PROPERTY(QXdgDBusImageVector AttentionIconPixmap READ attentionIconPixmap) |
| 148 | QXdgDBusImageVector attentionIconPixmap() const; |
| 149 | |
| 150 | Q_PROPERTY(QString AttentionMovieName READ attentionMovieName) |
| 151 | QString attentionMovieName() const; |
| 152 | |
| 153 | Q_PROPERTY(QString Category READ category) |
| 154 | QString category() const; |
| 155 | |
| 156 | Q_PROPERTY(QString IconName READ iconName) |
| 157 | QString iconName() const; |
| 158 | |
| 159 | Q_PROPERTY(QXdgDBusImageVector IconPixmap READ iconPixmap) |
| 160 | QXdgDBusImageVector iconPixmap() const; |
| 161 | |
| 162 | Q_PROPERTY(QString Id READ id) |
| 163 | QString id() const; |
| 164 | |
| 165 | Q_PROPERTY(bool ItemIsMenu READ itemIsMenu) |
| 166 | bool () const; |
| 167 | |
| 168 | Q_PROPERTY(QDBusObjectPath Menu READ menu) |
| 169 | QDBusObjectPath () const; |
| 170 | |
| 171 | Q_PROPERTY(QString OverlayIconName READ overlayIconName) |
| 172 | QString overlayIconName() const; |
| 173 | |
| 174 | Q_PROPERTY(QXdgDBusImageVector OverlayIconPixmap READ overlayIconPixmap) |
| 175 | QXdgDBusImageVector overlayIconPixmap() const; |
| 176 | |
| 177 | Q_PROPERTY(QString Status READ status) |
| 178 | QString status() const; |
| 179 | |
| 180 | Q_PROPERTY(QString Title READ title) |
| 181 | QString title() const; |
| 182 | |
| 183 | Q_PROPERTY(QXdgDBusToolTipStruct ToolTip READ toolTip) |
| 184 | QXdgDBusToolTipStruct toolTip() const; |
| 185 | |
| 186 | public Q_SLOTS: // METHODS |
| 187 | void Activate(int x, int y); |
| 188 | void (int x, int y); |
| 189 | void Scroll(int delta, const QString &orientation); |
| 190 | void SecondaryActivate(int x, int y); |
| 191 | Q_SIGNALS: // SIGNALS |
| 192 | void NewAttentionIcon(); |
| 193 | void NewIcon(); |
| 194 | void NewOverlayIcon(); |
| 195 | void (); |
| 196 | void NewStatus(const QString &status); |
| 197 | void NewTitle(); |
| 198 | void NewToolTip(); |
| 199 | |
| 200 | private: |
| 201 | QDBusTrayIcon *m_trayIcon; |
| 202 | }; |
| 203 | |
| 204 | QT_END_NAMESPACE |
| 205 | |
| 206 | #endif // QSTATUSNOTIFIERITEMADAPTER_P_H |
| 207 | |