KSysGuard::SensorFaceController

Search for usage in LXR

KSysGuard::SensorFaceController Class Reference

#include <SensorFaceController.h>

Inheritance diagram for KSysGuard::SensorFaceController:

Properties

QQuickItem appearanceConfigUi
 
QAbstractItemModel availableFacesModel
 
QAbstractItemModel availablePresetsModel
 
QQuickItem compactRepresentation
 
QQuickItem faceConfigUi
 
KConfigPropertyMap faceConfiguration
 
QString faceId
 
QQuickItem fullRepresentation
 
QJsonArray highPrioritySensorIds
 
QString icon
 
QJsonArray lowPrioritySensorIds
 
int maxTotalSensors
 
QJsonArray missingSensors
 
QString name
 
QVariantMap sensorColors
 
QVariantMap sensorLabels
 
QQuickItem sensorsConfigUi
 
bool showTitle
 
bool supportsLowPrioritySensors
 
bool supportsSensorsColors
 
bool supportsTotalSensors
 
QString title
 
QJsonArray totalSensors
 
int updateRateLimit
 
- Properties inherited from QObject
 objectName
 

Signals

void faceConfigurationChanged ()
 
void faceIdChanged ()
 
void highPrioritySensorIdsChanged ()
 
void lowPrioritySensorIdsChanged ()
 
void missingSensorsChanged ()
 
void sensorColorsChanged ()
 
void sensorLabelsChanged ()
 
void sensorsChanged ()
 
void showTitleChanged ()
 
void titleChanged ()
 
void totalSensorsChanged ()
 
void updateRateLimitChanged ()
 

Public Member Functions

 SensorFaceController (KConfigGroup &config, QQmlEngine *engine)
 
QQuickItemappearanceConfigUi ()
 
QAbstractItemModelavailableFacesModel ()
 
QAbstractItemModelavailablePresetsModel ()
 
QQuickItemcompactRepresentation ()
 
KConfigGroup configGroup () const
 
QQuickItemfaceConfigUi ()
 
KConfigPropertyMapfaceConfiguration () const
 
QString faceId () const
 
QQuickItemfullRepresentation ()
 
QJsonArray highPrioritySensorIds () const
 
const QString icon () const
 
Q_INVOKABLE void loadPreset (const QString &preset)
 
QJsonArray lowPrioritySensorIds () const
 
int maxTotalSensors () const
 
QJsonArray missingSensors () const
 
QString name () const
 
Q_INVOKABLE void reloadConfig ()
 
Q_INVOKABLE void reloadFaceConfiguration ()
 
Q_INVOKABLE void replaceSensors (const QString &from, const QString &to)
 
Q_INVOKABLE void savePreset ()
 
QVariantMap sensorColors () const
 
QVariantMap sensorLabels () const
 
QJsonArray sensors () const
 
QQuickItemsensorsConfigUi ()
 
void setFaceId (const QString &face)
 
void setHighPrioritySensorIds (const QJsonArray &ids)
 
void setLowPrioritySensorIds (const QJsonArray &ids)
 
void setSensorColors (const QVariantMap &colors)
 
void setSensorLabels (const QVariantMap &labels)
 
void setShouldSync (bool sync)
 
void setShowTitle (bool show)
 
void setTitle (const QString &title)
 
void setTotalSensors (const QJsonArray &sensor)
 
void setUpdateRateLimit (int limit)
 
bool shouldSync () const
 
bool showTitle () const
 
bool supportsLowPrioritySensors () const
 
bool supportsSensorsColors () const
 
bool supportsTotalSensors () const
 
QString title () const
 
QJsonArray totalSensors () const
 
Q_INVOKABLE void uninstallPreset (const QString &pluginId)
 
int updateRateLimit () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
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 ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
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 QRegExp &regExp, 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
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
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_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 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
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
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 setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- 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)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- 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)
 

Detailed Description

The SensorFaceController links sensor faces and applications in which these faces are shown.

It abstracts the configuration and properties of faces.

For faces it offers information about which sensors should be displayed and hints set by the application about how the information should be displayed. It can be accessed by faces using the SensorFace::controller property.

Applications can use this class to instantiate faces from a given config and for querying the capabilities of faces.

Since
5.19

Definition at line 41 of file SensorFaceController.h.

Property Documentation

◆ appearanceConfigUi

QQuickItem * SensorFaceController::appearanceConfigUi
read

A user interface for configuring the general appearance of a face like the title and the used face.

Emits configurationChanged if a config value changed. To apply the changes call saveConfig on it.

Definition at line 138 of file SensorFaceController.h.

◆ availableFacesModel

QAbstractItemModel * SensorFaceController::availableFacesModel
read

A list of all available faces.

The name is available as the display role and the id as pluginId

Definition at line 149 of file SensorFaceController.h.

◆ availablePresetsModel

QAbstractItemModel * SensorFaceController::availablePresetsModel
read

A list of available face presets.

The name is available as the display role, the id as pluginId. The properties of the preset can be accessed via the config role.

Definition at line 154 of file SensorFaceController.h.

◆ compactRepresentation

QQuickItem * SensorFaceController::compactRepresentation
read

The compact representation of the current face.

Typically only includes the main visualization of the data without legend, title, etc.

Definition at line 124 of file SensorFaceController.h.

◆ faceConfigUi

QQuickItem * SensorFaceController::faceConfigUi
read

A user interface that is suited for configuring the face specific options.

Emits configurationChanged if a config value changed. To apply the changes call saveConfig on it.

See also
faceConfiguration

Definition at line 131 of file SensorFaceController.h.

◆ faceConfiguration

KConfigPropertyMap * SensorFaceController::faceConfiguration
read

A map of config options and values that are specific to the current face as defined by the main.xml of the face.

See also
faceConfigUi

Definition at line 113 of file SensorFaceController.h.

◆ faceId

QString SensorFaceController::faceId
readwrite

The id of the current face.

For example org.kde.ksysguard.textonly

Definition at line 56 of file SensorFaceController.h.

◆ fullRepresentation

QQuickItem * SensorFaceController::fullRepresentation
read

The full representation of the current face.

Typically includes additional elements like a legend or title

Definition at line 119 of file SensorFaceController.h.

◆ highPrioritySensorIds

QJsonArray SensorFaceController::highPrioritySensorIds
readwrite

Sensors that should always be shown in the face.

This is the main list of sensors that are of the most interest.

Definition at line 66 of file SensorFaceController.h.

◆ icon

const QString SensorFaceController::icon
read

The icon of the current face.

Definition at line 91 of file SensorFaceController.h.

◆ lowPrioritySensorIds

QJsonArray SensorFaceController::lowPrioritySensorIds
readwrite

Secondary list of sensors.

These sensors do not necessarily appear in main part of the face. For example in most faces they are just added to the legend.

Definition at line 82 of file SensorFaceController.h.

◆ maxTotalSensors

int SensorFaceController::maxTotalSensors
read

The amount of total sensors the current face supports.

Definition at line 107 of file SensorFaceController.h.

◆ missingSensors

QJsonArray KSysGuard::SensorFaceController::missingSensors
read

Contains the paths of missing sensors, if there are any.

Definition at line 162 of file SensorFaceController.h.

◆ name

QString SensorFaceController::name
read

The name of the current face.

Definition at line 87 of file SensorFaceController.h.

◆ sensorColors

QVariantMap SensorFaceController::sensorColors
readwrite

Maps sensorIds to colors that can be used when a color for something relating to a specific sensor is needed.

Definition at line 71 of file SensorFaceController.h.

◆ sensorLabels

QVariantMap SensorFaceController::sensorLabels
readwrite

Maps sensorIds to user configurable labels than should be displayed instead of the name of the sensor.

Definition at line 76 of file SensorFaceController.h.

◆ sensorsConfigUi

QQuickItem * SensorFaceController::sensorsConfigUi
read

A user interface for configuring which sensors are displayed in a face Emits configurationChanged if a config value changed.

To apply the changes call saveConfig on it.

Definition at line 144 of file SensorFaceController.h.

◆ showTitle

bool SensorFaceController::showTitle
readwrite

Whether the title should be displayed or if it should be hidden instead.

See also
title

Definition at line 52 of file SensorFaceController.h.

◆ supportsLowPrioritySensors

bool SensorFaceController::supportsLowPrioritySensors
read

Whether the current face can display low priority sensors.

Definition at line 103 of file SensorFaceController.h.

◆ supportsSensorsColors

bool SensorFaceController::supportsSensorsColors
read

Whether the current face supports sensor colors.

Definition at line 95 of file SensorFaceController.h.

◆ supportsTotalSensors

bool SensorFaceController::supportsTotalSensors
read

Whether the current face can display total sensors.

Definition at line 99 of file SensorFaceController.h.

◆ title

QString SensorFaceController::title
readwrite

A title for the face.

See also
showTitle

Definition at line 48 of file SensorFaceController.h.

◆ totalSensors

QJsonArray SensorFaceController::totalSensors
readwrite

Sensors that are typically used to display a total in some way or form.

For example in the pie char face they are not drawn as part of the chart but appear in the centre of it.

Definition at line 61 of file SensorFaceController.h.

◆ updateRateLimit

int SensorFaceController::updateRateLimit
readwrite

The minimum time that needs to elapse, in milliseconds, between updates of the face.

Definition at line 158 of file SensorFaceController.h.

Constructor & Destructor Documentation

◆ SensorFaceController()

SensorFaceController::SensorFaceController ( KConfigGroup config,
QQmlEngine engine 
)

Creates a new SensorFaceController.

This is only useful for applications that want display SensorFaces.

SensorFaces can access the controller that created them using their SensorFace::controller property.

Parameters
configThe controller uses this config group to read and save the face configuration
engineThis engine will be used for creating the Qml components

Definition at line 362 of file SensorFaceController.cpp.

Member Function Documentation

◆ configGroup()

KConfigGroup KSysGuard::SensorFaceController::configGroup ( ) const

Retrieve the KConfigGroup this controller is using to store configuration.

This is primarily intended to allow adding child groups to the face configuration.

Definition at line 422 of file SensorFaceController.cpp.

◆ loadPreset()

void SensorFaceController::loadPreset ( const QString preset)

Loads a specific preset.

See also
availablePresetsModel

Definition at line 848 of file SensorFaceController.cpp.

◆ reloadConfig()

void SensorFaceController::reloadConfig ( )

Reload the configuration.

Definition at line 817 of file SensorFaceController.cpp.

◆ reloadFaceConfiguration()

void SensorFaceController::reloadFaceConfiguration ( )

Reload only the face configuration.

This does not touch sensors, colors or anything else, only the config loaded from the face package is reloaded.

Definition at line 1036 of file SensorFaceController.cpp.

◆ replaceSensors()

void KSysGuard::SensorFaceController::replaceSensors ( const QString from,
const QString to 
)

Replace one sensor with another.

This replaces a configured sensor with a new one. This replacement happens inside the configuration, bypassing thing like the sensor properties which are populated with resolved sensor ids rather than the configured entries.

You should call reloadConfig once you have made all replacements.

Definition at line 1065 of file SensorFaceController.cpp.

◆ savePreset()

void SensorFaceController::savePreset ( )

Save the current configuration as a preset.

Definition at line 905 of file SensorFaceController.cpp.

◆ setShouldSync()

void SensorFaceController::setShouldSync ( bool  sync)

Specifies if the controller should automatically sync configuration changes.

Parameters
syncIf true applied config changes are written to the KConfigGroup that was specified in the constructor. If false config changes are applied after calling saveConfig on a configuration ui but not written to the KConfigGroup.

Definition at line 1028 of file SensorFaceController.cpp.

◆ shouldSync()

bool SensorFaceController::shouldSync ( ) const

Whether the controller should sync configuration changes.

See also
setShouldSync

Definition at line 1023 of file SensorFaceController.cpp.

◆ uninstallPreset()

void SensorFaceController::uninstallPreset ( const QString pluginId)

Uninstall a specific preset.

Definition at line 1006 of file SensorFaceController.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:18:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.