kmail
KMFolder Class Reference
#include <kmfolder.h>
Inheritance diagram for KMFolder:

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 68 of file kmfolder.h.
Public Types | |
enum | CompactOptions { CompactLater, CompactNow, CompactSilentlyNow } |
enum | ExpireAction { ExpireDelete, ExpireMove } |
Public Slots | |
int | updateIndex () |
void | reallyAddMsg (KMMessage *aMsg) |
void | reallyAddCopyOfMsg (KMMessage *aMsg) |
Signals | |
void | changed () |
void | cleared () |
void | expunged (KMFolder *) |
void | iconsChanged () |
void | nameChanged () |
void | shortcutChanged (KMFolder *) |
void | msgRemoved (KMFolder *, Q_UINT32 sernum) |
void | msgRemoved (int idx, QString msgIdMD5) |
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) |
void | viewConfigChanged () |
Public Member Functions | |
KMFolder (KMFolderDir *parent, const QString &name, KMFolderType aFolderType, bool withIndex=true, bool exportedSernums=true) | |
~KMFolder () | |
bool | isMainInbox () |
bool | isOutbox () |
bool | isSent () |
bool | isTrash () |
bool | isDrafts () |
bool | isTemplates () |
void | setAcctList (AccountList *list) |
AccountList * | acctList () |
bool | hasAccounts () const |
void | readConfig (KConfig *config) |
void | writeConfig (KConfig *config) const |
FolderStorage * | storage () |
const FolderStorage * | storage () const |
KMFolderType | folderType () const |
QString | fileName () const |
QString | location () const |
QString | indexLocation () const |
QString | subdirLocation () const |
KMFolderDir * | child () const |
KMFolderDir * | createChildFolder () |
void | setChild (KMFolderDir *aChild) |
bool | noContent () const |
void | setNoContent (bool aNoContent) |
bool | noChildren () const |
void | setNoChildren (bool aNoChildren) |
KMMessage * | getMsg (int idx) |
KMMsgInfo * | unGetMsg (int idx) |
bool | isMessage (int idx) |
QCString & | getMsgString (int idx, QCString &mDest) |
DwString | getDwString (int idx) |
void | ignoreJobsForMessage (KMMessage *) |
FolderJob * | createJob (KMMessage *msg, FolderJob::JobType jt=FolderJob::tGetMessage, KMFolder *folder=0, QString partSpecifier=QString::null, const AttachmentStrategy *as=0) const |
FolderJob * | createJob (QPtrList< KMMessage > &msgList, const QString &sets, FolderJob::JobType jt=FolderJob::tGetMessage, KMFolder *folder=0) const |
const KMMsgBase * | getMsgBase (int idx) const |
KMMsgBase * | getMsgBase (int idx) |
const KMMsgBase * | operator[] (int idx) const |
KMMsgBase * | operator[] (int idx) |
KMMessage * | take (int idx) |
void | take (QPtrList< KMMessage > msgList) |
int | addMsg (KMMessage *msg, int *index_return=0) |
int | addMsgKeepUID (KMMessage *msg, int *index_return=0) |
int | addMsg (QPtrList< KMMessage > &, QValueList< int > &index_return) |
void | emitMsgAddedSignals (int idx) |
void | removeMsg (int i, bool imapQuiet=false) |
void | removeMsg (QPtrList< KMMessage > msgList, bool imapQuiet=false) |
int | expungeOldMsg (int days) |
int | moveMsg (KMMessage *msg, int *index_return=0) |
int | moveMsg (QPtrList< KMMessage >, int *index_return=0) |
int | find (const KMMsgBase *msg) const |
int | find (const KMMessage *msg) const |
int | count (bool cache=false) const |
int | countUnread () |
int | countUnreadRecursive () |
void | msgStatusChanged (const KMMsgStatus oldStatus, const KMMsgStatus newStatus, int idx) |
int | open () |
int | canAccess () |
void | close (bool force=false) |
void | sync () |
bool | isOpened () const |
void | markNewAsUnread () |
void | markUnreadAsRead () |
void | remove () |
int | expunge () |
void | compact (CompactOptions options) |
int | rename (const QString &newName, KMFolderDir *aParent=0) |
bool | dirty () const |
void | setDirty (bool f) |
bool | needsCompacting () const |
void | setNeedsCompacting (bool f) |
void | quiet (bool beQuiet) |
bool | isReadOnly () const |
bool | isSystemFolder () const |
void | setSystemFolder (bool itIs) |
virtual QString | label () const |
void | setLabel (const QString &l) |
virtual QString | systemLabel () const |
void | setSystemLabel (const QString &l) |
virtual QString | prettyURL () const |
void | setMailingListEnabled (bool enabled) |
bool | isMailingListEnabled () const |
void | setMailingList (const MailingList &mlist) |
MailingList | mailingList () const |
QString | mailingListPostAddress () 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) |
void | correctUnreadMsgsCount () |
QString | idString () const |
void | setAutoExpire (bool enabled) |
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 |
ExpireAction | expireAction () const |
void | setExpireAction (ExpireAction a) |
QString | expireToFolderId () const |
void | setExpireToFolderId (const QString &id) |
void | expireOldMessages (bool immediate) |
int | writeIndex (bool createEmptyIndex=false) |
void | setStatus (int idx, KMMsgStatus status, bool toggle=false) |
void | setStatus (QValueList< int > &ids, KMMsgStatus status, bool toggle=false) |
bool | useCustomIcons () const |
void | setUseCustomIcons (bool useCustomIcons) |
QString | normalIconPath () const |
QString | unreadIconPath () const |
void | setIconPaths (const QString &normalPath, const QString &unreadPath) |
void | removeJobs () |
void | daysToExpire (int &unreadDays, int &readDays) |
KMFolder * | trashFolder () const |
bool | putRepliesInSameFolder () const |
void | setPutRepliesInSameFolder (bool b) |
bool | ignoreNewMail () const |
void | setIgnoreNewMail (bool b) |
const KShortcut & | shortcut () const |
void | setShortcut (const KShortcut &) |
bool | isMoveable () const |
Friends | |
class | ::KMFolderJob |
Constructor & Destructor Documentation
|
Constructs a new Folder object.
Definition at line 47 of file kmfolder.cpp. |
Member Function Documentation
|
Adds the given messages to the folder. Behaviour is identical to addMsg(msg) Definition at line 392 of file kmfolder.cpp. |
|
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). Definition at line 382 of file kmfolder.cpp. |
|
(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 387 of file kmfolder.cpp. |
|
Check folder for permissions Returns zero if readable and writable.
Definition at line 476 of file kmfolder.cpp. |
|
Emitted when the status, name, or associated accounts of this folder changed.
|
|
Returns the folder directory associated with this node or 0 if no such directory exists.
Definition at line 156 of file kmfolder.h. |
|
Emitted when the contents of a folder have been cleared (new search in a search folder, for example).
|
|
Close folder. If force is true the files are closed even if others still use it (e.g. other mail reader windows). Definition at line 481 of file kmfolder.cpp. |
|
Compact this folder. Options: CompactLater: schedule it as a background task CompactNow: do it now, and inform the user of the result (manual compaction) CompactSilentlyNow: do it now, and keep silent about it (e.g. for outbox) Definition at line 771 of file kmfolder.cpp. |
|
A cludge to help make sure the count of unread messges is kept in sync.
Definition at line 660 of file kmfolder.cpp. |
|
Number of messages in this folder.
Definition at line 437 of file kmfolder.cpp. |
|
Number of new or unread messages in this folder.
Definition at line 442 of file kmfolder.cpp. |
|
Number of new or unread messages in this folder and all folders contained by this folder.
Definition at line 447 of file kmfolder.cpp. |
|
Create a child folder directory and associates it with this folder.
Definition at line 251 of file kmfolder.cpp. |
|
These methods create respective FolderJob (You should derive FolderJob for each derived KMFolder).
|
|
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 521 of file kmfolder.cpp. |
|
Called by derived classes implementation of addMsg. Emits msgAdded signals Definition at line 397 of file kmfolder.cpp. |
|
What should expiry do? Delete or move to another folder?
Definition at line 468 of file kmfolder.h. |
|
Expire old messages in this folder. If immediate is true, do it immediately; otherwise schedule it for later Definition at line 761 of file kmfolder.cpp. |
|
If expiry should move to folder, return the ID of that folder.
Definition at line 474 of file kmfolder.h. |
|
Delete entire folder. Forces a close *but* opens the folder again afterwards. Returns errno(3) error code or zero on success. see KMFolder::expungeContents Definition at line 511 of file kmfolder.cpp. |
|
Emitted after an expunge. If not quiet, changed() will be emmitted first. |
|
Delete messages in the folder that are older than days. Return the number of deleted messages. Definition at line 412 of file kmfolder.cpp. |
|
Returns the filename of the folder (reimplemented in KMFolderImap).
Definition at line 225 of file kmfolder.cpp. |
|
Returns the index of the given message or -1 if not found.
Definition at line 427 of file kmfolder.cpp. |
|
Returns the type of this folder.
Definition at line 220 of file kmfolder.cpp. |
|
Read a message and returns a DwString.
Definition at line 328 of file kmfolder.cpp. |
|
Read message at given index. Indexing starts at zero Definition at line 308 of file kmfolder.cpp. |
|
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. Definition at line 352 of file kmfolder.cpp. |
|
Read a message and return a referece to a string.
Definition at line 323 of file kmfolder.cpp. |
|
Get the age at which read messages are expired. Units are determined by getReadExpireUnits(). Definition at line 450 of file kmfolder.h. |
|
Units getReadExpireAge() is returned in. 1 = days, 2 = weeks, 3 = months. Definition at line 462 of file kmfolder.h. |
|
Get the age at which unread messages are expired. Units are determined by getUnreadExpireUnits(). Definition at line 444 of file kmfolder.h. |
|
Units getUnreadExpireAge() is returned in. 1 = days, 2 = weeks, 3 = months. Definition at line 456 of file kmfolder.h. |
|
Returns TRUE if accounts are associated with this folder.
Definition at line 127 of file kmfolder.h. |
|
Emitted when the icon paths are set.
|
|
Returns a string that can be used to identify this folder.
Definition at line 665 of file kmfolder.cpp. |
|
Removes and deletes all jobs associated with the particular message.
Definition at line 333 of file kmfolder.cpp. |
|
Returns true if the user doesn't want to get notified about new mail in this folder.
Definition at line 521 of file kmfolder.h. |
|
Returns full path to index file.
Definition at line 235 of file kmfolder.cpp. |
|
Does this folder automatically expire old messages?
Definition at line 412 of file kmfolder.h. |
|
Returns true if this folder is the drafts box of the local account, or is configured to be the drafts box of any of the users identities.
Definition at line 114 of file kmfolder.h. |
|
Returns true if this folder is the inbox on the local disk.
Definition at line 95 of file kmfolder.h. |
|
Checks if the message is already "gotten" with getMsg.
Definition at line 318 of file kmfolder.cpp. |
|
Returns true if this folder can be moved.
Definition at line 839 of file kmfolder.cpp. |
|
Test if folder is opened.
Definition at line 491 of file kmfolder.cpp. |
|
Returns true only if this is the outbox for outgoing mail.
Definition at line 99 of file kmfolder.h. |
|
Is the folder read-only?
Definition at line 546 of file kmfolder.cpp. |
|
Returns true if this folder is the sent-mail box of the local account, or is configured to be the sent mail box of any of the users identities.
Definition at line 104 of file kmfolder.h. |
|
Returns true if the folder is a kmail system folder. These are the folders 'inbox', 'outbox', 'sent', 'trash', 'drafts', 'templates'. 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 364 of file kmfolder.h. |
|
Returns true if this folder is the templates folder of the local account, or is configured to be the templates folder of any of the users identities.
Definition at line 119 of file kmfolder.h. |
|
Returns true if this folder is configured as a trash folder, locally or for one of the accounts.
Definition at line 109 of file kmfolder.h. |
|
Returns the label of the folder for visualization.
Reimplemented from KMFolderNode. Definition at line 551 of file kmfolder.cpp. |
|
Returns full path to folder file.
Definition at line 230 of file kmfolder.cpp. |
|
Mark all new messages as unread.
Definition at line 496 of file kmfolder.cpp. |
|
Mark all new and unread messages as read.
Definition at line 501 of file kmfolder.cpp. |
|
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 417 of file kmfolder.cpp. |
|
Emitted when a message is added from the folder.
|
|
Emitted, when the status of a message is changed.
|
|
Emitted when a field of the header of a specific message changed.
|
|
Emitted after a message is removed from the folder.
|
|
Emitted before a message is removed from the folder.
|
|
Called by KMMsgBase::setStatus when status of a message has changed required to keep the number unread messages variable current.
Definition at line 465 of file kmfolder.cpp. |
|
Emitted when the name of the folder changes.
|
|
Returns true if the folder contains deleted messages.
Definition at line 531 of file kmfolder.cpp. |
|
Returns, if the folder can't have children.
Definition at line 298 of file kmfolder.cpp. |
|
Returns, if the folder can't contain mails, but only subfolder.
Definition at line 288 of file kmfolder.cpp. |
|
Emitted when number of unread messages has changed.
|
|
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). Definition at line 471 of file kmfolder.cpp. |
|
Same as getMsgBase(int). This time non-const. Definition at line 367 of file kmfolder.cpp. |
|
Same as getMsgBase(int).
Definition at line 362 of file kmfolder.cpp. |
|
URL of the node for visualization purposes.
Implements KMFolderNode. Definition at line 563 of file kmfolder.cpp. |
|
Returns true if the replies to mails from this folder should be put in the same folder.
Definition at line 514 of file kmfolder.h. |
|
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 541 of file kmfolder.cpp. |
|
This is used by the storage to read the folder specific configuration.
Definition at line 151 of file kmfolder.cpp. |
|
Add a copy of the message to the folder after it has been retrieved from an IMAP server.
Definition at line 826 of file kmfolder.cpp. |
|
Add the message to the folder after it has been retrieved from an IMAP server.
Definition at line 821 of file kmfolder.cpp. |
|
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 KMFolder::removeContents Definition at line 506 of file kmfolder.cpp. |
|
Emitted when a folder was removed.
|
|
Remove (first occurrence of) given message from the folder.
Definition at line 402 of file kmfolder.cpp. |
|
Physically rename the folder. Returns zero on success and an errno on failure. Definition at line 516 of file kmfolder.cpp. |
|
Set whether this folder automatically expires messages.
Definition at line 685 of file kmfolder.cpp. |
|
Set the folder directory associated with this node.
Definition at line 282 of file kmfolder.cpp. |
|
Change the dirty flag.
Definition at line 526 of file kmfolder.cpp. |
|
Returns true if this folder is associated with a mailing-list.
Definition at line 590 of file kmfolder.cpp. |
|
Specify, that the folder can't have children.
Definition at line 303 of file kmfolder.cpp. |
|
Specify, that the folder can't contain mails.
Definition at line 293 of file kmfolder.cpp. |
|
Set the maximum age for read messages in this folder. Age should not be negative. Units are set using setReadExpireUnits(). Definition at line 708 of file kmfolder.cpp. |
|
Set units to use for expiry of read messages. Values are 1 = days, 2 = weeks, 3 = months. Definition at line 716 of file kmfolder.cpp. |
|
Set the status of the message(s) in the QValueList
Definition at line 796 of file kmfolder.cpp. |
|
Set the status of the message at index
Definition at line 791 of file kmfolder.cpp. |
|
Set the maximum age for unread messages in this folder. Age should not be negative. Units are set using setUnreadExpireUnits(). Definition at line 693 of file kmfolder.cpp. |
|
Set units to use for expiry of unread messages. Values are 1 = days, 2 = weeks, 3 = months. Definition at line 701 of file kmfolder.cpp. |
|
Emitted when the shortcut associated with this folder changes.
|
|
Emmited to display a message somewhere in a status line.
|
|
if the folder is const, the storage should be as well
Definition at line 137 of file kmfolder.h. |
|
Returns full path to sub directory file.
Definition at line 240 of file kmfolder.cpp. |
|
fsync buffers to disk
Definition at line 486 of file kmfolder.cpp. |
|
Set the label that is used as a system default.
Definition at line 372 of file kmfolder.h. |
|
Detach message from this folder. Usable to call addMsg() afterwards. Loads the message if it is not loaded up to now. Definition at line 372 of file kmfolder.cpp. |
|
If this folder has a special trash folder set, return it. Otherwise return 0. Definition at line 781 of file kmfolder.cpp. |
|
Replace KMMessage with KMMsgInfo and delete KMMessage.
Definition at line 313 of file kmfolder.cpp. |
|
Incrementally update the index if possible else call writeIndex.
Definition at line 816 of file kmfolder.cpp. |
|
Icon related methods.
Definition at line 494 of file kmfolder.h. |
|
Get / set the user-settings for the WhoField (From/To/Empty).
Definition at line 395 of file kmfolder.h. |
|
Emitted when the variables for the config of the view have changed.
|
|
Get / set the name of the field that is used for the Sender/Receiver column in the headers (From/To).
Definition at line 391 of file kmfolder.h. |
|
This is used by the storage to save the folder specific configuration.
Definition at line 190 of file kmfolder.cpp. |
|
Write index to index-file. Returns 0 on success and errno error on failure. Definition at line 786 of file kmfolder.cpp. |
The documentation for this class was generated from the following files: