kmail
FolderStorage Class Reference
#include <folderstorage.h>

Detailed Description
The FolderStorage class is the bass class for the storage related aspects of a collection of mail (a folder).
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 79 of file folderstorage.h.
Public Types | |
enum | ChildrenState { HasChildren, HasNoChildren, ChildrenUnknown } |
Public Slots | |
virtual int | updateIndex ()=0 |
virtual void | reallyAddMsg (KMMessage *aMsg) |
virtual void | reallyAddCopyOfMsg (KMMessage *aMsg) |
void | slotEmitChangedTimer () |
Signals | |
void | changed () |
void | cleared () |
void | expunged (KMFolder *) |
void | closed (KMFolder *) |
void | invalidated (KMFolder *) |
void | nameChanged () |
void | locationChanged (const QString &, const QString &) |
void | contentsTypeChanged (KMail::FolderContentsType type) |
void | readOnlyChanged (KMFolder *) |
void | noContentChanged () |
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 | searchResult (KMFolder *, QValueList< Q_UINT32 >, const KMSearchPattern *, bool complete) |
void | searchDone (KMFolder *, Q_UINT32, const KMSearchPattern *, bool) |
void | folderSizeChanged (KMFolder *) |
void | syncStateChanged () |
void | batchRemovingStarted () |
void | batchRemovingFinished () |
Public Member Functions | |
FolderStorage (KMFolder *folder, const char *name=0) | |
KMFolder * | folder () 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 KMMessage * | readTemporaryMsg (int idx) |
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) |
virtual int | addMsg (QPtrList< KMMessage > &, QValueList< int > &index_return) |
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 () |
Q_INT64 | folderSize () const |
virtual bool | isCloseToQuota () const |
virtual void | msgStatusChanged (const KMMsgStatus oldStatus, const KMMsgStatus newStatus, int idx) |
virtual int | open (const char *owner)=0 |
virtual int | canAccess ()=0 |
void | close (const char *owner, bool force=false) |
virtual void | reallyDoClose (const char *owner)=0 |
virtual void | tryReleasingFolder (KMFolder *) |
virtual void | sync ()=0 |
bool | isOpened () const |
virtual void | markNewAsUnread () |
virtual void | markUnreadAsRead () |
virtual int | create ()=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 |
virtual bool | canDeleteMessages () const |
QString | label () const |
virtual void | correctUnreadMsgsCount () |
virtual int | writeIndex (bool createEmptyIndex=false)=0 |
void | registerWithMessageDict () |
void | deregisterFromMessageDict () |
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 KMFolder * | trashFolder () const |
void | addJob (FolderJob *) const |
bool | compactable () const |
virtual void | setContentsType (KMail::FolderContentsType type, bool quiet=false) |
KMail::FolderContentsType | contentsType () const |
virtual void | search (const KMSearchPattern *) |
virtual void | search (const KMSearchPattern *, Q_UINT32 serNum) |
virtual bool | isMoveable () const |
virtual KMAccount * | account () const |
virtual bool | mailCheckInProgress () const |
Static Public Member Functions | |
static QString | dotEscape (const QString &) |
Protected Types | |
enum | { mDirtyTimerInterval = 600000 } |
Protected Slots | |
virtual void | removeJob (QObject *) |
void | slotProcessNextSearchBatch () |
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 void | fillMessageDict () |
void | readFolderIdsFile () |
int | writeFolderIdsFile () const |
int | touchFolderIdsFile () |
int | appendToFolderIdsFile (int idx=-1) |
void | setRDict (KMMsgDictREntry *rentry) const |
KMMsgDictREntry * | rDict () const |
void | replaceMsgSerNum (unsigned long sernum, KMMsgBase *msg, int idx) |
void | invalidateFolder () |
virtual int | removeContents ()=0 |
virtual int | expungeContents ()=0 |
virtual bool | readIndex ()=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 | truncateIndex ()=0 |
virtual Q_INT64 | doFolderSize () const |
Protected Attributes | |
int | mOpenCount |
int | mQuiet |
bool | mChanged:1 |
bool | mAutoCreateIndex:1 |
bool | mExportsSernums:1 |
bool | mDirty:1 |
bool | mFilesLocked:1 |
int | mUnreadMsgs |
int | mGuessedUnreadMsgs |
int | mTotalMsgs |
Q_INT64 | mSize |
bool | mWriteConfigEnabled:1 |
bool | needsCompact:1 |
bool | mCompactable:1 |
bool | mNoContent:1 |
bool | mNoChildren:1 |
bool | mConvertToUtf8:1 |
KMMsgDictREntry * | mRDict |
QPtrList< FolderJob > | mJobList |
QTimer * | mDirtyTimer |
ChildrenState | mHasChildren |
KMail::FolderContentsType | mContentsType |
KMFolder * | mFolder |
QTimer * | mEmitChangedTimer |
int | mCurrentSearchedMsg |
const KMSearchPattern * | mSearchPattern |
Friends | |
class | KMMsgDict |
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 63 of file folderstorage.cpp.
Member Function Documentation
virtual KMFolderType FolderStorage::folderType | ( | ) | const [inline, virtual] |
QString FolderStorage::fileName | ( | ) | const [virtual] |
Returns the filename of the folder (reimplemented in KMFolderImap).
Definition at line 143 of file folderstorage.cpp.
QString FolderStorage::location | ( | ) | const |
virtual QString FolderStorage::indexLocation | ( | ) | const [pure virtual] |
virtual bool FolderStorage::noContent | ( | ) | const [inline, virtual] |
Returns, if the folder can't contain mails, but only subfolder.
Definition at line 106 of file folderstorage.h.
void FolderStorage::setNoContent | ( | bool | aNoContent | ) | [virtual] |
virtual bool FolderStorage::noChildren | ( | ) | const [inline, virtual] |
void FolderStorage::setNoChildren | ( | bool | aNoChildren | ) | [virtual] |
virtual ChildrenState FolderStorage::hasChildren | ( | ) | const [inline, virtual] |
Returns if the folder has children, has no children or we don't know.
Definition at line 124 of file folderstorage.h.
virtual void FolderStorage::setHasChildren | ( | ChildrenState | state | ) | [inline, virtual] |
void FolderStorage::updateChildrenState | ( | ) | [virtual] |
KMMessage * FolderStorage::getMsg | ( | int | idx | ) | [virtual] |
Read message at given index.
Indexing starts at zero
Definition at line 497 of file folderstorage.cpp.
KMMsgInfo * FolderStorage::unGetMsg | ( | int | idx | ) | [virtual] |
Replace KMMessage with KMMsgInfo and delete KMMessage.
Definition at line 586 of file folderstorage.cpp.
bool FolderStorage::isMessage | ( | int | idx | ) | [virtual] |
Checks if the message is already "gotten" with getMsg.
Definition at line 611 of file folderstorage.cpp.
KMMessage * FolderStorage::readTemporaryMsg | ( | int | idx | ) | [virtual] |
Load message from file and do NOT store it, only return it.
This is equivalent to, but faster than, getMsg+unGetMsg WARNING: the caller has to delete the returned value!
Definition at line 547 of file folderstorage.cpp.
virtual DwString FolderStorage::getDwString | ( | int | idx | ) | [pure virtual] |
Read a message and returns a DwString.
void FolderStorage::ignoreJobsForMessage | ( | KMMessage * | msg | ) | [virtual] |
Removes and deletes all jobs associated with the particular message.
Definition at line 1084 of file folderstorage.cpp.
virtual 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).
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.
Implemented in KMFolderIndex.
virtual const KMMsgBase* FolderStorage::operator[] | ( | int | idx | ) | const [inline, virtual] |
virtual KMMsgBase* FolderStorage::operator[] | ( | int | idx | ) | [inline, virtual] |
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 443 of file folderstorage.cpp.
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).
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 196 of file folderstorage.h.
int FolderStorage::addMsg | ( | QPtrList< KMMessage > & | msgList, | |
QValueList< int > & | index_return | |||
) | [virtual] |
Adds the given messages to the folder.
Behaviour is identical to addMsg(msg)
Definition at line 1182 of file folderstorage.cpp.
void FolderStorage::emitMsgAddedSignals | ( | int | idx | ) |
Called by derived classes implementation of addMsg.
Emits msgAdded signals
Restart always the timer or not. BTW we get a kmheaders refresh each 3 seg.?
Definition at line 284 of file folderstorage.cpp.
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 301 of file folderstorage.cpp.
void FolderStorage::removeMsg | ( | int | i, | |
bool | imapQuiet = false | |||
) | [virtual] |
Remove (first occurrence of) given message from the folder.
Definition at line 398 of file folderstorage.cpp.
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 254 of file folderstorage.cpp.
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 641 of file folderstorage.cpp.
virtual int FolderStorage::find | ( | const KMMsgBase * | msg | ) | const [pure virtual] |
int FolderStorage::count | ( | bool | cache = false |
) | const [virtual] |
Number of messages in this folder.
Reimplemented in KMFolderIndex.
Definition at line 840 of file folderstorage.cpp.
int FolderStorage::countUnread | ( | ) | [virtual] |
Q_INT64 FolderStorage::folderSize | ( | ) | const |
bool FolderStorage::isCloseToQuota | ( | ) | const [virtual] |
Return whether the folder is close to its quota limit, which can be reflected in the UI.
Definition at line 878 of file folderstorage.cpp.
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 884 of file folderstorage.cpp.
virtual int FolderStorage::open | ( | const char * | owner | ) | [pure virtual] |
Open folder for access.
open() and close() use reference counting. Returns zero on success and an error code equal to the c-library fopen call otherwise (errno).
- See also:
- KMFolderOpener
virtual int FolderStorage::canAccess | ( | ) | [pure virtual] |
Check folder for permissions Returns zero if readable and writable.
void FolderStorage::close | ( | const char * | owner, | |
bool | force = false | |||
) |
Close folder.
open() and close() use reference counting. If force
is true the files are closed regardless of reference count, and the reference count will be set to zero.
Definition at line 102 of file folderstorage.cpp.
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 272 of file folderstorage.h.
virtual void FolderStorage::sync | ( | ) | [pure virtual] |
fsync buffers to disk
bool FolderStorage::isOpened | ( | ) | const [inline] |
Test if folder is opened, i.e.
its reference count is greater than zero.
Definition at line 278 of file folderstorage.h.
void FolderStorage::markNewAsUnread | ( | ) | [virtual] |
void FolderStorage::markUnreadAsRead | ( | ) | [virtual] |
virtual int FolderStorage::create | ( | ) | [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.
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 775 of file folderstorage.cpp.
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 KMFolder::expungeContents
Definition at line 803 of file folderstorage.cpp.
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.
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 685 of file folderstorage.cpp.
bool FolderStorage::autoCreateIndex | ( | ) | const [inline] |
Returns TRUE if a table of contents file is automatically created.
Definition at line 313 of file folderstorage.h.
void FolderStorage::setAutoCreateIndex | ( | bool | autoIndex | ) | [virtual] |
Allow/disallow automatic creation of a table of contents file.
Default is TRUE.
Definition at line 151 of file folderstorage.cpp.
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 322 of file folderstorage.h.
void FolderStorage::setDirty | ( | bool | f | ) |
bool FolderStorage::needsCompacting | ( | ) | const [inline] |
Returns TRUE if the folder contains deleted messages.
Definition at line 328 of file folderstorage.h.
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 205 of file folderstorage.cpp.
virtual bool FolderStorage::isReadOnly | ( | ) | const [pure virtual] |
Is the folder read-only?
bool FolderStorage::canDeleteMessages | ( | ) | const [virtual] |
QString FolderStorage::label | ( | ) | const |
Returns the label of the folder for visualization.
Definition at line 835 of file folderstorage.cpp.
void FolderStorage::correctUnreadMsgsCount | ( | ) | [virtual] |
A cludge to help make sure the count of unread messges is kept in sync.
Definition at line 977 of file folderstorage.cpp.
virtual int FolderStorage::writeIndex | ( | bool | createEmptyIndex = false |
) | [pure virtual] |
Write index to index-file.
Returns 0 on success and errno error on failure.
Implemented in KMFolderIndex.
void FolderStorage::registerWithMessageDict | ( | ) |
Triggers registration with the message dict, which will cause the dict to ask the FolderStorage to fill itself into it.
Definition at line 984 of file folderstorage.cpp.
void FolderStorage::deregisterFromMessageDict | ( | ) |
Triggers deregistration from the message dict, which will cause the dict to ask the FolderStorage to write the relevant data structures to disk.
Definition at line 990 of file folderstorage.cpp.
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 1063 of file folderstorage.cpp.
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 1076 of file folderstorage.cpp.
QString FolderStorage::dotEscape | ( | const QString & | aStr | ) | [static] |
void FolderStorage::readConfig | ( | void | ) | [virtual] |
void FolderStorage::writeConfig | ( | ) | [virtual] |
virtual KMFolder* FolderStorage::trashFolder | ( | ) | const [inline, virtual] |
If this folder has a special trash folder set, return it.
Otherwise return 0.
Definition at line 386 of file folderstorage.h.
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.
bool FolderStorage::compactable | ( | ) | const [inline] |
void FolderStorage::setContentsType | ( | KMail::FolderContentsType | type, | |
bool | quiet = false | |||
) | [virtual] |
Set the type of contents held in this folder (mail, calendar, etc.).
Definition at line 1136 of file folderstorage.cpp.
KMail::FolderContentsType FolderStorage::contentsType | ( | ) | const [inline] |
- Returns:
- the type of contents held in this folder (mail, calendar, etc.)
Definition at line 403 of file folderstorage.h.
void FolderStorage::search | ( | const KMSearchPattern * | pattern | ) | [virtual] |
Search for messages The end is signaled with searchDone().
Definition at line 1146 of file folderstorage.cpp.
void FolderStorage::search | ( | const KMSearchPattern * | pattern, | |
Q_UINT32 | serNum | |||
) | [virtual] |
Check if the message matches the search criteria The end is signaled with searchDone().
Definition at line 1174 of file folderstorage.cpp.
bool FolderStorage::isMoveable | ( | ) | const [virtual] |
void FolderStorage::changed | ( | ) | [signal] |
Emitted when the status, name, or associated accounts of this folder changed.
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 | ( | KMFolder * | ) | [signal] |
Emitted after an expunge.
If not quiet, changed() will be emmitted first.
void FolderStorage::closed | ( | KMFolder * | ) | [signal] |
Emitted when the folder was closed and ticket owners have to reopen.
void FolderStorage::invalidated | ( | KMFolder * | ) | [signal] |
Emitted when the serial numbers of this folder were invalidated.
void FolderStorage::nameChanged | ( | ) | [signal] |
Emitted when the name of the folder changes.
void FolderStorage::locationChanged | ( | const QString & | , | |
const QString & | ||||
) | [signal] |
Emitted when the location on disk of the folder changes.
This is used by all code which uses the locatio on disk of the folder storage ( or the cache storage ) as an identifier for the folder.
void FolderStorage::contentsTypeChanged | ( | KMail::FolderContentsType | type | ) | [signal] |
Emitted when the contents type (calendar, mail, tasks, .
.) of the folderstorage changes.
void FolderStorage::readOnlyChanged | ( | KMFolder * | ) | [signal] |
Emitted when the readonly status of the folder changes.
void FolderStorage::noContentChanged | ( | ) | [signal] |
Emitted when the no content state of the folder changes.
void FolderStorage::msgRemoved | ( | KMFolder * | , | |
Q_UINT32 | sernum | |||
) | [signal] |
Emitted before a message is removed from the folder.
void FolderStorage::msgRemoved | ( | int | idx, | |
QString | msgIdMD5 | |||
) | [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.
void FolderStorage::msgChanged | ( | KMFolder * | , | |
Q_UINT32 | sernum, | |||
int | delta | |||
) | [signal] |
Emitted, when the status of a message is changed.
void FolderStorage::msgHeaderChanged | ( | KMFolder * | , | |
int | ||||
) | [signal] |
Emitted when a field of the header of a specific message changed.
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.
void FolderStorage::removed | ( | KMFolder * | , | |
bool | ||||
) | [signal] |
Emitted when a folder was removed.
void FolderStorage::searchResult | ( | KMFolder * | , | |
QValueList< Q_UINT32 > | , | |||
const KMSearchPattern * | , | |||
bool | complete | |||
) | [signal] |
Emitted when a search delivers results The matching serial numbers are included If complete
is true the search is done.
void FolderStorage::searchDone | ( | KMFolder * | , | |
Q_UINT32 | , | |||
const KMSearchPattern * | , | |||
bool | ||||
) | [signal] |
Emitted when a search for a single message is completed The serial number and a bool matching yes/no is included.
void FolderStorage::folderSizeChanged | ( | KMFolder * | ) | [signal] |
Emitted when the folder's size changes.
void FolderStorage::syncStateChanged | ( | ) | [signal] |
Emitted when the sync state, i.e.
mailCheckInProgress(), changes. Currently only supported for disconnected IMAP.
void FolderStorage::batchRemovingStarted | ( | ) | [signal] |
Emitted when we are removing a list of messages.
This is caught for example by KMHeaders so it doesn't change any pointer in mMsgList. Pointers to messages that we are removing must correspond to the ones in mMsgList. More information in: https://issues.kolab.org/msg26709
void FolderStorage::batchRemovingFinished | ( | ) | [signal] |
Emitted when we finish removing a list of messages.
It's now safe to call getMsg() and change contents of mMsgList.
virtual int FolderStorage::updateIndex | ( | ) | [pure virtual, slot] |
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 323 of file folderstorage.cpp.
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 344 of file folderstorage.cpp.
void FolderStorage::slotEmitChangedTimer | ( | ) | [slot] |
void FolderStorage::slotProcessNextSearchBatch | ( | ) | [protected, slot] |
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
void FolderStorage::headerOfMsgChanged | ( | const KMMsgBase * | aMsg, | |
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 918 of file folderstorage.cpp.
virtual KMMessage* FolderStorage::readMsg | ( | int | idx | ) | [protected, pure virtual] |
Load message from file and store it at given index.
Returns 0 on failure.
virtual void FolderStorage::fillMessageDict | ( | ) | [inline, protected, virtual] |
Inserts messages into the message dictionary.
The messages will get new serial numbers. This is only used on newly appeared folders, where there is no .ids file yet, or when that has been invalidated.
Reimplemented in KMFolderIndex.
Definition at line 571 of file folderstorage.h.
void FolderStorage::readFolderIdsFile | ( | ) | [protected] |
Read the on-disk cache of serial numbers of messages in this store and fill those into the global message dict, such that the messages we hold can be looked up there.
Definition at line 996 of file folderstorage.cpp.
int FolderStorage::writeFolderIdsFile | ( | ) | const [protected] |
int FolderStorage::touchFolderIdsFile | ( | ) | [protected] |
int FolderStorage::appendToFolderIdsFile | ( | int | idx = -1 |
) | [protected] |
Append message to end of message serial number file.
Definition at line 1033 of file folderstorage.cpp.
void FolderStorage::setRDict | ( | KMMsgDictREntry * | rentry | ) | const [protected] |
Sets the reverse-dictionary for this folder.
const, because the mRDict is mutable, since it is not part of the (conceptually) const-relevant state of the object.
Definition at line 1051 of file folderstorage.cpp.
KMMsgDictREntry* FolderStorage::rDict | ( | ) | const [inline, protected] |
void FolderStorage::replaceMsgSerNum | ( | unsigned long | sernum, | |
KMMsgBase * | msg, | |||
int | idx | |||
) | [protected] |
Replaces the serial number for the message msg
at index idx
with sernum
.
Definition at line 1045 of file folderstorage.cpp.
void FolderStorage::invalidateFolder | ( | ) | [protected] |
Called when serial numbers for a folder are invalidated, invalidates/recreates data structures dependent on the serial numbers for this folder.
Definition at line 1007 of file folderstorage.cpp.
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.
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.
virtual bool FolderStorage::readIndex | ( | ) | [protected, pure virtual] |
Member Data Documentation
bool FolderStorage::mAutoCreateIndex [protected] |
bool FolderStorage::mExportsSernums [protected] |
Has this storage exported its serial numbers to the global message dict for lookup?
Definition at line 631 of file folderstorage.h.
bool FolderStorage::mDirty [protected] |
if the index is dirty it will be recreated upon close()
Definition at line 633 of file folderstorage.h.
bool FolderStorage::mFilesLocked [protected] |
TRUE if the files of the folder are locked (writable).
Definition at line 635 of file folderstorage.h.
int FolderStorage::mUnreadMsgs [protected] |
bool FolderStorage::needsCompact [protected] |
sven: true if on destruct folder needs to be compacted.
Definition at line 643 of file folderstorage.h.
bool FolderStorage::mCompactable [protected] |
KMMsgDictREntry* FolderStorage::mRDict [mutable, protected] |
QPtrList<FolderJob> FolderStorage::mJobList [mutable, protected] |
KMail::FolderContentsType FolderStorage::mContentsType [protected] |
The documentation for this class was generated from the following files: