kmail
KMFolderMaildir Class Reference

Detailed Description
Definition at line 21 of file kmfoldermaildir.h.
Public Member Functions | |
KMFolderMaildir (KMFolder *folder, const char *name=0) | |
virtual | ~KMFolderMaildir () |
virtual KMFolderType | folderType () const |
virtual DwString | getDwString (int idx) |
virtual KMMessage * | take (int idx) |
virtual int | addMsg (KMMessage *msg, int *index_return=0) |
virtual void | removeMsg (int i, bool imapQuiet=FALSE) |
virtual void | removeMsg (QPtrList< KMMessage > msgList, bool imapQuiet=FALSE) |
virtual void | msgStatusChanged (const KMMsgStatus oldStatus, const KMMsgStatus newStatus, int idx) |
virtual int | open (const char *owner) |
virtual int | canAccess () |
virtual void | sync () |
virtual void | reallyDoClose (const char *owner) |
virtual int | create () |
int | compact (unsigned int startIndex, int nbMessages, const QStringList &entryList, bool &done) |
virtual int | compact (bool silent) |
virtual bool | isReadOnly () const |
size_t | doFolderSize () const |
Static Public Member Functions | |
static int | createMaildirFolders (const QString &folderPath) |
static QString | constructValidFileName (const QString &filename=QString(), KMMsgStatus status=KMMsgStatusNew) |
static bool | removeFile (const QString &folderPath, const QString &filename) |
Protected Member Functions | |
virtual FolderJob * | doCreateJob (KMMessage *msg, FolderJob::JobType jt, KMFolder *folder, QString partSpecifier, const AttachmentStrategy *as) const |
virtual FolderJob * | doCreateJob (QPtrList< KMMessage > &msgList, const QString &sets, FolderJob::JobType jt, KMFolder *folder) const |
virtual KMMessage * | readMsg (int idx) |
virtual int | removeContents () |
virtual int | expungeContents () |
virtual int | createIndexFromContents () |
int | addMsgInternal (KMMessage *msg, int *index_return=0, bool stripUid=false) |
Friends | |
class | ::KMail::MaildirJob |
Constructor & Destructor Documentation
KMFolderMaildir::KMFolderMaildir | ( | KMFolder * | folder, | |
const char * | name = 0 | |||
) |
Usually a parent is given.
But in some cases there is no fitting parent object available. Then the name of the folder is used as the absolute path to the folder file.
Definition at line 52 of file kmfoldermaildir.cpp.
Member Function Documentation
virtual KMFolderType KMFolderMaildir::folderType | ( | ) | const [inline, virtual] |
Returns the type of this folder.
Reimplemented from FolderStorage.
Reimplemented in KMFolderCachedImap.
Definition at line 33 of file kmfoldermaildir.h.
DwString KMFolderMaildir::getDwString | ( | int | idx | ) | [virtual] |
Read a message and return it as a string.
Implements FolderStorage.
Definition at line 552 of file kmfoldermaildir.cpp.
KMMessage * KMFolderMaildir::take | ( | int | idx | ) | [virtual] |
Detach message from this folder.
Usable to call addMsg() afterwards. Loads the message if it is not loaded up to now.
Reimplemented from FolderStorage.
Reimplemented in KMFolderCachedImap.
Definition at line 930 of file kmfoldermaildir.cpp.
int KMFolderMaildir::addMsg | ( | KMMessage * | msg, | |
int * | index_return = 0 | |||
) | [virtual] |
Add the given message to the folder.
Usually the message is added at the end of the folder. Returns zero on success and an errno error code on failure. The index of the new message is stored in index_return if given. Please note that the message is added as is to the folder and the folder takes ownership of the message (deleting it in the destructor).
Implements FolderStorage.
Reimplemented in KMFolderCachedImap.
Definition at line 349 of file kmfoldermaildir.cpp.
void KMFolderMaildir::removeMsg | ( | int | i, | |
bool | imapQuiet = FALSE | |||
) | [virtual] |
Remove (first occurrence of) given message from the folder.
Reimplemented from FolderStorage.
Reimplemented in KMFolderCachedImap.
Definition at line 919 of file kmfoldermaildir.cpp.
void KMFolderMaildir::msgStatusChanged | ( | const KMMsgStatus | oldStatus, | |
const KMMsgStatus | newStatus, | |||
int | idx | |||
) | [virtual] |
Called by KMMsgBase::setStatus when status of a message has changed required to keep the number unread messages variable current.
Reimplemented from FolderStorage.
Definition at line 1090 of file kmfoldermaildir.cpp.
int KMFolderMaildir::open | ( | const char * | owner | ) | [virtual] |
Open folder for access.
Does nothing if the folder is already opened. To reopen a folder call close() first. Returns zero on success and an error code equal to the c-library fopen call otherwise (errno).
Implements FolderStorage.
Definition at line 100 of file kmfoldermaildir.cpp.
int KMFolderMaildir::canAccess | ( | ) | [virtual] |
Check folder for permissions Returns zero if readable and writable.
Implements FolderStorage.
Definition at line 67 of file kmfoldermaildir.cpp.
void KMFolderMaildir::sync | ( | ) | [virtual] |
void KMFolderMaildir::reallyDoClose | ( | const char * | owner | ) | [virtual] |
Close folder.
If force is TRUE the files are closed even if others still use it (e.g. other mail reader windows).
Implements FolderStorage.
Reimplemented in KMFolderCachedImap.
Definition at line 223 of file kmfoldermaildir.cpp.
int KMFolderMaildir::createMaildirFolders | ( | const QString & | folderPath | ) | [static] |
Create the necessary folders for a maildir folder.
Usually you will want to use create() instead.
- Parameters:
-
folderPath the full path of the folder as returned by location()
- Returns:
- 0 on success and an error code (cf. man 3 errno) otherwise
Definition at line 153 of file kmfoldermaildir.cpp.
int KMFolderMaildir::create | ( | ) | [virtual] |
Implements FolderStorage.
Reimplemented in KMFolderCachedImap.
Definition at line 186 of file kmfoldermaildir.cpp.
int KMFolderMaildir::compact | ( | unsigned int | startIndex, | |
int | nbMessages, | |||
const QStringList & | entryList, | |||
bool & | done | |||
) |
Remove some deleted messages from the folder.
Returns zero on success and an errno on failure. This is only for use from MaildirCompactionJob.
Definition at line 273 of file kmfoldermaildir.cpp.
int KMFolderMaildir::compact | ( | bool | silent | ) | [virtual] |
Remove deleted messages from the folder.
Returns zero on success and an errno on failure.
Implements FolderStorage.
Definition at line 320 of file kmfoldermaildir.cpp.
virtual bool KMFolderMaildir::isReadOnly | ( | ) | const [inline, virtual] |
Is the folder read-only?
Implements FolderStorage.
Reimplemented in KMFolderCachedImap.
Definition at line 103 of file kmfoldermaildir.h.
size_t KMFolderMaildir::doFolderSize | ( | ) | const [virtual] |
virtual FolderJob* KMFolderMaildir::doCreateJob | ( | KMMessage * | msg, | |
FolderJob::JobType | jt, | |||
KMFolder * | folder, | |||
QString | partSpecifier, | |||
const AttachmentStrategy * | as | |||
) | const [protected, virtual] |
These two methods actually create the jobs.
They have to be implemented in all folders.
- See also:
- createJob
Implements FolderStorage.
Reimplemented in KMFolderCachedImap.
KMMessage * KMFolderMaildir::readMsg | ( | int | idx | ) | [protected, virtual] |
Load message from file and store it at given index.
Returns 0 on failure.
Implements FolderStorage.
Definition at line 541 of file kmfoldermaildir.cpp.
int KMFolderMaildir::removeContents | ( | ) | [protected, virtual] |
Called by KMFolder::remove() to delete the actual contents.
At the time of the call the folder has already been closed, and the various index files deleted. Returns 0 on success.
Implements FolderStorage.
Definition at line 1004 of file kmfoldermaildir.cpp.
int KMFolderMaildir::expungeContents | ( | ) | [protected, virtual] |
Called by KMFolder::expunge() to delete the actual contents.
At the time of the call the folder has already been closed, and the various index files deleted. Returns 0 on success.
Implements FolderStorage.
Definition at line 255 of file kmfoldermaildir.cpp.
int KMFolderMaildir::createIndexFromContents | ( | ) | [protected, virtual] |
Create index file from messages file and fill the message-info list mMsgList.
Returns 0 on success and an errno value (see fopen) on failure.
Implements KMFolderIndex.
Reimplemented in KMFolderCachedImap.
Definition at line 829 of file kmfoldermaildir.cpp.
int KMFolderMaildir::addMsgInternal | ( | KMMessage * | msg, | |
int * | index_return = 0 , |
|||
bool | stripUid = false | |||
) | [protected] |
Internal helper called by addMsg.
If stripUid is true it will remove any uid headers and uid index setting before writing. KMFolderCachedImap needs this but can't do it itself, since the final take() which removes the original mail from the source folder, in moves, needs to happen after the adding, for safety reasons, but needs the uid, in case the source folder was an imap folder, to delete the original. TODO: Avoid this by moving the take() out of the addMsg() methods and moving it into the KMMoveCommand, where it can safely happen at a much higher level.
Definition at line 356 of file kmfoldermaildir.cpp.
The documentation for this class was generated from the following files: