folderstorage.cpp
269 //kdDebug(5006) << "deleting msg " << i << " : " << mb->subject() << " - " << mb->dateStr(); // << endl;
480 kdWarning(5006) << "FolderStorage::getMsg was called on a closed folder: " << folder()->prettyURL() << endl;
484 kdWarning(5006) << "FolderStorage::getMsg was asked for an invalid index. idx =" << idx << " count()=" << count() << endl;
1034 kdDebug(5006) << "WTF, this FolderStorage should be invisible to the msgdict, who is calling us?" << kdBacktrace() << endl;
This class is an abstraction of a search over messages.
Definition: kmsearchpattern.h:307
int writeFolderIdsFile() const
Writes the message serial number file.
Definition: folderstorage.cpp:999
virtual void reallyAddMsg(KMMessage *aMsg)
Add the message to the folder after it has been retrieved from an IMAP server.
Definition: folderstorage.cpp:323
virtual void setNoContent(bool aNoContent)
Specify, that the folder can't contain mails.
Definition: folderstorage.cpp:1199
virtual int updateIndex()=0
Incrementally update the index if possible else call writeIndex.
virtual FolderJob * createJob(KMMessage *msg, FolderJob::JobType jt=FolderJob::tGetMessage, KMFolder *folder=0, TQString partSpecifier=TQString(), const AttachmentStrategy *as=0) const
These methods create respective FolderJob (You should derive FolderJob for each derived KMFolder)...
Definition: folderstorage.cpp:600
void invalidateFolder()
Called when serial numbers for a folder are invalidated, invalidates/recreates data structures depend...
Definition: folderstorage.cpp:987
void locationChanged(const TQString &, const TQString &)
Emitted when the location on disk of the folder changes.
bool needsCompact
sven: true if on destruct folder needs to be compacted.
Definition: folderstorage.h:630
virtual bool isCloseToQuota() const
Return whether the folder is close to its quota limit, which can be reflected in the UI...
Definition: folderstorage.cpp:858
void readConfig(TDEConfig *config)
This is used by the storage to read the folder specific configuration.
Definition: kmfolder.cpp:161
KMMsgDictREntry * mRDict
Points at the reverse dictionary for this folder.
Definition: folderstorage.h:638
virtual void msgStatusChanged(const KMMsgStatus oldStatus, const KMMsgStatus newStatus, int idx)
Called by KMMsgBase::setStatus when status of a message has changed required to keep the number unrea...
Definition: folderstorage.cpp:864
virtual void removeMsg(int i, bool imapQuiet=false)
Remove (first occurrence of) given message from the folder.
Definition: folderstorage.cpp:380
virtual int countUnread()
Number of new or unread messages in this folder.
Definition: folderstorage.cpp:829
virtual int expungeContents()=0
Called by KMFolder::expunge() to delete the actual contents.
virtual void setContentsType(KMail::FolderContentsType type, bool quiet=false)
Set the type of contents held in this folder (mail, calendar, etc.)
Definition: folderstorage.cpp:1116
virtual int moveMsg(KMMessage *msg, int *index_return=0)
Detaches the given message from it's current folder and adds it to this folder.
Definition: folderstorage.cpp:621
virtual void setHasChildren(ChildrenState state)
Specify if the folder has children.
Definition: folderstorage.h:128
virtual void ignoreJobsForMessage(KMMessage *)
Removes and deletes all jobs associated with the particular message.
Definition: folderstorage.cpp:1064
virtual TQString fileName() const
Returns the filename of the folder (reimplemented in KMFolderImap)
Definition: folderstorage.cpp:143
virtual KMMessage * readMsg(int idx)=0
Load message from file and store it at given index.
static const KMMsgDict * instance()
Access the globally unique MessageDict.
Definition: kmmsgdict.cpp:167
void deregisterFromMessageDict()
Triggers deregistration from the message dict, which will cause the dict to ask the FolderStorage to ...
Definition: folderstorage.cpp:970
virtual void setStatus(int idx, KMMsgStatus status, bool toggle=false)
Set the status of the message at index idx to status.
Definition: folderstorage.cpp:1043
virtual bool canAddMsgNow(KMMessage *aMsg, int *aIndex_ret)
Returns false, if the message has to be retrieved from an IMAP account first.
Definition: folderstorage.cpp:301
void writeConfig(TDEConfig *config) const
This is used by the storage to save the folder specific configuration.
Definition: kmfolder.cpp:200
bool mAutoCreateIndex
is the automatic creation of a index file allowed ?
Definition: folderstorage.h:615
virtual void setAutoCreateIndex(bool)
Allow/disallow automatic creation of a table of contents file.
Definition: folderstorage.cpp:151
virtual DwString getDwString(int idx)=0
Read a message and returns a DwString.
void readFolderIdsFile()
Read the on-disk cache of serial numbers of messages in this store and fill those into the global mes...
Definition: folderstorage.cpp:976
void setMsgSerNum(unsigned long newMsgSerNum=0)
Sets the message serial number.
Definition: kmmessage.cpp:223
void closed(KMFolder *)
Emitted when the folder was closed and ticket owners have to reopen.
TQ_INT64 folderSize() const
Total size of the contents of this folder.
Definition: folderstorage.cpp:847
void contentsTypeChanged(KMail::FolderContentsType type)
Emitted when the contents type (calendar, mail, tasks, ..) of the folderstorage changes.
FolderJob * createJob(KMMessage *msg, FolderJob::JobType jt=FolderJob::tGetMessage, KMFolder *folder=0, TQString partSpecifier=TQString(), const AttachmentStrategy *as=0) const
These methods create respective FolderJob (You should derive FolderJob for each derived KMFolder)...
Definition: kmfolder.cpp:346
void headerOfMsgChanged(const KMMsgBase *, int idx)
Tell the folder that a header field that is usually used for the index (subject, from, ...) has changed of given message.
Definition: folderstorage.cpp:898
void numUnreadMsgsChanged(KMFolder *)
Emitted when number of unread messages has changed.
FolderStorage(KMFolder *folder, const char *name=0)
Usually a parent is given.
Definition: folderstorage.cpp:63
virtual TQString prettyURL() const
URL of the node for visualization purposes.
Definition: kmfolder.cpp:593
virtual void updateChildrenState()
Updates the hasChildren() state.
Definition: folderstorage.cpp:1096
void invalidated(KMFolder *)
Emitted when the serial numbers of this folder were invalidated.
bool matches(const KMMessage *msg, bool ignoreBody=false) const
The central function of this class.
Definition: kmsearchpattern.cpp:728
virtual void quiet(bool beQuiet)
If set to quiet the folder will not emit msgAdded(idx) signal.
Definition: folderstorage.cpp:205
virtual KMMsgInfo * unGetMsg(int idx)
Replace KMMessage with KMMsgInfo and delete KMMessage.
Definition: folderstorage.cpp:566
KMail list that manages the contents of one directory that may contain folders and/or other directori...
Definition: kmfolderdir.h:15
void changed()
Emitted when the status, name, or associated accounts of this folder changed.
void setRDict(KMMsgDictREntry *rentry) const
Sets the reverse-dictionary for this folder.
Definition: folderstorage.cpp:1031
void searchDone(KMFolder *, TQ_UINT32, const KMSearchPattern *, bool)
Emitted when a search for a single message is completed The serial number and a bool matching yes/no ...
virtual FolderJob * doCreateJob(KMMessage *msg, FolderJob::JobType jt, KMFolder *folder, TQString partSpecifier, const AttachmentStrategy *as) const =0
These two methods actually create the jobs.
virtual void setNoChildren(bool aNoChildren)
Specify, that the folder can't have children.
Definition: folderstorage.cpp:1108
void searchResult(KMFolder *, TQValueList< TQ_UINT32 >, const KMSearchPattern *, bool complete)
Emitted when a search delivers results The matching serial numbers are included If complete is true t...
virtual bool isMessage(int idx)
Checks if the message is already "gotten" with getMsg.
Definition: folderstorage.cpp:591
bool isComplete() const
Return true if the complete message is available without referring to the backing store...
Definition: kmmessage.h:867
virtual TQString label() const
Returns the label of the folder for visualization.
Definition: kmfolder.cpp:581
virtual bool isMoveable() const
Returns true if this folder can be moved.
Definition: folderstorage.cpp:1177
virtual int addMsg(KMMessage *msg, int *index_return=0)=0
Add the given message to the folder.
void fromDwString(const DwString &str, bool setStatus=false)
Parse the string and create this message from it.
Definition: kmmessage.cpp:402
TQString subject() const
Get or set the 'Subject' header field.
Definition: kmmessage.cpp:2049
TQString idString() const
Returns a string that can be used to identify this folder.
Definition: kmfolder.cpp:705
virtual void search(const KMSearchPattern *)
Search for messages The end is signaled with searchDone()
Definition: folderstorage.cpp:1126
void replaceMsgSerNum(unsigned long sernum, KMMsgBase *msg, int idx)
Replaces the serial number for the message msg at index idx with sernum.
Definition: folderstorage.cpp:1025
TQString fileName() const
Returns the filename of the folder (reimplemented in KMFolderImap)
Definition: kmfolder.cpp:238
virtual void remove()
Removes the folder physically from disk and empties the contents of the folder in memory...
Definition: folderstorage.cpp:755
bool transferInProgress() const
Return, if the message should not be deleted.
Definition: kmmessage.cpp:236
KMail::FolderContentsType mContentsType
Type of contents in this folder.
Definition: folderstorage.h:648
virtual TQString indexLocation() const =0
Returns full path to index file.
void msgHeaderChanged(KMFolder *, int)
Emitted when a field of the header of a specific message changed.
void msgChanged(KMFolder *, TQ_UINT32 sernum, int delta)
Emitted, when the status of a message is changed.
virtual int rename(const TQString &newName, KMFolderDir *aParent=0)
Physically rename the folder.
Definition: folderstorage.cpp:665
virtual int removeContents()=0
Called by KMFolder::remove() to delete the actual contents.
int appendToFolderIdsFile(int idx=-1)
Append message to end of message serial number file.
Definition: folderstorage.cpp:1013
virtual bool canDeleteMessages() const
Can messages in this folder be deleted?
Definition: folderstorage.cpp:1194
virtual const KMMsgBase * getMsgBase(int idx) const =0
Provides access to the basic message fields that are also stored in the index.
virtual void markUnreadAsRead()
Mark all new and unread messages as read.
Definition: folderstorage.cpp:183
virtual int find(const KMMsgBase *msg) const =0
Returns the index of the given message or -1 if not found.
virtual void fillMessageDict()
Inserts messages into the message dictionary.
Definition: folderstorage.h:558
unsigned long getMsgSerNum(KMFolder *folder, int index) const
Find the message serial number for the message located at index index in folder folder.
Definition: kmmsgdict.cpp:345
void setTransferInProgress(bool value, bool force=false)
Set that the message shall not be deleted because it is still required.
Definition: kmmessage.cpp:243
KMFolderDir * child() const
Returns the folder directory associated with this node or 0 if no such directory exists.
Definition: kmfolder.h:157
virtual void correctUnreadMsgsCount()
A cludge to help make sure the count of unread messges is kept in sync.
Definition: folderstorage.cpp:957
void registerWithMessageDict()
Triggers registration with the message dict, which will cause the dict to ask the FolderStorage to fi...
Definition: folderstorage.cpp:964
TQString subdirLocation() const
Returns full path to sub directory file.
Definition: kmfolder.cpp:253
TQString label() const
Returns the label of the folder for visualization.
Definition: folderstorage.cpp:815
virtual int expungeOldMsg(int days)
Delete messages in the folder that are older than days.
Definition: folderstorage.cpp:254
virtual KMMessage * readTemporaryMsg(int idx)
Load message from file and do NOT store it, only return it.
Definition: folderstorage.cpp:527
virtual int count(bool cache=false) const
Number of messages in this folder.
Definition: folderstorage.cpp:820
void noContentChanged()
Emitted when the no content state of the folder changes.
void msgRemoved(KMFolder *, TQ_UINT32 sernum)
Emitted before a message is removed from the folder.
bool mExportsSernums
Has this storage exported its serial numbers to the global message dict for lookup?
Definition: folderstorage.h:618
virtual void reallyAddCopyOfMsg(KMMessage *aMsg)
Add a copy of the message to the folder after it has been retrieved from an IMAP server.
Definition: folderstorage.cpp:344
void emitMsgAddedSignals(int idx)
Called by derived classes implementation of addMsg.
Definition: folderstorage.cpp:284