folderstorage.h
This class is an abstraction of a search over messages.
Definition: kmsearchpattern.h:307
bool compactable() const
false if index file is out of sync with mbox file
Definition: folderstorage.h:396
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 KMFolder * trashFolder() const
If this folder has a special trash folder set, return it.
Definition: folderstorage.h:387
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 int canAccess()=0
Check folder for permissions Returns zero if readable and writable.
virtual void tryReleasingFolder(KMFolder *)
Try releasing folder if possible, something is attempting an exclusive access to it.
Definition: folderstorage.h:273
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 bool noContent() const
Returns, if the folder can't contain mails, but only subfolder.
Definition: folderstorage.h:107
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 bool readIndex()=0
Read index file and fill the message-info list mMsgList.
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 KMMessage * readMsg(int idx)=0
Load message from file and store it at given index.
virtual bool noChildren() const
Returns, if the folder can't have children.
Definition: folderstorage.h:113
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 int count(bool cache=false) const
Number of messages in this folder.
Definition: folderstorage.cpp:820
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
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 const KMMsgBase * operator[](int idx) const
Same as getMsgBase(int).
Definition: folderstorage.h:176
KMail::FolderContentsType contentsType() const
Definition: folderstorage.h:404
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 statusMsg(const TQString &)
Emmited to display a message somewhere in a status line.
bool autoCreateIndex() const
Returns TRUE if a table of contents file is automatically created.
Definition: folderstorage.h:314
void closed(KMFolder *)
Emitted when the folder was closed and ticket owners have to reopen.
void contentsTypeChanged(KMail::FolderContentsType type)
Emitted when the contents type (calendar, mail, tasks, ..) of the folderstorage changes.
TQString label() const
Returns the label of the folder for visualization.
Definition: folderstorage.cpp:815
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 int addMsgKeepUID(KMMessage *msg, int *index_return=0)
(Note(bo): This needs to be fixed better at a later point.) This is overridden by dIMAP because addMs...
Definition: folderstorage.h:197
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
virtual TQString fileName() const
Returns the filename of the folder (reimplemented in KMFolderImap)
Definition: folderstorage.cpp:143
virtual void updateChildrenState()
Updates the hasChildren() state.
Definition: folderstorage.cpp:1096
void invalidated(KMFolder *)
Emitted when the serial numbers of this folder were invalidated.
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 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...
bool mFilesLocked
TRUE if the files of the folder are locked (writable)
Definition: folderstorage.h:622
virtual bool isMessage(int idx)
Checks if the message is already "gotten" with getMsg.
Definition: folderstorage.cpp:591
virtual int addMsg(KMMessage *msg, int *index_return=0)=0
Add the given message to the folder.
virtual int writeIndex(bool createEmptyIndex=false)=0
Write index to index-file.
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
KMail::FolderContentsType mContentsType
Type of contents in this folder.
Definition: folderstorage.h:648
void cleared()
Emitted when the contents of a folder have been cleared (new search in a search folder, for example)
TQ_INT64 folderSize() const
Total size of the contents of this folder.
Definition: folderstorage.cpp:847
KMMsgDictREntry * rDict() const
Returns the reverse-dictionary for this folder.
Definition: folderstorage.h:580
void setRDict(KMMsgDictREntry *rentry) const
Sets the reverse-dictionary for this folder.
Definition: folderstorage.cpp:1031
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
bool needsCompacting() const
Returns TRUE if the folder contains deleted messages.
Definition: folderstorage.h:329
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.
The FolderStorage class is the bass class for the storage related aspects of a collection of mail (a ...
Definition: folderstorage.h:79
void msgChanged(KMFolder *, TQ_UINT32 sernum, int delta)
Emitted, when the status of a message is changed.
virtual KMFolderType folderType() const
Returns the type of this folder.
Definition: folderstorage.h:96
int writeFolderIdsFile() const
Writes the message serial number file.
Definition: folderstorage.cpp:999
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.
virtual bool canDeleteMessages() const
Can messages in this folder be deleted?
Definition: folderstorage.cpp:1194
int appendToFolderIdsFile(int idx=-1)
Append message to end of message serial number file.
Definition: folderstorage.cpp:1013
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
virtual ChildrenState hasChildren() const
Returns if the folder has children, has no children or we don't know.
Definition: folderstorage.h:125
virtual void correctUnreadMsgsCount()
A cludge to help make sure the count of unread messges is kept in sync.
Definition: folderstorage.cpp:957
virtual bool isMoveable() const
Returns true if this folder can be moved.
Definition: folderstorage.cpp:1177
void registerWithMessageDict()
Triggers registration with the message dict, which will cause the dict to ask the FolderStorage to fi...
Definition: folderstorage.cpp:964
virtual int create()=0
Create a new folder with the name of this object and open it.
void readOnlyChanged(KMFolder *)
Emitted when the readonly status of the folder changes.
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
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