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 NOTIFY allowedByKioskChanged) | ||||
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 | Q_SIGNAL void allowedByKioskChanged(); | ||||
56 | | ||||
44 | QString configFile() const; | 57 | QString configFile() const; | ||
45 | void setConfigFile(const QString& newFile); | 58 | void setConfigFile(const QString& newFile); | ||
46 | Q_SIGNAL void configFileChanged(); | 59 | Q_SIGNAL void configFileChanged(); | ||
47 | 60 | | |||
48 | QObject* engine() const; | 61 | QObject* engine() const; | ||
49 | Q_SIGNAL void engineChanged(); | 62 | Q_SIGNAL void engineChanged(); | ||
50 | 63 | | |||
64 | bool hasAdoptionCommand() const; | ||||
65 | QString name() const; | ||||
66 | Q_SIGNAL void engineInitialized(); | ||||
67 | | ||||
68 | QObject* categories() const; | ||||
69 | Q_SIGNAL void categoriesChanged(); | ||||
70 | | ||||
71 | QStringList categoriesFilter() const; | ||||
72 | void setCategoriesFilter(const QStringList& newCategoriesFilter); | ||||
73 | Q_INVOKABLE void resetCategoriesFilter(); | ||||
74 | Q_SIGNAL void categoriesFilterChanged(); | ||||
75 | | ||||
76 | int filter() const; | ||||
77 | void setFilter(int newFilter); | ||||
78 | Q_SIGNAL void filterChanged(); | ||||
79 | | ||||
80 | int sortOrder() const; | ||||
81 | void setSortOrder(int newSortOrder); | ||||
82 | Q_SIGNAL void sortOrderChanged(); | ||||
83 | | ||||
84 | QString searchTerm() const; | ||||
85 | void setSearchTerm(const QString& newSearchTerm); | ||||
86 | Q_INVOKABLE void resetSearchTerm(); | ||||
87 | Q_SIGNAL void searchTermChanged(); | ||||
88 | | ||||
89 | KNSCore::EntryInternal::List changedEntries() const; | ||||
90 | Q_INVOKABLE void resetChangedEntries(); | ||||
91 | Q_SIGNAL void changedEntriesChanged(); | ||||
51 | Q_SIGNALS: | 92 | Q_SIGNALS: | ||
52 | void message(const QString& message); | 93 | void message(const QString& message); | ||
53 | void idleMessage(const QString& message); | 94 | void idleMessage(const QString& message); | ||
54 | void busyMessage(const QString& message); | 95 | void busyMessage(const QString& message); | ||
55 | void errorMessage(const QString& message); | 96 | void errorMessage(const QString& message); | ||
56 | 97 | | |||
57 | private: | 98 | private: | ||
58 | class Private; | 99 | class Private; | ||
59 | Private* d; | 100 | Private* d; | ||
60 | }; | 101 | }; | ||
61 | 102 | | |||
62 | #endif//ENGINE_H | 103 | #endif//ENGINE_H |