Update of /cvsroot/mahogany/M/include
In directory usw-pr-cvs1:/tmp/cvs-serv11528/include

Modified Files:
        Composer.h MObject.h Message.h MessageCC.h MessageEditor.h 
        Moptions.h MpersIds.h SendMessage.h SendMessageCC.h 
Log Message:
implemented message editing/postponing and the drafts folder - all very rough
but seems to sort of work


Index: Composer.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/Composer.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- Composer.h  13 Mar 2002 22:30:03 -0000      1.4
+++ Composer.h  16 Mar 2002 23:38:47 -0000      1.5
@@ -19,4 +19,5 @@
 class Message;
 class MessageView;
+class MimePart;
 class wxComposeView;
 
@@ -39,6 +40,7 @@
    };
 
-   /** @name Create a new composer window */
+   /** @name Different ways to create a new composer window */
    //@{
+
    /** Constructor for posting news.
        @param profile parent profile
@@ -90,6 +92,16 @@
    static Composer *CreateFwdMessage(const MailFolder::Params& params,
                                      Profile *profile,
-                                     Message * original = NULL,
+                                     Message *original = NULL,
                                      bool hide = false);
+
+   /**
+     Create a composer window initialized with an existing message.
+
+     @param profile the profile to use for the new composer
+     @param msg the message to edit
+     @return pointer to the new compose view
+    */
+   static Composer *EditMessage(Profile *profile, Message *message);
+
    //@}
 
@@ -107,9 +119,13 @@
    /** @name Set the composer headers */
    //@{
+
+   /// sets the "From" header
+   virtual void SetFrom(const String& from) = 0;
+
    /// Set the default value for the "From" header (if we have it)
    virtual void SetDefaultFrom() = 0;
 
    /// sets Subject field
-   virtual void SetSubject(const String &subj) = 0;
+   virtual void SetSubject(const String& subj) = 0;
 
    /// adds recepients from addr (Recepient_Max means to reuse the last)
@@ -145,8 +161,10 @@
    */
    virtual void AddHeaderEntry(const String& entry, const String& value) = 0;
+
    //@}
 
    /** @name Add/insert stuff into composer */
    //@{
+
    /** Initializes the composer text: for example, if this is a reply, inserts
        the quoted contents of the message being replied to (except that, in
@@ -172,5 +190,5 @@
 
    /** Insert MIME content data
-       @param data pointer to data (we take ownership of it)
+       @param data pointer to data (we will free() it later)
        @param len length of data
        @param mimetype mimetype to use
@@ -185,4 +203,7 @@
    virtual void InsertText(const String& txt) = 0;
 
+   /// insert (recursively) a MIME part
+   virtual void InsertMimePart(const MimePart *mimePart) = 0;
+
    /// move the cursor to the given position
    virtual void MoveCursorTo(int x, int y) = 0;
@@ -190,4 +211,5 @@
    /// reset the "dirty" flag
    virtual void ResetDirty() = 0;
+
    //@}
 

Index: MObject.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MObject.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -b -u -2 -r1.25 -r1.26
--- MObject.h   30 Nov 2001 22:39:24 -0000      1.25
+++ MObject.h   16 Mar 2002 23:38:47 -0000      1.26
@@ -213,5 +213,4 @@
    public: \
       classname##_obj(classname *ptr = NULL) { m_ptr = ptr; } \
-      ~classname##_obj() { if ( m_ptr ) m_ptr->DecRef(); } \
  \
       void Attach(classname *ptr) \
@@ -260,5 +259,6 @@
    BEGIN_DECLARE_AUTOPTR_NO_BOOL(classname)           \
    public:                                            \
-      operator bool() const { return m_ptr != NULL; } \
+      ~classname##_obj() { if ( m_ptr ) m_ptr->DecRef(); }  \
+      operator bool() const { return m_ptr != NULL; }
 
 // finish the class decl
@@ -275,5 +275,18 @@
    BEGIN_DECLARE_AUTOPTR_NO_BOOL(classname)           \
    public:                                            \
+      ~classname##_obj() { if ( m_ptr ) m_ptr->DecRef(); }  \
       operator classname *() const { return m_ptr; }  \
+   END_DECLARE_AUTOPTR()
+
+// same thing for non ref counted pointers
+#define BEGIN_DECLARE_AUTOPTR_NO_REF(classname)             \
+   BEGIN_DECLARE_AUTOPTR_NO_BOOL(classname)                 \
+   public:                                                  \
+      ~classname##_obj() { delete m_ptr; }                  \
+      operator bool() const { return m_ptr != NULL; }
+
+// declare an class which is an auto ptr to the given MObjectRC-derived type
+#define DECLARE_AUTOPTR_NO_REF(classname)                   \
+   BEGIN_DECLARE_AUTOPTR_NO_REF(classname)                  \
    END_DECLARE_AUTOPTR()
 

Index: Message.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/Message.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -b -u -2 -r1.61 -r1.62
--- Message.h   19 Dec 2001 12:56:56 -0000      1.61
+++ Message.h   16 Mar 2002 23:38:47 -0000      1.62
@@ -91,4 +91,14 @@
                                         wxArrayInt *encodings = NULL) const = 0;
 
+   /**
+     Get the names and values of all headers of the message.
+
+     @param names the array to return the header names in
+     @param values the array to return the header values in
+     @return the number of headers in the arrays
+   */
+   virtual size_t GetAllHeaders(wxArrayString *names,
+                                wxArrayString *values) const = 0;
+
    /** Get the complete header text.
        @return string with multiline text containing the message headers

Index: MessageCC.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageCC.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -b -u -2 -r1.50 -r1.51
--- MessageCC.h 17 Dec 2001 16:27:57 -0000      1.50
+++ MessageCC.h 16 Mar 2002 23:38:47 -0000      1.51
@@ -33,8 +33,8 @@
                                         wxArrayInt *encodings = NULL) const;
 
-   /** Get a complete header text.
-       @return string with multiline text containing the message headers
-   */
    virtual String GetHeader(void) const;
+
+   virtual size_t GetAllHeaders(wxArrayString *names,
+                                wxArrayString *values) const;
 
    /** @name Envelop headers */

Index: MessageEditor.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageEditor.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -u -2 -r1.1 -r1.2
--- MessageEditor.h     13 Mar 2002 22:30:03 -0000      1.1
+++ MessageEditor.h     16 Mar 2002 23:38:47 -0000      1.2
@@ -228,5 +228,5 @@
    void SetMimeType(const String& mimeType);
 
-   /// give us the data to attach, we take ownership of it (must be !NULL)
+   /// give us the data to attach, we will free() it (must be !NULL)
    void SetData(void *data, size_t length, const char *filename = NULL);
 

Index: Moptions.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/Moptions.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -b -u -2 -r1.42 -r1.43
--- Moptions.h  13 Mar 2002 17:29:53 -0000      1.42
+++ Moptions.h  16 Mar 2002 23:38:47 -0000      1.43
@@ -218,4 +218,5 @@
 extern const MOption MP_TRASH_FOLDER;
 extern const MOption MP_USE_TRASH_FOLDER;
+extern const MOption MP_DRAFTS_FOLDER;
 extern const MOption MP_FOLDER_PATH;
 extern const MOption MP_FOLDER_COMMENT;
@@ -796,4 +797,6 @@
 /// Use a trash folder?
 #define MP_USE_TRASH_FOLDER_NAME   "UseTrash"
+/// Name of the Drafts folder
+#define MP_DRAFTS_FOLDER_NAME "DraftsFolder"
 /// the filename for a mailbox
 #define   MP_FOLDER_PATH_NAME         "Path"
@@ -1578,4 +1581,6 @@
 /// Use a trash folder?
 #define MP_USE_TRASH_FOLDER_DEFVAL   1l
+/// Name of the Drafts folder
+#define MP_DRAFTS_FOLDER_DEFVAL ""
 /// the filename for a mailbox
 #define   MP_FOLDER_PATH_DEFVAL      ((const char *)NULL) // don't change this!

Index: MpersIds.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MpersIds.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- MpersIds.h  11 Mar 2002 19:40:48 -0000      1.2
+++ MpersIds.h  16 Mar 2002 23:38:47 -0000      1.3
@@ -101,4 +101,5 @@
 
 DECL_OR_DEF(REENABLE_HINT);
+DECL_OR_DEF(DRAFT_SAVED);
 
 DECL_OR_DEF(MAX);

Index: SendMessage.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/SendMessage.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -b -u -2 -r1.8 -r1.9
--- SendMessage.h       8 Mar 2002 17:43:17 -0000       1.8
+++ SendMessage.h       16 Mar 2002 23:38:47 -0000      1.9
@@ -132,17 +132,20 @@
    /** Writes the message to a String
        @param output string to write to
+       @return true if ok, false if an error occured
    */
-   virtual void WriteToString(String& output) = 0;
+   virtual bool WriteToString(String& output) = 0;
 
    /** Writes the message to a file
        @param filename file where to write to
        @param append if false, overwrite existing contents
+       @return true if ok, false if an error occured
    */
-   virtual void WriteToFile(const String &filename, bool append = true) = 0;
+   virtual bool WriteToFile(const String &filename, bool append = true) = 0;
 
    /** Writes the message to a folder.
        @param foldername file where to write to
+       @return true if ok, false if an error occured
    */
-   virtual void WriteToFolder(const String &foldername) = 0;
+   virtual bool WriteToFolder(const String &foldername) = 0;
 
    /** Sends the message or stores it in the outbox queue, depending
@@ -166,4 +169,7 @@
    virtual ~SendMessage();
 };
+
+// SendMessage_obj is a smart reference to SendMessage
+DECLARE_AUTOPTR_NO_REF(SendMessage);
 
 #endif // SENDMESSAGE_H

Index: SendMessageCC.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/SendMessageCC.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -b -u -2 -r1.49 -r1.50
--- SendMessageCC.h     8 Mar 2002 17:43:17 -0000       1.49
+++ SendMessageCC.h     16 Mar 2002 23:38:47 -0000      1.50
@@ -90,9 +90,9 @@
                         wxFontEncoding enc = wxFONTENCODING_SYSTEM);
 
-   virtual void WriteToString(String  &output);
+   virtual bool WriteToString(String  &output);
 
-   virtual void WriteToFile(const String &filename, bool append = true);
+   virtual bool WriteToFile(const String &filename, bool append = true);
 
-   virtual void WriteToFolder(const String &foldername);
+   virtual bool WriteToFolder(const String &foldername);
 
    virtual bool SendOrQueue(int flags = 0);


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to