diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch) | |
tree | 67208f7c145782a7e90b123b982ca78d88cc2c87 /knode/knfoldermanager.h | |
download | tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/knfoldermanager.h')
-rw-r--r-- | knode/knfoldermanager.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/knode/knfoldermanager.h b/knode/knfoldermanager.h new file mode 100644 index 000000000..9bc8254e8 --- /dev/null +++ b/knode/knfoldermanager.h @@ -0,0 +1,91 @@ +/* + KNode, the KDE newsreader + Copyright (c) 1999-2005 the KNode authors. + See file AUTHORS for details + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US +*/ + +#ifndef KNFOLDERMANAGER_H +#define KNFOLDERMANAGER_H + +#include <qobject.h> +#include <qvaluelist.h> + +class KNFolder; +class KNArticleManager; +class KNCleanUp; + + +class KNFolderManager : public QObject +{ + Q_OBJECT + + public: + KNFolderManager(KNArticleManager *a); + ~KNFolderManager(); + + //folder access + void setCurrentFolder(KNFolder *f); + KNFolder* currentFolder() const { return c_urrentFolder; } + bool hasCurrentFolder() const { return (c_urrentFolder!=0); } + KNFolder* folder(int id); + QValueList<KNFolder*> folders() const { return mFolderList; } + + //standard folders + KNFolder* root() const { return mFolderList[0]; } + KNFolder* drafts() const { return mFolderList[1]; } + KNFolder* outbox() const { return mFolderList[2]; } + KNFolder* sent() const { return mFolderList[3]; } + + //header loading + bool loadHeaders(KNFolder *f); + bool unloadHeaders(KNFolder *f, bool force=true); + bool loadDrafts() { return loadHeaders(drafts()); } + bool loadOutbox() { return loadHeaders(outbox()); } + bool loadSent() { return loadHeaders(sent()); } + + // returns the new folder + KNFolder* newFolder(KNFolder *p); + bool deleteFolder(KNFolder *f); + void emptyFolder(KNFolder *f); + bool moveFolder(KNFolder *f, KNFolder *p); + + //unsent articles + int unsentForAccount(int accId); + + //compacting + void compactFolder(KNFolder *f); + void compactAll(KNCleanUp *cup); + void compactAll(); + + // import + export + void importFromMBox(KNFolder *f); + void exportToMBox(KNFolder *f); + + //synchronization + void syncFolders(); + + signals: + // signals for the collection tree to update the UI + void folderAdded(KNFolder *f); + void folderRemoved(KNFolder *f); + void folderActivated(KNFolder *f); + + protected: + int loadCustomFolders(); + + KNFolder *c_urrentFolder; + QValueList<KNFolder*> mFolderList; + int l_astId; + KNArticleManager *a_rtManager; + +}; + +#endif |