Update of /cvsroot/mahogany/M/include
In directory usw-pr-cvs1:/tmp/cvs-serv741/include
Modified Files:
ASMailFolder.h MailFolder.h MailFolderCC.h MailFolderCmn.h
Log Message:
more MailFolder refactoring and added (untested and unused) VirtualFolder class
Index: ASMailFolder.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/ASMailFolder.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -b -u -2 -r1.55 -r1.56
--- ASMailFolder.h 4 Jul 2002 17:22:36 -0000 1.55
+++ ASMailFolder.h 16 Jul 2002 20:21:39 -0000 1.56
@@ -332,5 +332,6 @@
@param set if true, set the flag, if false, clear it
*/
- virtual Ticket SetSequenceFlag(const UIdArray *sequence,
+ virtual Ticket SetSequenceFlag(MailFolder::SequenceKind kind,
+ const Sequence& sequence,
int flag,
bool set = true) = 0;
Index: MailFolder.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MailFolder.h,v
retrieving revision 1.179
retrieving revision 1.180
diff -b -u -2 -r1.179 -r1.180
--- MailFolder.h 14 Jul 2002 23:41:22 -0000 1.179
+++ MailFolder.h 16 Jul 2002 20:21:43 -0000 1.180
@@ -126,4 +126,14 @@
};
+ /// flags for SetSequenceFlag()
+ enum SequenceKind
+ {
+ /// the sequence contains the UIDs
+ SEQ_UID,
+
+ /// the sequence contains the msgnos
+ SEQ_MSGNO
+ };
+
/// flags for SearchByFlag()
enum
@@ -537,10 +547,12 @@
/** UnDelete a message.
- @param uid the message uid
- @return true on success
+ @param uid the message uid @return true on success
*/
virtual bool UnDeleteMessage(unsigned long uid) = 0;
- /** Set flags on a messages. Possible flag values are MSG_STAT_xxx
+ /**
+ Set or clear the given flag for one message. Possible flag values are
+ MSG_STAT_xxx.
+
@param uid the message uid
@param flag flag to be set, e.g. "\\Deleted"
@@ -552,27 +564,36 @@
bool set = true) = 0;
- /** Set flag for all messages
- */
- virtual bool SetFlagForAll(int flag, bool set = true) = 0;
+ /** Set flags on a sequence of messages. Possible flag values are
+ MSG_STAT_xxx. Note that it is more efficient to call this function
+ rather SetMessageFlag() for each sequence element so it should be used
+ whenever possible.
- /** Set flags on a sequence of messages. Possible flag values are MSG_STAT_xxx
- @param sequence the IMAP sequence of uids
+ @param kind if SEQ_UID, sequence contains UIDs, otherwise -- msgnos
+ @param sequence the sequence of uids or msgnos
@param flag flag to be set, e.g. "\\Deleted"
@param set if true, set the flag, if false, clear it
@return true on success
*/
- virtual bool SetFlag(const UIdArray *sequence,
+ virtual bool SetSequenceFlag(SequenceKind kind,
+ const Sequence& sequence,
int flag,
bool set = true) = 0;
- /** Set flags on a sequence of messages. Possible flag values are MSG_STAT_xxx
- @param sequence the IMAP sequence of uids
- @param flag flag to be set, e.g. "\\Deleted"
- @param set if true, set the flag, if false, clear it
- @return true on success
+ /// for compatibility: SetSequenceFlag() working only with UIDs
+ bool SetSequenceFlag(const Sequence& sequence, int flag, bool set = true)
+ { return SetSequenceFlag(SEQ_UID, sequence, flag, set); }
+
+ /**
+ Set or clear the given flag for all messages in the folder.
*/
- virtual bool SetSequenceFlag(const String &sequence,
- int flag,
- bool set = true) = 0;
+ bool SetFlagForAll(int flag, bool set = true);
+
+ /**
+ Simple wrapper around SetSequenceFlag().
+
+ Avoid using this one, it is mainly here for backwards compatibility.
+ */
+ bool SetFlag(const UIdArray *sequence, int flag, bool set = true);
+
/** Appends the message to this folder.
@param msg the message to append
Index: MailFolderCC.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MailFolderCC.h,v
retrieving revision 1.208
retrieving revision 1.209
diff -b -u -2 -r1.208 -r1.209
--- MailFolderCC.h 14 Jul 2002 23:41:22 -0000 1.208
+++ MailFolderCC.h 16 Jul 2002 20:21:43 -0000 1.209
@@ -53,11 +53,4 @@
{
public:
- /// flags for DoSetSequenceFlag()
- enum SequenceKind
- {
- SEQ_UID,
- SEQ_MSGNO
- };
-
/** @name Constructors and destructor */
//@{
@@ -146,23 +139,16 @@
virtual Message *GetMessage(unsigned long uid);
- /** Set flags on a sequence of messages. Possible flag values are MSG_STAT_xxx
- @param sequence the IMAP sequence
- @param flag flag to be set, e.g. "\\Deleted"
- @param set if true, set the flag, if false, clear it
- @return always true UNSUPPORTED!
- */
- virtual bool SetSequenceFlag(const String& sequence,
+ virtual bool SetMessageFlag(unsigned long uid,
int flag,
bool set = true);
- virtual bool SetFlagForAll(int flag, bool set = true);
-
/** Set flags on a sequence of messages. Possible flag values are MSG_STAT_xxx
- @param sequence the IMAP sequence of uids
+ @param sequence the IMAP sequence
@param flag flag to be set, e.g. "\\Deleted"
@param set if true, set the flag, if false, clear it
- @return true on success
+ @return always true UNSUPPORTED!
*/
- virtual bool SetFlag(const UIdArray *sequence,
+ virtual bool SetSequenceFlag(SequenceKind kind,
+ const Sequence& sequence,
int flag,
bool set = true);
@@ -191,12 +177,4 @@
- /** Set a flag for all messages in this sequence which may contain either
- UIDs or msgnos
- */
- virtual bool DoSetSequenceFlag(SequenceKind kind,
- const String& sequence,
- int flag,
- bool set = true);
-
/** Check whether mailbox has changed.
@return FALSE on error
@@ -350,7 +328,4 @@
/** @name Mailbox update helpers */
//@{
-
- /// call to notify everybody that its listing changed
- virtual void RequestUpdate(void);
/// call to notify everybody that some messages were expunged
Index: MailFolderCmn.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MailFolderCmn.h,v
retrieving revision 1.75
retrieving revision 1.76
diff -b -u -2 -r1.75 -r1.76
--- MailFolderCmn.h 5 Jul 2002 15:57:06 -0000 1.75
+++ MailFolderCmn.h 16 Jul 2002 20:21:43 -0000 1.76
@@ -35,4 +35,7 @@
#define TRACE_MF_NEWMAIL "mfnew"
+// trace mask for the mail folder related events
+#define TRACE_MF_EVENTS "mfevent"
+
class FilterRule;
@@ -87,5 +90,5 @@
@return true on success
*/
- virtual bool DeleteMessages(const UIdArray *messages, bool expunge=false);
+ virtual bool DeleteMessages(const UIdArray *messages, bool expunge = false);
/** Mark messages as no longer deleted.
@@ -95,34 +98,16 @@
virtual bool UnDeleteMessages(const UIdArray *messages);
- /**@name Old-style functions, try to avoid. */
- //@{
-
- /** Set flags on a messages. Possible flag values are MSG_STAT_xxx
- @param uid mesage uid
- @param flag flag to be set, e.g. "\\Deleted"
- @param set if true, set the flag, if false, clear it
- @return always true UNSUPPORTED!
- */
- virtual bool SetMessageFlag(unsigned long uid,
- int flag,
- bool set = true)
- {
- return SetSequenceFlag(strutil_ultoa(uid),flag,set);
- }
-
- /** Delete a message.
+ /** Mark message as deleted.
@param uid mesage uid
- @return always true UNSUPPORTED!
+ @return true if ok
*/
virtual bool DeleteMessage(unsigned long uid);
- /** UnDelete a message.
+ /** Mark message as not deleted.
@param uid mesage uid
- @return always true UNSUPPORTED!
+ @return true if ok
*/
- virtual inline bool UnDeleteMessage(unsigned long uid)
- { SetMessageFlag(uid,MSG_STAT_DELETED, false); return true; }
+ virtual bool UnDeleteMessage(unsigned long uid);
- //@}
/** Reply to selected messages.
@param messages pointer to an array holding the message numbers
@@ -186,4 +171,5 @@
virtual void SuspendUpdates() { m_suspendUpdates++; }
virtual void ResumeUpdates() { if ( !--m_suspendUpdates ) RequestUpdate(); }
+ virtual void RequestUpdate();
/** @name Delayed folder closing
-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates