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

Modified Files:
        wxComposeView.h wxMDialogs.h wxMenuDefs.h 
Log Message:
implemented message editing/postponing and the drafts folder - all very rough
but seems to sort of work


Index: wxComposeView.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/gui/wxComposeView.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -b -u -2 -r1.74 -r1.75
--- wxComposeView.h     13 Mar 2002 22:30:03 -0000      1.74
+++ wxComposeView.h     16 Mar 2002 23:38:47 -0000      1.75
@@ -84,41 +84,33 @@
    };
 
-   /** Initializes the composer text: for example, if this is a reply, inserts
-       the quoted contents of the message being replied to (except that, in
-       fact, it may do whatever the user configured it to do using templates).
-       The msg parameter may be NULL only for the new messages, messages
-       created with CreateReply/FwdMessage require it to be !NULL.
-
-       @param msg the message we're replying to or forwarding
-    */
-   void InitText(Message *msg = NULL, MessageView *msgview = NULL);
-
-   /** insert a file into buffer
-       @param filename file to insert
-       @param mimetype mimetype to use
-       @param num_mimetype numeric mimetype
+   /**
+     Set the template to use for this message. Should be called before
+     InitText(), if at all.
+
+     @param templ the name of the template
        */
-   void InsertFile(const char *filename = NULL,
-                   const char *mimetype = NULL);
+   void SetTemplate(const String& templ) { m_template = templ; }
 
-   /** Insert MIME content data
-       @param data pointer to data (we take ownership of it)
-       @param len length of data
-       @param mimetype mimetype to use
-       @param filename optional filename to add to list of parameters
+   /**
+     Set the original message to use when replying or forwarding. Should be
+     called only by CreateReplyMessage() and CreateFwdMessage()
        */
-   void InsertData(void *data,
+   void SetOriginal(Message *original);
+
+   // implement Composer pure virtuals
+   virtual void InitText(Message *msg = NULL, MessageView *msgview = NULL);
+   virtual void InsertFile(const char *filename = NULL,
+                           const char *mimetype = NULL);
+
+   virtual void InsertData(void *data,
                    size_t length,
                    const char *mimetype = NULL,
                    const char *filename = NULL);
 
-   /// inserts a text
-   void InsertText(const String &txt);
+   virtual void InsertText(const String &txt);
 
-   /// move the cursor to the given position
-   void MoveCursorTo(int x, int y);
+   virtual void InsertMimePart(const MimePart *mimePart);
 
-   /// set the focus to the composer window
-   void SetFocusToComposer();
+   virtual void MoveCursorTo(int x, int y);
 
    /** Set the newsgroups to post to.
@@ -127,4 +119,6 @@
    void SetNewsgroups(const String &groups);
 
+   virtual void SetFrom(const String& from);
+
    /// Set the default value for the "From" header (if we have it)
    void SetDefaultFrom();
@@ -146,7 +140,17 @@
    virtual String GetSubject() const;
 
+   /// set the focus to the editor window itself
+   void SetFocusToComposer();
+
    /// make a printout of input window
    void Print(void);
 
+   /**
+     Save the message in the drafts folder.
+
+     @return true if message was saved ok
+   */
+   bool SaveAsDraft() const;
+
    /** Send the message.
        @param schedule if TRUE, call calendar module to schedule sending
@@ -207,4 +211,7 @@
    void ResetDirty();
 
+   /// set the message encoding to be equal to the encoding of this msg
+   void SetEncodingToSameAs(Message *msg);
+
    // implement base class virtual
    virtual wxComposeView *GetComposeView() { return this; }
@@ -215,7 +222,4 @@
        @param parent parent window
        @param parentProfile parent profile
-       @param to default value for To field
-       @param cc default value for Cc field
-       @param bcc default value for Bcc field
        @param hide if true, do not show frame
    */
@@ -225,8 +229,13 @@
 
    /** Constructor
-       @param iname  name of windowclass
+       @param name  name of windowclass
+       @param mode can be either news or email
+       @param kind is new message/article, reply/followup or forward
        @param parent parent window
    */
-   wxComposeView(const String &iname, wxWindow *parent = NULL);
+   wxComposeView(const String& name,
+                 Mode mode,
+                 MessageKind kind,
+                 wxWindow *parent = NULL);
 
    // helpers
@@ -242,7 +251,4 @@
    void DoInsertAttachment(EditorContentPart *mc, const char *mimetype);
 
-   /// set the message encoding to be equal to the encoding of this msg
-   void SetEncodingToSameAs(Message *msg);
-
    /// set encoding to use
    void SetEncoding(wxFontEncoding encoding);
@@ -442,5 +448,9 @@
 private:
    // it creates us
-   friend class Composer;
+   friend wxComposeView *CreateComposeView(Profile *profile,
+                                           const MailFolder::Params& params,
+                                           wxComposeView::Mode mode,
+                                           wxComposeView::MessageKind kind,
+                                           bool hide);
 
    // wxWindows macros

Index: wxMDialogs.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/gui/wxMDialogs.h,v
retrieving revision 1.95
retrieving revision 1.96
diff -b -u -2 -r1.95 -r1.96
--- wxMDialogs.h        11 Mar 2002 19:40:48 -0000      1.95
+++ wxMDialogs.h        16 Mar 2002 23:38:48 -0000      1.96
@@ -33,4 +33,5 @@
 class ArrayAdbElements;
 class MFolder;
+class MPersMsgBox;
 
 class WXDLLEXPORT wxFrame;
@@ -49,4 +50,14 @@
 
 /**
+  Return value of MDialog_YesNoCancel
+ */
+enum MDlgResult
+{
+   MDlg_Cancel = -1,
+   MDlg_No,
+   MDlg_Yes
+};
+
+/**
    Dialog Boxes
 */
@@ -177,7 +188,24 @@
                            char const *title = MDIALOG_YESNOTITLE,
                            int flags = M_DLG_YES_DEFAULT,
-                           const class MPersMsgBox *persMsg = NULL,
+                           const MPersMsgBox *persMsg = NULL,
                            const char *folderName = NULL);
 
+/**
+  This is a 3 choice dialog: it has Yes, No and Cancel buttons. Unlile
+  MDialog_YesNoDialog it is not persistent as remembering "Cancel" as answer
+  would probably be very confusing.
+
+  @param message the text to display
+  @param parent the parent frame
+  @param title title for message box window
+  @param flags combination of M_DLG_XXX values
+
+  @return M_DLG_ if yes was chosen, 0 if no and -1 if cancel
+ */
+MDlgResult MDialog_YesNoCancel(char const *message,
+                               const wxWindow *parent = NULL,
+                               char const *title = MDIALOG_YESNOTITLE,
+                               int flags = M_DLG_YES_DEFAULT);
+
 /** File requester dialog: asks user for a file name
        @param message the text to display
@@ -213,4 +241,18 @@
 
 } // extern "C"
+
+/**
+  Another, new, version of MDialog_Message which uses MPersMsgBox and has a
+  more useful parameter order.
+
+  @param message the text to display
+  @param parent the parent frame
+  @param persMsg the profile path to use (doesn't use profile if NULL)
+  @param title title for message box window
+ */
+void MDialog_Message(char const *message,
+                     const wxWindow *parent,
+                     const MPersMsgBox *persMsg,
+                     char const *title = MDIALOG_MSGTITLE);
 
 

Index: wxMenuDefs.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/gui/wxMenuDefs.h,v
retrieving revision 1.104
retrieving revision 1.105
diff -b -u -2 -r1.104 -r1.105
--- wxMenuDefs.h        13 Mar 2002 16:38:27 -0000      1.104
+++ wxMenuDefs.h        16 Mar 2002 23:38:48 -0000      1.105
@@ -168,4 +168,5 @@
    WXMENU_MSG_BEGIN = WXMENU_EDIT_END,
    WXMENU_MSG_OPEN,
+   WXMENU_MSG_EDIT,
    WXMENU_MSG_PRINT,
    WXMENU_MSG_PRINT_PREVIEW,
@@ -238,8 +239,9 @@
    WXMENU_COMPOSE_LOADTEXT,
    WXMENU_COMPOSE_SEND,
+   WXMENU_COMPOSE_SAVE_AS_DRAFT,
    WXMENU_COMPOSE_SEND_LATER,
    WXMENU_COMPOSE_SEND_KEEP_OPEN,
-   WXMENU_COMPOSE_PRINT,
    WXMENU_COMPOSE_SEP1,
+   WXMENU_COMPOSE_PRINT,
    WXMENU_COMPOSE_PREVIEW,
    WXMENU_COMPOSE_SAVETEXT,


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

Reply via email to