kmail Library API Documentation

KMFolder Class Reference

Mail folder. More...

#include <kmfolder.h>

Inheritance diagram for KMFolder:

KMAcctFolder List of all members.

Public Slots

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

Signals

void changed ()
void cleared ()
void expunged ()
void iconsChanged ()
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 syncRunning (KMFolder *, bool)

Public Methods

 KMFolder (KMFolderDir *parent=0, const QString &name=QString::null)
virtual ~KMFolder ()
virtual KMFolderType folderType () const
virtual QString fileName () const
QString location () const
virtual QString indexLocation () const=0
QString subdirLocation () const
virtual KMFolderDirchild () const
virtual KMFolderDircreateChildFolder ()
virtual void setChild (KMFolderDir *aChild)
virtual bool noContent () const
virtual void setNoContent (bool aNoContent)
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 (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 int countUnreadRecursive ()
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 sync ()=0
bool isOpened () const
virtual void markNewAsUnread ()
virtual void markUnreadAsRead ()
virtual int create (bool imap=FALSE)=0
virtual int remove ()
virtual int expunge ()
virtual int compact ()=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
bool isSystemFolder () const
void setSystemFolder (bool itIs)
virtual QString label () const
void setLabel (const QString &lbl)
virtual const char * type () const
virtual QCString protocol () const=0
bool hasAccounts () const
void setMailingList (bool enabled)
bool isMailingList () const
void setMailingListPostAddress (const QString &address)
QString mailingListPostAddress () const
void setMailingListAdminAddress (const QString &address)
QString mailingListAdminAddress () const
void setIdentity (uint identity)
uint identity () const
QString whoField () const
void setWhoField (const QString &aWhoField)
QString userWhoField (void)
void setUserWhoField (const QString &whoField, bool writeConfig=true)
virtual void correctUnreadMsgsCount ()
virtual QString idString () const
void setAutoExpire (bool enabled)
virtual bool isAutoExpire () const
void setUnreadExpireAge (int age)
void setUnreadExpireUnits (ExpireUnits units)
void setReadExpireAge (int age)
void setReadExpireUnits (ExpireUnits units)
int getUnreadExpireAge () const
int getReadExpireAge () const
ExpireUnits getUnreadExpireUnits () const
ExpireUnits getReadExpireUnits () const
void expireOldMessages ()
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)
virtual bool useCustomIcons () const
virtual void setUseCustomIcons (bool useCustomIcons)
virtual QString normalIconPath () const
virtual QString unreadIconPath () const
virtual void setIconPaths (const QString &normalPath, const QString &unreadPath)
void removeJobs ()

Static Public Methods

size_t crlf2lf (char *str, const size_t strLen)

Protected Types

enum  { mDirtyTimerInterval = 600000 }

Protected Slots

virtual void removeJob (QObject *)

Protected Methods

virtual void addJob (FolderJob *) const
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 QString dotEscape (const QString &) const
virtual KMMessage * readMsg (int idx)=0
virtual bool readIndex ()=0
virtual int removeContents ()=0
virtual int expungeContents ()=0
virtual void writeConfig ()
virtual void readConfig ()
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
int daysToExpire (int num, ExpireUnits units)

Protected Attributes

int mOpenCount
int mQuiet
bool mChanged
bool mAutoCreateIndex
bool mDirty
bool mFilesLocked
QString mLabel
QString mWhoField
QString mUserWhoField
bool mIsSystemFolder
KMAcctList * mAcctList
bool mMailingListEnabled
QString mMailingListPostingAddress
QString mMailingListAdminAddress
uint mIdentity
int mUnreadMsgs
int mGuessedUnreadMsgs
int mTotalMsgs
bool mWriteConfigEnabled
bool needsCompact
bool mCompactable
bool mNoContent
KMFolderDirmChild
bool mConvertToUtf8
bool expireMessages
int unreadExpireAge
int readExpireAge
ExpireUnits unreadExpireUnits
ExpireUnits readExpireUnits
KMMsgDictREntry * mRDict
QPtrList< FolderJob > mJobList
bool mUseCustomIcons
QString mNormalIconPath
QString mUnreadIconPath
QTimermDirtyTimer

Detailed Description

Mail folder.

(description will be here).

@sect 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 50 of file kmfolder.h.


Constructor & Destructor Documentation

KMFolder::KMFolder KMFolderDir   parent = 0,
const QString   name = QString::null
 

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 31 of file kmfolder.cpp.

References QObject::connect(), expireMessages, mAutoCreateIndex, mCompactable, mDirty, mGuessedUnreadMsgs, mRDict, msgAdded(), msgChanged(), msgHeaderChanged(), msgRemoved(), mUnreadMsgs, mUseCustomIcons, needsCompact, QObject::parent(), readConfig(), and updateIndex().


Member Function Documentation

virtual KMFolderType KMFolder::folderType   const [inline, virtual]
 

Returns the type of this folder.

Definition at line 64 of file kmfolder.h.

Referenced by canAddMsgNow(), createChildFolder(), and KMSystemTray::prettyName().

virtual QString KMFolder::fileName   const [inline, virtual]
 

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

Definition at line 67 of file kmfolder.h.

References QObject::name().

Referenced by createChildFolder(), location(), KMFolderDir::reload(), rename(), and subdirLocation().

QString KMFolder::location   const
 

Returns full path to folder file.

Definition at line 109 of file kmfolder.cpp.

References dotEscape(), fileName(), and QString::isEmpty().

Referenced by getMsg(), and rename().

virtual QString KMFolder::indexLocation   const [pure virtual]
 

Returns full path to index file.

Referenced by expunge(), remove(), and rename().

QString KMFolder::subdirLocation   const
 

Returns full path to sub directory file.

Definition at line 122 of file kmfolder.cpp.

References dotEscape(), fileName(), and QString::isEmpty().

Referenced by rename().

virtual KMFolderDir* KMFolder::child   const [inline, virtual]
 

Returns the folder directory associated with this node or 0 if no such directory exists.

Definition at line 80 of file kmfolder.h.

Referenced by countUnreadRecursive().

KMFolderDir * KMFolder::createChildFolder   [virtual]
 

Create a child folder directory and associates it with this folder.

Definition at line 135 of file kmfolder.cpp.

References QFile::encodeName(), fileName(), folderType(), QObject::parent(), and KMFolderDir::reload().

virtual void KMFolder::setChild KMFolderDir   aChild [inline, virtual]
 

Set the folder directory associated with this node.

Definition at line 87 of file kmfolder.h.

Referenced by KMFolderDir::reload().

virtual bool KMFolder::noContent   const [inline, virtual]
 

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

Definition at line 91 of file kmfolder.h.

virtual void KMFolder::setNoContent bool    aNoContent [inline, virtual]
 

Specify, that the folder can't contain mails.

Definition at line 95 of file kmfolder.h.

KMMessage * KMFolder::getMsg int    idx [virtual]
 

Read message at given index.

Indexing starts at zero

Definition at line 488 of file kmfolder.cpp.

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

Referenced by KMHeaders::currentMsg(), KMHeaders::msgChanged(), and KMHeaders::selectMessage().

KMMsgInfo * KMFolder::unGetMsg int    idx [virtual]
 

Replace KMMessage with KMMsgInfo and delete KMMessage.

Definition at line 532 of file kmfolder.cpp.

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

Referenced by reallyAddCopyOfMsg(), reallyAddMsg(), and KMHeaders::slotFilterMsg().

bool KMFolder::isMessage int    idx [virtual]
 

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

Definition at line 557 of file kmfolder.cpp.

References count(), and getMsgBase().

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

Read a message and return a referece to a string.

virtual DwString KMFolder::getDwString int    idx [pure virtual]
 

Read a message and returns a DwString.

void KMFolder::ignoreJobsForMessage KMMessage *    [virtual]
 

Removes and deletes all jobs associated with the particular message.

Definition at line 1064 of file kmfolder.cpp.

References QPtrListIterator::current(), mJobList, and QPtrList< FolderJob >::remove().

Referenced by unGetMsg().

FolderJob * KMFolder::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 566 of file kmfolder.cpp.

References doCreateJob().

Referenced by canAddMsgNow(), and expireOldMessages().

virtual const KMMsgBase* KMFolder::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 KMHeaders::contentsMouseMoveEvent(), expungeOldMsg(), KMHeaders::findUnreadAux(), getMsg(), isMessage(), markNewAsUnread(), markUnreadAsRead(), KMHeaders::msgAdded(), KMHeaders::msgChanged(), operator[](), removeMsg(), KMHeaders::selectedMsgs(), KMHeaders::setMsgStatus(), setStatus(), KMHeaders::showNewMail(), take(), and unGetMsg().

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

Same as getMsgBase(int).

Definition at line 137 of file kmfolder.h.

References getMsgBase().

virtual KMMsgBase* KMFolder::operator[] int    idx [inline, virtual]
 

Same as getMsgBase(int).

This time non-const.

Definition at line 140 of file kmfolder.h.

References getMsgBase().

KMMessage * KMFolder::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 437 of file kmfolder.cpp.

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

virtual int KMFolder::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 addMsgKeepUID(), moveMsg(), reallyAddCopyOfMsg(), and reallyAddMsg().

virtual int KMFolder::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 158 of file kmfolder.h.

References addMsg().

void KMFolder::emitMsgAddedSignals int    idx
 

Called by derived classes implementation of addMsg.

Emits msgAdded signals

Definition at line 321 of file kmfolder.cpp.

References msgAdded().

bool KMFolder::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 333 of file kmfolder.cpp.

References QObject::connect(), createJob(), folderType(), and reallyAddMsg().

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

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

Definition at line 399 of file kmfolder.cpp.

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

Referenced by expungeOldMsg().

int KMFolder::expungeOldMsg int    days [virtual]
 

Delete messages in the folder that are older than days.

Return the number of deleted messages.

Definition at line 262 of file kmfolder.cpp.

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

int KMFolder::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 587 of file kmfolder.cpp.

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

virtual int KMFolder::find const KMMsgBase *    msg const [pure virtual]
 

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

int KMFolder::count bool    cache = false const [virtual]
 

Number of messages in this folder.

Definition at line 793 of file kmfolder.cpp.

Referenced by appendtoMsgDict(), countUnreadRecursive(), expungeOldMsg(), KMHeaders::findUnread(), getMsg(), isMessage(), markNewAsUnread(), markUnreadAsRead(), KMHeaders::msgAdded(), KMHeaders::msgChanged(), KMHeaders::msgRemoved(), reallyAddCopyOfMsg(), KMHeaders::setCurrentMsg(), KMHeaders::setFolderInfoStatus(), take(), and unGetMsg().

int KMFolder::countUnread   [virtual]
 

Number of new or unread messages in this folder.

Definition at line 802 of file kmfolder.cpp.

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

Referenced by countUnreadRecursive(), KMHeaders::findUnread(), KMHeaders::nextUnreadMessage(), KMHeaders::prevUnreadMessage(), KMHeaders::setFolderInfoStatus(), and writeConfig().

int KMFolder::countUnreadRecursive   [virtual]
 

Number of new or unread messages in this folder and all folders contained by this folder.

Definition at line 821 of file kmfolder.cpp.

References child(), count(), countUnread(), and QPtrListIterator::current().

void KMFolder::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 840 of file kmfolder.cpp.

References QTimer::changeInterval(), msgChanged(), mUnreadMsgs, and numUnreadMsgsChanged().

virtual int KMFolder::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(), rename(), and KMHeaders::setFolder().

virtual int KMFolder::canAccess   [pure virtual]
 

Check folder for permissions Returns zero if readable and writable.

virtual void KMFolder::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 correctUnreadMsgsCount(), countUnread(), expunge(), moveMsg(), remove(), rename(), and KMHeaders::setFolder().

virtual void KMFolder::sync   [pure virtual]
 

fsync buffers to disk.

bool KMFolder::isOpened   const [inline]
 

Test if folder is opened.

Definition at line 224 of file kmfolder.h.

void KMFolder::markNewAsUnread   [virtual]
 

Mark all new messages as unread.

Definition at line 190 of file kmfolder.cpp.

References count(), and getMsgBase().

Referenced by KMHeaders::setFolder().

void KMFolder::markUnreadAsRead   [virtual]
 

Mark all new and unread messages as read.

Definition at line 206 of file kmfolder.cpp.

References QValueList< Q_UINT32 >::append(), count(), QValueList< Q_UINT32 >::empty(), and getMsgBase().

virtual int KMFolder::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 KMFolderDir::createFolder().

int KMFolder::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 718 of file kmfolder.cpp.

References close(), QFile::encodeName(), indexLocation(), QObject::name(), needsCompact, and removeContents().

int KMFolder::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 739 of file kmfolder.cpp.

References changed(), close(), QFile::encodeName(), expungeContents(), expunged(), indexLocation(), mDirty, mUnreadMsgs, QObject::name(), needsCompact, numUnreadMsgsChanged(), open(), and writeConfig().

virtual int KMFolder::compact   [pure virtual]
 

Remove deleted messages from the folder.

Returns zero on success and an errno on failure.

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

Physically rename the folder.

Returns zero on success and an errno on failure.

Definition at line 634 of file kmfolder.cpp.

References close(), QFile::encodeName(), fileName(), QPtrList< KMFolderNode >::findRef(), indexLocation(), QPtrList< KMFolderNode >::inSort(), QString::isEmpty(), location(), nameChanged(), open(), QObject::parent(), QObject::setName(), subdirLocation(), and QPtrList< KMFolderNode >::take().

bool KMFolder::autoCreateIndex   const [inline]
 

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

Definition at line 257 of file kmfolder.h.

References mAutoCreateIndex.

void KMFolder::setAutoCreateIndex bool    [virtual]
 

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

Default is TRUE.

Definition at line 168 of file kmfolder.cpp.

References mAutoCreateIndex.

bool KMFolder::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 266 of file kmfolder.h.

References mDirty.

Referenced by KMHeaders::setFolder().

void KMFolder::setDirty bool    f
 

Change the dirty flag.

Definition at line 174 of file kmfolder.cpp.

References QTimer::changeInterval(), mAutoCreateIndex, mDirty, and QTimer::stop().

Referenced by removeMsg(), and take().

bool KMFolder::needsCompacting   const [inline]
 

Returns TRUE if the folder contains deleted messages.

Definition at line 272 of file kmfolder.h.

References needsCompact.

void KMFolder::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 228 of file kmfolder.cpp.

References changed().

virtual bool KMFolder::isReadOnly   const [pure virtual]
 

Is the folder read-only?

Referenced by KMHeaders::setFolderInfoStatus().

bool KMFolder::isSystemFolder   const [inline]
 

Returns TRUE if the folder is a kmail system folder.

These are the folders 'outbox', 'sent', 'trash'. The name of these folders is nationalized in the folder display and they cannot have accounts associated. Deletion is also forbidden. Etc.

Definition at line 292 of file kmfolder.h.

QString KMFolder::label   const [virtual]
 

Returns the label of the folder for visualization.

Definition at line 786 of file kmfolder.cpp.

References QString::isEmpty(), mLabel, and QObject::name().

Referenced by getMsg(), and KMSystemTray::prettyName().

const char * KMFolder::type   const [virtual]
 

Type of the folder.

Inherited.

Definition at line 778 of file kmfolder.cpp.

bool KMFolder::hasAccounts   const [inline]
 

Returns TRUE if accounts are associated with this folder.

Definition at line 305 of file kmfolder.h.

void KMFolder::setMailingList bool    enabled [inline]
 

Returns TRUE if this folder is associated with a mailing-list.

Definition at line 308 of file kmfolder.h.

References writeConfig().

QString KMFolder::whoField   const [inline]
 

Get / set the name of the field that is used for the Sender/Receiver column in the headers (From/To).

Definition at line 326 of file kmfolder.h.

References mWhoField.

Referenced by KMHeaders::setFolder().

QString KMFolder::userWhoField void    [inline]
 

Get / set the user-settings for the WhoField (From/To/Empty).

Definition at line 330 of file kmfolder.h.

References mUserWhoField.

void KMFolder::correctUnreadMsgsCount   [virtual]
 

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

Definition at line 950 of file kmfolder.cpp.

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

Referenced by KMFolderDir::createFolder(), and KMHeaders::findUnread().

QString KMFolder::idString   const [virtual]
 

Returns a string that can be used to identify this folder.

Definition at line 877 of file kmfolder.cpp.

References QString::isEmpty(), QString::length(), QObject::name(), QObject::parent(), QString::replace(), and QString::right().

Referenced by readConfig(), KMHeaders::readFolderConfig(), writeConfig(), and KMHeaders::writeFolderConfig().

void KMFolder::setAutoExpire bool    enabled [inline]
 

Set whether this folder automatically expires messages.

Definition at line 343 of file kmfolder.h.

References expireMessages, and writeConfig().

virtual bool KMFolder::isAutoExpire   const [inline, virtual]
 

Does this folder automatically expire old messages?

Definition at line 351 of file kmfolder.h.

References expireMessages.

void KMFolder::setUnreadExpireAge int    age [inline]
 

Set the maximum age for unread messages in this folder.

Age should not be negative. Units are set using setUnreadExpireUnits().

Definition at line 359 of file kmfolder.h.

References writeConfig().

void KMFolder::setUnreadExpireUnits ExpireUnits    units [inline]
 

Set units to use for expiry of unread messages.

Values are 1 = days, 2 = weeks, 3 = months.

Definition at line 371 of file kmfolder.h.

void KMFolder::setReadExpireAge int    age [inline]
 

Set the maximum age for read messages in this folder.

Age should not be negative. Units are set using setReadExpireUnits().

Definition at line 383 of file kmfolder.h.

References writeConfig().

void KMFolder::setReadExpireUnits ExpireUnits    units [inline]
 

Set units to use for expiry of read messages.

Values are 1 = days, 2 = weeks, 3 = months.

Definition at line 395 of file kmfolder.h.

int KMFolder::getUnreadExpireAge   const [inline]
 

Get the age at which unread messages are expired.

Units are determined by getUnreadExpireUnits().

Definition at line 405 of file kmfolder.h.

int KMFolder::getReadExpireAge   const [inline]
 

Get the age at which read messages are expired.

Units are determined by getReadExpireUnits().

Definition at line 411 of file kmfolder.h.

ExpireUnits KMFolder::getUnreadExpireUnits   const [inline]
 

Units getUnreadExpireAge() is returned in.

1 = days, 2 = weeks, 3 = months.

Definition at line 417 of file kmfolder.h.

ExpireUnits KMFolder::getReadExpireUnits   const [inline]
 

Units getReadExpireAge() is returned in.

1 = days, 2 = weeks, 3 = months.

Definition at line 423 of file kmfolder.h.

void KMFolder::expireOldMessages  
 

Expire old messages from this folder.

Read and unread messages have different expiry times. An expiry time of 0 or less is considered to mean no-expiry. Also check the general 'expire' flag as well.

Definition at line 314 of file kmfolder.cpp.

References createJob().

virtual int KMFolder::writeIndex bool    createEmptyIndex = false [pure virtual]
 

Write index to index-file.

Returns 0 on success and errno error on failure.

Referenced by KMHeaders::setFolder().

void KMFolder::fillMsgDict KMMsgDict *    dict
 

Inserts messages into the message dictionary.

Might be called during kernel initialization.

Definition at line 958 of file kmfolder.cpp.

int KMFolder::writeMsgDict KMMsgDict *    dict = 0
 

Writes the message serial number file.

Definition at line 964 of file kmfolder.cpp.

int KMFolder::touchMsgDict  
 

Touches the message serial number file.

Definition at line 975 of file kmfolder.cpp.

int KMFolder::appendtoMsgDict int    idx = -1
 

Append message to end of message serial number file.

Definition at line 985 of file kmfolder.cpp.

References count().

void KMFolder::setRDict KMMsgDictREntry *    rentry
 

Sets the reverse-dictionary for this folder.

Definition at line 1011 of file kmfolder.cpp.

References mRDict.

KMMsgDictREntry* KMFolder::rDict   const [inline]
 

Returns the reverse-dictionary for this folder.

Definition at line 448 of file kmfolder.h.

References mRDict.

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

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

Definition at line 1000 of file kmfolder.cpp.

References getMsgBase().

Referenced by KMHeaders::msgAdded(), and setStatus().

void KMFolder::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 1019 of file kmfolder.cpp.

References QValueList::begin(), QValueList::end(), and setStatus().

virtual bool KMFolder::useCustomIcons   const [inline, virtual]
 

Icon related methods.

Definition at line 457 of file kmfolder.h.

References mUseCustomIcons.

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

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

The conversion happens in place. Returns the length of the resulting string.

Definition at line 1102 of file kmfolder.cpp.

Referenced by KMAcctExpPop::slotMsgRetrieved().

void KMFolder::changed   [signal]
 

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

Referenced by expunge(), and quiet().

void KMFolder::cleared   [signal]
 

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

void KMFolder::expunged   [signal]
 

Emitted after an expunge.

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

Referenced by expunge().

void KMFolder::iconsChanged   [signal]
 

Emitted when the icon paths are set.

Referenced by readConfig().

void KMFolder::nameChanged   [signal]
 

Emitted when the name of the folder changes.

Referenced by rename().

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

Emitted before a message is removed from the folder.

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

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

Emitted after a message is removed from the folder.

void KMFolder::msgAdded int    idx [signal]
 

Emitted when a message is added from the folder.

Referenced by emitMsgAddedSignals(), and KMFolder().

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

Emitted, when the status of a message is changed.

Referenced by KMFolder(), and msgStatusChanged().

void KMFolder::msgHeaderChanged KMFolder *   ,
int   
[signal]
 

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

Referenced by headerOfMsgChanged(), and KMFolder().

void KMFolder::statusMsg const QString   [signal]
 

Emmited to display a message somewhere in a status line.

void KMFolder::numUnreadMsgsChanged KMFolder *    [signal]
 

Emitted when number of unread messages has changed.

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

virtual int KMFolder::updateIndex   [pure virtual, slot]
 

Incrementally update the index if possible else call writeIndex.

Referenced by KMFolder().

void KMFolder::reallyAddMsg KMMessage *    aMsg [virtual, slot]
 

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

Definition at line 355 of file kmfolder.cpp.

References addMsg(), and unGetMsg().

Referenced by canAddMsgNow().

void KMFolder::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 375 of file kmfolder.cpp.

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

virtual FolderJob* KMFolder::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 KMFolder::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 866 of file kmfolder.cpp.

References msgHeaderChanged().

QString KMFolder::dotEscape const QString   const [protected, virtual]
 

Escape a leading dot.

Definition at line 89 of file kmfolder.cpp.

References QString::find(), and QString::left().

Referenced by location(), and subdirLocation().

virtual KMMessage* KMFolder::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 KMFolder::readIndex   [protected, pure virtual]
 

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

virtual int KMFolder::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 KMFolder::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().

void KMFolder::writeConfig   [protected, virtual]
 

Write the config file.

Definition at line 926 of file kmfolder.cpp.

References countUnread(), expireMessages, idString(), mCompactable, mUseCustomIcons, and mUserWhoField.

Referenced by expunge(), getMsg(), setAutoExpire(), setMailingList(), setReadExpireAge(), and setUnreadExpireAge().

void KMFolder::readConfig   [protected, virtual]
 

Read the config file.

Definition at line 897 of file kmfolder.cpp.

References expireMessages, iconsChanged(), idString(), mCompactable, mUnreadMsgs, and mUseCustomIcons.

Referenced by countUnread(), and KMFolder().

int KMFolder::daysToExpire int    number,
ExpireUnits    units
[protected]
 

Return the number of days given some value, and the units for that value.

Currently, supported units are days, weeks and months.

Definition at line 292 of file kmfolder.cpp.


Member Data Documentation

bool KMFolder::mAutoCreateIndex [protected]
 

is the automatic creation of a index file allowed ?

Definition at line 582 of file kmfolder.h.

Referenced by autoCreateIndex(), KMFolder(), setAutoCreateIndex(), and setDirty().

bool KMFolder::mDirty [protected]
 

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

Definition at line 584 of file kmfolder.h.

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

bool KMFolder::mFilesLocked [protected]
 

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

Definition at line 586 of file kmfolder.h.

QString KMFolder::mLabel [protected]
 

nationalized label or QString::null (then name() should be used).

Definition at line 588 of file kmfolder.h.

Referenced by label().

QString KMFolder::mWhoField [protected]
 

name of the field that is used for "From" in listbox.

Definition at line 590 of file kmfolder.h.

Referenced by whoField().

QString KMFolder::mUserWhoField [protected]
 

name of the field that is used for "From" in listbox.

Definition at line 590 of file kmfolder.h.

Referenced by userWhoField(), and writeConfig().

int KMFolder::mUnreadMsgs [protected]
 

number of unread messages, -1 if not yet set.

Definition at line 600 of file kmfolder.h.

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

int KMFolder::mGuessedUnreadMsgs [protected]
 

number of unread messages, -1 if not yet set.

Definition at line 600 of file kmfolder.h.

Referenced by countUnread(), and KMFolder().

bool KMFolder::needsCompact [protected]
 

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

Definition at line 604 of file kmfolder.h.

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

bool KMFolder::mCompactable [protected]
 

false if index file is out of sync with mbox file.

Definition at line 606 of file kmfolder.h.

Referenced by getMsg(), KMFolder(), readConfig(), and writeConfig().

bool KMFolder::expireMessages [protected]
 

Support for automatic expiry of old messages.

Definition at line 612 of file kmfolder.h.

Referenced by isAutoExpire(), KMFolder(), readConfig(), setAutoExpire(), and writeConfig().

KMMsgDictREntry* KMFolder::mRDict [protected]
 

Points at the reverse dictionary for this folder.

Definition at line 621 of file kmfolder.h.

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

QPtrList<FolderJob> KMFolder::mJobList [protected]
 

List of jobs created by this folder.

REMEBER to add jobs created via createJob to this list.

Definition at line 626 of file kmfolder.h.

Referenced by ignoreJobsForMessage().

bool KMFolder::mUseCustomIcons [protected]
 

Icon related variables.

Definition at line 629 of file kmfolder.h.

Referenced by KMFolder(), readConfig(), useCustomIcons(), 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.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:36 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003