KNewStuff

quickengine.h
1 /*
2  SPDX-FileCopyrightText: 2016 Dan Leinir Turthra Jensen <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #ifndef ENGINE_H
8 #define ENGINE_H
9 
10 #include <QObject>
11 #include <QQmlListProperty>
12 
13 #include "entrywrapper.h"
14 
23 class Engine : public QObject
24 {
25  Q_OBJECT
26  Q_PROPERTY(bool allowedByKiosk READ allowedByKiosk CONSTANT)
27  Q_PROPERTY(QString configFile READ configFile WRITE setConfigFile NOTIFY configFileChanged)
28  Q_PROPERTY(QObject* engine READ engine NOTIFY engineChanged)
34  Q_PROPERTY(bool hasAdoptionCommand READ hasAdoptionCommand NOTIFY engineInitialized)
35  Q_PROPERTY(QString name READ name NOTIFY engineInitialized)
36  Q_PROPERTY(QObject* categories READ categories NOTIFY categoriesChanged)
37  Q_PROPERTY(QStringList categoriesFilter READ categoriesFilter WRITE setCategoriesFilter RESET resetCategoriesFilter NOTIFY categoriesFilterChanged)
38  Q_PROPERTY(int filter READ filter WRITE setFilter NOTIFY filterChanged)
39  Q_PROPERTY(int sortOrder READ sortOrder WRITE setSortOrder NOTIFY sortOrderChanged)
40  Q_PROPERTY(QString searchTerm READ searchTerm WRITE setSearchTerm RESET resetSearchTerm NOTIFY searchTermChanged)
41  Q_PROPERTY(QQmlListProperty<KNSCore::EntryWrapper> changedEntries READ changedEntries NOTIFY changedEntriesChanged)
42  Q_PROPERTY(int changedEntriesCount READ changedEntriesCount NOTIFY changedEntriesChanged)
43 public:
44  explicit Engine(QObject *parent = nullptr);
45  virtual ~Engine();
46 
47  bool allowedByKiosk() const;
48 
49  QString configFile() const;
50  void setConfigFile(const QString &newFile);
51  Q_SIGNAL void configFileChanged();
52 
53  QObject *engine() const;
54  Q_SIGNAL void engineChanged();
55 
60  bool isLoading() const;
66 
67  bool hasAdoptionCommand() const;
68  QString name() const;
69  Q_SIGNAL void engineInitialized();
70 
71  QObject *categories() const;
72  Q_SIGNAL void categoriesChanged();
73 
74  QStringList categoriesFilter() const;
75  void setCategoriesFilter(const QStringList &newCategoriesFilter);
76  Q_INVOKABLE void resetCategoriesFilter();
77  Q_SIGNAL void categoriesFilterChanged();
78 
79  int filter() const;
80  void setFilter(int newFilter);
81  Q_SIGNAL void filterChanged();
82 
83  int sortOrder() const;
84  void setSortOrder(int newSortOrder);
85  Q_SIGNAL void sortOrderChanged();
86 
87  QString searchTerm() const;
88  void setSearchTerm(const QString &newSearchTerm);
89  Q_INVOKABLE void resetSearchTerm();
90  Q_SIGNAL void searchTermChanged();
91 
92  QQmlListProperty<KNSCore::EntryWrapper> changedEntries();
93  Q_INVOKABLE void resetChangedEntries();
94  Q_SIGNAL void changedEntriesChanged();
95  int changedEntriesCount() const;
96 Q_SIGNALS:
97  void message(const QString &message);
98  void idleMessage(const QString &message);
99  void busyMessage(const QString &message);
100  void errorMessage(const QString &message);
101 
102 private:
103  class Private;
104  Private *d;
105 };
106 
107 #endif//ENGINE_H
Contains the core functionality for handling interaction with NewStuff providers. ...
Q_SIGNAL void isLoadingChanged()
Fired when the isLoading value changes.
Encapsulates a KNSCore::Engine for use in Qt Quick.
Definition: quickengine.h:23
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALQ_SIGNAL
bool isLoading() const
Whether or not the engine is performing its initial loading operations.
Q_INVOKABLEQ_INVOKABLE
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 11 2020 22:43:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.