2 * Copyright (C) 2013, 2014, 2015 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/>.
20#include <unity/shell/scopes/ScopeInterface.h>
22#include "fake_categories.h"
23#include "fake_previewmodel.h"
29class FakeOptionSelectorFilter;
31class Scope : public unity::shell::scopes::ScopeInterface
36 Scope(Scopes* parent = 0);
37 Scope(QString const& id, QString const& name, bool favorite, Scopes* parent = 0, int categories = 20, bool returnNullPreview = false, const QStringList primaryNavigationFilterOptionLabels = QStringList() << "meat" << "vegetables");
40 QString id() const override;
41 QString name() const override;
42 QString iconHint() const override;
43 QString description() const override;
44 QString searchHint() const override;
45 QString shortcut() const override;
46 bool searchInProgress() const override;
47 bool activationInProgress() const override;
48 bool favorite() const override;
49 unity::shell::scopes::CategoriesInterface* categories() const override;
50 QString searchQuery() const override;
51 QString noResultsHint() const override;
52 QString formFactor() const override;
53 bool isActive() const override;
54 unity::shell::scopes::SettingsModelInterface* settings() const override;
57 void setSearchQuery(const QString& search_query) override;
58 void setNoResultsHint(const QString& hint) override;
59 void setFormFactor(const QString& form_factor) override;
60 void setActive(const bool) override;
61 void setFavorite(const bool) override;
62 Q_INVOKABLE void setId(const QString &id); // This is not invokable in the Interface, here for testing benefits
63 Q_INVOKABLE void setName(const QString &name); // This is not invokable in the Interface, here for testing benefits
64 Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits
66 Q_INVOKABLE void activate(QVariant const& result, QString const& categoryId) override;
67 Q_INVOKABLE PreviewModel* preview(QVariant const& result, QString const& categoryId) override;
68 Q_INVOKABLE void cancelActivation() override;
69 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
71 QString currentNavigationId() const override;
72 bool hasNavigation() const override;
73 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override;
74 Q_INVOKABLE void setNavigationState(const QString &navigationId) override;
75 Q_INVOKABLE void setHasNavigation(bool hasNavigation); // This is not invokable in the Interface, here for testing benefits
77 unity::shell::scopes::FilterBaseInterface* primaryNavigationFilter() const override;
78 unity::shell::scopes::FiltersInterface* filters() const override;
79 QString primaryNavigationTag() const override;
80 int activeFiltersCount() const override;
81 Q_INVOKABLE void resetPrimaryNavigationTag() override;
82 Q_INVOKABLE void setHasPrimaryFilter(bool hasPrimaryFilter); // This is not invokable in the Interface, here for testing benefits
84 void performQuery(const QString& query) override;
86 Status status() const override;
87 QVariantMap customizations() const override;
89 Q_INVOKABLE void refresh() override;
91 Q_INVOKABLE void resetFilters() override;
93 Q_INVOKABLE void activateAction(QVariant const& result, QString const& categoryId, QString const& actionId) override;
96 // These are not in the Interface, here for testing benefits
98 void queryPerformed(const QString& query);
104 QString m_description;
106 QString m_searchQuery;
107 QString m_noResultsHint;
108 QString m_formFactor;
112 bool m_hasBeenActive;
113 bool m_hasNavigation;
114 bool m_hasPrimaryFilter;
115 QString m_currentNavigationId;
117 QString m_previewRendererName;
119 unity::shell::scopes::CategoriesInterface* m_categories;
120 unity::shell::scopes::ScopeInterface* m_openScope;
121 unity::shell::scopes::SettingsModelInterface* m_settings;
123 FakeOptionSelectorFilter* m_primaryNavigationFilter;
125 bool m_returnNullPreview;
128#endif // FAKE_SCOPE_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