MessageList::Core::OptionSet
#include <optionset.h>
Public Member Functions | |
OptionSet (const OptionSet &src) | |
OptionSet (const QString &name, const QString &description, bool readOnly=false) | |
const QString & | description () const |
void | generateUniqueId () |
const QString & | id () const |
bool | loadFromString (const QString &data) |
const QString & | name () const |
bool | readOnly () const |
QString | saveToString () const |
void | setDescription (const QString &description) |
void | setName (const QString &name) |
void | setReadOnly (bool b) |
Protected Member Functions | |
virtual bool | load (QDataStream &s)=0 |
virtual void | save (QDataStream &s) const =0 |
Protected Attributes | |
QString | mDescription |
QString | mId |
QString | mName |
bool | mReadOnly = false |
Detailed Description
A set of options that can be applied to the MessageList in one shot.
In the sources and in the user interface you can find this set of options referred also as "View Mode" or "Preset".
The option set has a name and an unique id that identifies it. The name is shown to the user in the combo box above the message list view. The set has also a description that is shown as tooltip and should explain the purpose, the best usage cases, eventually the advantages and disadvantages.
The option set can be "packed" to a string and "unpacked" from a string. This is basically for storing it in a configuration file.
Definition at line 32 of file optionset.h.
Constructor & Destructor Documentation
◆ OptionSet() [1/2]
|
explicit |
Definition at line 23 of file optionset.cpp.
◆ OptionSet() [2/2]
|
explicit |
Definition at line 30 of file optionset.cpp.
Member Function Documentation
◆ description()
|
inline |
Returns a description of this option set.
Ideally it should contain its purpose and what to expect from it. But in the end we'll show whatever the user will put in here.
Definition at line 79 of file optionset.h.
◆ generateUniqueId()
void OptionSet::generateUniqueId | ( | ) |
(Re)generates a (hopefully) unique identifier for this option set.
Please note that this function is reserved to this class and to Configure*Dialog instances which need it for cloning option sets. You shouldn't need to call it.
Definition at line 40 of file optionset.cpp.
◆ id()
|
inline |
Returns the unique id of this OptionSet.
The id can't be set. It's either automatically generated or loaded from configuration.
Definition at line 51 of file optionset.h.
◆ load()
|
protectedpure virtual |
Loads the inner contents of this option set from the specified data stream.
The implementation of this method MUST be provided by derived classes and must return true in case of success and false in case of load failure.
Implemented in MessageList::Core::Aggregation, and MessageList::Core::Theme.
◆ loadFromString()
bool OptionSet::loadFromString | ( | const QString & | data | ) |
Attempts to unpack this configuration object from a string (that is likely to come out from a config file).
Returns true if the string was in a valid format and the load operation succeeded, false otherwise.
Definition at line 69 of file optionset.cpp.
◆ name()
|
inline |
Returns the name of this OptionSet.
Definition at line 59 of file optionset.h.
◆ readOnly()
|
inlinenodiscard |
Definition at line 113 of file optionset.h.
◆ save()
|
protectedpure virtual |
Saves the inner contents of this option set to the specified data stream.
The implementation of this method MUST be provided by derived classes.
Implemented in MessageList::Core::Aggregation, and MessageList::Core::Theme.
◆ saveToString()
|
nodiscard |
Packs this configuration object into a string suitable for storing in a config file.
Definition at line 47 of file optionset.cpp.
◆ setDescription()
|
inline |
Sets the description for this option set.
Definition at line 87 of file optionset.h.
◆ setName()
|
inline |
Sets the name of this OptionSet.
You must take care of specifying an unique name in order for the Manager to store the sets properly.
Definition at line 69 of file optionset.h.
◆ setReadOnly()
|
inline |
Definition at line 118 of file optionset.h.
Member Data Documentation
◆ mDescription
|
protected |
Definition at line 43 of file optionset.h.
◆ mId
|
protected |
Definition at line 41 of file optionset.h.
◆ mName
|
protected |
Definition at line 42 of file optionset.h.
◆ mReadOnly
|
protected |
Definition at line 44 of file optionset.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.