kmail Library API Documentation

FolderStorage Class Reference

Mail folder. More...

#include <folderstorage.h>

Inheritance diagram for FolderStorage:

QObject List of all members.

Public Types

enum  ChildrenState { HasChildren, HasNoChildren, ChildrenUnknown }

Public Slots

virtual int updateIndex ()=0
virtual void reallyAddMsg (KMMessage *aMsg)
virtual void reallyAddCopyOfMsg (KMMessage *aMsg)

Signals

void changed ()
void cleared ()
void expunged ()
void nameChanged ()
void msgRemoved (KMFolder *, Q_UINT32 sernum)
void msgRemoved (int idx, QString msgIdMD5, QString strippedSubjMD5)
void msgRemoved (KMFolder *)
void msgAdded (int idx)
void msgAdded (KMFolder *, Q_UINT32 sernum)
void msgChanged (KMFolder *, Q_UINT32 sernum, int delta)
void msgHeaderChanged (KMFolder *, int)
void statusMsg (const QString &)
void numUnreadMsgsChanged (KMFolder *)
void removed (KMFolder *, bool)

Public Member Functions

 FolderStorage (KMFolder *folder, const char *name=0)
KMFolderfolder () const
void setAcctList (KMAcctList *list)
KMAcctList * acctList () const
virtual KMFolderType folderType () const
virtual QString fileName () const
QString location () const
virtual QString indexLocation () const =0
virtual bool noContent () const
virtual void setNoContent (bool aNoContent)
virtual bool noChildren () const
virtual void setNoChildren (bool aNoChildren)
virtual ChildrenState hasChildren () const
virtual void setHasChildren (ChildrenState state)
virtual void updateChildrenState ()
virtual KMMessage * getMsg (int idx)
virtual KMMsgInfo * unGetMsg (int idx)
virtual bool isMessage (int idx)
virtual QCStringgetMsgString (int idx, QCString &mDest)=0
virtual DwString getDwString (int idx)=0
virtual void ignoreJobsForMessage (KMMessage *)
virtual FolderJob * createJob (KMMessage *msg, FolderJob::JobType jt=FolderJob::tGetMessage, KMFolder *folder=0, QString partSpecifier=QString::null, const AttachmentStrategy *as=0) const
virtual FolderJob * createJob (QPtrList< KMMessage > &msgList, const QString &sets, FolderJob::JobType jt=FolderJob::tGetMessage, KMFolder *folder=0) const
virtual const KMMsgBase * getMsgBase (int idx) const =0
virtual KMMsgBase * getMsgBase (int idx)=0
virtual const KMMsgBase * operator[] (int idx) const
virtual KMMsgBase * operator[] (int idx)
virtual KMMessage * take (int idx)
virtual void take (QPtrList< KMMessage > msgList)
virtual int addMsg (KMMessage *msg, int *index_return=0)=0
virtual int addMsgKeepUID (KMMessage *msg, int *index_return=0)
void emitMsgAddedSignals (int idx)
virtual bool canAddMsgNow (KMMessage *aMsg, int *aIndex_ret)
virtual void removeMsg (int i, bool imapQuiet=FALSE)
virtual void removeMsg (const QPtrList< KMMsgBase > &msgList, bool imapQuiet=FALSE)
virtual void removeMsg (const QPtrList< KMMessage > &msgList, bool imapQuiet=FALSE)
virtual int expungeOldMsg (int days)
virtual int moveMsg (KMMessage *msg, int *index_return=0)
virtual int moveMsg (QPtrList< KMMessage >, int *index_return=0)
virtual int find (const KMMsgBase *msg) const =0
int find (const KMMessage *msg) const
virtual int count (bool cache=false) const
virtual int countUnread ()
virtual void msgStatusChanged (const KMMsgStatus oldStatus, const KMMsgStatus newStatus, int idx)
virtual int open ()=0
virtual int canAccess ()=0
virtual void close (bool force=FALSE)=0
virtual void tryReleasingFolder (KMFolder *)
virtual void sync ()=0
bool isOpened () const
virtual void markNewAsUnread ()
virtual void markUnreadAsRead ()
virtual int create (bool imap=FALSE)=0
virtual void remove ()
virtual int expunge ()
virtual int compact (bool silent)=0
virtual int rename (const QString &newName, KMFolderDir *aParent=0)
bool autoCreateIndex () const
virtual void setAutoCreateIndex (bool)
bool dirty () const
void setDirty (bool f)
bool needsCompacting () const
virtual void setNeedsCompacting (bool f)
virtual void quiet (bool beQuiet)
virtual bool isReadOnly () const =0
QString label () const
virtual const char * type () const
bool hasAccounts () const
virtual void correctUnreadMsgsCount ()
virtual int writeIndex (bool createEmptyIndex=false)=0
void fillMsgDict (KMMsgDict *dict)
int writeMsgDict (KMMsgDict *dict=0)
int touchMsgDict ()
int appendtoMsgDict (int idx=-1)
void setRDict (KMMsgDictREntry *rentry)
KMMsgDictREntry * rDict () const
virtual void setStatus (int idx, KMMsgStatus status, bool toggle=false)
virtual void setStatus (QValueList< int > &ids, KMMsgStatus status, bool toggle=false)
void removeJobs ()
virtual void readConfig ()
virtual void writeConfig ()
virtual KMFoldertrashFolder () const
void addJob (FolderJob *) const
bool compactable () const
virtual void setContentsType (KMail::FolderContentsType type)
KMail::FolderContentsType contentsType () const

Static Public Member Functions

size_t crlf2lf (char *str, const size_t strLen)
QString dotEscape (const QString &)

Protected Types

enum  { mDirtyTimerInterval = 600000 }

Protected Slots

virtual void removeJob (QObject *)

Protected Member Functions

virtual FolderJob * doCreateJob (KMMessage *msg, FolderJob::JobType jt, KMFolder *folder, QString partSpecifier, const AttachmentStrategy *as) const =0
virtual FolderJob * doCreateJob (QPtrList< KMMessage > &msgList, const QString &sets, FolderJob::JobType jt, KMFolder *folder) const =0
void headerOfMsgChanged (const KMMsgBase *, int idx)
virtual KMMessage * readMsg (int idx)=0
virtual bool readIndex ()=0
virtual int removeContents ()=0
virtual int expungeContents ()=0
virtual KMMsgBase * takeIndexEntry (int idx)=0
virtual KMMsgInfo * setIndexEntry (int idx, KMMessage *msg)=0
virtual void clearIndex (bool autoDelete=true, bool syncDict=false)=0
virtual void fillDictFromIndex (KMMsgDict *dict)=0
virtual void truncateIndex ()=0

Protected Attributes

int mOpenCount
int mQuiet
bool mChanged
bool mAutoCreateIndex
bool mDirty
bool mFilesLocked
KMAcctList * mAcctList
int mUnreadMsgs
int mGuessedUnreadMsgs
int mTotalMsgs
bool mWriteConfigEnabled
bool needsCompact
bool mCompactable
bool mNoContent
bool mNoChildren
bool mConvertToUtf8
bool mContentsTypeChanged
KMMsgDictREntry * mRDict
QPtrList< FolderJob > mJobList
QTimermDirtyTimer
ChildrenState mHasChildren
KMail::FolderContentsType mContentsType
KMFoldermFolder

Detailed Description

Mail folder.

(description will be here).

Accounts: The accounts (of KMail) that are fed into the folder are represented as the children of the folder. They are only stored here during runtime to have a reference for which accounts point to a specific folder.

Definition at line 80 of file folderstorage.h.


Constructor & Destructor Documentation

FolderStorage::FolderStorage 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 62 of file folderstorage.cpp.

References mAutoCreateIndex, mCompactable, mContentsType, mDirty, mGuessedUnreadMsgs, mRDict, mUnreadMsgs, needsCompact, and updateIndex().


Member Function Documentation

virtual KMFolderType FolderStorage::folderType  )  const [inline, virtual]
 

Returns the type of this folder.

Definition at line 99 of file folderstorage.h.

Referenced by KMFolder::folderType(), and KMail::ScheduledCompactionTask::run().

QString FolderStorage::fileName  )  const [virtual]
 

Returns the filename of the folder (reimplemented in KMFolderImap).

Definition at line 130 of file folderstorage.cpp.

Referenced by KMFolder::fileName(), and location().

QString FolderStorage::location  )  const
 

Returns full path to folder file.

Definition at line 120 of file folderstorage.cpp.

References dotEscape(), and fileName().

Referenced by getMsg(), KMFolder::location(), and rename().

virtual QString FolderStorage::indexLocation  )  const [pure virtual]
 

Returns full path to index file.

Referenced by expunge(), KMFolder::indexLocation(), remove(), and rename().

virtual bool FolderStorage::noContent  )  const [inline, virtual]
 

Returns, if the folder can't contain mails, but only subfolder.

Definition at line 110 of file folderstorage.h.

Referenced by KMFolder::noContent().

virtual void FolderStorage::setNoContent bool  aNoContent  )  [inline, virtual]
 

Specify, that the folder can't contain mails.

Definition at line 113 of file folderstorage.h.

Referenced by KMFolder::setNoContent().

virtual bool FolderStorage::noChildren  )  const [inline, virtual]
 

Returns, if the folder can't have children.

Definition at line 117 of file folderstorage.h.

Referenced by KMFolder::noChildren().

void FolderStorage::setNoChildren bool  aNoChildren  )  [virtual]
 

Specify, that the folder can't have children.

Definition at line 988 of file folderstorage.cpp.

References setHasChildren().

Referenced by KMFolder::setNoChildren().

virtual ChildrenState FolderStorage::hasChildren  )  const [inline, virtual]
 

Returns if the folder has children, has no children or we don't know.

Definition at line 129 of file folderstorage.h.

virtual void FolderStorage::setHasChildren ChildrenState  state  )  [inline, virtual]
 

Specify if the folder has children.

Definition at line 132 of file folderstorage.h.

Referenced by setNoChildren(), and updateChildrenState().

void FolderStorage::updateChildrenState  )  [virtual]
 

Updates the hasChildren() state.

Definition at line 976 of file folderstorage.cpp.

References KMFolder::child(), and setHasChildren().

Referenced by KMFolder::setChild().

KMMessage * FolderStorage::getMsg int  idx  )  [virtual]
 

Read message at given index.

Indexing starts at zero Definition at line 428 of file folderstorage.cpp.

References count(), getMsgBase(), label(), location(), mCompactable, readMsg(), and writeConfig().

Referenced by KMFolder::getMsg().

KMMsgInfo * FolderStorage::unGetMsg int  idx  )  [virtual]
 

Replace KMMessage with KMMsgInfo and delete KMMessage.

Definition at line 473 of file folderstorage.cpp.

References count(), getMsgBase(), and ignoreJobsForMessage().

Referenced by reallyAddCopyOfMsg(), reallyAddMsg(), and KMFolder::unGetMsg().

bool FolderStorage::isMessage int  idx  )  [virtual]
 

Checks if the message is already "gotten" with getMsg.

Definition at line 498 of file folderstorage.cpp.

References count(), and getMsgBase().

Referenced by KMFolder::isMessage().

virtual QCString& FolderStorage::getMsgString int  idx,
QCString mDest
[pure virtual]
 

Read a message and return a referece to a string.

Referenced by KMFolder::getMsgString().

virtual DwString FolderStorage::getDwString int  idx  )  [pure virtual]
 

Read a message and returns a DwString.

Referenced by KMFolder::getDwString().

void FolderStorage::ignoreJobsForMessage KMMessage *   )  [virtual]
 

Removes and deletes all jobs associated with the particular message.

Definition at line 916 of file folderstorage.cpp.

References mJobList.

Referenced by KMFolder::ignoreJobsForMessage(), and unGetMsg().

FolderJob * FolderStorage::createJob KMMessage *  msg,
FolderJob::JobType  jt = FolderJob::tGetMessage,
KMFolder folder = 0,
QString  partSpecifier = QString::null,
const AttachmentStrategy *  as = 0
const [virtual]
 

These methods create respective FolderJob (You should derive FolderJob for each derived KMFolder).

Definition at line 507 of file folderstorage.cpp.

References addJob(), and doCreateJob().

Referenced by KMFolder::createJob().

virtual const KMMsgBase* FolderStorage::getMsgBase int  idx  )  const [pure virtual]
 

Provides access to the basic message fields that are also stored in the index.

Whenever you only need subject, from, date, status you should use this method instead of getMsg() because getMsg() will load the message if necessary and this method does not.

Referenced by expungeOldMsg(), getMsg(), KMFolder::getMsgBase(), isMessage(), markNewAsUnread(), markUnreadAsRead(), operator[](), removeMsg(), setStatus(), take(), and unGetMsg().

virtual const KMMsgBase* FolderStorage::operator[] int  idx  )  const [inline, virtual]
 

Same as getMsgBase(int).

Definition at line 177 of file folderstorage.h.

References getMsgBase().

virtual KMMsgBase* FolderStorage::operator[] int  idx  )  [inline, virtual]
 

Same as getMsgBase(int).

This time non-const. Definition at line 180 of file folderstorage.h.

References getMsgBase().

KMMessage * FolderStorage::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. Definition at line 377 of file folderstorage.cpp.

References count(), getMsgBase(), msgRemoved(), mUnreadMsgs, needsCompact, numUnreadMsgsChanged(), readMsg(), and setDirty().

Referenced by KMFolder::take().

virtual int FolderStorage::addMsg KMMessage *  msg,
int *  index_return = 0
[pure 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).

Referenced by KMFolder::addMsg(), addMsgKeepUID(), moveMsg(), reallyAddCopyOfMsg(), and reallyAddMsg().

virtual int FolderStorage::addMsgKeepUID KMMessage *  msg,
int *  index_return = 0
[inline, virtual]
 

(Note(bo): This needs to be fixed better at a later point.) This is overridden by dIMAP because addMsg strips the X-UID header from the mail.

Definition at line 198 of file folderstorage.h.

References addMsg().

Referenced by KMFolder::addMsgKeepUID().

void FolderStorage::emitMsgAddedSignals int  idx  ) 
 

Called by derived classes implementation of addMsg.

Emits msgAdded signals Definition at line 250 of file folderstorage.cpp.

References msgAdded().

Referenced by KMFolder::emitMsgAddedSignals().

bool FolderStorage::canAddMsgNow KMMessage *  aMsg,
int *  aIndex_ret
[virtual]
 

Returns FALSE, if the message has to be retrieved from an IMAP account first.

In this case this function does this and cares for the rest Definition at line 262 of file folderstorage.cpp.

References KMFolder::createJob(), KMFolder::folderType(), and reallyAddMsg().

void FolderStorage::removeMsg int  i,
bool  imapQuiet = FALSE
[virtual]
 

Remove (first occurrence of) given message from the folder.

Definition at line 339 of file folderstorage.cpp.

References getMsgBase(), msgRemoved(), mUnreadMsgs, needsCompact, numUnreadMsgsChanged(), and setDirty().

Referenced by expungeOldMsg(), and KMFolder::removeMsg().

int FolderStorage::expungeOldMsg int  days  )  [virtual]
 

Delete messages in the folder that are older than days.

Return the number of deleted messages. Definition at line 226 of file folderstorage.cpp.

References count(), getMsgBase(), and removeMsg().

Referenced by KMFolder::expungeOldMsg().

int FolderStorage::moveMsg KMMessage *  msg,
int *  index_return = 0
[virtual]
 

Detaches the given message from it's current folder and adds it to this 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. Definition at line 528 of file folderstorage.cpp.

References addMsg(), KMFolder::close(), close(), open(), and KMFolder::open().

Referenced by KMFolder::moveMsg().

virtual int FolderStorage::find const KMMsgBase *  msg  )  const [pure virtual]
 

Returns the index of the given message or -1 if not found.

Referenced by KMFolder::find().

int FolderStorage::count bool  cache = false  )  const [virtual]
 

Number of messages in this folder.

Definition at line 738 of file folderstorage.cpp.

Referenced by appendtoMsgDict(), KMFolder::count(), expungeOldMsg(), getMsg(), isMessage(), markNewAsUnread(), markUnreadAsRead(), reallyAddCopyOfMsg(), take(), and unGetMsg().

int FolderStorage::countUnread  )  [virtual]
 

Number of new or unread messages in this folder.

Definition at line 747 of file folderstorage.cpp.

References close(), mGuessedUnreadMsgs, mUnreadMsgs, open(), and readConfig().

Referenced by KMFolder::countUnread().

void FolderStorage::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.

Definition at line 766 of file folderstorage.cpp.

References msgChanged(), mUnreadMsgs, and numUnreadMsgsChanged().

Referenced by KMFolder::msgStatusChanged().

virtual int FolderStorage::open  )  [pure virtual]
 

Open folder for access.

Does not work if the parent is not set. 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).

Referenced by correctUnreadMsgsCount(), countUnread(), expunge(), moveMsg(), KMFolder::open(), and rename().

virtual int FolderStorage::canAccess  )  [pure virtual]
 

Check folder for permissions Returns zero if readable and writable.

Referenced by KMFolder::canAccess().

virtual void FolderStorage::close bool  force = FALSE  )  [pure virtual]
 

Close folder.

If force is TRUE the files are closed even if others still use it (e.g. other mail reader windows).

Referenced by KMFolder::close(), correctUnreadMsgsCount(), countUnread(), expunge(), moveMsg(), remove(), and rename().

virtual void FolderStorage::tryReleasingFolder KMFolder  )  [inline, virtual]
 

Try releasing folder if possible, something is attempting an exclusive access to it.

Currently used for KMFolderSearch and the background tasks like expiry. Definition at line 259 of file folderstorage.h.

virtual void FolderStorage::sync  )  [pure virtual]
 

fsync buffers to disk

Referenced by KMFolder::sync().

bool FolderStorage::isOpened  )  const [inline]
 

Test if folder is opened.

Definition at line 265 of file folderstorage.h.

Referenced by KMFolder::isOpened().

void FolderStorage::markNewAsUnread  )  [virtual]
 

Mark all new messages as unread.

Definition at line 154 of file folderstorage.cpp.

References count(), and getMsgBase().

Referenced by KMFolder::markNewAsUnread().

void FolderStorage::markUnreadAsRead  )  [virtual]
 

Mark all new and unread messages as read.

Definition at line 170 of file folderstorage.cpp.

References count(), and getMsgBase().

Referenced by KMFolder::markUnreadAsRead().

virtual int FolderStorage::create bool  imap = FALSE  )  [pure virtual]
 

Create a new folder with the name of this object and open it.

Returns zero on success and an error code equal to the c-library fopen call otherwise.

Referenced by KMFolder::create().

void FolderStorage::remove  )  [virtual]
 

Removes the folder physically from disk and empties the contents of the folder in memory.

Note that the folder is closed during this process, whether there are others using it or not.

See also:
KMFolder::removeContents
Definition at line 662 of file folderstorage.cpp.

References close(), indexLocation(), needsCompact, removeContents(), and removed().

Referenced by KMFolder::remove().

int FolderStorage::expunge  )  [virtual]
 

Delete entire folder.

Forces a close *but* opens the folder again afterwards. Returns errno(3) error code or zero on success.

See also:
KMFolder::expungeContents
Definition at line 686 of file folderstorage.cpp.

References changed(), close(), expungeContents(), expunged(), indexLocation(), mAutoCreateIndex, mDirty, mUnreadMsgs, needsCompact, numUnreadMsgsChanged(), open(), and writeConfig().

Referenced by KMFolder::expunge().

virtual int FolderStorage::compact bool  silent  )  [pure virtual]
 

Remove deleted messages from the folder.

Returns zero on success and an errno on failure. A statusbar message will inform the user that the compaction worked, unless silent is set.

Referenced by KMFolder::compact().

int FolderStorage::rename const QString newName,
KMFolderDir aParent = 0
[virtual]
 

Physically rename the folder.

Returns zero on success and an errno on failure. Definition at line 569 of file folderstorage.cpp.

References KMFolder::child(), close(), KMFolder::fileName(), KMFolder::idString(), indexLocation(), location(), nameChanged(), open(), KMFolder::subdirLocation(), and writeConfig().

Referenced by KMFolder::rename().

bool FolderStorage::autoCreateIndex  )  const [inline]
 

Returns TRUE if a table of contents file is automatically created.

Definition at line 300 of file folderstorage.h.

References mAutoCreateIndex.

Referenced by KMFolder::autoCreateIndex().

void FolderStorage::setAutoCreateIndex bool   )  [virtual]
 

Allow/disallow automatic creation of a table of contents file.

Default is TRUE. Definition at line 138 of file folderstorage.cpp.

References mAutoCreateIndex.

Referenced by KMFolder::setAutoCreateIndex().

bool FolderStorage::dirty  )  const [inline]
 

Returns TRUE if the table of contents is dirty.

This happens when a message is deleted from the folder. The toc will then be re-created when the folder is closed. Definition at line 309 of file folderstorage.h.

References mDirty.

Referenced by KMFolder::dirty().

void FolderStorage::setDirty bool  f  ) 
 

Change the dirty flag.

Definition at line 144 of file folderstorage.cpp.

References mAutoCreateIndex, and mDirty.

Referenced by removeMsg(), KMFolder::setDirty(), and take().

bool FolderStorage::needsCompacting  )  const [inline]
 

Returns TRUE if the folder contains deleted messages.

Definition at line 315 of file folderstorage.h.

References needsCompact.

Referenced by KMFolder::needsCompacting().

void FolderStorage::quiet bool  beQuiet  )  [virtual]
 

If set to quiet the folder will not emit msgAdded(idx) signal.

This is necessary because adding the messages to the listview one by one as they come in ( as happens on msgAdded(idx) ) is very slow for large ( >10000 ) folders. For pop, where whole bodies are downloaded this is not an issue, but for imap, where we only download headers it becomes a bottleneck. We therefore set the folder quiet() and rebuild the listview completely once the complete folder has been checked. Definition at line 192 of file folderstorage.cpp.

References changed().

Referenced by KMFolder::quiet().

virtual bool FolderStorage::isReadOnly  )  const [pure virtual]
 

Is the folder read-only?

Referenced by KMFolder::isReadOnly().

QString FolderStorage::label  )  const
 

Returns the label of the folder for visualization.

Definition at line 733 of file folderstorage.cpp.

References KMFolder::label().

Referenced by getMsg().

const char * FolderStorage::type  )  const [virtual]
 

Type of the folder.

Inherited. Definition at line 725 of file folderstorage.cpp.

Referenced by readConfig(), and KMFolder::type().

bool FolderStorage::hasAccounts  )  const [inline]
 

Returns TRUE if accounts are associated with this folder.

Definition at line 338 of file folderstorage.h.

Referenced by KMFolder::hasAccounts().

void FolderStorage::correctUnreadMsgsCount  )  [virtual]
 

A cludge to help make sure the count of unread messges is kept in sync.

Definition at line 839 of file folderstorage.cpp.

References close(), numUnreadMsgsChanged(), and open().

Referenced by KMFolder::correctUnreadMsgsCount().

virtual int FolderStorage::writeIndex bool  createEmptyIndex = false  )  [pure virtual]
 

Write index to index-file.

Returns 0 on success and errno error on failure.

Referenced by KMFolder::writeIndex().

void FolderStorage::fillMsgDict KMMsgDict *  dict  ) 
 

Inserts messages into the message dictionary.

Might be called during kernel initialization. Definition at line 847 of file folderstorage.cpp.

Referenced by KMFolder::fillMsgDict().

int FolderStorage::writeMsgDict KMMsgDict *  dict = 0  ) 
 

Writes the message serial number file.

Definition at line 853 of file folderstorage.cpp.

Referenced by KMFolder::writeMsgDict().

int FolderStorage::touchMsgDict  ) 
 

Touches the message serial number file.

Definition at line 864 of file folderstorage.cpp.

Referenced by KMFolder::touchMsgDict().

int FolderStorage::appendtoMsgDict int  idx = -1  ) 
 

Append message to end of message serial number file.

Definition at line 874 of file folderstorage.cpp.

References count().

Referenced by KMFolder::appendtoMsgDict().

void FolderStorage::setRDict KMMsgDictREntry *  rentry  ) 
 

Sets the reverse-dictionary for this folder.

Definition at line 900 of file folderstorage.cpp.

References mRDict.

Referenced by KMFolder::setRDict().

KMMsgDictREntry* FolderStorage::rDict  )  const [inline]
 

Returns the reverse-dictionary for this folder.

Definition at line 364 of file folderstorage.h.

References mRDict.

Referenced by KMFolder::rDict().

void FolderStorage::setStatus int  idx,
KMMsgStatus  status,
bool  toggle = false
[virtual]
 

Set the status of the message at index idx to status.

Definition at line 889 of file folderstorage.cpp.

References getMsgBase().

Referenced by KMFolder::setStatus(), and setStatus().

void FolderStorage::setStatus QValueList< int > &  ids,
KMMsgStatus  status,
bool  toggle = false
[virtual]
 

Set the status of the message(s) in the QValueList ids to status.

Definition at line 908 of file folderstorage.cpp.

References setStatus().

size_t FolderStorage::crlf2lf char *  str,
const size_t  strLen
[static]
 

Convert "\r\n" line endings in "\n" line endings.

The conversion happens in place. Returns the length of the resulting string. Definition at line 946 of file folderstorage.cpp.

Referenced by KMFolder::crlf2lf().

QString FolderStorage::dotEscape const QString  )  [static]
 

Escape a leading dot.

Definition at line 100 of file folderstorage.cpp.

Referenced by location(), and KMFolder::subdirLocation().

void FolderStorage::readConfig  )  [virtual]
 

Read the config file.

Definition at line 805 of file folderstorage.cpp.

References mCompactable, mUnreadMsgs, KMFolder::readConfig(), setContentsType(), and type().

Referenced by countUnread(), and KMFolder::KMFolder().

void FolderStorage::writeConfig  )  [virtual]
 

Write the config file.

Definition at line 825 of file folderstorage.cpp.

References mCompactable, mContentsType, mGuessedUnreadMsgs, mUnreadMsgs, and KMFolder::writeConfig().

Referenced by expunge(), getMsg(), rename(), KMFolder::setAutoExpire(), setContentsType(), KMFolder::setMailingListEnabled(), KMFolder::setReadExpireAge(), and KMFolder::setUnreadExpireAge().

virtual KMFolder* FolderStorage::trashFolder  )  const [inline, virtual]
 

If this folder has a special trash folder set, return it.

Otherwise return 0. Definition at line 392 of file folderstorage.h.

Referenced by KMFolder::trashFolder().

void FolderStorage::addJob FolderJob *   )  const
 

Add job for this folder.

This is done automatically by createJob. This method is public only for other kind of FolderJob like ExpireJob. Definition at line 106 of file folderstorage.cpp.

References mJobList.

Referenced by createJob().

bool FolderStorage::compactable  )  const [inline]
 

false if index file is out of sync with mbox file

Definition at line 401 of file folderstorage.h.

References mCompactable.

void FolderStorage::setContentsType KMail::FolderContentsType  type  )  [virtual]
 

Set the type of contents held in this folder (mail, calendar, etc.).

Definition at line 996 of file folderstorage.cpp.

References mContentsType, and writeConfig().

Referenced by readConfig(), and KMail::FolderDiaGeneralTab::save().

KMail::FolderContentsType FolderStorage::contentsType  )  const [inline]
 

the type of contents held in this folder (mail, calendar, etc.)

Definition at line 406 of file folderstorage.h.

References mContentsType.

void FolderStorage::changed  )  [signal]
 

Emitted when the status, name, or associated accounts of this folder changed.

Referenced by expunge(), and quiet().

void FolderStorage::cleared  )  [signal]
 

Emitted when the contents of a folder have been cleared (new search in a search folder, for example).

void FolderStorage::expunged  )  [signal]
 

Emitted after an expunge.

If not quiet, changed() will be emmitted first.

Referenced by expunge().

void FolderStorage::nameChanged  )  [signal]
 

Emitted when the name of the folder changes.

Referenced by rename().

void FolderStorage::msgRemoved KMFolder ,
Q_UINT32  sernum
[signal]
 

Emitted before a message is removed from the folder.

Referenced by removeMsg(), and take().

void FolderStorage::msgRemoved int  idx,
QString  msgIdMD5,
QString  strippedSubjMD5
[signal]
 

Emitted after a message is removed from the folder.

void FolderStorage::msgAdded int  idx  )  [signal]
 

Emitted when a message is added from the folder.

Referenced by emitMsgAddedSignals().

void FolderStorage::msgChanged KMFolder ,
Q_UINT32  sernum,
int  delta
[signal]
 

Emitted, when the status of a message is changed.

Referenced by msgStatusChanged().

void FolderStorage::msgHeaderChanged KMFolder ,
int 
[signal]
 

Emitted when a field of the header of a specific message changed.

Referenced by headerOfMsgChanged().

void FolderStorage::statusMsg const QString  )  [signal]
 

Emmited to display a message somewhere in a status line.

void FolderStorage::numUnreadMsgsChanged KMFolder  )  [signal]
 

Emitted when number of unread messages has changed.

Referenced by correctUnreadMsgsCount(), expunge(), msgStatusChanged(), removeMsg(), and take().

void FolderStorage::removed KMFolder ,
bool 
[signal]
 

Emitted when a folder was removed.

Referenced by remove().

virtual int FolderStorage::updateIndex  )  [pure virtual, slot]
 

Incrementally update the index if possible else call writeIndex.

Referenced by FolderStorage(), and KMFolder::updateIndex().

void FolderStorage::reallyAddMsg KMMessage *  aMsg  )  [virtual, slot]
 

Add the message to the folder after it has been retrieved from an IMAP server.

Definition at line 284 of file folderstorage.cpp.

References addMsg(), and unGetMsg().

Referenced by canAddMsgNow(), and KMFolder::reallyAddMsg().

void FolderStorage::reallyAddCopyOfMsg KMMessage *  aMsg  )  [virtual, slot]
 

Add a copy of the message to the folder after it has been retrieved from an IMAP server.

Definition at line 304 of file folderstorage.cpp.

References addMsg(), count(), and unGetMsg().

Referenced by KMFolder::reallyAddCopyOfMsg().

virtual FolderJob* FolderStorage::doCreateJob KMMessage *  msg,
FolderJob::JobType  jt,
KMFolder folder,
QString  partSpecifier,
const AttachmentStrategy *  as
const [protected, pure virtual]
 

These two methods actually create the jobs.

They have to be implemented in all folders.

See also:
createJob

Referenced by createJob().

void FolderStorage::headerOfMsgChanged const KMMsgBase *  ,
int  idx
[protected]
 

Tell the folder that a header field that is usually used for the index (subject, from, ...) has changed of given message.

This method is usually called from within KMMessage::setSubject/set... Definition at line 794 of file folderstorage.cpp.

References msgHeaderChanged().

virtual KMMessage* FolderStorage::readMsg int  idx  )  [protected, pure virtual]
 

Load message from file and store it at given index.

Returns 0 on failure.

Referenced by getMsg(), and take().

virtual bool FolderStorage::readIndex  )  [protected, pure virtual]
 

Read index file and fill the message-info list mMsgList.

virtual int FolderStorage::removeContents  )  [protected, pure 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.

Referenced by remove().

virtual int FolderStorage::expungeContents  )  [protected, pure 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.

Referenced by expunge().


Member Data Documentation

bool FolderStorage::mAutoCreateIndex [protected]
 

is the automatic creation of a index file allowed ?

Definition at line 508 of file folderstorage.h.

Referenced by autoCreateIndex(), expunge(), FolderStorage(), setAutoCreateIndex(), and setDirty().

bool FolderStorage::mDirty [protected]
 

if the index is dirty it will be recreated upon close()

Definition at line 510 of file folderstorage.h.

Referenced by dirty(), expunge(), FolderStorage(), and setDirty().

bool FolderStorage::mFilesLocked [protected]
 

TRUE if the files of the folder are locked (writable).

Definition at line 512 of file folderstorage.h.

int FolderStorage::mUnreadMsgs [protected]
 

number of unread messages, -1 if not yet set

Definition at line 516 of file folderstorage.h.

Referenced by countUnread(), expunge(), FolderStorage(), msgStatusChanged(), readConfig(), removeMsg(), take(), and writeConfig().

int FolderStorage::mGuessedUnreadMsgs [protected]
 

number of unread messages, -1 if not yet set

Definition at line 516 of file folderstorage.h.

Referenced by countUnread(), FolderStorage(), and writeConfig().

bool FolderStorage::needsCompact [protected]
 

sven: true if on destruct folder needs to be compacted.

Definition at line 520 of file folderstorage.h.

Referenced by expunge(), FolderStorage(), needsCompacting(), remove(), removeMsg(), and take().

bool FolderStorage::mCompactable [protected]
 

false if index file is out of sync with mbox file

Definition at line 522 of file folderstorage.h.

Referenced by compactable(), FolderStorage(), getMsg(), readConfig(), and writeConfig().

KMMsgDictREntry* FolderStorage::mRDict [protected]
 

Points at the reverse dictionary for this folder.

Definition at line 529 of file folderstorage.h.

Referenced by FolderStorage(), rDict(), and setRDict().

QPtrList<FolderJob> FolderStorage::mJobList [mutable, protected]
 

List of jobs created by this folder.

Definition at line 531 of file folderstorage.h.

Referenced by addJob(), and ignoreJobsForMessage().

KMail::FolderContentsType FolderStorage::mContentsType [protected]
 

Type of contents in this folder.

Definition at line 539 of file folderstorage.h.

Referenced by contentsType(), FolderStorage(), setContentsType(), and writeConfig().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:52:55 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003