4 This file is part of KMail, the KDE mail client.
5 Copyright (C) 2002 Carsten Burghardt <burghardt@kde.org>
6 Copyright (C) 2007 Thomas McGuire <mcguire@kde.org>
8 KMail is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License, version 2, as
10 published by the Free Software Foundation.
12 KMail is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 In addition, as a special exception, the copyright holders give
22 permission to link the code of this program with any edition of
23 the Qt library by Trolltech AS, Norway (or with modified versions
24 of Qt that use the same license as Qt), and distribute linked
25 combinations including the two. You must obey the GNU General
26 Public License in all respects for all of the code used other than
27 Qt. If you modify this file, you may extend this exception to
28 your version of the file, but you are not obligated to do so. If
29 you do not wish to do so, delete this exception statement from
33 #ifndef KDEPIM_KACCOUNT_H
34 #define KDEPIM_KACCOUNT_H
36 #include "kdepim_export.h"
45 /** Base class for mail and news accounts. */
46 class KDEPIM_EXPORT KAccount
52 /** Type information */
62 }; //If you add a value here, remember to add it to displayNameForType() also!
64 explicit KAccount( const uint id
= 0, const QString
&name
= QString(),
65 const Type type
= Other
);
70 QString
name() const { return mName
; }
71 void setName( const QString
&name
) { mName
= name
; }
76 uint
id() const { return mId
; }
77 void setId( const uint id
) { mId
= id
; }
82 Type
type() const { return mType
; }
83 void setType( const Type type
) { mType
= type
; }
88 void writeConfig( KConfigGroup
&config
) const;
93 void readConfig( const KConfigGroup
&config
);
96 * Convert a Type to a string representation.
97 * This should not be used for a user-visible string, as the
98 * returned string is the same as the enum name.
100 static QString
nameForType( Type type
);
103 * Convert a string representation of a Type back to Type.
104 * The string should only come from calling nameForType().
106 static KAccount::Type
typeForName( const QString
&name
);
109 * Returns the translated name for the given aType.
111 static QString
displayNameForType( const Type aType
);