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"
29 * @brief An interface that provides all the data needed by the launcher.
32class LauncherBackend : public QObject
38 LauncherBackend(QObject *parent = 0);
39 virtual ~LauncherBackend();
42 * @brief Returns a list of stored applications.
43 * @returns A list of application IDs.
45 QStringList storedApplications() const;
48 * @brief Set the list of stored applications.
50 * Any previously stored information for apps not contained
51 * in the list any more, e.g. the pinned state, will be
54 * @param appIds The new list of stored applications.
56 void setStoredApplications(const QStringList &appIds);
59 * @brief Get the full path to the .desktop file.
60 * @returns The full path to the .dekstop file.
62 QString desktopFile(const QString &appId) const;
65 * @brief Get the user friendly name of an application.
66 * @param appId The ID of the application.
67 * @returns The user friendly name of the application.
69 QString displayName(const QString &appId) const;
72 * @brief Get the icon of an application.
73 * @param appId The ID of the application.
74 * @returns The full path to the icon for the application.
76 QString icon(const QString &appId) const;
79 * @brief Is the app manually pinned?
80 * @returns true if pinned, otherwise false.
82 bool isPinned(const QString &appId) const;
85 * @brief Change the pinned state of an application.
86 * @param appId The application where the pinned flag should be set.
87 * @param pinned true if pinned, otherwise false.
89 void setPinned(const QString &appId, bool pinned);
91 //TODO: Fill in getters for all the other things needed from the .desktop file.
94 * @brief Get the QuickList for an application.
95 * @param appId The ID of the application.
96 * @returns A QuickListModelInterface containing the QuickList.
98 QList<QuickListEntry> quickList(const QString &appId) const;
101 * @brief Execute an action from the quickList
102 * @param appId The app ID for which the action was triggered
103 * @param the quicklist ID of the action that was triggered
105 void triggerQuickListAction(const QString &appId, const QString &entryId);
108 * @brief Get the progress for the progress overlay of an application.
109 * @param appId The ID of the application.
110 * @returns The percentage of the overlay progress bar. -1 if no progress bar available.
112 int progress(const QString &appId) const;
115 * @brief Get the count of the count overlay of an application.
116 * @param appId The ID of the application.
117 * @returns The number to be displayed in the overlay. -1 if no count overlay is available.
119 int count(const QString &appId) const;
122 void quickListChanged(const QString &appId, const QList<QuickListEntry> &quickList);
123 void progressChanged(const QString &appId, int progress);
124 void countChanged(const QString &appId, int count);
127 QStringList m_storedApps;
128 QHash<QString, QString> m_displayNameMap;
129 QHash<QString, QString> m_iconMap;
132#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