LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
fancytrayiconfreedesktop.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QObject>
12#include <QDBusAbstractAdaptor>
13#include "fancytrayiconimpl.h"
14
15namespace LC::Util
16{
17 class FancyTrayIconFreedesktop;
18}
19
20namespace LC::Util::detail
21{
22 struct IconFrame
23 {
24 int Width_;
27
28 static IconFrame FromPixmap (const QPixmap&);
29 };
30
36}
37
41
42namespace LC::Util::detail
43{
44 class SNIAdaptor : public QDBusAbstractAdaptor
45 {
47
48 // KDE seems to expect `org.kde.StatusNotifierItem` contrary to the spec
49 Q_CLASSINFO ("D-Bus Interface", "org.kde.StatusNotifierItem")
50
53
57
59 Q_PROPERTY (QList<LC::Util::detail::IconFrame> IconPixmap READ GetIconPixmap NOTIFY NewIcon)
60
62
64
66 const QString Status_ = QStringLiteral ("Active");
67 const quint32 WindowId_ = 0;
68 public:
71 void ContextMenu (int x, int y);
72 void Activate (int, int);
73 void SecondaryActivate (int, int);
74 void Scroll (int, const QString&);
75 private:
76 QString GetId () const;
77 QString GetTitle () const;
78 QString GetStatus () const;
79 QString GetIconName () const;
80 QList<IconFrame> GetIconPixmap () const;
81 DBusTooltip GetTooltip () const;
82 signals:
83 void NewIcon ();
84 void NewTooltip ();
85 void NewStatus ();
86 };
87}
88
89namespace LC::Util
90{
92 {
93 friend class detail::SNIAdaptor;
94
95 FancyTrayIcon& FTI_;
96
97 detail::SNIAdaptor Adaptor_;
98 public:
100
101 void UpdateIcon () override;
102 void UpdateTooltip () override;
103 void UpdateMenu () override;
104 void UpdateStatus () override;
105 };
106}
QList< LC::Util::detail::IconFrame > IconPixmap
LC::Util::detail::DBusTooltip ToolTip
Container< T > Filter(const Container< T > &c, F f)
Definition prelude.h:118
Definition constants.h:15
static IconFrame FromPixmap(const QPixmap &)
Q_DECLARE_METATYPE(QVariantList *)