Merge lp:~stolowski/unity-api/social-attributes-role into lp:unity-api
- social-attributes-role
- Merge into trunk
Proposed by
Paweł Stołowski
on 2016-03-02
| Status: | Superseded |
|---|---|
| Proposed branch: | lp:~stolowski/unity-api/social-attributes-role |
| Merge into: | lp:unity-api |
| Diff against target: |
1425 lines (+1001/-50) 25 files modified
debian/changelog (+6/-0) include/unity/shell/scopes/CMakeLists.txt (+1/-1) include/unity/shell/scopes/FilterBaseInterface.h (+60/-0) include/unity/shell/scopes/FiltersInterface.h (+75/-0) include/unity/shell/scopes/NavigationInterface.h (+2/-0) include/unity/shell/scopes/OptionSelectorFilterInterface.h (+67/-0) include/unity/shell/scopes/OptionSelectorOptionsInterface.h (+66/-0) include/unity/shell/scopes/RangeInputFilterInterface.h (+90/-0) include/unity/shell/scopes/ResultsModelInterface.h (+3/-1) include/unity/shell/scopes/ScopeInterface.h (+43/-22) include/unity/shell/scopes/ValueSliderFilterInterface.h (+73/-0) include/unity/shell/scopes/ValueSliderValuesInterface.h (+62/-0) test/qmltest/mocks/plugins/Unity/Scopes/CMakeLists.txt (+8/-0) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockDepartment.cpp (+2/-0) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockFiltersModel.cpp (+51/-0) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockFiltersModel.h (+40/-0) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockOptionSelectorFilter.cpp (+57/-0) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockOptionSelectorFilter.h (+45/-0) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockResultsModel.cpp (+2/-0) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp (+29/-17) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h (+8/-6) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockSelectorOptions.cpp (+53/-0) test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockSelectorOptions.h (+36/-0) test/qmltest/mocks/plugins/Unity/Scopes/TestScopesPlugin.cpp (+10/-0) test/qmltest/unity/shell/scopes/tst_Scopes.qml (+112/-3) |
| To merge this branch: | bzr merge lp:~stolowski/unity-api/social-attributes-role |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Andrea Cimitan (community) | 2016-03-02 | Needs Fixing on 2016-03-04 | |
| Unity Team | 2016-03-02 | Pending | |
|
Review via email:
|
|||
This proposal has been superseded by a proposal from 2016-03-16.
Commit Message
Added RoleSocialActions.
Description of the Change
Added RoleSocialActions.
To post a comment you must log in.
lp:~stolowski/unity-api/social-attributes-role
updated
on 2016-03-03
- 212. By Paweł Stołowski on 2016-03-03
-
Rename RoleSocialAttri
butes to RoleSocialActions - 213. By Paweł Stołowski on 2016-03-03
-
Fix comment
review:
Needs Fixing
lp:~stolowski/unity-api/social-attributes-role
updated
on 2016-04-26
- 214. By Paweł Stołowski on 2016-03-07
-
Merged trunk
- 215. By Paweł Stołowski on 2016-03-07
-
Bump
- 216. By Paweł Stołowski on 2016-03-07
-
Fix role name in the test
- 217. By Paweł Stołowski on 2016-03-16
-
Merged filters
- 218. By Paweł Stołowski on 2016-03-24
-
Merged trunk + bump
- 219. By Paweł Stołowski on 2016-04-15
-
Merged trunk + bump
- 220. By Paweł Stołowski on 2016-04-26
-
Merged trunk
- 221. By Paweł Stołowski on 2016-04-26
-
Fix version
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
| 1 | === modified file 'debian/changelog' |
| 2 | --- debian/changelog 2016-02-23 12:12:26 +0000 |
| 3 | +++ debian/changelog 2016-03-16 11:18:19 +0000 |
| 4 | @@ -1,3 +1,9 @@ |
| 5 | +unity-api (7.108) UNRELEASED; urgency=medium |
| 6 | + |
| 7 | + * Added RoleSocialActions to ResultsModelInterface of scopes. |
| 8 | + |
| 9 | + -- Pawel Stolowski <pawel.stolowski@canonical.com> Wed, 02 Mar 2016 16:29:42 +0100 |
| 10 | + |
| 11 | unity-api (7.107+16.04.20160223-0ubuntu1) xenial; urgency=medium |
| 12 | |
| 13 | * Removed PreviewStackInterface, modified ScopeInterface to return |
| 14 | |
| 15 | === modified file 'include/unity/shell/scopes/CMakeLists.txt' |
| 16 | --- include/unity/shell/scopes/CMakeLists.txt 2016-02-18 15:46:46 +0000 |
| 17 | +++ include/unity/shell/scopes/CMakeLists.txt 2016-03-16 11:18:19 +0000 |
| 18 | @@ -7,7 +7,7 @@ |
| 19 | |
| 20 | set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE) |
| 21 | |
| 22 | -set(VERSION 10) |
| 23 | +set(VERSION 11) |
| 24 | set(PKGCONFIG_NAME "unity-shell-scopes") |
| 25 | set(PKGCONFIG_DESCRIPTION "Unity shell Scopes APIs") |
| 26 | set(PKGCONFIG_REQUIRES "Qt5Core") |
| 27 | |
| 28 | === added file 'include/unity/shell/scopes/FilterBaseInterface.h' |
| 29 | --- include/unity/shell/scopes/FilterBaseInterface.h 1970-01-01 00:00:00 +0000 |
| 30 | +++ include/unity/shell/scopes/FilterBaseInterface.h 2016-03-16 11:18:19 +0000 |
| 31 | @@ -0,0 +1,60 @@ |
| 32 | +/* |
| 33 | + * Copyright (C) 2015 Canonical, Ltd. |
| 34 | + * |
| 35 | + * This program is free software; you can redistribute it and/or modify |
| 36 | + * it under the terms of the GNU General Public License as published by |
| 37 | + * the Free Software Foundation; version 3. |
| 38 | + * |
| 39 | + * This program is distributed in the hope that it will be useful, |
| 40 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 41 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 42 | + * GNU General Public License for more details. |
| 43 | + * |
| 44 | + * You should have received a copy of the GNU General Public License |
| 45 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 46 | + */ |
| 47 | + |
| 48 | +#ifndef UNITY_SHELL_SCOPES_FILTERBASEINTERHACE_H |
| 49 | +#define UNITY_SHELL_SCOPES_FILTERBASEINTERHACE_H |
| 50 | + |
| 51 | +#include "FiltersInterface.h" |
| 52 | +#include <QObject> |
| 53 | + |
| 54 | +namespace unity |
| 55 | +{ |
| 56 | +namespace shell |
| 57 | +{ |
| 58 | +namespace scopes |
| 59 | +{ |
| 60 | + |
| 61 | +class UNITY_API FilterBaseInterface : public QObject |
| 62 | +{ |
| 63 | + Q_OBJECT |
| 64 | + |
| 65 | + public: |
| 66 | + |
| 67 | + Q_PROPERTY(QString filterId READ filterId CONSTANT) |
| 68 | + Q_PROPERTY(QString title READ title NOTIFY titleChanged) |
| 69 | + Q_PROPERTY(unity::shell::scopes::FiltersInterface::FilterType filterType READ filterType CONSTANT) |
| 70 | + |
| 71 | + virtual QString filterId() const = 0; |
| 72 | + virtual QString title() const = 0; |
| 73 | + virtual FiltersInterface::FilterType filterType() const = 0; |
| 74 | + virtual QString filterTag() const = 0; |
| 75 | + |
| 76 | + Q_SIGNALS: |
| 77 | + void titleChanged(); |
| 78 | + |
| 79 | + protected: |
| 80 | + /// @cond |
| 81 | + explicit FilterBaseInterface(QObject* parent = 0) : QObject(parent) {} |
| 82 | + /// @endcond |
| 83 | +}; |
| 84 | + |
| 85 | +} |
| 86 | +} |
| 87 | +} |
| 88 | + |
| 89 | +Q_DECLARE_METATYPE(unity::shell::scopes::FilterBaseInterface*) |
| 90 | + |
| 91 | +#endif |
| 92 | |
| 93 | === added file 'include/unity/shell/scopes/FiltersInterface.h' |
| 94 | --- include/unity/shell/scopes/FiltersInterface.h 1970-01-01 00:00:00 +0000 |
| 95 | +++ include/unity/shell/scopes/FiltersInterface.h 2016-03-16 11:18:19 +0000 |
| 96 | @@ -0,0 +1,75 @@ |
| 97 | +/* |
| 98 | + * Copyright (C) 2015 Canonical, Ltd. |
| 99 | + * |
| 100 | + * This program is free software; you can redistribute it and/or modify |
| 101 | + * it under the terms of the GNU General Public License as published by |
| 102 | + * the Free Software Foundation; version 3. |
| 103 | + * |
| 104 | + * This program is distributed in the hope that it will be useful, |
| 105 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 106 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 107 | + * GNU General Public License for more details. |
| 108 | + * |
| 109 | + * You should have received a copy of the GNU General Public License |
| 110 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 111 | + */ |
| 112 | + |
| 113 | +#ifndef UNITY_SHELL_SCOPES_FILTERSINTERFACE_H |
| 114 | +#define UNITY_SHELL_SCOPES_FILTERSINTERFACE_H |
| 115 | + |
| 116 | +#include <unity/SymbolExport.h> |
| 117 | + |
| 118 | +#include <QAbstractListModel> |
| 119 | + |
| 120 | +namespace unity |
| 121 | +{ |
| 122 | +namespace shell |
| 123 | +{ |
| 124 | +namespace scopes |
| 125 | +{ |
| 126 | + |
| 127 | +class UNITY_API FiltersInterface : public QAbstractListModel |
| 128 | +{ |
| 129 | + Q_OBJECT |
| 130 | + |
| 131 | + Q_ENUMS(Roles) |
| 132 | + Q_ENUMS(FilterType) |
| 133 | + |
| 134 | +public: |
| 135 | + enum Roles { |
| 136 | + RoleFilterId = Qt::UserRole + 1, |
| 137 | + RoleFilterType, |
| 138 | + RoleFilter |
| 139 | + }; |
| 140 | + |
| 141 | + enum FilterType { |
| 142 | + Invalid, |
| 143 | + OptionSelectorFilter, |
| 144 | + RangeInputFilter, |
| 145 | + ValueSliderFilter |
| 146 | + // TODO add remaining filters |
| 147 | + }; |
| 148 | + |
| 149 | + QHash<int, QByteArray> roleNames() const override |
| 150 | + { |
| 151 | + QHash<int, QByteArray> roles; |
| 152 | + roles[RoleFilterId] = "id"; |
| 153 | + roles[RoleFilterType] = "type"; |
| 154 | + roles[RoleFilter] = "filter"; |
| 155 | + return roles; |
| 156 | + } |
| 157 | + |
| 158 | +protected: |
| 159 | + /// @cond |
| 160 | + explicit FiltersInterface(QObject* parent = 0) : QAbstractListModel(parent) {} |
| 161 | + /// @endcond |
| 162 | +}; |
| 163 | + |
| 164 | +} |
| 165 | + |
| 166 | +} |
| 167 | +} |
| 168 | + |
| 169 | +Q_DECLARE_METATYPE(unity::shell::scopes::FiltersInterface*) |
| 170 | + |
| 171 | +#endif |
| 172 | |
| 173 | === modified file 'include/unity/shell/scopes/NavigationInterface.h' |
| 174 | --- include/unity/shell/scopes/NavigationInterface.h 2014-08-04 13:58:53 +0000 |
| 175 | +++ include/unity/shell/scopes/NavigationInterface.h 2016-03-16 11:18:19 +0000 |
| 176 | @@ -94,6 +94,7 @@ |
| 177 | enum Roles { |
| 178 | RoleNavigationId, |
| 179 | RoleLabel, |
| 180 | + RoleAllLabel, |
| 181 | RoleHasChildren, |
| 182 | RoleIsActive |
| 183 | }; |
| 184 | @@ -113,6 +114,7 @@ |
| 185 | QHash<int, QByteArray> roles; |
| 186 | roles[RoleNavigationId] = "navigationId"; |
| 187 | roles[RoleLabel] = "label"; |
| 188 | + roles[RoleAllLabel] = "allLabel"; |
| 189 | roles[RoleHasChildren] = "hasChildren"; |
| 190 | roles[RoleIsActive] = "isActive"; |
| 191 | return roles; |
| 192 | |
| 193 | === added file 'include/unity/shell/scopes/OptionSelectorFilterInterface.h' |
| 194 | --- include/unity/shell/scopes/OptionSelectorFilterInterface.h 1970-01-01 00:00:00 +0000 |
| 195 | +++ include/unity/shell/scopes/OptionSelectorFilterInterface.h 2016-03-16 11:18:19 +0000 |
| 196 | @@ -0,0 +1,67 @@ |
| 197 | +/* |
| 198 | + * Copyright (C) 2015 Canonical, Ltd. |
| 199 | + * |
| 200 | + * This program is free software; you can redistribute it and/or modify |
| 201 | + * it under the terms of the GNU General Public License as published by |
| 202 | + * the Free Software Foundation; version 3. |
| 203 | + * |
| 204 | + * This program is distributed in the hope that it will be useful, |
| 205 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 206 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 207 | + * GNU General Public License for more details. |
| 208 | + * |
| 209 | + * You should have received a copy of the GNU General Public License |
| 210 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 211 | + */ |
| 212 | + |
| 213 | +#ifndef UNITY_SHELL_SCOPES_OPTIONSELECTORFILTERINTERFACE_H |
| 214 | +#define UNITY_SHELL_SCOPES_OPTIONSELECTORFILTERINTERFACE_H |
| 215 | + |
| 216 | +#include <unity/SymbolExport.h> |
| 217 | + |
| 218 | +#include "FilterBaseInterface.h" |
| 219 | +#include "OptionSelectorOptionsInterface.h" |
| 220 | + |
| 221 | +namespace unity |
| 222 | +{ |
| 223 | +namespace shell |
| 224 | +{ |
| 225 | +namespace scopes |
| 226 | +{ |
| 227 | + |
| 228 | +class UNITY_API OptionSelectorFilterInterface : public FilterBaseInterface |
| 229 | +{ |
| 230 | + Q_OBJECT |
| 231 | + |
| 232 | +public: |
| 233 | + Q_PROPERTY(QString label READ label NOTIFY labelChanged) |
| 234 | + Q_PROPERTY(bool multiSelect READ multiSelect NOTIFY multiSelectChanged) |
| 235 | + Q_PROPERTY(unity::shell::scopes::OptionSelectorOptionsInterface* options READ options CONSTANT) |
| 236 | + |
| 237 | + FiltersInterface::FilterType filterType() const override |
| 238 | + { |
| 239 | + return FiltersInterface::OptionSelectorFilter; |
| 240 | + } |
| 241 | + |
| 242 | + virtual QString label() const = 0; |
| 243 | + virtual bool multiSelect() const = 0; |
| 244 | + virtual OptionSelectorOptionsInterface* options() const = 0; |
| 245 | + |
| 246 | +Q_SIGNALS: |
| 247 | + void labelChanged(const QString&); |
| 248 | + void multiSelectChanged(bool); |
| 249 | + |
| 250 | +protected: |
| 251 | + /// @cond |
| 252 | + explicit OptionSelectorFilterInterface(QObject* parent = 0) : FilterBaseInterface(parent) {} |
| 253 | + /// @endcond |
| 254 | +}; |
| 255 | + |
| 256 | +} |
| 257 | + |
| 258 | +} |
| 259 | +} |
| 260 | + |
| 261 | +Q_DECLARE_METATYPE(unity::shell::scopes::OptionSelectorFilterInterface*) |
| 262 | + |
| 263 | +#endif |
| 264 | |
| 265 | === added file 'include/unity/shell/scopes/OptionSelectorOptionsInterface.h' |
| 266 | --- include/unity/shell/scopes/OptionSelectorOptionsInterface.h 1970-01-01 00:00:00 +0000 |
| 267 | +++ include/unity/shell/scopes/OptionSelectorOptionsInterface.h 2016-03-16 11:18:19 +0000 |
| 268 | @@ -0,0 +1,66 @@ |
| 269 | +/* |
| 270 | + * Copyright (C) 2015 Canonical, Ltd. |
| 271 | + * |
| 272 | + * This program is free software; you can redistribute it and/or modify |
| 273 | + * it under the terms of the GNU General Public License as published by |
| 274 | + * the Free Software Foundation; version 3. |
| 275 | + * |
| 276 | + * This program is distributed in the hope that it will be useful, |
| 277 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 278 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 279 | + * GNU General Public License for more details. |
| 280 | + * |
| 281 | + * You should have received a copy of the GNU General Public License |
| 282 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 283 | + */ |
| 284 | + |
| 285 | +#ifndef UNITY_SHELL_SCOPES_OPTIONSELECTOROPTIONSINTERFACE_H |
| 286 | +#define UNITY_SHELL_SCOPES_OPTIONSELECTOROPTIONSINTERFACE_H |
| 287 | + |
| 288 | +#include <unity/SymbolExport.h> |
| 289 | +#include <QAbstractListModel> |
| 290 | + |
| 291 | +namespace unity |
| 292 | +{ |
| 293 | +namespace shell |
| 294 | +{ |
| 295 | +namespace scopes |
| 296 | +{ |
| 297 | + |
| 298 | +class UNITY_API OptionSelectorOptionsInterface : public QAbstractListModel |
| 299 | +{ |
| 300 | + Q_OBJECT |
| 301 | + |
| 302 | + Q_ENUMS(OptionRoles) |
| 303 | + |
| 304 | +public: |
| 305 | + enum Roles { |
| 306 | + RoleOptionId = Qt::UserRole + 1, |
| 307 | + RoleOptionLabel, |
| 308 | + RoleOptionChecked |
| 309 | + }; |
| 310 | + |
| 311 | + Q_INVOKABLE virtual void setChecked(int index, bool checked) = 0; |
| 312 | + |
| 313 | + QHash<int, QByteArray> roleNames() const override |
| 314 | + { |
| 315 | + QHash<int, QByteArray> roles; |
| 316 | + roles[RoleOptionId] = "id"; |
| 317 | + roles[RoleOptionLabel] = "label"; |
| 318 | + roles[RoleOptionChecked] = "checked"; |
| 319 | + return roles; |
| 320 | + } |
| 321 | + |
| 322 | +protected: |
| 323 | + /// @cond |
| 324 | + explicit OptionSelectorOptionsInterface(QObject* parent = 0) : QAbstractListModel(parent) {} |
| 325 | + /// @endcond |
| 326 | +}; |
| 327 | + |
| 328 | +} |
| 329 | +} |
| 330 | +} |
| 331 | + |
| 332 | +Q_DECLARE_METATYPE(unity::shell::scopes::OptionSelectorOptionsInterface*) |
| 333 | + |
| 334 | +#endif |
| 335 | |
| 336 | === added file 'include/unity/shell/scopes/RangeInputFilterInterface.h' |
| 337 | --- include/unity/shell/scopes/RangeInputFilterInterface.h 1970-01-01 00:00:00 +0000 |
| 338 | +++ include/unity/shell/scopes/RangeInputFilterInterface.h 2016-03-16 11:18:19 +0000 |
| 339 | @@ -0,0 +1,90 @@ |
| 340 | +/* |
| 341 | + * Copyright (C) 2015 Canonical, Ltd. |
| 342 | + * |
| 343 | + * This program is free software; you can redistribute it and/or modify |
| 344 | + * it under the terms of the GNU General Public License as published by |
| 345 | + * the Free Software Foundation; version 3. |
| 346 | + * |
| 347 | + * This program is distributed in the hope that it will be useful, |
| 348 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 349 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 350 | + * GNU General Public License for more details. |
| 351 | + * |
| 352 | + * You should have received a copy of the GNU General Public License |
| 353 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 354 | + */ |
| 355 | + |
| 356 | +#ifndef UNITY_SHELL_SCOPES_RANGEINPUTFILTERINTERFACE_H |
| 357 | +#define UNITY_SHELL_SCOPES_RANGEINPUTFILTERINTERFACE_H |
| 358 | + |
| 359 | +#include <unity/SymbolExport.h> |
| 360 | + |
| 361 | +#include "FilterBaseInterface.h" |
| 362 | + |
| 363 | +namespace unity |
| 364 | +{ |
| 365 | +namespace shell |
| 366 | +{ |
| 367 | +namespace scopes |
| 368 | +{ |
| 369 | + |
| 370 | +class UNITY_API RangeInputFilterInterface : public FilterBaseInterface |
| 371 | +{ |
| 372 | + Q_OBJECT |
| 373 | + |
| 374 | +public: |
| 375 | + Q_PROPERTY(double startValue READ startValue WRITE setStartValue NOTIFY startValueChanged) |
| 376 | + Q_PROPERTY(double endValue READ endValue WRITE setEndValue NOTIFY endValueChanged) |
| 377 | + Q_PROPERTY(QString startPrefixLabel READ startPrefixLabel NOTIFY startPrefixLabelChanged) |
| 378 | + Q_PROPERTY(QString startPostfixLabel READ startPostfixLabel NOTIFY startPostfixLabelChanged) |
| 379 | + Q_PROPERTY(QString centralLabel READ centralLabel NOTIFY centralLabelChanged) |
| 380 | + Q_PROPERTY(QString endPrefixLabel READ endPrefixLabel NOTIFY endPrefixLabelChanged) |
| 381 | + Q_PROPERTY(QString endPostfixLabel READ endPostfixLabel NOTIFY endPostfixLabelChanged) |
| 382 | + Q_PROPERTY(bool hasStartValue READ hasStartValue NOTIFY hasStartValueChanged) |
| 383 | + Q_PROPERTY(bool hasEndValue READ hasEndValue NOTIFY hasEndValueChanged) |
| 384 | + |
| 385 | + FiltersInterface::FilterType filterType() const override |
| 386 | + { |
| 387 | + return FiltersInterface::RangeInputFilter; |
| 388 | + } |
| 389 | + |
| 390 | + virtual double startValue() const = 0; |
| 391 | + virtual double endValue() const = 0; |
| 392 | + virtual void setStartValue(double value) = 0; |
| 393 | + virtual void setEndValue(double value) = 0; |
| 394 | + virtual QString startPrefixLabel() const = 0; |
| 395 | + virtual QString startPostfixLabel() const = 0; |
| 396 | + virtual QString centralLabel() const = 0; |
| 397 | + virtual QString endPrefixLabel() const = 0; |
| 398 | + virtual QString endPostfixLabel() const = 0; |
| 399 | + virtual bool hasStartValue() const = 0; |
| 400 | + virtual bool hasEndValue() const = 0; |
| 401 | + |
| 402 | + Q_INVOKABLE virtual void eraseStartValue() = 0; |
| 403 | + Q_INVOKABLE virtual void eraseEndValue() = 0; |
| 404 | + |
| 405 | +Q_SIGNALS: |
| 406 | + void startValueChanged(); |
| 407 | + void endValueChanged(); |
| 408 | + void hasStartValueChanged(); |
| 409 | + void hasEndValueChanged(); |
| 410 | + void startPrefixLabelChanged(); |
| 411 | + void startPostfixLabelChanged(); |
| 412 | + void centralLabelChanged(); |
| 413 | + void endPrefixLabelChanged(); |
| 414 | + void endPostfixLabelChanged(); |
| 415 | + |
| 416 | +protected: |
| 417 | + /// @cond |
| 418 | + explicit RangeInputFilterInterface(QObject* parent = 0) : FilterBaseInterface(parent) {} |
| 419 | + /// @endcond |
| 420 | +}; |
| 421 | + |
| 422 | +} |
| 423 | + |
| 424 | +} |
| 425 | +} |
| 426 | + |
| 427 | +Q_DECLARE_METATYPE(unity::shell::scopes::RangeInputFilterInterface*) |
| 428 | + |
| 429 | +#endif |
| 430 | |
| 431 | === modified file 'include/unity/shell/scopes/ResultsModelInterface.h' |
| 432 | --- include/unity/shell/scopes/ResultsModelInterface.h 2015-09-16 10:05:47 +0000 |
| 433 | +++ include/unity/shell/scopes/ResultsModelInterface.h 2016-03-16 11:18:19 +0000 |
| 434 | @@ -71,7 +71,8 @@ |
| 435 | RoleAttributes, |
| 436 | RoleBackground, |
| 437 | RoleOverlayColor, |
| 438 | - RoleQuickPreviewData ///< Data for UI quick previewing. In case of audio should contain uri and duration |
| 439 | + RoleQuickPreviewData, ///< Data for UI quick previewing. In case of audio should contain uri and duration |
| 440 | + RoleSocialActions ///< Data for social actions (in-card actions such as "+1"). |
| 441 | }; |
| 442 | |
| 443 | // @cond |
| 444 | @@ -96,6 +97,7 @@ |
| 445 | roles[RoleAttributes] = "attributes"; |
| 446 | roles[RoleBackground] = "background"; |
| 447 | roles[RoleOverlayColor] = "overlayColor"; |
| 448 | + roles[RoleSocialActions] = "socialActions"; |
| 449 | return roles; |
| 450 | } |
| 451 | |
| 452 | |
| 453 | === modified file 'include/unity/shell/scopes/ScopeInterface.h' |
| 454 | --- include/unity/shell/scopes/ScopeInterface.h 2016-02-18 15:46:46 +0000 |
| 455 | +++ include/unity/shell/scopes/ScopeInterface.h 2016-03-16 11:18:19 +0000 |
| 456 | @@ -33,6 +33,8 @@ |
| 457 | class PreviewModelInterface; |
| 458 | class NavigationInterface; |
| 459 | class SettingsModelInterface; |
| 460 | +class FiltersInterface; |
| 461 | +class FilterBaseInterface; |
| 462 | |
| 463 | /** |
| 464 | * @brief Object representing scope instance, which exposes model(s) with results. |
| 465 | @@ -98,6 +100,11 @@ |
| 466 | Q_PROPERTY(unity::shell::scopes::SettingsModelInterface* settings READ settings NOTIFY settingsChanged) |
| 467 | |
| 468 | /** |
| 469 | + * @brief |
| 470 | + */ |
| 471 | + Q_PROPERTY(unity::shell::scopes::FilterBaseInterface* primaryNavigationFilter READ primaryNavigationFilter NOTIFY primaryNavigationFilterChanged) |
| 472 | + |
| 473 | + /** |
| 474 | * @brief Current search query. |
| 475 | * |
| 476 | * Writing to this property issues a new search to the scope. |
| 477 | @@ -134,16 +141,6 @@ |
| 478 | Q_PROPERTY(bool hasNavigation READ hasNavigation NOTIFY hasNavigationChanged) |
| 479 | |
| 480 | /** |
| 481 | - * @brief String specifying currently selected sort order |
| 482 | - */ |
| 483 | - Q_PROPERTY(QString currentAltNavigationId READ currentAltNavigationId NOTIFY currentAltNavigationIdChanged) |
| 484 | - |
| 485 | - /** |
| 486 | - * @brief Boolean specifying whether current query has sort order. |
| 487 | - */ |
| 488 | - Q_PROPERTY(bool hasAltNavigation READ hasAltNavigation NOTIFY hasAltNavigationChanged) |
| 489 | - |
| 490 | - /** |
| 491 | * @brief VariantMap with customization properties |
| 492 | */ |
| 493 | Q_PROPERTY(QVariantMap customizations READ customizations NOTIFY customizationsChanged) |
| 494 | @@ -153,6 +150,21 @@ |
| 495 | */ |
| 496 | Q_PROPERTY(unity::shell::scopes::ScopeInterface::Status status READ status NOTIFY statusChanged) |
| 497 | |
| 498 | + /** |
| 499 | + * @brief Filters model for the scope. |
| 500 | + */ |
| 501 | + Q_PROPERTY(unity::shell::scopes::FiltersInterface* filters READ filters NOTIFY filtersChanged) |
| 502 | + |
| 503 | + /** |
| 504 | + * @brief Label for the currently active top level navigation (department or primary filter). |
| 505 | + */ |
| 506 | + Q_PROPERTY(QString primaryNavigationTag READ primaryNavigationTag NOTIFY primaryNavigationTagChanged) |
| 507 | + |
| 508 | + /** |
| 509 | + * @brief The number of currently selected filters. |
| 510 | + */ |
| 511 | + Q_PROPERTY(int activeFiltersCount READ activeFiltersCount NOTIFY activeFiltersCountChanged) |
| 512 | + |
| 513 | protected: |
| 514 | /// @cond |
| 515 | explicit ScopeInterface(QObject* parent = 0) : QObject(parent) { } |
| 516 | @@ -182,16 +194,18 @@ |
| 517 | virtual bool favorite() const = 0; |
| 518 | virtual CategoriesInterface* categories() const = 0; |
| 519 | virtual SettingsModelInterface* settings() const = 0; |
| 520 | + virtual FilterBaseInterface* primaryNavigationFilter() const = 0; |
| 521 | virtual QString searchQuery() const = 0; |
| 522 | virtual QString noResultsHint() const = 0; |
| 523 | virtual QString formFactor() const = 0; |
| 524 | virtual bool isActive() const = 0; |
| 525 | virtual QString currentNavigationId() const = 0; |
| 526 | virtual bool hasNavigation() const = 0; |
| 527 | - virtual QString currentAltNavigationId() const = 0; |
| 528 | - virtual bool hasAltNavigation() const = 0; |
| 529 | virtual Status status() const = 0; |
| 530 | virtual QVariantMap customizations() const = 0; |
| 531 | + virtual FiltersInterface* filters() const = 0; |
| 532 | + virtual QString primaryNavigationTag() const = 0; |
| 533 | + virtual int activeFiltersCount() const = 0; |
| 534 | |
| 535 | /* setters */ |
| 536 | virtual void setSearchQuery(const QString& search_query) = 0; |
| 537 | @@ -230,14 +244,9 @@ |
| 538 | Q_INVOKABLE virtual unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) = 0; |
| 539 | |
| 540 | /** |
| 541 | - * @brief Get a NavigationInterface instance for the passed altNavigationId. |
| 542 | - */ |
| 543 | - Q_INVOKABLE virtual unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) = 0; |
| 544 | - |
| 545 | - /** |
| 546 | - * @brief Request change to the current navigation or altNavigation id. |
| 547 | - */ |
| 548 | - Q_INVOKABLE virtual void setNavigationState(QString const& navId, bool altNavigation) = 0; |
| 549 | + * @brief Request change to the current navigation id. |
| 550 | + */ |
| 551 | + Q_INVOKABLE virtual void setNavigationState(QString const& navId) = 0; |
| 552 | |
| 553 | /** |
| 554 | * @brief Execute canned query. |
| 555 | @@ -250,6 +259,16 @@ |
| 556 | Q_INVOKABLE virtual void refresh() = 0; |
| 557 | |
| 558 | /** |
| 559 | + * @brief Reset primary navigation filter and its tag in the search bar. |
| 560 | + */ |
| 561 | + Q_INVOKABLE virtual void resetPrimaryNavigationTag() = 0; |
| 562 | + |
| 563 | + /** |
| 564 | + * @brief Reset filters to default values. |
| 565 | + */ |
| 566 | + Q_INVOKABLE virtual void resetFilters() = 0; |
| 567 | + |
| 568 | + /* |
| 569 | * @brief Method used to activate an action of a result. |
| 570 | */ |
| 571 | Q_INVOKABLE virtual void activateAction(QVariant const& result, QString const& categoryId, QString const& actionId) = 0; |
| 572 | @@ -273,11 +292,13 @@ |
| 573 | void isActiveChanged(); |
| 574 | void hasNavigationChanged(); |
| 575 | void currentNavigationIdChanged(); |
| 576 | - void hasAltNavigationChanged(); |
| 577 | - void currentAltNavigationIdChanged(); |
| 578 | void customizationsChanged(); |
| 579 | void statusChanged(); |
| 580 | void detailsChanged(); |
| 581 | + void filtersChanged(); |
| 582 | + void primaryNavigationTagChanged(); |
| 583 | + void activeFiltersCountChanged(); |
| 584 | + void primaryNavigationFilterChanged(); |
| 585 | // @endcond |
| 586 | |
| 587 | // signals triggered by activate(..) or preview(..) requests. |
| 588 | |
| 589 | === added file 'include/unity/shell/scopes/ValueSliderFilterInterface.h' |
| 590 | --- include/unity/shell/scopes/ValueSliderFilterInterface.h 1970-01-01 00:00:00 +0000 |
| 591 | +++ include/unity/shell/scopes/ValueSliderFilterInterface.h 2016-03-16 11:18:19 +0000 |
| 592 | @@ -0,0 +1,73 @@ |
| 593 | +/* |
| 594 | + * Copyright (C) 2015 Canonical, Ltd. |
| 595 | + * |
| 596 | + * This program is free software; you can redistribute it and/or modify |
| 597 | + * it under the terms of the GNU General Public License as published by |
| 598 | + * the Free Software Foundation; version 3. |
| 599 | + * |
| 600 | + * This program is distributed in the hope that it will be useful, |
| 601 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 602 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 603 | + * GNU General Public License for more details. |
| 604 | + * |
| 605 | + * You should have received a copy of the GNU General Public License |
| 606 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 607 | + */ |
| 608 | + |
| 609 | +#ifndef UNITY_SHELL_SCOPES_VALUESLIDERFILTERINTERFACE_H |
| 610 | +#define UNITY_SHELL_SCOPES_VALUESLIDERFILTERINTERFACE_H |
| 611 | + |
| 612 | +#include <unity/SymbolExport.h> |
| 613 | + |
| 614 | +#include "FilterBaseInterface.h" |
| 615 | +#include "ValueSliderValuesInterface.h" |
| 616 | + |
| 617 | +namespace unity |
| 618 | +{ |
| 619 | +namespace shell |
| 620 | +{ |
| 621 | +namespace scopes |
| 622 | +{ |
| 623 | + |
| 624 | +class UNITY_API ValueSliderFilterInterface : public FilterBaseInterface |
| 625 | +{ |
| 626 | + Q_OBJECT |
| 627 | + |
| 628 | +public: |
| 629 | + Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged) |
| 630 | + Q_PROPERTY(unity::shell::scopes::ValueSliderValuesInterface* values READ values NOTIFY valuesChanged) |
| 631 | + Q_PROPERTY(double minValue READ minValue NOTIFY minValueChanged) |
| 632 | + Q_PROPERTY(double maxValue READ maxValue NOTIFY maxValueChanged) |
| 633 | + |
| 634 | +public: |
| 635 | + FiltersInterface::FilterType filterType() const override |
| 636 | + { |
| 637 | + return FiltersInterface::ValueSliderFilter; |
| 638 | + } |
| 639 | + |
| 640 | + virtual double value() const = 0; |
| 641 | + virtual void setValue(double) = 0; |
| 642 | + virtual double minValue() const = 0; |
| 643 | + virtual double maxValue() const = 0; |
| 644 | + virtual ValueSliderValuesInterface* values() const = 0; |
| 645 | + |
| 646 | +Q_SIGNALS: |
| 647 | + void valueChanged(); |
| 648 | + void valuesChanged(); |
| 649 | + void minValueChanged(); |
| 650 | + void maxValueChanged(); |
| 651 | + |
| 652 | +protected: |
| 653 | + /// @cond |
| 654 | + explicit ValueSliderFilterInterface(QObject* parent = 0) : FilterBaseInterface(parent) {} |
| 655 | + /// @endcond |
| 656 | +}; |
| 657 | + |
| 658 | +} |
| 659 | + |
| 660 | +} |
| 661 | +} |
| 662 | + |
| 663 | +Q_DECLARE_METATYPE(unity::shell::scopes::ValueSliderFilterInterface*) |
| 664 | + |
| 665 | +#endif |
| 666 | |
| 667 | === added file 'include/unity/shell/scopes/ValueSliderValuesInterface.h' |
| 668 | --- include/unity/shell/scopes/ValueSliderValuesInterface.h 1970-01-01 00:00:00 +0000 |
| 669 | +++ include/unity/shell/scopes/ValueSliderValuesInterface.h 2016-03-16 11:18:19 +0000 |
| 670 | @@ -0,0 +1,62 @@ |
| 671 | +/* |
| 672 | + * Copyright (C) 2015 Canonical, Ltd. |
| 673 | + * |
| 674 | + * This program is free software; you can redistribute it and/or modify |
| 675 | + * it under the terms of the GNU General Public License as published by |
| 676 | + * the Free Software Foundation; version 3. |
| 677 | + * |
| 678 | + * This program is distributed in the hope that it will be useful, |
| 679 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 680 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 681 | + * GNU General Public License for more details. |
| 682 | + * |
| 683 | + * You should have received a copy of the GNU General Public License |
| 684 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 685 | + */ |
| 686 | + |
| 687 | +#ifndef UNITY_SHELL_SCOPES_VALUESLIDERVALUESINTERFACE_H |
| 688 | +#define UNITY_SHELL_SCOPES_VALUESLIDERVALUESINTERFACE_H |
| 689 | + |
| 690 | +#include <unity/SymbolExport.h> |
| 691 | +#include <QAbstractListModel> |
| 692 | + |
| 693 | +namespace unity |
| 694 | +{ |
| 695 | +namespace shell |
| 696 | +{ |
| 697 | +namespace scopes |
| 698 | +{ |
| 699 | + |
| 700 | +class UNITY_API ValueSliderValuesInterface : public QAbstractListModel |
| 701 | +{ |
| 702 | + Q_OBJECT |
| 703 | + |
| 704 | + Q_ENUMS(SliderValueRoles) |
| 705 | + |
| 706 | +public: |
| 707 | + enum Roles { |
| 708 | + RoleValue = Qt::UserRole + 1, |
| 709 | + RoleLabel |
| 710 | + }; |
| 711 | + |
| 712 | + QHash<int, QByteArray> roleNames() const override |
| 713 | + { |
| 714 | + QHash<int, QByteArray> roles; |
| 715 | + roles[RoleValue] = "value"; |
| 716 | + roles[RoleLabel] = "label"; |
| 717 | + return roles; |
| 718 | + } |
| 719 | + |
| 720 | +protected: |
| 721 | + /// @cond |
| 722 | + explicit ValueSliderValuesInterface(QObject* parent = 0) : QAbstractListModel(parent) {} |
| 723 | + /// @endcond |
| 724 | +}; |
| 725 | + |
| 726 | +} |
| 727 | +} |
| 728 | +} |
| 729 | + |
| 730 | +Q_DECLARE_METATYPE(unity::shell::scopes::ValueSliderValuesInterface*) |
| 731 | + |
| 732 | +#endif |
| 733 | |
| 734 | === modified file 'test/qmltest/mocks/plugins/Unity/Scopes/CMakeLists.txt' |
| 735 | --- test/qmltest/mocks/plugins/Unity/Scopes/CMakeLists.txt 2016-02-11 14:00:36 +0000 |
| 736 | +++ test/qmltest/mocks/plugins/Unity/Scopes/CMakeLists.txt 2016-03-16 11:18:19 +0000 |
| 737 | @@ -19,7 +19,15 @@ |
| 738 | Mocks/MockScope.cpp |
| 739 | Mocks/MockScopes.cpp |
| 740 | Mocks/MockSettingsModel.cpp |
| 741 | + Mocks/MockFiltersModel.cpp |
| 742 | + Mocks/MockOptionSelectorFilter.cpp |
| 743 | + Mocks/MockSelectorOptions.cpp |
| 744 | ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/CategoriesInterface.h |
| 745 | + ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/FiltersInterface.h |
| 746 | + ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/FilterBaseInterface.h |
| 747 | + ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/OptionSelectorFilterInterface.h |
| 748 | + ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/OptionSelectorOptionsInterface.h |
| 749 | + ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/RangeInputFilterInterface.h |
| 750 | ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/NavigationInterface.h |
| 751 | ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/ResultsModelInterface.h |
| 752 | ${CMAKE_SOURCE_DIR}/include/unity/shell/scopes/PreviewModelInterface.h |
| 753 | |
| 754 | === modified file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockDepartment.cpp' |
| 755 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockDepartment.cpp 2014-08-04 13:58:53 +0000 |
| 756 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockDepartment.cpp 2016-03-16 11:18:19 +0000 |
| 757 | @@ -79,6 +79,8 @@ |
| 758 | return "child"; |
| 759 | case RoleLabel: |
| 760 | return "Child Clothes"; |
| 761 | + case RoleAllLabel: |
| 762 | + return "All Child Clothes"; |
| 763 | case RoleHasChildren: |
| 764 | return true; |
| 765 | case RoleIsActive: |
| 766 | |
| 767 | === added file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockFiltersModel.cpp' |
| 768 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockFiltersModel.cpp 1970-01-01 00:00:00 +0000 |
| 769 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockFiltersModel.cpp 2016-03-16 11:18:19 +0000 |
| 770 | @@ -0,0 +1,51 @@ |
| 771 | +/* |
| 772 | + * Copyright (C) 2015 Canonical, Ltd. |
| 773 | + * |
| 774 | + * This program is free software; you can redistribute it and/or modify |
| 775 | + * it under the terms of the GNU General Public License as published by |
| 776 | + * the Free Software Foundation; version 3. |
| 777 | + * |
| 778 | + * This program is distributed in the hope that it will be useful, |
| 779 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 780 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 781 | + * GNU General Public License for more details. |
| 782 | + * |
| 783 | + * You should have received a copy of the GNU General Public License |
| 784 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 785 | + */ |
| 786 | + |
| 787 | +#include "MockFiltersModel.h" |
| 788 | +#include "MockOptionSelectorFilter.h" |
| 789 | + |
| 790 | +MockFiltersModel::MockFiltersModel(unity::shell::scopes::ScopeInterface *parent) |
| 791 | + : unity::shell::scopes::FiltersInterface(parent) |
| 792 | +{ |
| 793 | + MockOptionSelectorFilter *f = new MockOptionSelectorFilter("f1", "Filter 1", false, this); |
| 794 | + m_filters.append(f); // owned by parent, so no need to manage it |
| 795 | +} |
| 796 | + |
| 797 | +QVariant MockFiltersModel::data(const QModelIndex& index, int role) const |
| 798 | +{ |
| 799 | + if (index.row() >= 0 && index.row() < m_filters.count()) |
| 800 | + { |
| 801 | + auto filter = m_filters.at(index.row()); |
| 802 | + switch (role) |
| 803 | + { |
| 804 | + case Qt::DisplayRole: |
| 805 | + case unity::shell::scopes::FiltersInterface::RoleFilterId: |
| 806 | + return QVariant(filter->filterId()); |
| 807 | + case unity::shell::scopes::FiltersInterface::RoleFilterType: |
| 808 | + return QVariant(static_cast<int>(filter->filterType())); |
| 809 | + case unity::shell::scopes::FiltersInterface::RoleFilter: |
| 810 | + return QVariant::fromValue(filter); |
| 811 | + default: |
| 812 | + return QVariant(); |
| 813 | + } |
| 814 | + } |
| 815 | + return QVariant(); |
| 816 | +} |
| 817 | + |
| 818 | +int MockFiltersModel::rowCount(const QModelIndex&) const |
| 819 | +{ |
| 820 | + return m_filters.count(); |
| 821 | +} |
| 822 | |
| 823 | === added file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockFiltersModel.h' |
| 824 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockFiltersModel.h 1970-01-01 00:00:00 +0000 |
| 825 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockFiltersModel.h 2016-03-16 11:18:19 +0000 |
| 826 | @@ -0,0 +1,40 @@ |
| 827 | +/* |
| 828 | + * Copyright (C) 2015 Canonical, Ltd. |
| 829 | + * |
| 830 | + * This program is free software; you can redistribute it and/or modify |
| 831 | + * it under the terms of the GNU General Public License as published by |
| 832 | + * the Free Software Foundation; version 3. |
| 833 | + * |
| 834 | + * This program is distributed in the hope that it will be useful, |
| 835 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 836 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 837 | + * GNU General Public License for more details. |
| 838 | + * |
| 839 | + * You should have received a copy of the GNU General Public License |
| 840 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 841 | + */ |
| 842 | + |
| 843 | +#ifndef MOCKFILTERS_H |
| 844 | +#define MOCKFILTERS_H |
| 845 | + |
| 846 | +#include <unity/shell/scopes/FiltersInterface.h> |
| 847 | +#include <unity/shell/scopes/FilterBaseInterface.h> |
| 848 | +#include <unity/shell/scopes/ScopeInterface.h> |
| 849 | + |
| 850 | +#include <QList> |
| 851 | + |
| 852 | +class MockFiltersModel : public unity::shell::scopes::FiltersInterface |
| 853 | +{ |
| 854 | + Q_OBJECT |
| 855 | + |
| 856 | +public: |
| 857 | + explicit MockFiltersModel(unity::shell::scopes::ScopeInterface *parent = 0); |
| 858 | + |
| 859 | + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; |
| 860 | + int rowCount(const QModelIndex& parent = QModelIndex()) const override; |
| 861 | + |
| 862 | +private: |
| 863 | + QList<unity::shell::scopes::FilterBaseInterface*> m_filters; |
| 864 | +}; |
| 865 | + |
| 866 | +#endif // MOCKDEPARTMENT_H |
| 867 | |
| 868 | === added file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockOptionSelectorFilter.cpp' |
| 869 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockOptionSelectorFilter.cpp 1970-01-01 00:00:00 +0000 |
| 870 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockOptionSelectorFilter.cpp 2016-03-16 11:18:19 +0000 |
| 871 | @@ -0,0 +1,57 @@ |
| 872 | +/* |
| 873 | + * Copyright (C) 2015 Canonical, Ltd. |
| 874 | + * |
| 875 | + * This program is free software; you can redistribute it and/or modify |
| 876 | + * it under the terms of the GNU General Public License as published by |
| 877 | + * the Free Software Foundation; version 3. |
| 878 | + * |
| 879 | + * This program is distributed in the hope that it will be useful, |
| 880 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 881 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 882 | + * GNU General Public License for more details. |
| 883 | + * |
| 884 | + * You should have received a copy of the GNU General Public License |
| 885 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 886 | + */ |
| 887 | + |
| 888 | +#include "MockOptionSelectorFilter.h" |
| 889 | + |
| 890 | +MockOptionSelectorFilter::MockOptionSelectorFilter(const QString &id, const QString &title, const QString &label, bool multi, QObject *parent) |
| 891 | + : unity::shell::scopes::OptionSelectorFilterInterface(parent), |
| 892 | + m_id(id), |
| 893 | + m_title(title), |
| 894 | + m_label(label), |
| 895 | + m_multiSelect(multi), |
| 896 | + m_options(new MockSelectorOptions(2, this)) |
| 897 | +{ |
| 898 | +} |
| 899 | + |
| 900 | +QString MockOptionSelectorFilter::filterId() const |
| 901 | +{ |
| 902 | + return m_id; |
| 903 | +} |
| 904 | + |
| 905 | +QString MockOptionSelectorFilter::title() const |
| 906 | +{ |
| 907 | + return m_title; |
| 908 | +} |
| 909 | + |
| 910 | +QString MockOptionSelectorFilter::label() const |
| 911 | +{ |
| 912 | + return m_label; |
| 913 | +} |
| 914 | + |
| 915 | +bool MockOptionSelectorFilter::multiSelect() const |
| 916 | +{ |
| 917 | + return m_multiSelect; |
| 918 | +} |
| 919 | + |
| 920 | +unity::shell::scopes::OptionSelectorOptionsInterface* MockOptionSelectorFilter::options() const |
| 921 | +{ |
| 922 | + return m_options; |
| 923 | +} |
| 924 | + |
| 925 | +QString MockOptionSelectorFilter::filterTag() const |
| 926 | +{ |
| 927 | + return ""; |
| 928 | +} |
| 929 | |
| 930 | === added file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockOptionSelectorFilter.h' |
| 931 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockOptionSelectorFilter.h 1970-01-01 00:00:00 +0000 |
| 932 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockOptionSelectorFilter.h 2016-03-16 11:18:19 +0000 |
| 933 | @@ -0,0 +1,45 @@ |
| 934 | +/* |
| 935 | + * Copyright (C) 2015 Canonical, Ltd. |
| 936 | + * |
| 937 | + * This program is free software; you can redistribute it and/or modify |
| 938 | + * it under the terms of the GNU General Public License as published by |
| 939 | + * the Free Software Foundation; version 3. |
| 940 | + * |
| 941 | + * This program is distributed in the hope that it will be useful, |
| 942 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 943 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 944 | + * GNU General Public License for more details. |
| 945 | + * |
| 946 | + * You should have received a copy of the GNU General Public License |
| 947 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 948 | + */ |
| 949 | + |
| 950 | +#ifndef MOCKOPTIONSELECTORFILTER_H |
| 951 | +#define MOCKOPTIONSELECTORFILTER_H |
| 952 | + |
| 953 | +#include <unity/shell/scopes/OptionSelectorFilterInterface.h> |
| 954 | +#include <unity/shell/scopes/FiltersInterface.h> |
| 955 | +#include "MockSelectorOptions.h" |
| 956 | + |
| 957 | +class MockOptionSelectorFilter : public unity::shell::scopes::OptionSelectorFilterInterface |
| 958 | +{ |
| 959 | + Q_OBJECT |
| 960 | + |
| 961 | +public: |
| 962 | + MockOptionSelectorFilter(const QString &id, const QString& title, const QString &label, bool multi, QObject *parent = 0); |
| 963 | + QString filterId() const override; |
| 964 | + QString title() const override; |
| 965 | + QString label() const override; |
| 966 | + bool multiSelect() const override; |
| 967 | + unity::shell::scopes::OptionSelectorOptionsInterface* options() const override; |
| 968 | + QString filterTag() const override; |
| 969 | + |
| 970 | +private: |
| 971 | + QString m_id; |
| 972 | + QString m_title; |
| 973 | + QString m_label; |
| 974 | + bool m_multiSelect; |
| 975 | + MockSelectorOptions *m_options; |
| 976 | +}; |
| 977 | + |
| 978 | +#endif |
| 979 | |
| 980 | === modified file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockResultsModel.cpp' |
| 981 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockResultsModel.cpp 2014-07-18 12:56:46 +0000 |
| 982 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockResultsModel.cpp 2016-03-16 11:18:19 +0000 |
| 983 | @@ -67,6 +67,8 @@ |
| 984 | case RoleUri: |
| 985 | case RoleCategoryId: |
| 986 | case RoleDndUri: |
| 987 | + case RoleAttributes: |
| 988 | + case RoleSocialActions: |
| 989 | default: |
| 990 | return QString(); |
| 991 | } |
| 992 | |
| 993 | === modified file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp' |
| 994 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp 2016-02-18 15:46:46 +0000 |
| 995 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp 2016-03-16 11:18:19 +0000 |
| 996 | @@ -19,6 +19,7 @@ |
| 997 | #include "MockPreviewModel.h" |
| 998 | #include "MockDepartment.h" |
| 999 | #include "MockSettingsModel.h" |
| 1000 | +#include "MockFiltersModel.h" |
| 1001 | |
| 1002 | MockScope::MockScope(QObject* parent) : MockScope(QString(), QString(), parent) |
| 1003 | { |
| 1004 | @@ -34,6 +35,7 @@ |
| 1005 | , m_previewRendererName("preview-generic") |
| 1006 | , m_categories(new MockCategories(20, this)) |
| 1007 | , m_settings(new MockSettingsModel(this)) |
| 1008 | + , m_filters(new MockFiltersModel(this)) |
| 1009 | { |
| 1010 | } |
| 1011 | |
| 1012 | @@ -69,10 +71,6 @@ |
| 1013 | return m_currentDepartmentId; |
| 1014 | } |
| 1015 | |
| 1016 | -QString MockScope::currentAltNavigationId() const { |
| 1017 | - return m_currentAltDepartmentId; |
| 1018 | -} |
| 1019 | - |
| 1020 | bool MockScope::searchInProgress() const { |
| 1021 | return m_searching; |
| 1022 | } |
| 1023 | @@ -89,6 +87,14 @@ |
| 1024 | return m_settings; |
| 1025 | } |
| 1026 | |
| 1027 | +unity::shell::scopes::FiltersInterface* MockScope::filters() const { |
| 1028 | + return m_filters; |
| 1029 | +} |
| 1030 | + |
| 1031 | +unity::shell::scopes::FilterBaseInterface* MockScope::primaryNavigationFilter() const { |
| 1032 | + return nullptr; |
| 1033 | +} |
| 1034 | + |
| 1035 | QString MockScope::noResultsHint() const { |
| 1036 | return m_noResultsHint; |
| 1037 | } |
| 1038 | @@ -109,10 +115,6 @@ |
| 1039 | return m_hasNavigation; |
| 1040 | } |
| 1041 | |
| 1042 | -bool MockScope::hasAltNavigation() const { |
| 1043 | - return m_hasAltNavigation; |
| 1044 | -} |
| 1045 | - |
| 1046 | QVariantMap MockScope::customizations() const { |
| 1047 | return m_customizations; |
| 1048 | } |
| 1049 | @@ -193,17 +195,9 @@ |
| 1050 | return new MockDepartment(); |
| 1051 | } |
| 1052 | |
| 1053 | -unity::shell::scopes::NavigationInterface* MockScope::getAltNavigation(QString const& navigationId) |
| 1054 | -{ |
| 1055 | - Q_UNUSED(navigationId); |
| 1056 | - |
| 1057 | - return new MockDepartment(); |
| 1058 | -} |
| 1059 | - |
| 1060 | -void MockScope::setNavigationState(QString const& navId, bool altNavigation) |
| 1061 | +void MockScope::setNavigationState(QString const& navId) |
| 1062 | { |
| 1063 | Q_UNUSED(navId); |
| 1064 | - Q_UNUSED(altNavigation); |
| 1065 | } |
| 1066 | |
| 1067 | void MockScope::cancelActivation() |
| 1068 | @@ -223,3 +217,21 @@ |
| 1069 | void MockScope::refresh() |
| 1070 | { |
| 1071 | } |
| 1072 | + |
| 1073 | +QString MockScope::primaryNavigationTag() const |
| 1074 | +{ |
| 1075 | + return ""; |
| 1076 | +} |
| 1077 | + |
| 1078 | +void MockScope::resetPrimaryNavigationTag() |
| 1079 | +{ |
| 1080 | +} |
| 1081 | + |
| 1082 | +void MockScope::resetFilters() |
| 1083 | +{ |
| 1084 | +} |
| 1085 | + |
| 1086 | +int MockScope::activeFiltersCount() const |
| 1087 | +{ |
| 1088 | + return 0; |
| 1089 | +} |
| 1090 | |
| 1091 | === modified file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h' |
| 1092 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h 2016-02-18 15:46:46 +0000 |
| 1093 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h 2016-03-16 11:18:19 +0000 |
| 1094 | @@ -39,16 +39,18 @@ |
| 1095 | bool activationInProgress() const override; |
| 1096 | unity::shell::scopes::CategoriesInterface* categories() const override; |
| 1097 | unity::shell::scopes::SettingsModelInterface* settings() const override; |
| 1098 | + unity::shell::scopes::FiltersInterface* filters() const override; |
| 1099 | + unity::shell::scopes::FilterBaseInterface* primaryNavigationFilter() const override; |
| 1100 | QString searchQuery() const override; |
| 1101 | QString noResultsHint() const override; |
| 1102 | QString formFactor() const override; |
| 1103 | bool isActive() const override; |
| 1104 | bool hasNavigation() const override; |
| 1105 | QString currentNavigationId() const override; |
| 1106 | - bool hasAltNavigation() const override; |
| 1107 | - QString currentAltNavigationId() const override; |
| 1108 | QVariantMap customizations() const override; |
| 1109 | Status status() const override; |
| 1110 | + QString primaryNavigationTag() const override; |
| 1111 | + int activeFiltersCount() const override; |
| 1112 | |
| 1113 | /* setters */ |
| 1114 | void setName(const QString& name); |
| 1115 | @@ -64,10 +66,11 @@ |
| 1116 | Q_INVOKABLE void cancelActivation() override; |
| 1117 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; |
| 1118 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& departmentId) override; |
| 1119 | - Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& departmentId) override; |
| 1120 | - Q_INVOKABLE void setNavigationState(QString const& navId, bool altNavigation) override; |
| 1121 | + Q_INVOKABLE void setNavigationState(QString const& navId) override; |
| 1122 | Q_INVOKABLE void performQuery(QString const& cannedQuery) override; |
| 1123 | Q_INVOKABLE void refresh() override; |
| 1124 | + Q_INVOKABLE void resetPrimaryNavigationTag() override; |
| 1125 | + Q_INVOKABLE void resetFilters() override; |
| 1126 | |
| 1127 | protected: |
| 1128 | QString m_id; |
| 1129 | @@ -78,18 +81,17 @@ |
| 1130 | QString m_noResultsHint; |
| 1131 | QString m_formFactor; |
| 1132 | QString m_currentDepartmentId; |
| 1133 | - QString m_currentAltDepartmentId; |
| 1134 | bool m_favorite; |
| 1135 | bool m_searching; |
| 1136 | bool m_isActive; |
| 1137 | bool m_hasNavigation; |
| 1138 | - bool m_hasAltNavigation; |
| 1139 | QVariantMap m_customizations; |
| 1140 | |
| 1141 | QString m_previewRendererName; |
| 1142 | |
| 1143 | unity::shell::scopes::CategoriesInterface* m_categories; |
| 1144 | unity::shell::scopes::SettingsModelInterface* m_settings; |
| 1145 | + unity::shell::scopes::FiltersInterface* m_filters; |
| 1146 | }; |
| 1147 | |
| 1148 | #endif |
| 1149 | |
| 1150 | === added file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockSelectorOptions.cpp' |
| 1151 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockSelectorOptions.cpp 1970-01-01 00:00:00 +0000 |
| 1152 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockSelectorOptions.cpp 2016-03-16 11:18:19 +0000 |
| 1153 | @@ -0,0 +1,53 @@ |
| 1154 | +/* |
| 1155 | + * Copyright (C) 2015 Canonical, Ltd. |
| 1156 | + * |
| 1157 | + * This program is free software; you can redistribute it and/or modify |
| 1158 | + * it under the terms of the GNU General Public License as published by |
| 1159 | + * the Free Software Foundation; version 3. |
| 1160 | + * |
| 1161 | + * This program is distributed in the hope that it will be useful, |
| 1162 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 1163 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 1164 | + * GNU General Public License for more details. |
| 1165 | + * |
| 1166 | + * You should have received a copy of the GNU General Public License |
| 1167 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 1168 | + */ |
| 1169 | + |
| 1170 | +#include "MockSelectorOptions.h" |
| 1171 | + |
| 1172 | +MockSelectorOptions::MockSelectorOptions(int num, QObject *parent) |
| 1173 | + : unity::shell::scopes::OptionSelectorOptionsInterface(parent), |
| 1174 | + m_numOfOptions(num) |
| 1175 | +{ |
| 1176 | +} |
| 1177 | + |
| 1178 | +QVariant MockSelectorOptions::data(const QModelIndex& index, int role) const |
| 1179 | +{ |
| 1180 | + if (index.row() >= 0 && index.row() < m_numOfOptions) |
| 1181 | + { |
| 1182 | + switch (role) |
| 1183 | + { |
| 1184 | + case unity::shell::scopes::OptionSelectorOptionsInterface::RoleOptionId: |
| 1185 | + return QVariant(QString("option") + QString::number(index.row())); |
| 1186 | + case Qt::DisplayRole: |
| 1187 | + case unity::shell::scopes::OptionSelectorOptionsInterface::RoleOptionLabel: |
| 1188 | + return QVariant(QString("Option") + QString::number(index.row())); |
| 1189 | + case unity::shell::scopes::OptionSelectorOptionsInterface::RoleOptionChecked: |
| 1190 | + return QVariant(false); |
| 1191 | + default: |
| 1192 | + return QVariant(); |
| 1193 | + } |
| 1194 | + } |
| 1195 | + return QVariant(); |
| 1196 | +} |
| 1197 | + |
| 1198 | +int MockSelectorOptions::rowCount(const QModelIndex&) const |
| 1199 | +{ |
| 1200 | + return m_numOfOptions; |
| 1201 | +} |
| 1202 | + |
| 1203 | +void MockSelectorOptions::setChecked(int, bool) |
| 1204 | +{ |
| 1205 | + qFatal("Using un-implemented setChecked() method"); |
| 1206 | +} |
| 1207 | |
| 1208 | === added file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockSelectorOptions.h' |
| 1209 | --- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockSelectorOptions.h 1970-01-01 00:00:00 +0000 |
| 1210 | +++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockSelectorOptions.h 2016-03-16 11:18:19 +0000 |
| 1211 | @@ -0,0 +1,36 @@ |
| 1212 | +/* |
| 1213 | + * Copyright (C) 2015 Canonical, Ltd. |
| 1214 | + * |
| 1215 | + * This program is free software; you can redistribute it and/or modify |
| 1216 | + * it under the terms of the GNU General Public License as published by |
| 1217 | + * the Free Software Foundation; version 3. |
| 1218 | + * |
| 1219 | + * This program is distributed in the hope that it will be useful, |
| 1220 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 1221 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 1222 | + * GNU General Public License for more details. |
| 1223 | + * |
| 1224 | + * You should have received a copy of the GNU General Public License |
| 1225 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 1226 | + */ |
| 1227 | + |
| 1228 | +#ifndef MOCKOPTIONSELECTOROPTIONS_H |
| 1229 | +#define MOCKOPTIONSELECTOROPTIONS_H |
| 1230 | + |
| 1231 | +#include <unity/shell/scopes/OptionSelectorOptionsInterface.h> |
| 1232 | + |
| 1233 | +class MockSelectorOptions : public unity::shell::scopes::OptionSelectorOptionsInterface |
| 1234 | +{ |
| 1235 | + Q_OBJECT |
| 1236 | + |
| 1237 | +public: |
| 1238 | + MockSelectorOptions(int num = 2, QObject *parent = 0); |
| 1239 | + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; |
| 1240 | + int rowCount(const QModelIndex& parent = QModelIndex()) const override; |
| 1241 | + void setChecked(int index, bool checked) override; |
| 1242 | + |
| 1243 | +private: |
| 1244 | + int m_numOfOptions; |
| 1245 | +}; |
| 1246 | + |
| 1247 | +#endif |
| 1248 | |
| 1249 | === modified file 'test/qmltest/mocks/plugins/Unity/Scopes/TestScopesPlugin.cpp' |
| 1250 | --- test/qmltest/mocks/plugins/Unity/Scopes/TestScopesPlugin.cpp 2016-02-11 14:00:36 +0000 |
| 1251 | +++ test/qmltest/mocks/plugins/Unity/Scopes/TestScopesPlugin.cpp 2016-03-16 11:18:19 +0000 |
| 1252 | @@ -25,6 +25,11 @@ |
| 1253 | #include "PreviewModelInterface.h" |
| 1254 | #include "PreviewWidgetModelInterface.h" |
| 1255 | #include "SettingsModelInterface.h" |
| 1256 | +#include "FiltersInterface.h" |
| 1257 | +#include "FilterBaseInterface.h" |
| 1258 | +#include "OptionSelectorOptionsInterface.h" |
| 1259 | +#include "OptionSelectorFilterInterface.h" |
| 1260 | +#include "RangeInputFilterInterface.h" |
| 1261 | #include "Mocks/MockScopes.h" |
| 1262 | #include "Mocks/MockScope.h" |
| 1263 | |
| 1264 | @@ -38,4 +43,9 @@ |
| 1265 | qmlRegisterUncreatableType<unity::shell::scopes::PreviewModelInterface>(uri, 0, 2, "PreviewModel", "Can't create new PreviewModel in QML. Get them from Scope instance."); |
| 1266 | qmlRegisterUncreatableType<unity::shell::scopes::PreviewWidgetModelInterface>(uri, 0, 2, "PreviewWidgetModel", "Can't create new PreviewWidgetModel in QML. Get them from PreviewModel instance."); |
| 1267 | qmlRegisterUncreatableType<unity::shell::scopes::SettingsModelInterface>(uri, 0, 2, "Settings", "Can't create new Settings in QML. Get them from Scope instance."); |
| 1268 | + qmlRegisterUncreatableType<unity::shell::scopes::FilterBaseInterface>(uri, 0, 2, "FilterBase", "Can't create new Filter in QML. Get them from Filters instance."); |
| 1269 | + qmlRegisterUncreatableType<unity::shell::scopes::FiltersInterface>(uri, 0, 2, "Filters", "Can't create new Filters in QML. Get them from Scope instance."); |
| 1270 | + qmlRegisterUncreatableType<unity::shell::scopes::OptionSelectorOptionsInterface>(uri, 0, 2, "OptionSelectorOptions", "Can't create new OptionSelectorOptions in QML. Get them from OptionSelectorFilter instance."); |
| 1271 | + qmlRegisterUncreatableType<unity::shell::scopes::OptionSelectorFilterInterface>(uri, 0, 2, "OptionSelectorFilter", "Can't create new OptionSelectorFilter in QML. Get them from Filters instance."); |
| 1272 | + qmlRegisterUncreatableType<unity::shell::scopes::RangeInputFilterInterface>(uri, 0, 2, "RangeInputFilter", "Can't create new RangeInputFilter in QML. Get them from Filters instance."); |
| 1273 | } |
| 1274 | |
| 1275 | === modified file 'test/qmltest/unity/shell/scopes/tst_Scopes.qml' |
| 1276 | --- test/qmltest/unity/shell/scopes/tst_Scopes.qml 2016-02-11 14:06:46 +0000 |
| 1277 | +++ test/qmltest/unity/shell/scopes/tst_Scopes.qml 2016-03-16 11:18:19 +0000 |
| 1278 | @@ -122,14 +122,13 @@ |
| 1279 | { tag: "Item.properties[favorite]", constant: "favorite", type: "boolean" }, |
| 1280 | { tag: "Item.properties[shortcut]", constant: "shortcut", type: "string" }, |
| 1281 | { tag: "Item.properties[categories]", constant: "categories", type: "object" }, |
| 1282 | + { tag: "Item.properties[filters]", constant: "filters", type: "object" }, |
| 1283 | { tag: "Item.properties[searchQuery]", constant: "searchQuery", type: "string" }, |
| 1284 | { tag: "Item.properties[noResultsHint]", constant: "noResultsHint", type: "string" }, |
| 1285 | { tag: "Item.properties[formFactor]", constant: "formFactor", type: "string" }, |
| 1286 | { tag: "Item.properties[isActive]", constant: "isActive", type: "boolean" }, |
| 1287 | { tag: "Item.properties[currentNavigationId]", constant: "currentNavigationId", type: "string" }, |
| 1288 | { tag: "Item.properties[hasNavigation]", constant: "hasNavigation", type: "boolean" }, |
| 1289 | - { tag: "Item.properties[currentAltNavigationId]", constant: "currentAltNavigationId", type: "string" }, |
| 1290 | - { tag: "Item.properties[hasAltNavigation]", constant: "hasAltNavigation", type: "boolean" }, |
| 1291 | { tag: "Item.properties[customizations]", constant: "customizations", type: "object" }, |
| 1292 | { tag: "Item.properties[status]", constant: "status", type: "number" } |
| 1293 | ]; |
| 1294 | @@ -156,7 +155,6 @@ |
| 1295 | { tag: "Model.methods[performQuery]", method: "performQuery" }, |
| 1296 | { tag: "Model.methods[refresh]", method: "refresh" }, |
| 1297 | { tag: "Model.methods[getNavigation]", method: "getNavigation" }, |
| 1298 | - { tag: "Model.methods[getAltNavigation]", method: "getAltNavigation" }, |
| 1299 | { tag: "Model.methods[setNavigationState]", method: "setNavigationState" }, |
| 1300 | ]; |
| 1301 | } |
| 1302 | @@ -169,6 +167,116 @@ |
| 1303 | } |
| 1304 | |
| 1305 | Verifier { |
| 1306 | + id: filtersVerifier |
| 1307 | + |
| 1308 | + Repeater { |
| 1309 | + id: filtersRepeater |
| 1310 | + model: root.scope.filters |
| 1311 | + delegate: Item { |
| 1312 | + property var roles: model |
| 1313 | + } |
| 1314 | + } |
| 1315 | + |
| 1316 | + function test_filters(data) { |
| 1317 | + object = filtersRepeater.model; |
| 1318 | + name = "Filters"; |
| 1319 | + verifyData(data); |
| 1320 | + } |
| 1321 | + |
| 1322 | + function test_filters_data() { |
| 1323 | + return [ |
| 1324 | + { tag: "Filters[object]", type: "object" }, |
| 1325 | + { tag: "Filters[FiltersInterface]", type: "unity::shell::scopes::FiltersInterface" }, |
| 1326 | + ]; |
| 1327 | + } |
| 1328 | + |
| 1329 | + function test_filters_roles(data) { |
| 1330 | + object = filtersRepeater.itemAt(0).roles; |
| 1331 | + name = "Filters"; |
| 1332 | + verifyData(data); |
| 1333 | + } |
| 1334 | + |
| 1335 | + function test_filters_roles_data() { |
| 1336 | + return [ |
| 1337 | + { tag: "Model.roles[id]", role: "id", type: "string" }, |
| 1338 | + { tag: "Model.roles[type]", role: "type", type: "number" }, |
| 1339 | + { tag: "Model.roles[filter]", role: "filter", type: "unity::shell::scopes::FilterBaseInterface" }, |
| 1340 | + ]; |
| 1341 | + } |
| 1342 | + } |
| 1343 | + |
| 1344 | + Verifier { |
| 1345 | + id: optionSelectorFilterVerifier |
| 1346 | + |
| 1347 | + function test_option_selector_filter(data) { |
| 1348 | + object = filtersRepeater.itemAt(0).roles.filter; |
| 1349 | + name = "Filter"; |
| 1350 | + verifyData(data); |
| 1351 | + } |
| 1352 | + |
| 1353 | + function test_option_selector_filter_data() { |
| 1354 | + return [ |
| 1355 | + { tag: "Filter[object]", type: "object" }, |
| 1356 | + { tag: "Filter[OptionSelectorFilterInterface]", type: "unity::shell::scopes::OptionSelectorFilterInterface" }, |
| 1357 | + ]; |
| 1358 | + } |
| 1359 | + |
| 1360 | + function test_option_selector_filter_properties_data() { |
| 1361 | + return [ |
| 1362 | + { tag: "Filter.properties[filterId]", constant: "filterId", type: "string" }, |
| 1363 | + { tag: "Filter.properties[label]", constant: "label", type: "string" }, |
| 1364 | + { tag: "Filter.properties[multiSelect]", constant: "multiSelect", type: "boolean" }, |
| 1365 | + { tag: "Filter.properties[options]", constant: "options", type: "object" }, |
| 1366 | + ]; |
| 1367 | + } |
| 1368 | + |
| 1369 | + function test_option_selector_filter_properties(data) { |
| 1370 | + object = filtersRepeater.itemAt(0).roles.filter; |
| 1371 | + name = "Filter"; |
| 1372 | + verifyData(data); |
| 1373 | + } |
| 1374 | + |
| 1375 | + function test_options_data() { |
| 1376 | + return [ |
| 1377 | + { tag: "Options[object]", type: "object" }, |
| 1378 | + { tag: "Options[OptionSelectorOptionsInterface]", type: "unity::shell::scopes::OptionSelectorOptionsInterface" }, |
| 1379 | + ]; |
| 1380 | + } |
| 1381 | + |
| 1382 | + function test_options(data) { |
| 1383 | + object = filtersRepeater.itemAt(0).roles.filter.options; |
| 1384 | + name = "Options"; |
| 1385 | + verifyData(data); |
| 1386 | + } |
| 1387 | + } |
| 1388 | + |
| 1389 | + Verifier { |
| 1390 | + id: optionSelectorFilterOptionsVerifier |
| 1391 | + |
| 1392 | + Repeater { |
| 1393 | + id: optionsRepeater |
| 1394 | + model: filtersRepeater.count > 0 ? filtersRepeater.itemAt(0).roles.filter.options : undefined |
| 1395 | + delegate: Item { |
| 1396 | + property var roles: model |
| 1397 | + } |
| 1398 | + } |
| 1399 | + |
| 1400 | + function test_option_selector_filter_options_roles_data() { |
| 1401 | + return [ |
| 1402 | + { tag: "Model.roles[id]", role: "id", type: "string" }, |
| 1403 | + { tag: "Model.roles[label]", role: "label", type: "string" }, |
| 1404 | + { tag: "Model.roles[checked]", role: "checked", type: "boolean" }, |
| 1405 | + ]; |
| 1406 | + } |
| 1407 | + |
| 1408 | + function test_option_selector_filter_options_roles(data) { |
| 1409 | + object = optionsRepeater.itemAt(0).roles; |
| 1410 | + name = "Options"; |
| 1411 | + verifyData(data); |
| 1412 | + } |
| 1413 | + } |
| 1414 | + |
| 1415 | + Verifier { |
| 1416 | id: categoriesVerifier |
| 1417 | |
| 1418 | Repeater { |
| 1419 | @@ -319,6 +427,7 @@ |
| 1420 | { tag: "Model.roles[attributes]", role: "attributes", type: "string" }, |
| 1421 | { tag: "Model.roles[background]", role: "background", type: "object" }, |
| 1422 | { tag: "Model.roles[overlayColor]", role: "overlayColor", type: "string" }, |
| 1423 | + { tag: "Model.roles[socialActions]", role: "socialActions", type: "string" }, |
| 1424 | ]; |
| 1425 | } |
| 1426 |
