• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmail

KMFolderMaildir Class Reference

#include <kmfoldermaildir.h>

Inheritance diagram for KMFolderMaildir:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 21 of file kmfoldermaildir.h.


Public Member Functions

virtual int addMsg (KMMessage *msg, int *index_return=0)
virtual bool canAccess () const
virtual void close (const char *owner, bool force=false)
virtual int compact (bool silent)
int compact (unsigned int startIndex, int nbMessages, const QStringList &entryList, bool &done)
virtual int create ()
virtual int createIndexFromContents ()
virtual qint64 doFolderSize () const
virtual KMFolderType folderType () const
virtual DwString getDwString (int idx)
virtual bool isReadOnly () const
 KMFolderMaildir (KMFolder *folder, const char *name=0)
virtual void msgStatusChanged (const MessageStatus &oldStatus, const MessageStatus &newStatus, int idx)
virtual int open (const char *owner)
virtual void removeMsg (int i, bool imapQuiet=false)
virtual void sync ()
virtual KMMessage * take (int idx)
virtual ~KMFolderMaildir ()

Static Public Member Functions

static QString constructValidFileName (const QString &filename=QString(), const MessageStatus &status=MessageStatus::statusNew())
static int createMaildirFolders (const QString &folderPath)
static bool removeFile (const QString &folderPath, const QString &filename)

Protected Member Functions

int addMsgInternal (KMMessage *msg, int *index_return=0, bool stripUid=false)
virtual FolderJob * doCreateJob (QList< KMMessage * > &msgList, const QString &sets, FolderJob::JobType jt, KMFolder *folder) const
virtual FolderJob * doCreateJob (KMMessage *msg, FolderJob::JobType jt, KMFolder *folder, const QString &partSpecifier, const AttachmentStrategy *as) const
virtual int expungeContents ()
virtual KMMessage * readMsg (int idx)
virtual int removeContents ()

Constructor & Destructor Documentation

KMFolderMaildir::KMFolderMaildir ( KMFolder *  folder,
const char *  name = 0 
) [explicit]

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 71 of file kmfoldermaildir.cpp.

KMFolderMaildir::~KMFolderMaildir (  )  [virtual]

Definition at line 79 of file kmfoldermaildir.cpp.


Member Function Documentation

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 388 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 395 of file kmfoldermaildir.cpp.

bool KMFolderMaildir::canAccess (  )  const [virtual]

Check folder for permissions.

Returns:
true if readable and writable.

Implements FolderStorage.

Definition at line 90 of file kmfoldermaildir.cpp.

void KMFolderMaildir::close ( const char *  owner,
bool  force = false 
) [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.

Definition at line 237 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 359 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 312 of file kmfoldermaildir.cpp.

static QString KMFolderMaildir::constructValidFileName ( const QString &  filename = QString(),
const MessageStatus &  status = MessageStatus::statusNew() 
) [static]

int KMFolderMaildir::create (  )  [virtual]

Implements FolderStorage.

Reimplemented in KMFolderCachedImap.

Definition at line 222 of file kmfoldermaildir.cpp.

int KMFolderMaildir::createIndexFromContents (  )  [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 844 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 181 of file kmfoldermaildir.cpp.

FolderJob * KMFolderMaildir::doCreateJob ( QList< KMMessage * > &  msgList,
const QString &  sets,
FolderJob::JobType  jt,
KMFolder *  folder 
) const [protected, virtual]

Implements FolderStorage.

Reimplemented in KMFolderCachedImap.

Definition at line 379 of file kmfoldermaildir.cpp.

virtual FolderJob* KMFolderMaildir::doCreateJob ( KMMessage *  msg,
FolderJob::JobType  jt,
KMFolder *  folder,
const 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.

qint64 KMFolderMaildir::doFolderSize (  )  const [virtual]

reimp

Reimplemented from FolderStorage.

Definition at line 1103 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 294 of file kmfoldermaildir.cpp.

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 585 of file kmfoldermaildir.cpp.

virtual bool KMFolderMaildir::isReadOnly (  )  const [inline, virtual]

Is the folder read-only?

Implements FolderStorage.

Reimplemented in KMFolderCachedImap.

Definition at line 101 of file kmfoldermaildir.h.

void KMFolderMaildir::msgStatusChanged ( const MessageStatus &  oldStatus,
const MessageStatus &  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 1086 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 120 of file kmfoldermaildir.cpp.

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 575 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 1003 of file kmfoldermaildir.cpp.

bool KMFolderMaildir::removeFile ( const QString &  folderPath,
const QString &  filename 
) [static]

Definition at line 976 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 947 of file kmfoldermaildir.cpp.

void KMFolderMaildir::sync (  )  [virtual]

fsync buffers to disk

Implements FolderStorage.

Definition at line 282 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 958 of file kmfoldermaildir.cpp.


The documentation for this class was generated from the following files:
  • kmfoldermaildir.h
  • kmfoldermaildir.cpp

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal