MessageList::Core::OptionSet

MessageList::Core::OptionSet Class Referenceabstract

#include <optionset.h>

Inheritance diagram for MessageList::Core::OptionSet:

Public Member Functions

 OptionSet (const OptionSet &src)
 
 OptionSet (const QString &name, const QString &description, bool readOnly=false)
 
const QStringdescription () const
 
void generateUniqueId ()
 
const QStringid () const
 
bool loadFromString (const QString &data)
 
const QStringname () 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
 

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 43 of file optionset.h.

Member Function Documentation

const QString& MessageList::Core::OptionSet::description ( ) const
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 90 of file optionset.h.

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 60 of file optionset.cpp.

const QString& MessageList::Core::OptionSet::id ( ) const
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 62 of file optionset.h.

virtual bool MessageList::Core::OptionSet::load ( QDataStream s)
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::Theme, and MessageList::Core::Aggregation.

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 89 of file optionset.cpp.

const QString& MessageList::Core::OptionSet::name ( ) const
inline

Returns the name of this OptionSet.

Definition at line 70 of file optionset.h.

virtual void MessageList::Core::OptionSet::save ( QDataStream s) const
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::Theme, and MessageList::Core::Aggregation.

QString OptionSet::saveToString ( ) const

Packs this configuration object into a string suitable for storing in a config file.

Definition at line 67 of file optionset.cpp.

void MessageList::Core::OptionSet::setDescription ( const QString description)
inline

Sets the description for this option set.

Definition at line 98 of file optionset.h.

void MessageList::Core::OptionSet::setName ( const QString name)
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 80 of file optionset.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 24 2020 22:44:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.