1/* Copyright (C) 2013 Canonical, Ltd.
4 * Michael Zanetti <michael.zanetti@canonical.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19#ifndef LAUNCHERBACKEND_H
20#define LAUNCHERBACKEND_H
22#include "common/quicklistentry.h"
28class AccountsServiceDBusAdaptor;
31 * @brief An interface that provides all the data needed by the launcher.
34class LauncherBackendItem;
36class LauncherBackend : public QObject
42 LauncherBackend(QObject *parent = 0);
43 virtual ~LauncherBackend();
46 * @brief Returns a list of stored applications.
47 * @returns A list of application IDs.
49 QStringList storedApplications() const;
52 * @brief Set the list of stored applications.
54 * Any previously stored information for apps not contained
55 * in the list any more, e.g. the pinned state, will be
58 * @param appIds The new list of stored applications.
60 void setStoredApplications(const QStringList &appIds);
63 * @brief Get the full path to the .desktop file.
65 * The application does not need to be in the list of stored applications.
67 * @returns The full path to the .dekstop file.
69 QString desktopFile(const QString &appId) const;
72 * @brief Get the user friendly name of an application.
74 * The application does not need to be in the list of stored applications.
76 * @param appId The ID of the application.
77 * @returns The user friendly name of the application.
79 QString displayName(const QString &appId) const;
82 * @brief Get the icon of an application.
84 * The application does not need to be in the list of stored applications.
86 * @param appId The ID of the application.
87 * @returns The full path to the icon for the application.
89 QString icon(const QString &appId) const;
92 * @brief Get the QuickList for an application.
93 * @param appId The ID of the application.
94 * @returns A QuickListModelInterface containing the QuickList.
96 QList<QuickListEntry> quickList(const QString &appId) const;
99 * @brief Execute an action from the quickList
100 * @param appId The app ID for which the action was triggered
101 * @param the quicklist ID of the action that was triggered
103 void triggerQuickListAction(const QString &appId, const QString &entryId);
106 * @brief Get the progress for the progress overlay of an application.
107 * @param appId The ID of the application.
108 * @returns The percentage of the overlay progress bar. -1 if no progress bar available.
110 int progress(const QString &appId) const;
113 * @brief Get the count of the count overlay of an application.
114 * @param appId The ID of the application.
115 * @returns The number to be displayed in the overlay. -1 if no count overlay is available.
117 int count(const QString &appId) const;
120 * @brief Sets the username for which to look up launcher items.
121 * @param username The username to use.
123 void setUser(const QString &username);
126 void quickListChanged(const QString &appId, const QList<QuickListEntry> &quickList);
127 void progressChanged(const QString &appId, int progress);
128 void countChanged(const QString &appId, int count);
131 QString findDesktopFile(const QString &appId) const;
132 LauncherBackendItem* parseDesktopFile(const QString &desktopFile) const;
134 QVariantMap itemToVariant(const QString &appId) const;
135 void loadFromVariant(const QVariantMap &details);
137 bool isDefaultsItem(const QList<QVariantMap> &apps) const;
138 void syncFromAccounts();
139 void syncToAccounts();
141 QList<QString> m_storedApps;
142 mutable QHash<QString, LauncherBackendItem*> m_itemCache;
144 AccountsServiceDBusAdaptor *m_accounts;
148#endif // LAUNCHERBACKEND_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list