Changeset View
Changeset View
Standalone View
Standalone View
src/qtquick/quickengine.h
Show All 17 Lines | |||||
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef ENGINE_H | 22 | #ifndef ENGINE_H | ||
23 | #define ENGINE_H | 23 | #define ENGINE_H | ||
24 | 24 | | |||
25 | #include <QObject> | 25 | #include <QObject> | ||
26 | #include <entryinternal.h> | ||||
26 | 27 | | |||
27 | /** | 28 | /** | ||
28 | * @short Encapsulates a KNSCore::Engine for use in Qt Quick | 29 | * @short Encapsulates a KNSCore::Engine for use in Qt Quick | ||
29 | * | 30 | * | ||
30 | * This class takes care of initialisation of a KNSCore::Engine when assigned a config file. | 31 | * This class takes care of initialisation of a KNSCore::Engine when assigned a config file. | ||
31 | * The actual KNSCore:Engine can be read through the Engine::engine property. | 32 | * The actual KNSCore:Engine can be read through the Engine::engine property. | ||
32 | * | 33 | * | ||
33 | * @see ItemsModel | 34 | * @see ItemsModel | ||
34 | */ | 35 | */ | ||
35 | class Engine : public QObject | 36 | class Engine : public QObject | ||
36 | { | 37 | { | ||
37 | Q_OBJECT | 38 | Q_OBJECT | ||
39 | Q_PROPERTY(bool allowedByKiosk READ allowedByKiosk CONSTANT) | ||||
38 | Q_PROPERTY(QString configFile READ configFile WRITE setConfigFile NOTIFY configFileChanged) | 40 | Q_PROPERTY(QString configFile READ configFile WRITE setConfigFile NOTIFY configFileChanged) | ||
39 | Q_PROPERTY(QObject* engine READ engine NOTIFY engineChanged) | 41 | Q_PROPERTY(QObject* engine READ engine NOTIFY engineChanged) | ||
42 | Q_PROPERTY(bool hasAdoptionCommand READ hasAdoptionCommand NOTIFY engineInitialized) | ||||
43 | Q_PROPERTY(QString name READ name NOTIFY engineInitialized) | ||||
44 | Q_PROPERTY(QObject* categories READ categories NOTIFY categoriesChanged) | ||||
45 | Q_PROPERTY(QStringList categoriesFilter READ categoriesFilter WRITE setCategoriesFilter RESET resetCategoriesFilter NOTIFY categoriesFilterChanged) | ||||
46 | Q_PROPERTY(int filter READ filter WRITE setFilter NOTIFY filterChanged) | ||||
47 | Q_PROPERTY(int sortOrder READ sortOrder WRITE setSortOrder NOTIFY sortOrderChanged) | ||||
48 | Q_PROPERTY(QString searchTerm READ searchTerm WRITE setSearchTerm RESET resetSearchTerm NOTIFY searchTermChanged) | ||||
49 | Q_PROPERTY(KNSCore::EntryInternal::List changedEntries READ changedEntries RESET resetChangedEntries NOTIFY changedEntriesChanged) | ||||
40 | public: | 50 | public: | ||
41 | explicit Engine(QObject* parent = nullptr); | 51 | explicit Engine(QObject* parent = nullptr); | ||
42 | virtual ~Engine(); | 52 | virtual ~Engine(); | ||
43 | 53 | | |||
54 | bool allowedByKiosk() const; | ||||
55 | | ||||
44 | QString configFile() const; | 56 | QString configFile() const; | ||
45 | void setConfigFile(const QString& newFile); | 57 | void setConfigFile(const QString& newFile); | ||
46 | Q_SIGNAL void configFileChanged(); | 58 | Q_SIGNAL void configFileChanged(); | ||
47 | 59 | | |||
48 | QObject* engine() const; | 60 | QObject* engine() const; | ||
49 | Q_SIGNAL void engineChanged(); | 61 | Q_SIGNAL void engineChanged(); | ||
50 | 62 | | |||
63 | bool hasAdoptionCommand() const; | ||||
64 | QString name() const; | ||||
65 | Q_SIGNAL void engineInitialized(); | ||||
66 | | ||||
67 | QObject* categories() const; | ||||
68 | Q_SIGNAL void categoriesChanged(); | ||||
69 | | ||||
70 | QStringList categoriesFilter() const; | ||||
71 | void setCategoriesFilter(const QStringList& newCategoriesFilter); | ||||
72 | Q_INVOKABLE void resetCategoriesFilter(); | ||||
73 | Q_SIGNAL void categoriesFilterChanged(); | ||||
74 | | ||||
75 | int filter() const; | ||||
76 | void setFilter(int newFilter); | ||||
77 | Q_SIGNAL void filterChanged(); | ||||
78 | | ||||
79 | int sortOrder() const; | ||||
80 | void setSortOrder(int newSortOrder); | ||||
81 | Q_SIGNAL void sortOrderChanged(); | ||||
82 | | ||||
83 | QString searchTerm() const; | ||||
84 | void setSearchTerm(const QString& newSearchTerm); | ||||
85 | Q_INVOKABLE void resetSearchTerm(); | ||||
86 | Q_SIGNAL void searchTermChanged(); | ||||
87 | | ||||
88 | KNSCore::EntryInternal::List changedEntries() const; | ||||
89 | Q_INVOKABLE void resetChangedEntries(); | ||||
90 | Q_SIGNAL void changedEntriesChanged(); | ||||
51 | Q_SIGNALS: | 91 | Q_SIGNALS: | ||
52 | void message(const QString& message); | 92 | void message(const QString& message); | ||
53 | void idleMessage(const QString& message); | 93 | void idleMessage(const QString& message); | ||
54 | void busyMessage(const QString& message); | 94 | void busyMessage(const QString& message); | ||
55 | void errorMessage(const QString& message); | 95 | void errorMessage(const QString& message); | ||
56 | 96 | | |||
57 | private: | 97 | private: | ||
58 | class Private; | 98 | class Private; | ||
59 | Private* d; | 99 | Private* d; | ||
60 | }; | 100 | }; | ||
61 | 101 | | |||
62 | #endif//ENGINE_H | 102 | #endif//ENGINE_H |