~dandrader/unity-api/lifecycle

« back to all changes in this revision

Viewing changes to include/unity/shell/scopes/ScopeInterface.h

  • Committer: CI bot
  • Author(s): Michal Hruby, Albert Astals
  • Date: 2014-06-16 14:45:00 UTC
  • mfrom: (134.3.11 departments)
  • Revision ID: ps-jenkins@lists.canonical.com-20140616144500-xcnt2u2onjgu26si
Add Departments interfaces
 Fixes: 1320847

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
class CategoriesInterface;
32
32
class PreviewStackInterface;
 
33
class DepartmentInterface;
33
34
 
34
35
/**
35
36
 * @brief Object representing scope instance, which exposes model(s) with results.
109
110
     */
110
111
    Q_PROPERTY(bool isActive READ isActive WRITE setActive NOTIFY isActiveChanged)
111
112
 
 
113
    /**
 
114
     * @brief String specifying currently selected department
 
115
     */
 
116
    Q_PROPERTY(QString currentDepartmentId READ currentDepartmentId NOTIFY currentDepartmentIdChanged)
 
117
 
 
118
    /**
 
119
     * @brief Boolean specifying whether current query has departments.
 
120
     */
 
121
    Q_PROPERTY(bool hasDepartments READ hasDepartments NOTIFY hasDepartmentsChanged)
 
122
 
112
123
protected:
113
124
    /// @cond
114
125
    explicit ScopeInterface(QObject* parent = 0) : QObject(parent) { }
130
141
    virtual QString noResultsHint() const = 0;
131
142
    virtual QString formFactor() const = 0;
132
143
    virtual bool isActive() const = 0;
 
144
    virtual QString currentDepartmentId() const = 0;
 
145
    virtual bool hasDepartments() const = 0;
133
146
 
134
147
    /* setters */
135
148
    virtual void setSearchQuery(const QString& search_query) = 0;
161
174
     */
162
175
    Q_INVOKABLE virtual void closeScope(unity::shell::scopes::ScopeInterface* scope) = 0;
163
176
 
 
177
    /**
 
178
     * @brief Get a DepartmentInterface instance for the passed departmentId.
 
179
     */
 
180
    Q_INVOKABLE virtual unity::shell::scopes::DepartmentInterface* getDepartment(QString const& departmentId) = 0;
 
181
 
 
182
    /**
 
183
     * @brief Activate department by its id.
 
184
     *
 
185
     * This effectively runs a new query.
 
186
     */
 
187
    Q_INVOKABLE virtual void loadDepartment(QString const& departmentId) = 0;
 
188
 
164
189
Q_SIGNALS:
165
190
    // @cond
166
191
    void idChanged();
167
 
    void nameChanged(const QString&);
168
 
    void iconHintChanged(const QString&);
169
 
    void descriptionChanged(const QString&);
170
 
    void searchHintChanged(const QString&);
 
192
    void nameChanged();
 
193
    void iconHintChanged();
 
194
    void descriptionChanged();
 
195
    void searchHintChanged();
171
196
    void searchInProgressChanged();
172
 
    void visibleChanged(bool);
173
 
    void shortcutChanged(const QString&);
 
197
    void visibleChanged();
 
198
    void shortcutChanged();
174
199
    void categoriesChanged();
175
200
    void searchQueryChanged();
176
201
    void noResultsHintChanged();
177
202
    void formFactorChanged();
178
 
    void isActiveChanged(bool);
 
203
    void isActiveChanged();
 
204
    void hasDepartmentsChanged();
 
205
    void currentDepartmentIdChanged();
179
206
    // @endcond
180
207
 
181
208
    // signals triggered by activate(..) or preview(..) requests.