kmail

listjob.h
1 /*
2  * Copyright (c) 2004 Carsten Burghardt <burghardt@kde.org>
3  *
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; version 2 of the License
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16  *
17  * In addition, as a special exception, the copyright holders give
18  * permission to link the code of this program with any edition of
19  * the TQt library by Trolltech AS, Norway (or with modified versions
20  * of TQt that use the same license as TQt), and distribute linked
21  * combinations including the two. You must obey the GNU General
22  * Public License in all respects for all of the code used other than
23  * TQt. If you modify this file, you may extend this exception to
24  * your version of the file, but you are not obligated to do so. If
25  * you do not wish to do so, delete this exception statement from
26  * your version.
27  */
28 #ifndef LISTJOB_H
29 #define LISTJOB_H
30 
31 #include "folderjob.h"
32 #include "imapaccountbase.h"
33 
34 class KMFolderImap;
35 class KMFolderCachedImap;
36 class KMAcctImap;
37 class KMAcctCachedImap;
38 class FolderStorage;
39 class KURL;
40 
41 namespace TDEIO {
42  class Job;
43 }
44 
45 namespace KPIM {
46  class ProgressItem;
47 }
48 
49 namespace KMail {
50 
54 class ListJob : public FolderJob
55 {
56  TQ_OBJECT
57 
58 public:
69  ListJob( ImapAccountBase* account, ImapAccountBase::ListType type,
70  FolderStorage* storage = 0, const TQString& path = TQString(),
71  bool complete = false, KPIM::ProgressItem* item = 0 );
72 
73  virtual ~ListJob();
74 
80  void setHonorLocalSubscription( bool value );
81 
87  bool honorLocalSubscription() const;
88 
89  virtual void execute();
90 
92  void setPath( const TQString& path ) { mPath = path; }
93 
95  void setStorage( FolderStorage* st ) { mStorage = st; }
96 
98  void setComplete( bool complete ) { mComplete = complete; }
99 
101  void setParentProgressItem( KPIM::ProgressItem* it ) {
102  mParentProgressItem = it; }
103 
105  void setNamespace( const TQString& ns ) { mNamespace = ns; }
106 
107 protected slots:
112  void slotListResult( TDEIO::Job* job );
113 
117  void slotListEntries( TDEIO::Job* job, const TDEIO::UDSEntryList& uds );
118 
122  void slotConnectionResult( int errorCode, const TQString& errorMsg );
123 
124 signals:
128  void receivedFolders( const TQStringList&, const TQStringList&,
129  const TQStringList&, const TQStringList&, const ImapAccountBase::jobData& );
130 
131 protected:
132  FolderStorage* mStorage;
133  ImapAccountBase* mAccount;
134  ImapAccountBase::ListType mType;
135  bool mComplete;
136  bool mHonorLocalSubscription;
137  TQString mPath;
138  TQStringList mSubfolderNames, mSubfolderPaths,
139  mSubfolderMimeTypes, mSubfolderAttributes;
140  KPIM::ProgressItem* mParentProgressItem;
141  TQString mNamespace;
142 };
143 
144 } // namespace
145 
146 #endif /* LISTJOB_H */
147 
The FolderStorage class is the bass class for the storage related aspects of a collection of mail (a ...
Definition: folderstorage.h:80
Generic folder list job for (d)imap accounts.
Definition: listjob.h:55
void receivedFolders(const TQStringList &, const TQStringList &, const TQStringList &, const TQStringList &, const ImapAccountBase::jobData &)
Emitted when new folders have been received.
void slotConnectionResult(int errorCode, const TQString &errorMsg)
Called from the account when a connection was established.
Definition: listjob.cpp:154
void setComplete(bool complete)
Set this to true for a complete listing.
Definition: listjob.h:98
ListJob(ImapAccountBase *account, ImapAccountBase::ListType type, FolderStorage *storage=0, const TQString &path=TQString(), bool complete=false, KPIM::ProgressItem *item=0)
Create a new job.
Definition: listjob.cpp:53
void slotListResult(TDEIO::Job *job)
Is called when the listing is done Passes the folders and the jobData to the responding folder.
Definition: listjob.cpp:166
void setStorage(FolderStorage *st)
Storage.
Definition: listjob.h:95
void setHonorLocalSubscription(bool value)
Set whether the listing should include only folders that the account is subscribed to locally.
Definition: listjob.cpp:245
bool honorLocalSubscription() const
Return whether the listing includes only folders that the account is subscribed to locally.
Definition: listjob.cpp:250
void setNamespace(const TQString &ns)
Set the namespace for this listing.
Definition: listjob.h:105
void setPath(const TQString &path)
Path.
Definition: listjob.h:92
void setParentProgressItem(KPIM::ProgressItem *it)
Set parent progress item.
Definition: listjob.h:101
void slotListEntries(TDEIO::Job *job, const TDEIO::UDSEntryList &uds)
Collects the folder information.
Definition: listjob.cpp:189
folderdiaquotatab.h
Definition: aboutdata.cpp:40