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