* 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 <QObject>
-#include <QString>
#include <QDBusArgument>
#include <QDBusConnection>
+#include <QObject>
#include <QPixmap>
+#include <QString>
-//Custom message type for DBus
-struct DBusImageStruct {
+// Custom message type for DBus
+struct DBusImageStruct
+{
int width;
int height;
QByteArray data;
};
-typedef QVector<DBusImageStruct> DBusImageVector;
+using DBusImageVector = QVector<DBusImageStruct>;
-struct DBusToolTipStruct {
+struct DBusToolTipStruct
+{
QString icon;
DBusImageVector image;
QString title;
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
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
*/
QDBusObjectPath Menu() const;
-public Q_SLOTS:
- //interaction
+public slots:
+ // interaction
/**
* Shows the context menu associated to this item
* at the desired screen position
/**
* 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
* 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)