2 KNode, the KDE newsreader
3 Copyright (c) 1999-2005 the KNode authors.
4 See file AUTHORS for details
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
15 #ifndef KNNNTPACCOUNT_H
16 #define KNNNTPACCOUNT_H
18 #include "configuration/settings_container_interface.h"
19 #include "kncollection.h"
20 #include "knserverinfo.h"
30 namespace KPIMIdentities
{
34 /** Handles the interval checking of an news server account. */
35 class KNNntpAccountIntervalChecking
: public QObject
{
40 explicit KNNntpAccountIntervalChecking(KNNntpAccount
*account
);
41 ~KNNntpAccountIntervalChecking();
43 void deinstallTimer();
47 KNNntpAccount
*a_ccount
;
55 /** Represents an account on a news server. */
56 class KNNntpAccount
: public KNCollection
, public KNServerInfo
, public KNode::SettingsContainerInterface
60 * Shared pointer to a KNNntpAccount. To be used instead of raw KNNntpAccount*.
62 typedef boost::shared_ptr
<KNNntpAccount
> Ptr
;
66 typedef QList
<KNNntpAccount::Ptr
> List
;
71 collectionType
type() { return CTnntpAccount
; }
73 /** tries to read information, returns false if it fails to do so */
74 bool readInfo(const QString
&confPath
);
78 /** returns true when the user accepted */
79 bool editProperties(QWidget
*parent
);
81 // news interval checking
85 bool fetchDescriptions() const { return f_etchDescriptions
; }
86 QDate
lastNewFetch() const { return l_astNewFetch
; }
87 bool wasOpen() const { return w_asOpen
; }
88 bool useDiskCache() const { return u_seDiskCache
; }
91 Returns this server's specific identity or
92 the null identity if there is none.
94 virtual const KPIMIdentities::Identity
& identity() const;
96 Sets this server's specific identity
97 @param identity this server's identity of a null identity to unset.
99 virtual void setIdentity( const KPIMIdentities::Identity
&identity
);
101 bool intervalChecking() const { return i_ntervalChecking
; }
102 int checkInterval() const { return c_heckInterval
; }
103 KNode::Cleanup
*cleanupConfig() const { return mCleanupConf
; }
105 /** Returns the cleanup configuration that should be used for this account */
106 KNode::Cleanup
*activeCleanupConfig() const;
109 void setFetchDescriptions(bool b
) { f_etchDescriptions
= b
; }
110 void setLastNewFetch(QDate date
) { l_astNewFetch
= date
; }
111 void setUseDiskCache(bool b
) { u_seDiskCache
=b
; }
112 void setCheckInterval(int c
);
113 void setIntervalChecking(bool b
) { i_ntervalChecking
=b
; }
117 Unique object identifier of the identity of this server.
118 -1 means there is no specific identity for this group
119 (because KPIMIdentities::Identity::uoid() returns an unsigned int.
122 /** account specific cleanup configuration */
123 KNode::Cleanup
*mCleanupConf
;
124 /** use an additional "list newsgroups" command to fetch the newsgroup descriptions */
125 bool f_etchDescriptions
;
126 /** last use of "newgroups" */
128 /** was the server open in the listview on the last shutdown? */
130 /** cache fetched articles on disk */
132 /** is interval checking enabled */
133 bool i_ntervalChecking
;
136 /** helper class for news interval checking, manages the QTimer */
137 KNNntpAccountIntervalChecking
*a_ccountIntervalChecking
;
140 * Reimplemented from KNArticleCollection::selfPtr().
142 virtual KNCollection::Ptr
selfPtr();