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>
32#include "categories.h"
36class Scope : public QObject
40 Q_PROPERTY(QString id READ id NOTIFY idChanged)
41 Q_PROPERTY(QString name READ name NOTIFY nameChanged)
42 Q_PROPERTY(QString iconHint READ iconHint NOTIFY iconHintChanged)
43 Q_PROPERTY(QString description READ description NOTIFY descriptionChanged)
44 Q_PROPERTY(QString searchHint READ searchHint NOTIFY searchHintChanged)
45 Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
46 Q_PROPERTY(QString shortcut READ shortcut NOTIFY shortcutChanged)
47 Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
48 Q_PROPERTY(Categories* categories READ categories NOTIFY categoriesChanged)
50 Q_PROPERTY(QString searchQuery READ searchQuery WRITE setSearchQuery NOTIFY searchQueryChanged)
51 Q_PROPERTY(QString noResultsHint READ noResultsHint WRITE setNoResultsHint NOTIFY noResultsHintChanged)
52 Q_PROPERTY(QString formFactor READ formFactor WRITE setFormFactor NOTIFY formFactorChanged)
55 explicit Scope(QObject *parent = 0);
60 QString iconHint() const;
61 QString description() const;
62 QString searchHint() const;
64 QString shortcut() const;
65 bool connected() const;
66 Categories* categories() const;
67 QString searchQuery() const;
68 QString noResultsHint() const;
69 QString formFactor() const;
72 void setSearchQuery(const QString& search_query);
73 void setNoResultsHint(const QString& hint);
74 void setFormFactor(const QString& form_factor);
76 Q_INVOKABLE void activate(const QVariant &uri, const QVariant &icon_hint, const QVariant &category,
77 const QVariant &result_type, const QVariant &mimetype, const QVariant &title,
78 const QVariant &comment, const QVariant &dnd_uri, const QVariant &metadata);
79 Q_INVOKABLE void preview(const QVariant &uri, const QVariant &icon_hint, const QVariant &category,
80 const QVariant &result_type, const QVariant &mimetype, const QVariant &title,
81 const QVariant &comment, const QVariant &dnd_uri, const QVariant &metadata);
82 void setUnityScope(const unity::dash::Scope::Ptr& scope);
83 unity::dash::Scope::Ptr unityScope() const;
86 void idChanged(const std::string&);
87 void dbusNameChanged(const std::string&);
88 void dbusPathChanged(const std::string&);
89 void nameChanged(const std::string&);
90 void iconHintChanged(const std::string&);
91 void descriptionChanged(const std::string&);
92 void searchHintChanged(const std::string&);
93 void visibleChanged(bool);
94 void shortcutChanged(const std::string&);
95 void connectedChanged(bool);
96 void categoriesChanged();
97 void searchFinished(const std::string&, unity::glib::HintsMap const&, unity::glib::Error const&);
98 void searchQueryChanged();
99 void noResultsHintChanged();
100 void formFactorChanged();
102 // signals triggered by activate(..) or preview(..) requests.
103 void previewReady(Preview *preview);
106 void gotoUri(const QString &uri);
109 void synchronizeStates();
110 void onSearchFinished(const std::string &, unity::glib::HintsMap const &);
113 unity::dash::LocalResult createLocalResult(const QVariant &uri, const QVariant &icon_hint,
114 const QVariant &category, const QVariant &result_type,
115 const QVariant &mimetype, const QVariant &title,
116 const QVariant &comment, const QVariant &dnd_uri,
117 const QVariant &metadata);
118 void onActivated(unity::dash::LocalResult const& result, unity::dash::ScopeHandledType type, unity::glib::HintsMap const& hints);
119 void onPreviewReady(unity::dash::LocalResult const& result, unity::dash::Preview::Ptr const& preview);
120 void fallbackActivate(const QString& uri);
122 unity::dash::Scope::Ptr m_unityScope;
123 std::unique_ptr<Categories> m_categories;
124 QString m_searchQuery;
125 QString m_noResultsHint;
126 QString m_formFactor;
129Q_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