Engine

Search for usage in LXR

#include <quickengine.h>

Inheritance diagram for Engine:

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 }
 
- Public Types inherited from KNSCore::EngineBase
enum class  ContentWarningType { Static , Executables }
 

Properties

QString busyMessage
 
BusyState busyState
 
CategoriesModelcategories
 
QStringList categoriesFilter
 
QString configFile
 
KNSCore::Provider::Filter filter
 
bool hasAdoptionCommand
 
bool isLoading
 
bool isValid
 
QString name
 
bool needsLazyLoadSpinner
 
SearchPresetModelsearchPresetModel
 
QString searchTerm
 
KNSCore::Provider::SortMode sortOrder
 
- Properties inherited from KNSCore::EngineBase
ContentWarningType contentWarningType
 
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)
 

Public Member Functions

 Engine (QObject *parent=nullptr)
 
Q_INVOKABLE KNSCore::Entry __createEntry (const QString &providerId, const QString &entryId)
 
void addProvider (QSharedPointer< KNSCore::Provider > provider) override
 
Q_INVOKABLE void adoptEntry (const KNSCore::Entry &entry)
 
QString busyMessage () const
 
Engine::BusyState busyState () const
 
Q_SIGNAL void busyStateChanged ()
 
CategoriesModelcategories () const
 
Q_SIGNAL void categoriesChanged ()
 
QStringList categoriesFilter () const
 
Q_SIGNAL void categoriesFilterChanged ()
 
QString configFile () const
 
Q_SIGNAL void configFileChanged ()
 
KNSCore::Provider::Filter filter () const
 
Q_SIGNAL void filterChanged ()
 
Q_INVOKABLE void install (const KNSCore::Entry &entry, int linkId=1)
 
bool isLoading () const
 
bool isValid ()
 
void loadPreview (const KNSCore::Entry &entry, KNSCore::Entry::PreviewType type)
 
void reloadEntries ()
 
void requestMoreData ()
 
Q_INVOKABLE void resetCategoriesFilter ()
 
Q_INVOKABLE void resetSearchTerm ()
 
Q_INVOKABLE void restoreSearch ()
 
Q_INVOKABLE void revalidateCacheEntries ()
 
SearchPresetModelsearchPresetModel () const
 
Q_SIGNAL void searchPresetModelChanged ()
 
QString searchTerm () const
 
Q_SIGNAL void searchTermChanged ()
 
void setBusyState (Engine::BusyState state)
 
void setCategoriesFilter (const QStringList &newCategoriesFilter)
 
void setConfigFile (const QString &newFile)
 
void setFilter (KNSCore::Provider::Filter filter)
 
void setSearchTerm (const QString &newSearchTerm)
 
void setSortOrder (KNSCore::Provider::SortMode newSortOrder)
 
KNSCore::Provider::SortMode sortOrder () const
 
Q_SIGNAL void sortOrderChanged ()
 
Q_INVOKABLE void storeSearch ()
 
Q_INVOKABLE void uninstall (const KNSCore::Entry &entry)
 
Q_INVOKABLE void updateEntryContents (const KNSCore::Entry &entry)
 
- Public Member Functions inherited from KNSCore::EngineBase
 EngineBase (QObject *parent=nullptr)
 
void addDownloadTagFilter (const QString &filter)
 
void addTagFilter (const QString &filter)
 
QList< Attica::Provider * > atticaProviders () const
 
void becomeFan (const Entry &entry)
 
QSharedPointer< Cache > cache () const
 
QStringList categories () const
 
QList< Provider::CategoryMetadatacategoriesMetadata ()
 
ContentWarningType contentWarningType () const
 
Q_SIGNAL void contentWarningTypeChanged ()
 
QSharedPointer< ProviderdefaultProvider () const
 
QStringList downloadTagFilter () const
 
bool hasAdoptionCommand () const
 
QString name () const
 
QSharedPointer< Providerprovider (const QString &providerId) const
 
QStringList providerIDs () const
 
ResultsStreamsearch (const KNSCore::Provider::SearchRequest &request)
 
QList< Provider::SearchPresetsearchPresets ()
 
void setDownloadTagFilter (const QStringList &filter)
 
void setTagFilter (const QStringList &filter)
 
QStringList tagFilter () const
 
bool uploadEnabled () const
 
Q_SIGNAL void uploadEnabledChanged ()
 
QString useLabel () const
 
Q_SIGNAL void useLabelChanged ()
 
bool userCanBecomeFan (const Entry &entry)
 
bool userCanVote (const Entry &entry)
 
void vote (const Entry &entry, uint rating)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Static Public Member Functions inherited from KNSCore::EngineBase
static QStringList availableConfigFiles ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from KNSCore::EngineBase
Installation * installation () const
 
QList< QSharedPointer< Provider > > providers () const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Attributes inherited from KNSCore::EngineBase
std::unique_ptr< EngineBasePrivated
 

Detailed Description

KNSCore::EngineBase for interfacing with QML.

See also
ItemsModel

Definition at line 28 of file quickengine.h.

Member Typedef Documentation

◆ BusyState

typedef QFlags< BusyOperation > Engine::BusyState

Definition at line 62 of file quickengine.h.

Member Enumeration Documentation

◆ BusyOperation

enum class Engine::BusyOperation
strong

Definition at line 56 of file quickengine.h.

◆ EntryEvent

enum Engine::EntryEvent

Definition at line 65 of file quickengine.h.

Property Documentation

◆ busyMessage

QString Engine::busyMessage
read

Definition at line 51 of file quickengine.h.

◆ busyState

BusyState Engine::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 50 of file quickengine.h.

◆ categories

CategoriesModel * Engine::categories
read

Definition at line 38 of file quickengine.h.

◆ categoriesFilter

QStringList Engine::categoriesFilter
readwrite

Definition at line 39 of file quickengine.h.

◆ configFile

QString Engine::configFile
readwrite

Definition at line 31 of file quickengine.h.

◆ filter

KNSCore::Provider::Filter Engine::filter
readwrite

Definition at line 40 of file quickengine.h.

◆ hasAdoptionCommand

bool Engine::hasAdoptionCommand
read

Definition at line 34 of file quickengine.h.

◆ isLoading

bool Engine::isLoading
read

Definition at line 32 of file quickengine.h.

◆ isValid

bool Engine::isValid
read

Definition at line 36 of file quickengine.h.

◆ name

QString Engine::name
read

Definition at line 35 of file quickengine.h.

◆ needsLazyLoadSpinner

bool Engine::needsLazyLoadSpinner
read

Definition at line 33 of file quickengine.h.

◆ searchPresetModel

SearchPresetModel * Engine::searchPresetModel
read

Definition at line 43 of file quickengine.h.

◆ searchTerm

QString Engine::searchTerm
readwrite

Definition at line 42 of file quickengine.h.

◆ sortOrder

KNSCore::Provider::SortMode Engine::sortOrder
readwrite

Definition at line 41 of file quickengine.h.

Constructor & Destructor Documentation

◆ Engine()

Engine::Engine ( QObject * parent = nullptr)
explicit

Definition at line 46 of file quickengine.cpp.

Member Function Documentation

◆ __createEntry()

Q_INVOKABLE KNSCore::Entry Engine::__createEntry ( const QString & providerId,
const QString & entryId )
inline

Definition at line 128 of file quickengine.h.

◆ addProvider()

void Engine::addProvider ( QSharedPointer< KNSCore::Provider > provider)
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
entryEntry 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()

Q_SIGNAL void Engine::busyStateChanged ( )

Signal gets emitted when the busy state changes.

Since
5.74

◆ categories()

CategoriesModel * 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

void Engine::entryEvent ( const KNSCore::Entry & entry,
KNSCore::Entry::EntryEvent event )
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:

function onEntryEvent(entry, event) {
if (event == NewStuff.Engine.StatusChangedEvent) {
myModel.ghnsEntryChanged(entry);
}
}
virtual bool event(QEvent *e)

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

void Engine::errorCode ( KNSCore::ErrorCode::ErrorCode errorCode,
const QString & message,
const QVariant & metadata )
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
errorCodeRepresents the specific type of error which has occurred
messageA human-readable message which can be shown to the end user
metadataAny 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
entryEntry to be installed
See also
signalInstallationFinished
signalInstallationFailed

Definition at line 376 of file quickengine.cpp.

◆ isLoading()

bool Engine::isLoading ( ) const
inline

Whether or not the engine is performing its initial loading operations.

Since
5.65

Definition at line 91 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()

Q_INVOKABLE void Engine::resetCategoriesFilter ( )
inline

Definition at line 102 of file quickengine.h.

◆ resetSearchTerm()

Q_INVOKABLE void Engine::resetSearchTerm ( )
inline

Definition at line 118 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()

SearchPresetModel * 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()

void Engine::setConfigFile ( const QString & newFile)

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()

void Engine::setSearchTerm ( const QString & newSearchTerm)

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

void Engine::signalEntryEvent ( const KNSCore::Entry & entry,
KNSCore::Entry::EntryEvent event )
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
entryThe 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:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:52:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.