26 #include "kmfoldernode.h" 27 #include "kmfoldertype.h" 28 #include "kmmsginfo.h" 31 #include "folderjob.h" 32 using KMail::FolderJob;
33 #include "mailinglist-magic.h" 35 #include "kmaccount.h" 37 #include "mimelib/string.h" 39 #include <tqptrvector.h> 40 #include <sys/types.h> 42 #include <tdeshortcut.h> 48 class KMFolderTreeItem;
52 class AttachmentStrategy;
54 using KMail::AttachmentStrategy;
56 typedef TQValueList<TQ_UINT32> SerNumList;
72 friend class ::KMFolderJob;
91 KMFolderType aFolderType,
bool withIndex =
true,
92 bool exportedSernums =
true );
124 void setAcctList( AccountList* list ) { mAcctList = list; }
125 AccountList* acctList() {
return mAcctList; }
131 void readConfig( TDEConfig* config );
134 void writeConfig( TDEConfig* config )
const;
141 KMFolderType folderType()
const;
144 TQString fileName()
const;
147 TQString location()
const;
150 TQString indexLocation()
const;
153 TQString subdirLocation()
const;
167 bool noContent()
const;
170 void setNoContent(
bool aNoContent);
173 bool noChildren()
const;
176 void setNoChildren(
bool aNoChildren);
182 KMMsgInfo* unGetMsg(
int idx);
185 bool isMessage(
int idx);
188 DwString getDwString(
int idx);
199 FolderJob* createJob(
KMMessage *msg, FolderJob::JobType jt = FolderJob::tGetMessage,
200 KMFolder *folder = 0, TQString partSpecifier = TQString(),
201 const AttachmentStrategy *as = 0 )
const;
202 FolderJob* createJob( TQPtrList<KMMessage>& msgList,
const TQString& sets,
203 FolderJob::JobType jt = FolderJob::tGetMessage,
210 const KMMsgBase* getMsgBase(
int idx)
const;
211 KMMsgBase* getMsgBase(
int idx);
214 const KMMsgBase* operator[](
int idx)
const;
217 KMMsgBase* operator[](
int idx);
222 void take(TQPtrList<KMMessage> msgList);
230 int addMsg(
KMMessage* msg,
int* index_return = 0);
235 int addMsgKeepUID(
KMMessage* msg,
int* index_return = 0);
241 int addMsg(TQPtrList<KMMessage>&, TQValueList<int>& index_return);
245 void emitMsgAddedSignals(
int idx);
248 void removeMsg(
int i,
bool imapQuiet =
false);
249 void removeMsg(TQPtrList<KMMessage> msgList,
bool imapQuiet =
false);
253 int expungeOldMsg(
int days);
259 int moveMsg(
KMMessage* msg,
int* index_return = 0);
260 int moveMsg(TQPtrList<KMMessage>,
int* index_return = 0);
263 int find(
const KMMsgBase* msg)
const;
267 int count(
bool cache =
false)
const;
274 int countUnreadRecursive();
278 void msgStatusChanged(
const KMMsgStatus oldStatus,
279 const KMMsgStatus newStatus,
287 int open(
const char *owner);
295 void close(
const char *owner,
bool force=
false);
301 bool isOpened()
const;
304 void markNewAsUnread();
307 void markUnreadAsRead();
320 enum CompactOptions { CompactLater, CompactNow, CompactSilentlyNow };
327 void compact( CompactOptions options );
331 int rename(
const TQString& newName,
KMFolderDir *aParent = 0);
339 void setDirty(
bool f);
342 bool needsCompacting()
const;
343 void setNeedsCompacting(
bool f);
353 void quiet(
bool beQuiet);
356 bool isReadOnly()
const;
358 bool isWritable()
const;
360 bool mailCheckInProgress()
const;
363 bool canDeleteMessages()
const;
370 void setSystemFolder(
bool itIs) { mIsSystemFolder=itIs; }
373 virtual TQString label()
const;
374 void setLabel(
const TQString& l ) { mLabel = l; }
378 void setSystemLabel(
const TQString& l ) { mSystemLabel = l; }
381 virtual TQString prettyURL()
const;
384 void setMailingListEnabled(
bool enabled );
385 bool isMailingListEnabled()
const {
return mMailingListEnabled; }
389 {
return mMailingList; }
390 TQString mailingListPostAddress()
const;
392 void setIdentity(uint identity);
393 uint identity()
const;
397 void setWhoField(
const TQString& aWhoField);
401 void setUserWhoField(
const TQString &whoField,
bool writeConfig=
true);
404 void correctUnreadMsgsCount();
407 TQString idString()
const;
412 void setAutoExpire(
bool enabled);
424 void setUnreadExpireAge(
int age);
430 void setUnreadExpireUnits(ExpireUnits units);
437 void setReadExpireAge(
int age);
443 void setReadExpireUnits(ExpireUnits units);
469 enum ExpireAction { ExpireDelete, ExpireMove };
474 void setExpireAction( ExpireAction a );
480 void setExpireToFolderId(
const TQString&
id );
486 void expireOldMessages(
bool immediate );
490 int writeIndex(
bool createEmptyIndex =
false );
493 void setStatus(
int idx, KMMsgStatus status,
bool toggle=
false);
496 void setStatus(TQValueList<int>& ids, KMMsgStatus status,
bool toggle=
false);
500 void setUseCustomIcons(
bool useCustomIcons) { mUseCustomIcons = useCustomIcons; }
501 TQString normalIconPath()
const {
return mNormalIconPath; }
502 TQString unreadIconPath()
const {
return mUnreadIconPath; }
503 void setIconPaths(
const TQString &normalPath,
const TQString &unreadPath);
507 void daysToExpire(
int& unreadDays,
int& readDays );
520 void setPutRepliesInSameFolder(
bool b ) { mPutRepliesInSameFolder = b; }
527 void setIgnoreNewMail(
bool b ) { mIgnoreNewMail = b; }
529 const TDEShortcut &shortcut()
const {
return mShortcut; }
530 void setShortcut(
const TDEShortcut& );
533 bool isMoveable()
const;
548 bool isValidName(
const TQString &folderName, TQString &message );
577 void msgRemoved(
KMFolder*, TQ_UINT32 sernum);
580 void msgRemoved(
int idx, TQString msgIdMD5 );
584 void msgAdded(
int idx);
585 void msgAdded(
KMFolder*, TQ_UINT32 sernum);
588 void msgChanged(
KMFolder*, TQ_UINT32 sernum,
int delta);
591 void msgHeaderChanged(
KMFolder*,
int);
594 void statusMsg(
const TQString&);
597 void numUnreadMsgsChanged(
KMFolder* );
603 void viewConfigChanged();
606 void folderSizeChanged(
KMFolder * );
609 void noContentChanged();
615 void syncStateChanged();
627 void reallyAddCopyOfMsg(
KMMessage* aMsg);
631 void slotContentsTypeChanged( KMail::FolderContentsType type );
633 void slotFolderSizeChanged();
638 bool mIsSystemFolder;
640 bool mExportsSernums :1;
641 bool mMoveInProgress :1;
645 TQString mSystemLabel;
648 bool mExpireMessages;
649 int mUnreadExpireAge;
651 ExpireUnits mUnreadExpireUnits;
652 ExpireUnits mReadExpireUnits;
653 ExpireAction mExpireAction;
654 TQString mExpireToFolderId;
657 bool mUseCustomIcons;
658 TQString mNormalIconPath;
659 TQString mUnreadIconPath;
662 bool mMailingListEnabled;
665 AccountList* mAcctList;
670 TQString mWhoField, mUserWhoField;
673 bool mPutRepliesInSameFolder;
679 TDEShortcut mShortcut;
690 const char*
const mOwner;
699 mOpenRc = folder->
open( owner );
705 mFolder->
close( mOwner );
708 KMFolder* folder()
const {
return mFolder; }
710 int openResult()
const {
return mOpenRc; }
714 void*
operator new(
size_t size );
ExpireAction expireAction() const
What should expiry do? Delete or move to another folder?
bool isTemplates()
Returns true if this folder is the templates folder of the local account, or is configured to be the ...
RAII for KMFolder::open() / close().
bool isAutoExpire() const
Does this folder automatically expire old messages?
bool isSent()
Returns true if this folder is the sent-mail box of the local account, or is configured to be the sen...
TQString expireToFolderId() const
If expiry should move to folder, return the ID of that folder.
static KMKernel * self()
normal control stuff
ExpireUnits getReadExpireUnits() const
Units getReadExpireAge() is returned in.
bool isTrash()
Returns true if this folder is configured as a trash folder, locally or for one of the accounts...
bool isOutbox()
Returns true only if this is the outbox for outgoing mail.
int getUnreadExpireAge() const
Get the age at which unread messages are expired.
KMail list that manages the contents of one directory that may contain folders and/or other directori...
bool hasAccounts() const
Returns true if accounts are associated with this folder.
bool isDrafts()
Returns true if this folder is the drafts box of the local account, or is configured to be the drafts...
void setMoveInProgress(bool b)
Sets the move-in-progress flag.
bool isSystemFolder() const
Returns true if the folder is a kmail system folder.
virtual TQString systemLabel() const
Set the label that is used as a system default.
Class is used for all Mailing List handling inside KMail.
bool ignoreNewMail() const
Returns true if the user doesn't want to get notified about new mail in this folder.
The FolderStorage class is the bass class for the storage related aspects of a collection of mail (a ...
const FolderStorage * storage() const
if the folder is const, the storage should be as well
void close(const char *owner, bool force=false)
Close folder.
bool moveInProgress() const
Returns true if there is currently a move or copy operation going on with this folder as target...
bool putRepliesInSameFolder() const
Returns true if the replies to mails from this folder should be put in the same folder.
bool useCustomIcons() const
Icon related methods.
bool folderIsSentMailFolder(const KMFolder *)
Returns true if the folder is one of the sent-mail folders.
KMFolderDir * child() const
Returns the folder directory associated with this node or 0 if no such directory exists.
int open(const char *owner)
Open folder for access.
ExpireUnits getUnreadExpireUnits() const
Units getUnreadExpireAge() is returned in.
TQString whoField() const
Get / set the name of the field that is used for the Sender/Receiver column in the headers (From/To) ...
int getReadExpireAge() const
Get the age at which read messages are expired.
bool isMainInbox()
Returns true if this folder is the inbox on the local disk.
TQString userWhoField(void)
Get / set the user-settings for the WhoField (From/To/Empty)