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

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
knconfig.h
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 1999-2005 the KNode authors.
4  See file AUTHORS for details
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  You should have received a copy of the GNU General Public License
11  along with this program; if not, write to the Free Software Foundation,
12  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
13 */
14 
15 #ifndef KNCONFIG_H
16 #define KNCONFIG_H
17 
18 #include "knode_export.h"
19 
20 #include <QList>
21 #include <QPixmap>
22 #include <QDateTime>
23 #include <kconfig.h>
24 
25 
26 class KNDisplayedHeader;
27 
28 
29 namespace KNode {
30 
34 class ConfigBase {
35 
36  public:
37  ConfigBase() : d_irty(false) {}
38  virtual ~ConfigBase() {}
39 
40  virtual void save() {}
41 
42  bool dirty()const { return d_irty; }
43  void setDirty(bool b) { d_irty=b; }
44 
45  protected:
46  bool d_irty;
47 
48 };
49 
50 
55 class KNODE_EXPORT Appearance : public ConfigBase {
56 
57 #define ICON_CNT 14
58 
59  friend class AppearanceWidget;
60 
61  public:
62  enum IconIndex { greyBall=0, redBall=1, greyBallChkd=2,
63  redBallChkd=3, newFups=4, eyes=5,
64  ignore=6, mail=7, posting=8,
65  canceledPosting=9, savedRemote=10, group=11,
66  null=12 };
67  Appearance();
68 
69  const QPixmap& icon(IconIndex i) { return i_cons[i]; }
70 
71  protected:
72  void recreateLVIcons();
73 
74  QPixmap i_cons[ICON_CNT];
75 
76 };
77 
78 
80 class KNODE_EXPORT DisplayedHeaders : public ConfigBase
81 {
82  public:
83  DisplayedHeaders();
84  ~DisplayedHeaders();
85 
86  void save();
87 
88  KNDisplayedHeader* createNewHeader();
89  void remove(KNDisplayedHeader *h);
90  void up(KNDisplayedHeader *h);
91  void down(KNDisplayedHeader *h);
92 
94  QList<KNDisplayedHeader*> headers() const { return mHeaderList; }
95 
96 
97  protected:
98  QList<KNDisplayedHeader*> mHeaderList;
99 
100 };
101 
102 
104 class KNODE_EXPORT XHeader
105 {
106  public:
110  explicit XHeader( const QString &s );
111 
113  typedef QList<XHeader> List;
114 
116  QString name() const { return mName; }
118  QString value() const { return mValue; }
120  QString header() const { return mName + ": " + mValue; }
121 
122  private:
123  QString mName;
124  QString mValue;
125 };
126 
127 
128 
129 //BEGIN: Cleanup configuration -----------------------------------------------
130 
132 class KNODE_EXPORT Cleanup : public ConfigBase {
133 
134  friend class CleanupWidget;
135  friend class GroupCleanupWidget;
136 
137  public:
138  explicit Cleanup( bool global = true );
139  ~Cleanup() {}
140 
141  void loadConfig( const KConfigGroup &conf );
142  void saveConfig( KConfigGroup &conf );
143  void save();
144 
145  //expire
146  int maxAgeForRead() const { return r_eadMaxAge; }
147  int maxAgeForUnread() const { return u_nreadMaxAge; }
148  bool removeUnavailable() const { return r_emoveUnavailable; }
149  bool preserveThreads() const { return p_reserveThr; }
150  bool isGlobal() const { return mGlobal; }
151  bool useDefault() const { return mDefault; }
152  bool expireToday();
153  void setLastExpireDate();
154 
155  void setUseDefault( bool def ) { mDefault = def; }
156 
157  //compact
158  bool compactToday();
159  void setLastCompactDate();
160 
161 
162  protected:
163  bool d_oExpire,
164  r_emoveUnavailable,
165  p_reserveThr,
166  d_oCompact;
167  int e_xpireInterval,
168  r_eadMaxAge,
169  u_nreadMaxAge,
170  c_ompactInterval;
171 
172  private:
174  bool mGlobal;
176  bool mDefault;
178  QDate mLastExpDate, mLastCompDate;
179 
180 };
181 
182 //END: Cleanup configuration -------------------------------------------------
183 
184 } //KNode
185 
186 #endif //KNCONFIG_H
KNode::Appearance::IconIndex
IconIndex
Definition: knconfig.h:62
KNode::Cleanup::setUseDefault
void setUseDefault(bool def)
Definition: knconfig.h:155
KNode::Cleanup::useDefault
bool useDefault() const
Definition: knconfig.h:151
KNode::Cleanup::maxAgeForRead
int maxAgeForRead() const
Definition: knconfig.h:146
KNode::XHeader::name
QString name() const
Returns the header name.
Definition: knconfig.h:116
KNode::XHeader::header
QString header() const
Returns a string representation of the header, ie.
Definition: knconfig.h:120
KNDisplayedHeader
A header displayed in the article viewer.
Definition: kndisplayedheader.h:23
KNode::ConfigBase::ConfigBase
ConfigBase()
Definition: knconfig.h:37
KNode::Cleanup
Expirery/cleaup settings (globally or per account/group/folder).
Definition: knconfig.h:132
KNode::Cleanup::maxAgeForUnread
int maxAgeForUnread() const
Definition: knconfig.h:147
knode_export.h
KNode::Cleanup::preserveThreads
bool preserveThreads() const
Definition: knconfig.h:149
KNode::Cleanup::~Cleanup
~Cleanup()
Definition: knconfig.h:139
KNode::ConfigBase::save
virtual void save()
Definition: knconfig.h:40
KNode::DisplayedHeaders::mHeaderList
QList< KNDisplayedHeader * > mHeaderList
Definition: knconfig.h:98
KNode::DisplayedHeaders::headers
QList< KNDisplayedHeader * > headers() const
Returns the list of headers displayed in the article viewer.
Definition: knconfig.h:94
KNode::XHeader::value
QString value() const
Returns the header value.
Definition: knconfig.h:118
KNode::Appearance::icon
const QPixmap & icon(IconIndex i)
Definition: knconfig.h:69
KNode::ConfigBase
Base class for config settings.
Definition: knconfig.h:34
KNode::XHeader::List
QList< XHeader > List
A list of additional headers.
Definition: knconfig.h:113
KNode::Cleanup::removeUnavailable
bool removeUnavailable() const
Definition: knconfig.h:148
KNode::GroupCleanupWidget
Configuration widget for group expireration.
Definition: knconfigwidgets.h:540
KNode::ConfigBase::dirty
bool dirty() const
Definition: knconfig.h:42
KNode::AppearanceWidget
Appearance configuration widget.
Definition: knconfigwidgets.h:145
KNode::Cleanup::r_emoveUnavailable
bool r_emoveUnavailable
Definition: knconfig.h:163
KNODE_EXPORT
#define KNODE_EXPORT
Definition: knode_export.h:35
KNode::Cleanup::u_nreadMaxAge
int u_nreadMaxAge
Definition: knconfig.h:167
KNode::Appearance
Ex-Appearance settings.
Definition: knconfig.h:55
KNode::DisplayedHeaders
Headers displayed in the article viewer.
Definition: knconfig.h:80
KNode::ConfigBase::d_irty
bool d_irty
Definition: knconfig.h:46
KNode::ConfigBase::~ConfigBase
virtual ~ConfigBase()
Definition: knconfig.h:38
KNode::XHeader
Represents an additional header added by the composer.
Definition: knconfig.h:104
KNode::Cleanup::isGlobal
bool isGlobal() const
Definition: knconfig.h:150
KNode::ConfigBase::setDirty
void setDirty(bool b)
Definition: knconfig.h:43
KNode::CleanupWidget
Global cleanup configuration widget.
Definition: knconfigwidgets.h:565
QList< KNDisplayedHeader * >
ICON_CNT
#define ICON_CNT
Definition: knconfig.h:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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

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