2 * Copyright (C) 2011 Canonical, Ltd.
5 * Florian Boucault <florian.boucault@canonical.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29#include <UnityCore/Scope.h>
30#include <UnityCore/Results.h>
33#include "deelistmodel.h"
38class Scope : public QObject
42 Q_PROPERTY(QString id READ id NOTIFY idChanged)
43 Q_PROPERTY(QString name READ name NOTIFY nameChanged)
44 Q_PROPERTY(QString iconHint READ iconHint NOTIFY iconHintChanged)
45 Q_PROPERTY(QString description READ description NOTIFY descriptionChanged)
46 Q_PROPERTY(QString searchHint READ searchHint NOTIFY searchHintChanged)
47 Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
48 Q_PROPERTY(QString shortcut READ shortcut NOTIFY shortcutChanged)
49 Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
50 Q_PROPERTY(DeeListModel* results READ results NOTIFY resultsChanged)
51 Q_PROPERTY(Categories* categories READ categories NOTIFY categoriesChanged)
53 Q_PROPERTY(QString searchQuery READ searchQuery WRITE setSearchQuery NOTIFY searchQueryChanged)
54 Q_PROPERTY(QString noResultsHint READ noResultsHint WRITE setNoResultsHint NOTIFY noResultsHintChanged)
57 explicit Scope(QObject *parent = 0);
62 QString iconHint() const;
63 QString description() const;
64 QString searchHint() const;
66 QString shortcut() const;
67 bool connected() const;
68 DeeListModel* results() const;
69 Categories* categories() const;
70 QString searchQuery() const;
71 QString noResultsHint() const;
74 void setSearchQuery(const QString& search_query);
75 void setNoResultsHint(const QString& hint);
77 Q_INVOKABLE void activate(const QVariant &uri, const QVariant &icon_hint, const QVariant &category,
78 const QVariant &result_type, const QVariant &mimetype, const QVariant &title,
79 const QVariant &comment, const QVariant &dnd_uri, const QVariant &metadata);
80 Q_INVOKABLE void preview(const QVariant &uri, const QVariant &icon_hint, const QVariant &category,
81 const QVariant &result_type, const QVariant &mimetype, const QVariant &title,
82 const QVariant &comment, const QVariant &dnd_uri, const QVariant &metadata);
83 void setUnityScope(const unity::dash::Scope::Ptr& scope);
84 unity::dash::Scope::Ptr unityScope() const;
87 void idChanged(const std::string&);
88 void dbusNameChanged(const std::string&);
89 void dbusPathChanged(const std::string&);
90 void nameChanged(const std::string&);
91 void iconHintChanged(const std::string&);
92 void descriptionChanged(const std::string&);
93 void searchHintChanged(const std::string&);
94 void visibleChanged(bool);
95 void shortcutChanged(const std::string&);
96 void connectedChanged(bool);
97 void resultsChanged();
98 void categoriesChanged();
99 void searchFinished(const std::string&, unity::glib::HintsMap const&, unity::glib::Error const&);
100 void searchQueryChanged();
101 void noResultsHintChanged();
103 // signals triggered by activate(..) or preview(..) requests.
104 void previewReady(Preview *preview);
107 void gotoUri(const QString &uri);
110 void synchronizeStates();
111 void onSearchFinished(const std::string &, unity::glib::HintsMap const &);
114 void onResultsSwarmNameChanged(const std::string&);
115 void onResultsChanged(const unity::dash::Results::Ptr&);
116 void onResultsModelChanged(unity::glib::Object<DeeModel>);
117 void onCategoriesSwarmNameChanged(const std::string&);
118 void onCategoriesModelChanged(unity::glib::Object<DeeModel>);
119 void onCategoriesChanged(const unity::dash::Categories::Ptr&);
120 unity::dash::LocalResult createLocalResult(const QVariant &uri, const QVariant &icon_hint,
121 const QVariant &category, const QVariant &result_type,
122 const QVariant &mimetype, const QVariant &title,
123 const QVariant &comment, const QVariant &dnd_uri,
124 const QVariant &metadata);
125 void onActivated(unity::dash::LocalResult const& result, unity::dash::ScopeHandledType type, unity::glib::HintsMap const& hints);
126 void onPreviewReady(unity::dash::LocalResult const& result, unity::dash::Preview::Ptr const& preview);
127 void fallbackActivate(const QString& uri);
129 unity::dash::Scope::Ptr m_unityScope;
130 DeeListModel* m_results;
131 Categories* m_categories;
132 QString m_searchQuery;
133 QString m_noResultsHint;
136Q_DECLARE_METATYPE(Scope*)
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