Engine
#include <quickengine.h>
Public Types | |
enum class | BusyOperation { Initializing = 1 , LoadingData , LoadingPreview , InstallingEntry } |
typedef QFlags< BusyOperation > | BusyState |
enum | EntryEvent { UnknownEvent = KNSCore::Entry::UnknownEvent , StatusChangedEvent = KNSCore::Entry::StatusChangedEvent , AdoptedEvent = KNSCore::Entry::AdoptedEvent , DetailsLoadedEvent = KNSCore::Entry::DetailsLoadedEvent } |
Properties | |
QString | busyMessage |
BusyState | busyState |
QObject * | categories |
QStringList | categoriesFilter |
QString | configFile |
KNSCore::Provider::Filter | filter |
bool | hasAdoptionCommand |
bool | isLoading |
bool | isValid |
QString | name |
bool | needsLazyLoadSpinner |
QObject * | searchPresetModel |
QString | searchTerm |
KNSCore::Provider::SortMode | sortOrder |
Properties inherited from KNSCore::EngineBase | |
QStringList | providerIDs |
bool | uploadEnabled |
QString | useLabel |
Properties inherited from QObject | |
objectName | |
Signals | |
void | entryEvent (const KNSCore::Entry &entry, KNSCore::Entry::EntryEvent event) |
void | entryPreviewLoaded (const KNSCore::Entry &, KNSCore::Entry::PreviewType) |
void | errorCode (KNSCore::ErrorCode::ErrorCode errorCode, const QString &message, const QVariant &metadata) |
void | signalEntriesLoaded (const KNSCore::Entry::List &entries) |
void | signalEntryEvent (const KNSCore::Entry &entry, KNSCore::Entry::EntryEvent event) |
void | signalResetView () |
Signals inherited from KNSCore::EngineBase | |
void | loadingProvider () |
void | providersChanged () |
void | signalCategoriesMetadataLoded (const QList< Provider::CategoryMetadata > &categories) |
void | signalErrorCode (KNSCore::ErrorCode::ErrorCode errorCode, const QString &message, const QVariant &metadata) |
void | signalMessage (const QString &message) |
void | signalProvidersLoaded () |
void | signalSearchPresetsLoaded (const QList< Provider::SearchPreset > &presets) |
Detailed Description
KNSCore::EngineBase for interfacing with QML.
- See also
- ItemsModel
Definition at line 26 of file quickengine.h.
Member Typedef Documentation
◆ BusyState
typedef QFlags< BusyOperation > Engine::BusyState |
Definition at line 60 of file quickengine.h.
Member Enumeration Documentation
◆ BusyOperation
Definition at line 54 of file quickengine.h.
◆ EntryEvent
enum Engine::EntryEvent |
Definition at line 63 of file quickengine.h.
Property Documentation
◆ busyMessage
|
read |
Definition at line 49 of file quickengine.h.
◆ busyState
|
readwrite |
Current state of the engine, the state con contain multiple operations an empty BusyState represents the idle status.
- Since
- 5.74
Definition at line 48 of file quickengine.h.
◆ categories
|
read |
Definition at line 36 of file quickengine.h.
◆ categoriesFilter
|
readwrite |
Definition at line 37 of file quickengine.h.
◆ configFile
|
readwrite |
Definition at line 29 of file quickengine.h.
◆ filter
|
readwrite |
Definition at line 38 of file quickengine.h.
◆ hasAdoptionCommand
|
read |
Definition at line 32 of file quickengine.h.
◆ isLoading
|
read |
Definition at line 30 of file quickengine.h.
◆ isValid
|
read |
Definition at line 34 of file quickengine.h.
◆ name
|
read |
Definition at line 33 of file quickengine.h.
◆ needsLazyLoadSpinner
|
read |
Definition at line 31 of file quickengine.h.
◆ searchPresetModel
|
read |
Definition at line 41 of file quickengine.h.
◆ searchTerm
|
readwrite |
Definition at line 40 of file quickengine.h.
◆ sortOrder
|
readwrite |
Definition at line 39 of file quickengine.h.
Constructor & Destructor Documentation
◆ Engine()
Definition at line 46 of file quickengine.cpp.
Member Function Documentation
◆ __createEntry()
|
inline |
Definition at line 126 of file quickengine.h.
◆ addProvider()
|
overridevirtual |
Add a provider and connect it to the right slots.
Reimplemented from KNSCore::EngineBase.
Definition at line 329 of file quickengine.cpp.
◆ adoptEntry()
void Engine::adoptEntry | ( | const KNSCore::Entry & | entry | ) |
Adopt an entry using the adoption command.
This will also take care of displaying error messages
- Parameters
-
entry Entry that should be adopted
- See also
- signalErrorCode
- signalEntryEvent
- Since
- 5.77
Definition at line 372 of file quickengine.cpp.
◆ busyMessage()
QString Engine::busyMessage | ( | ) | const |
Definition at line 165 of file quickengine.cpp.
◆ busyState()
Engine::BusyState Engine::busyState | ( | ) | const |
Definition at line 161 of file quickengine.cpp.
◆ busyStateChanged()
Signal gets emitted when the busy state changes.
- Since
- 5.74
◆ categories()
QObject * Engine::categories | ( | ) | const |
Definition at line 199 of file quickengine.cpp.
◆ categoriesFilter()
QStringList Engine::categoriesFilter | ( | ) | const |
Definition at line 204 of file quickengine.cpp.
◆ configFile()
QString Engine::configFile | ( | ) | const |
Definition at line 170 of file quickengine.cpp.
◆ entryEvent
|
signal |
This is fired for events related directly to a single Entry instance The intermediate states Updating and Installing are not forwarded.
In case you need those you have to listen to the signals of the KNSCore::Engine instance of the engine property.
As an example, if you need to know when the status of an entry changes, you might write:
nb: The above example is also how one would port a handler for the old changedEntries signal
- See also
- Entry::EntryEvent for details on which specific event is being notified
◆ errorCode
|
signal |
Fires in the case of any critical or serious errors, such as network or API problems.
This forwards the signal from KNSCore::Engine::signalErrorCode, but with QML friendly enumerations.
- Parameters
-
errorCode Represents the specific type of error which has occurred message A human-readable message which can be shown to the end user metadata Any additional data which might be hepful to further work out the details of the error (see KNSCore::Entry::ErrorCode for the metadata details)
- See also
- KNSCore::Engine::signalErrorCode
- Since
- 5.84
◆ filter()
KNSCore::Provider::Filter Engine::filter | ( | ) | const |
Definition at line 218 of file quickengine.cpp.
◆ install()
void Engine::install | ( | const KNSCore::Entry & | entry, |
int | linkId = 1 ) |
Installs an entry's payload file.
This includes verification, if necessary, as well as decompression and other steps according to the application's *.knsrc file.
- Parameters
-
entry Entry to be installed
- See also
- signalInstallationFinished
- signalInstallationFailed
Definition at line 376 of file quickengine.cpp.
◆ isLoading()
|
inline |
Whether or not the engine is performing its initial loading operations.
- Since
- 5.65
Definition at line 89 of file quickengine.h.
◆ loadPreview()
void Engine::loadPreview | ( | const KNSCore::Entry & | entry, |
KNSCore::Entry::PreviewType | type ) |
Definition at line 351 of file quickengine.cpp.
◆ reloadEntries()
void Engine::reloadEntries | ( | ) |
Definition at line 285 of file quickengine.cpp.
◆ requestMoreData()
void Engine::requestMoreData | ( | ) |
Definition at line 395 of file quickengine.cpp.
◆ resetCategoriesFilter()
|
inline |
Definition at line 100 of file quickengine.h.
◆ resetSearchTerm()
|
inline |
Definition at line 116 of file quickengine.h.
◆ restoreSearch()
void Engine::restoreSearch | ( | ) |
Definition at line 442 of file quickengine.cpp.
◆ revalidateCacheEntries()
void Engine::revalidateCacheEntries | ( | ) |
Definition at line 418 of file quickengine.cpp.
◆ searchPresetModel()
QObject * Engine::searchPresetModel | ( | ) | const |
Definition at line 265 of file quickengine.cpp.
◆ searchTerm()
QString Engine::searchTerm | ( | ) | const |
Definition at line 246 of file quickengine.cpp.
◆ setBusyState()
void Engine::setBusyState | ( | Engine::BusyState | state | ) |
Definition at line 156 of file quickengine.cpp.
◆ setCategoriesFilter()
void Engine::setCategoriesFilter | ( | const QStringList & | newCategoriesFilter | ) |
Definition at line 209 of file quickengine.cpp.
◆ setConfigFile()
Definition at line 175 of file quickengine.cpp.
◆ setFilter()
void Engine::setFilter | ( | KNSCore::Provider::Filter | filter | ) |
Definition at line 223 of file quickengine.cpp.
◆ setSearchTerm()
Definition at line 251 of file quickengine.cpp.
◆ setSortOrder()
void Engine::setSortOrder | ( | KNSCore::Provider::SortMode | newSortOrder | ) |
Definition at line 237 of file quickengine.cpp.
◆ signalEntryEvent
|
signal |
◆ sortOrder()
KNSCore::Provider::SortMode Engine::sortOrder | ( | ) | const |
Definition at line 232 of file quickengine.cpp.
◆ storeSearch()
void Engine::storeSearch | ( | ) |
Definition at line 458 of file quickengine.cpp.
◆ uninstall()
void Engine::uninstall | ( | const KNSCore::Entry & | entry | ) |
Uninstalls an entry.
It reverses the steps which were performed during the installation.
- Parameters
-
entry The entry to deinstall
Definition at line 384 of file quickengine.cpp.
◆ updateEntryContents()
void Engine::updateEntryContents | ( | const KNSCore::Entry & | entry | ) |
Definition at line 275 of file quickengine.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:21:35 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.