french -> French
[kdepim.git] / knode / settings.h
blob048ebb35d6a8028222bdfd63e93f2bc875ed3528
1 /*
2 Copyright (c) 2005 by Volker Krause <vkrause@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 You should have received a copy of the GNU General Public License
9 along with this program; if not, write to the Free Software Foundation,
10 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
13 #ifndef KNODE_SETTINGS_H
14 #define KNODE_SETTINGS_H
16 #include "configuration/settings_container_interface.h"
17 #include "knode_export.h"
18 #include "settings_base.h"
19 // TODO: remove as soon as XHeader is in it's own file
20 #include "knconfig.h"
22 namespace KPIMIdentities {
23 class Identity;
27 namespace KNode {
29 /** Application settings.
30 * SettingsBase (the base class) is generated by KConfigXT.
31 * @todo Make the color and font accessors const (requires the KConfigXT
32 * generated item accessors to be const too).
34 class KNODE_EXPORT Settings : public SettingsBase, public SettingsContainerInterface
36 public:
37 /// Create a new Settings object.
38 Settings();
40 /// Returns the effective background color.
41 QColor backgroundColor() { return effectiveColor( backgroundColorItem() ); }
42 /// Returns the effective alternate background color.
43 QColor alternateBackgroundColor() { return effectiveColor( alternateBackgroundColorItem() ); }
44 /// Returns the effective text color.
45 QColor textColor() { return effectiveColor( textColorItem() ); }
46 /** Returns the effective quoting color.
47 * @param depth The quoting depth (0-2).
49 QColor quoteColor( int depth ) { return effectiveColor( quoteColorItem( depth ) ); }
50 /// Returns the effective link color.
51 QColor linkColor() { return effectiveColor( linkColorItem() ); }
52 /// Returns the effective color for unread threads.
53 QColor unreadThreadColor() { return effectiveColor( unreadThreadColorItem() ); }
54 /// Returns the effective color for read threads.
55 QColor readThreadColor() { return effectiveColor( readThreadColorItem() ); }
56 /// Returns the effective color for unread articles.
57 QColor unreadArticleColor() { return effectiveColor( unreadArticleColorItem() ); }
58 /// Returns the effective color for read articles.
59 QColor readArticleColor() { return effectiveColor( readArticleColorItem() ); }
60 /// Returns the effective color for valid signatures with a trusted key.
61 QColor signOkKeyOkColor() { return effectiveColor( signOkKeyOkColorItem() ); }
62 /// Returns the effective color for valid signatures with a untrusted key.
63 QColor signOkKeyBadColor() { return effectiveColor( signOkKeyBadColorItem() ); }
64 /// Returns the effective color for unchecked signatures.
65 QColor signWarnColor() { return effectiveColor( signWarnColorItem() ); }
66 /// Returns the effective color for bad signatures.
67 QColor signErrColor() { return effectiveColor( signErrColorItem() ); }
68 /// Returns the effective color for HTML warnings.
69 QColor htmlWarningColor() { return effectiveColor( htmlWarningColorItem() ); }
71 /// Returns the effective article font.
72 QFont articleFont() { return effectiveFont( articleFontItem() ); }
73 /// Returns the effective article fixed font.
74 QFont articleFixedFont() { return effectiveFont( articleFixedFontItem() ); }
75 /// Returns the effective composer font.
76 QFont composerFont() { return effectiveFont( composerFontItem() ); }
77 /// Returns the effective folder tree font.
78 QFont groupListFont() { return effectiveFont( groupListFontItem() ); }
79 /// Returns the effective article list font.
80 QFont articleListFont() { return effectiveFont( articleListFontItem() ); }
82 /** Returns a list of additional headers added to created articles. */
83 QList<XHeader> xHeaders() const { return mXHeaders; }
84 /** Sets the list of additional headers added to created articles.
85 * @param list The new list.
87 void setXHeaders( const QList<XHeader> &list ) { mXHeaders = list; }
89 /**
90 Returns the global identity (or the default one when none is set yet).
92 virtual const KPIMIdentities::Identity & identity() const;
93 /**
94 Sets the global identity.
96 virtual void setIdentity( const KPIMIdentities::Identity &identity );
98 /**
99 Reimplemented to hide writeConfig() from SettingsContainerInterface
100 and delegate call to SettingsBase::writeConfig().
102 virtual void writeConfig()
103 { SettingsBase::writeConfig(); }
105 protected:
106 /** Reimplemented from KConfigSkeleton. */
107 virtual void usrReadConfig();
108 /** Reimplemented from KConfigSkeleton. */
109 virtual void usrWriteConfig();
110 /** Returns the effective color value of the given config item.
111 * @param item The KConfigSkeletonItem.
113 QColor effectiveColor( KConfigSkeleton::ItemColor *item ) const;
114 /** Returns the effective font value of the given config item.
115 * @param item The KConfigSkeletonItem.
117 QFont effectiveFont( KConfigSkeleton::ItemFont *item ) const;
119 private:
120 /// The list of additional headers.
121 QList<XHeader> mXHeaders;
126 #endif