Unity 8
 All Classes Functions
dbusinterface.h
1 /*
2  * Copyright 2014 Canonical Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authors:
17  * Michael Zanetti <michael.zanetti@canonical.com>
18  */
19 
20 #include "launcheritem.h"
21 
22 #include <QDBusVirtualObject>
23 
24 class LauncherModel;
25 
26 class DBusInterface: public QDBusVirtualObject
27 {
28  Q_OBJECT
29 public:
30  DBusInterface(LauncherModel *parent);
31  ~DBusInterface();
32 
33  // QDBusVirtualObject implementaition
34  QString introspect (const QString &path) const override;
35  bool handleMessage(const QDBusMessage& message, const QDBusConnection& connection) override;
36 
37 Q_SIGNALS:
38  void countChanged(const QString &appId, int count);
39  void countVisibleChanged(const QString &appId, bool countVisible);
40  void refreshCalled();
41 
42 private:
43  static QString decodeAppId(const QString& path);
44  static QString encodeAppId(const QString& appId);
45 
46  void emitPropChangedDbus(const QString& appId, const QString& property, const QVariant &value);
47 
48  LauncherModel *m_launcherModel;
49 
50 };