2 * Copyright (C) 2014 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
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 General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef FAKE_SCOPESOVERVIEW_H
18#define FAKE_SCOPESOVERVIEW_H
20#include "fake_scope.h"
21#include <unity/shell/scopes/ResultsModelInterface.h>
24class ScopesOverviewCategories;
25class ScopesOverviewResultsModel;
27class ScopesOverview : public Scope
32 ScopesOverview(Scopes* parent = 0);
34 void setSearchQuery(const QString& search_query) override;
35 Q_INVOKABLE void activate(QVariant const& result, QString const& categoryId) override;
37 // This is implementation detail
38 void setFavorite(Scope *scope, bool favorite);
39 void moveFavoriteTo(Scope *scope, int index);
42 ScopesOverviewCategories *m_scopesOverviewCategories;
43 unity::shell::scopes::CategoriesInterface *m_searchCategories;
46class ScopesOverviewCategories : public unity::shell::scopes::CategoriesInterface
51 ScopesOverviewCategories(Scopes *scopes, QObject* parent = 0);
53 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
54 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
56 Q_INVOKABLE bool overrideCategoryJson(QString const& categoryId, QString const& json) override;
58 // This is implementation detail
59 void setFavorite(Scope *scope, bool favorite);
60 void moveFavoriteTo(Scope *scope, int index);
63 mutable QHash<int, ScopesOverviewResultsModel*> m_resultsModels;
68class ScopesOverviewSearchCategories : public unity::shell::scopes::CategoriesInterface
73 ScopesOverviewSearchCategories(Scopes *scopes, QObject* parent = 0);
75 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
76 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
78 Q_INVOKABLE bool overrideCategoryJson(QString const& categoryId, QString const& json) override;
81 mutable QHash<int, ScopesOverviewResultsModel*> m_resultsModels;
86class ScopesOverviewResultsModel : public unity::shell::scopes::ResultsModelInterface
91 explicit ScopesOverviewResultsModel(const QList<Scope *> &scopes, const QString &categoryId, QObject* parent = 0);
93 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
94 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
97 QString categoryId() const override;
98 int count() const override;
101 void setCategoryId(QString const& id) override;
104 Q_INVOKABLE int scopeIndex(QString const& id) const;
105 QHash<int, QByteArray> roleNames() const override;
107 // This is implementation detail
108 void appendScope(Scope *scope);
109 void removeScope(Scope *scope);
110 void moveScopeTo(Scope *scope, int index);
113 QList<Scope *> m_scopes;
114 QString m_categoryId;
117#endif // FAKE_SCOPESOVERVIEW_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