• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

messagelist

  • sources
  • kde-4.14
  • kdepim
  • messagelist
  • core
optionset.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  *******************************************************************************/
20 
21 #ifndef __MESSAGELIST_CORE_OPTIONSET_H__
22 #define __MESSAGELIST_CORE_OPTIONSET_H__
23 
24 #include <QString>
25 
26 class QDataStream;
27 
28 namespace MessageList
29 {
30 
31 namespace Core
32 {
33 
47 class OptionSet
48 {
49 public:
50  explicit OptionSet();
51  explicit OptionSet( const OptionSet &src );
52  explicit OptionSet( const QString &name, const QString &description, bool readOnly = false );
53  virtual ~OptionSet();
54 
55 protected:
56  QString mId;
57  QString mName;
58  QString mDescription;
59  bool mReadOnly;
60 
61 public:
66  const QString &id() const
67  { return mId; }
68 
72  const QString &name() const
73  { return mName; }
74 
80  void setName( const QString &name )
81  { mName = name; }
82 
88  const QString &description() const
89  { return mDescription; }
90 
94  void setDescription( const QString &description )
95  { mDescription = description; }
96 
101  QString saveToString() const;
102 
108  bool loadFromString( const QString &data );
109 
116  void generateUniqueId();
117 
118  bool readOnly() const { return mReadOnly; }
119  void setReadOnly( bool b) { mReadOnly = b; }
120 
121 protected:
126  virtual void save( QDataStream &s ) const = 0;
127 
133  virtual bool load( QDataStream &s ) = 0;
134 };
135 
136 } // namespace Core
137 
138 } // namespace MessageList
139 
140 #endif
MessageList::Core::OptionSet::mName
QString mName
Definition: optionset.h:57
MessageList::Core::OptionSet::id
const QString & id() const
Returns the unique id of this OptionSet.
Definition: optionset.h:66
MessageList::Core::OptionSet::setDescription
void setDescription(const QString &description)
Sets the description for this option set.
Definition: optionset.h:94
MessageList::Core::OptionSet
A set of options that can be applied to the MessageList in one shot.
Definition: optionset.h:47
QDataStream
MessageList::Core::OptionSet::mId
QString mId
Definition: optionset.h:56
MessageList::Core::OptionSet::description
const QString & description() const
Returns a description of this option set.
Definition: optionset.h:88
MessageList::Core::OptionSet::setReadOnly
void setReadOnly(bool b)
Definition: optionset.h:119
MessageList::Core::OptionSet::name
const QString & name() const
Returns the name of this OptionSet.
Definition: optionset.h:72
MessageList::Core::OptionSet::generateUniqueId
void generateUniqueId()
(Re)generates a (hopefully) unique identifier for this option set.
Definition: optionset.cpp:57
QString
MessageList::Core::OptionSet::loadFromString
bool loadFromString(const QString &data)
Attempts to unpack this configuration object from a string (that is likely to come out from a config ...
Definition: optionset.cpp:86
MessageList::Core::OptionSet::setName
void setName(const QString &name)
Sets the name of this OptionSet.
Definition: optionset.h:80
MessageList::Core::OptionSet::save
virtual void save(QDataStream &s) const =0
Saves the inner contents of this option set to the specified data stream.
MessageList::Core::OptionSet::mDescription
QString mDescription
Definition: optionset.h:58
MessageList::Core::OptionSet::OptionSet
OptionSet()
Definition: optionset.cpp:36
MessageList::Core::OptionSet::mReadOnly
bool mReadOnly
Definition: optionset.h:59
MessageList::Core::OptionSet::saveToString
QString saveToString() const
Packs this configuration object into a string suitable for storing in a config file.
Definition: optionset.cpp:64
MessageList::Core::OptionSet::readOnly
bool readOnly() const
Definition: optionset.h:118
MessageList::Core::OptionSet::~OptionSet
virtual ~OptionSet()
Definition: optionset.cpp:53
MessageList::Core::OptionSet::load
virtual bool load(QDataStream &s)=0
Loads the inner contents of this option set from the specified data stream.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messagelist

Skip menu "messagelist"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal