MessageList::Core::OptionSet

Search for usage in LXR

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 = 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]

OptionSet::OptionSet ( )
explicit

Definition at line 23 of file optionset.cpp.

◆ OptionSet() [2/2]

OptionSet::OptionSet ( const QString & name,
const QString & description,
bool readOnly = false )
explicit

Definition at line 30 of file optionset.cpp.

Member Function Documentation

◆ description()

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

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

◆ load()

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

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

Returns the name of this OptionSet.

Definition at line 59 of file optionset.h.

◆ readOnly()

bool MessageList::Core::OptionSet::readOnly ( ) const
inlinenodiscard

Definition at line 113 of file optionset.h.

◆ save()

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::Aggregation, and MessageList::Core::Theme.

◆ saveToString()

QString OptionSet::saveToString ( ) const
nodiscard

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

Definition at line 47 of file optionset.cpp.

◆ setDescription()

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

Sets the description for this option set.

Definition at line 87 of file optionset.h.

◆ setName()

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

◆ setReadOnly()

void MessageList::Core::OptionSet::setReadOnly ( bool b)
inline

Definition at line 118 of file optionset.h.

Member Data Documentation

◆ mDescription

QString MessageList::Core::OptionSet::mDescription
protected

Definition at line 43 of file optionset.h.

◆ mId

QString MessageList::Core::OptionSet::mId
protected

Definition at line 41 of file optionset.h.

◆ mName

QString MessageList::Core::OptionSet::mName
protected

Definition at line 42 of file optionset.h.

◆ mReadOnly

bool MessageList::Core::OptionSet::mReadOnly = false
protected

Definition at line 44 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-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:05:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.