X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fstatusnotifieritemdbus.h;h=fb1f5cdaf30cfdf70ec785ac38f2a292d3ca64e0;hb=4e51500401db3c85dbe5e92e5e5c15b6e3c87787;hp=d033c9c2d356b66015bff331d15ee2c0e94b3f86;hpb=5d9af8ed007d38faf3995ea18174249121f246fe;p=quassel.git diff --git a/src/qtui/statusnotifieritemdbus.h b/src/qtui/statusnotifieritemdbus.h index d033c9c2..fb1f5cda 100644 --- a/src/qtui/statusnotifieritemdbus.h +++ b/src/qtui/statusnotifieritemdbus.h @@ -4,9 +4,9 @@ * Quasselfied 2010 by Manuel Nickschas * * * * This file is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * it under the terms of the GNU Library General Public License (LGPL) * + * as published by the Free Software Foundation; either version 2 of the * + * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -16,28 +16,30 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef STATUSNOTIFIERITEMDBUS_H_ #define STATUSNOTIFIERITEMDBUS_H_ -#include -#include #include #include +#include #include +#include -//Custom message type for DBus -struct DBusImageStruct { +// Custom message type for DBus +struct DBusImageStruct +{ int width; int height; QByteArray data; }; -typedef QVector DBusImageVector; +using DBusImageVector = QVector; -struct DBusToolTipStruct { +struct DBusToolTipStruct +{ QString icon; DBusImageVector image; QString title; @@ -67,9 +69,10 @@ class StatusNotifierItemDBus : public QObject Q_PROPERTY(QDBusObjectPath Menu READ Menu) friend class StatusNotifierItem; + public: - StatusNotifierItemDBus(StatusNotifierItem *parent); - ~StatusNotifierItemDBus(); + StatusNotifierItemDBus(StatusNotifierItem* parent); + ~StatusNotifierItemDBus() override; /** * @return the dbus connection used by this object @@ -77,14 +80,14 @@ public: QDBusConnection dbusConnection() const; /** - * Register the service to DBus + * Register the StatusNotifierItem to DBus */ - void registerService(); + void registerTrayIcon(); /** - * Unregister the service from DBus + * Unregister the StatusNotifierItem from DBus */ - void unregisterService(); + void unregisterTrayIcon(); /** * @return the service this object is registered on the bus under @@ -172,8 +175,8 @@ public: */ QDBusObjectPath Menu() const; -public Q_SLOTS: - //interaction +public slots: + // interaction /** * Shows the context menu associated to this item * at the desired screen position @@ -194,9 +197,9 @@ public Q_SLOTS: /** * Inform this item that the mouse wheel was used on its representation */ - void Scroll(int delta, const QString &orientation); + void Scroll(int delta, const QString& orientation); -Q_SIGNALS: +signals: /** * Inform the systemtray that the own main icon has been changed, * so should be reloaded @@ -223,28 +226,26 @@ Q_SIGNALS: * Signal the new status when it has been changed * @see Status */ - void NewStatus(const QString &status); + void NewStatus(const QString& status); private: - StatusNotifierItem *m_statusNotifierItem; - QString m_service; + StatusNotifierItem* m_statusNotifierItem; QDBusConnection m_dbus; static int s_serviceCount; }; - -const QDBusArgument &operator<<(QDBusArgument &argument, const DBusImageStruct &icon); -const QDBusArgument &operator>>(const QDBusArgument &argument, DBusImageStruct &icon); +const QDBusArgument& operator<<(QDBusArgument& argument, const DBusImageStruct& icon); +const QDBusArgument& operator>>(const QDBusArgument& argument, DBusImageStruct& icon); Q_DECLARE_METATYPE(DBusImageStruct) -const QDBusArgument &operator<<(QDBusArgument &argument, const DBusImageVector &iconVector); -const QDBusArgument &operator>>(const QDBusArgument &argument, DBusImageVector &iconVector); +const QDBusArgument& operator<<(QDBusArgument& argument, const DBusImageVector& iconVector); +const QDBusArgument& operator>>(const QDBusArgument& argument, DBusImageVector& iconVector); Q_DECLARE_METATYPE(DBusImageVector) -const QDBusArgument &operator<<(QDBusArgument &argument, const DBusToolTipStruct &toolTip); -const QDBusArgument &operator>>(const QDBusArgument &argument, DBusToolTipStruct &toolTip); +const QDBusArgument& operator<<(QDBusArgument& argument, const DBusToolTipStruct& toolTip); +const QDBusArgument& operator>>(const QDBusArgument& argument, DBusToolTipStruct& toolTip); Q_DECLARE_METATYPE(DBusToolTipStruct)