Unity 8
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 #include "unitydbusvirtualobject.h"
22 
23 class LauncherModel;
24 
25 class DBusInterface: public UnityDBusVirtualObject
26 {
27  Q_OBJECT
28 public:
29  DBusInterface(LauncherModel *parent);
30  ~DBusInterface() = default;
31 
32  // QDBusVirtualObject implementaition
33  QString introspect (const QString &path) const override;
34  bool handleMessage(const QDBusMessage& message, const QDBusConnection& connection) override;
35 
36 Q_SIGNALS:
37  void countChanged(const QString &appId, int count);
38  void countVisibleChanged(const QString &appId, bool countVisible);
39  void progressChanged(const QString &appId, int progress);
40  void refreshCalled();
41  void alertCalled(const QString &appId);
42 
43 private:
44  static QString decodeAppId(const QString& path);
45  static QString encodeAppId(const QString& appId);
46 
47  LauncherModel *m_launcherModel;
48 
49 };