Torc
0.1
|
A wrapper around a database setting. More...
#include <torcsetting.h>
Public Types | |
enum | Type { Bool, Integer, String, StringList, Group } |
enum | Role { None = (0 << 0), Persistent = (1 << 0), Public = (1 << 1) } |
Public Slots | |
void | SubscriberDeleted (QObject *Subscriber) |
QVariantMap | GetChildList (void) |
bool | SetValue (const QVariant &Value) |
bool | GetIsActive (void) |
void | SetActive (bool Value) |
QVariant | GetValue (void) |
QString | GetUiName (void) |
QString | GetHelpText (void) |
QVariant | GetDefaultValue (void) |
QString | GetSettingType (void) |
QVariantMap | GetSelections (void) |
int | GetBegin (void) |
int | GetEnd (void) |
int | GetStep (void) |
Signals | |
void | ValueChanged (int Value) |
void | ValueChanged (bool Value) |
void | ValueChanged (QString &Value) |
void | ValueChanged (QStringList &Value) |
void | ActiveChanged (bool Active) |
void | Removed (void) |
Public Member Functions | |
TorcSetting (TorcSetting *Parent, const QString &DBName, const QString &UIName, Type SettingType, Roles SettingRoles, const QVariant &Default) | |
void | Remove (void) |
void | SetActiveThreshold (int Threshold) |
void | SetHelpText (const QString &HelpText) |
void | SetRange (int Begin, int End, int Step) |
void | SetSelections (QVariantMap &Selections) |
Public Member Functions inherited from TorcHTTPService | |
TorcHTTPService (QObject *Parent, const QString &Signature, const QString &Name, const QMetaObject &MetaObject, const QString &Blacklist=QStringLiteral("")) | |
virtual | ~TorcHTTPService () |
void | ProcessHTTPRequest (const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request) override |
QVariantMap | ProcessRequest (const QString &Method, const QVariant &Parameters, QObject *Connection, bool Authenticated) override |
QString | GetMethod (int Index) |
QVariant | GetProperty (int Index) |
Get the value of a given property. More... | |
QVariantMap | GetServiceDetails (void) |
Return a QVariantMap describing the services methods and properties. More... | |
virtual QString | GetUIName (void) |
virtual QString | GetPresentationURL (void) |
Public Member Functions inherited from TorcHTTPHandler | |
TorcHTTPHandler (const QString &Signature, const QString &Name) | |
virtual | ~TorcHTTPHandler () |
QString | Signature (void) const |
bool | GetRecursive (void) const |
QString | Name (void) const |
Public Member Functions inherited from TorcReferenceCounter | |
TorcReferenceCounter (void) | |
virtual | ~TorcReferenceCounter (void)=default |
void | UpRef (void) |
virtual bool | DownRef (void) |
bool | IsShared (void) |
Protected Member Functions | |
virtual | ~TorcSetting ()=default |
QString | GetChildList (QVariantMap &Children) |
TorcSetting * | FindChild (const QString &Child, bool Recursive=false) |
QSet< TorcSetting * > | GetChildren (void) |
void | AddChild (TorcSetting *Child) |
void | RemoveChild (TorcSetting *Child) |
Protected Member Functions inherited from TorcHTTPService | |
void | HandleSubscriberDeleted (QObject *Subscriber) |
Properties | |
QVariant | value |
QString | uiName |
QString | helpText |
QVariant | defaultValue |
bool | isActive |
QString | settingType |
QVariantMap | selections |
Additional Inherited Members | |
Static Public Member Functions inherited from TorcReferenceCounter | |
static void | EventLoopEnding (bool Ending) |
Static Protected Member Functions inherited from TorcHTTPHandler | |
static bool | MethodIsAuthorised (TorcHTTPRequest &Request, int Allowed) |
Check the current request is authorised and set the authentication header if not. More... | |
static void | HandleOptions (TorcHTTPRequest &Request, int Allowed) |
static void | HandleFile (TorcHTTPRequest &Request, const QString &Filename, int Cache) |
Protected Attributes inherited from TorcHTTPService | |
QReadWriteLock | m_httpServiceLock |
Protected Attributes inherited from TorcHTTPHandler | |
QString | m_signature |
bool | m_recursive |
QString | m_name |
Protected Attributes inherited from TorcReferenceCounter | |
QAtomicInt | m_refCount |
Static Protected Attributes inherited from TorcReferenceCounter | |
static bool | m_eventLoopEnding = false |
A wrapper around a database setting.
TorcSetting acts as a wrapper around a persistent (stored in a database) or temporary (system/state dependant) setting.
Setting storage types are currently limited to Int, Bool, String or StringList but could be extended to any QVariant supported type that can be converted to a string and hence easily stored within the database.
The setting type describes the setting's behaviour.
TorcSetting additionally acts as a state machine. It can be activated by other settings and QObjects and can notify other objects of any change to its value.
A class can create and connect a number of TorcSettings to encapsulate the desired setting behaviour and allow the setting structure to be presented and manipulated by an appropriate user facing interface.
Definition at line 15 of file torcsetting.h.
enum TorcSetting::Role |
Enumerator | |
---|---|
None | |
Persistent | |
Public |
Definition at line 27 of file torcsetting.h.
enum TorcSetting::Type |
Enumerator | |
---|---|
Bool | |
Integer | |
String | |
StringList | |
Group |
Definition at line 18 of file torcsetting.h.
TorcSetting::TorcSetting | ( | TorcSetting * | Parent, |
const QString & | DBName, | ||
const QString & | UIName, | ||
Type | SettingType, | ||
Roles | SettingRoles, | ||
const QVariant & | Default | ||
) |
Definition at line 50 of file torcsetting.cpp.
|
protectedvirtualdefault |
|
signal |
|
protected |
Definition at line 158 of file torcsetting.cpp.
|
protected |
Definition at line 196 of file torcsetting.cpp.
|
slot |
Definition at line 262 of file torcsetting.cpp.
|
slot |
Definition at line 119 of file torcsetting.cpp.
|
protected |
Definition at line 128 of file torcsetting.cpp.
|
protected |
Definition at line 217 of file torcsetting.cpp.
|
slot |
Definition at line 250 of file torcsetting.cpp.
|
slot |
Definition at line 268 of file torcsetting.cpp.
|
slot |
Definition at line 244 of file torcsetting.cpp.
|
slot |
Definition at line 232 of file torcsetting.cpp.
|
slot |
Definition at line 146 of file torcsetting.cpp.
|
slot |
Definition at line 256 of file torcsetting.cpp.
|
slot |
Definition at line 274 of file torcsetting.cpp.
|
slot |
Definition at line 238 of file torcsetting.cpp.
|
slot |
Definition at line 398 of file torcsetting.cpp.
void TorcSetting::Remove | ( | void | ) |
Definition at line 187 of file torcsetting.cpp.
|
protected |
Definition at line 167 of file torcsetting.cpp.
|
signal |
|
slot |
Definition at line 280 of file torcsetting.cpp.
void TorcSetting::SetActiveThreshold | ( | int | Threshold | ) |
Definition at line 294 of file torcsetting.cpp.
void TorcSetting::SetHelpText | ( | const QString & | HelpText | ) |
Definition at line 392 of file torcsetting.cpp.
void TorcSetting::SetRange | ( | int | Begin, |
int | End, | ||
int | Step | ||
) |
Definition at line 374 of file torcsetting.cpp.
void TorcSetting::SetSelections | ( | QVariantMap & | Selections | ) |
Definition at line 152 of file torcsetting.cpp.
|
slot |
Definition at line 308 of file torcsetting.cpp.
|
slot |
Definition at line 114 of file torcsetting.cpp.
|
signal |
|
signal |
|
signal |
|
signal |
|
read |
Definition at line 49 of file torcsetting.h.
|
read |
Definition at line 48 of file torcsetting.h.
|
read |
Definition at line 50 of file torcsetting.h.
|
read |
Definition at line 52 of file torcsetting.h.
|
read |
Definition at line 51 of file torcsetting.h.
|
read |
Definition at line 47 of file torcsetting.h.
|
read |
Definition at line 46 of file torcsetting.h.