Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs1:/tmp/cvs-serv2949/include

Modified Files:
        MessageView.h MessageViewer.h ViewFilter.h 
Log Message:
1. moved the URL highlighting and quote level detection logic to a separate
   view filter
2. view filters now get a pointer to the associated MessageView


Index: MessageView.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageView.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -b -u -2 -r1.35 -r1.36
--- MessageView.h       29 Nov 2002 02:02:39 -0000      1.35
+++ MessageView.h       1 Dec 2002 00:27:34 -0000       1.36
@@ -45,8 +45,4 @@
 WX_DEFINE_ARRAY(ProcessInfo *, ArrayProcessInfo);
 
-// the max quoting level for which we have unique colours (after that we reuse
-// them)
-#define QUOTE_LEVEL_MAX 3
-
 // ----------------------------------------------------------------------------
 // constants
@@ -68,6 +64,6 @@
 
 // ----------------------------------------------------------------------------
-// MessageView: this class does MIME handling and uses MessageViewer to really
-//              show things on screen
+// MessageView: this class does MIME handling and uses ViewFilters (which, in
+//              turn, use MessageViewer) to really show things on the screen
 // ----------------------------------------------------------------------------
 
@@ -237,4 +233,18 @@
    static String GetLabelFor(const MimePart *mimepart);
 
+   /** @name Accessors
+
+       Some trivial accessors
+    */
+   //@{
+
+   /// get the profile to read settings from: DO NOT CALL DecRef() ON RESULT
+   Profile *GetProfile() const;
+
+   /// get the folder we use: DO NOT CALL DecRef() ON RESULT
+   ASMailFolder *GetFolder() const { return m_asyncFolder; }
+
+   //@}
+
 protected:
    /** @name Initialization
@@ -266,18 +276,4 @@
    //@}
 
-   /** @name Accessors
-
-       Some trivial accessors
-    */
-   //@{
-
-   /// get the profile to read settings from: DO NOT CALL DecRef() ON RESULT
-   Profile *GetProfile() const;
-
-   /// get the folder we use: DO NOT CALL DecRef() ON RESULT
-   ASMailFolder *GetFolder() const { return m_asyncFolder; }
-
-   //@}
-
    /** @name External processes
 
@@ -368,10 +364,4 @@
    void ShowImage(const MimePart *part);
 
-   /// return the quoting level of this line, 0 if unquoted
-   size_t GetQuotedLevel(const wxChar *text) const;
-
-   /// return the colour to use for the given quoting level
-   wxColour GetQuoteColour(size_t qlevel) const;
-
    /// return the clickable info object (basicly a label) for this part
    ClickableInfo *GetClickableInfo(const MimePart *part) const;
@@ -489,7 +479,5 @@
       wxColour BgCol,
                FgCol,
-               UrlCol,           // URL colour (used only if highlightURLs)
-               AttCol,
-               SigCol,           // signature colour (if highlightSig)
+               AttCol,           // attachment colour
                HeaderNameCol,
                HeaderValueCol;
@@ -505,41 +493,15 @@
       //@}
 
-      /// @name URL highlighting and text quoting colourizing data
-      //@{
-
-      /// the colours for quoted text (only used if quotedColourize)
-      wxColour QuotedCol[QUOTE_LEVEL_MAX];
-
-      /// max number of whitespaces before >
-      int quotedMaxWhitespace;
-
-      /// max number of A-Z before >
-      int quotedMaxAlpha;
-
-      /// process quoted text colourizing?
-      bool quotedColourize:1;
-
-      /// if there is > QUOTE_LEVEL_MAX levels of quoting, cycle colours?
-      bool quotedCycleColours:1;
-
-      /// highlight URLs?
-      bool highlightURLs:1;
-
-      /// highlight the signature?
-      bool highlightSig:1;
-
-      //@}
-
       /// @name MIME options
       //@{
 
       /// show all headers?
-      bool showHeaders;
+      bool showHeaders:1;
 
       /// inline MESSAGE/RFC822 attachments?
-      bool inlineRFC822;
+      bool inlineRFC822:1;
 
       /// inline TEXT/PLAIN attachments?
-      bool inlinePlainText;
+      bool inlinePlainText:1;
 
       /// max size of inline graphics: 0 if never inline at all, -1 if no limit
@@ -547,8 +509,8 @@
 
       /// follow the links to external images in the HTML messages?
-      bool showExtImages;
+      bool showExtImages:1;
 
       /// Show XFaces?
-      bool showFaces;
+      bool showFaces:1;
 
       //@}
@@ -556,4 +518,11 @@
       /// @name URL viewing
       //@{
+
+      /// highlight the URLs in the message?
+      bool highlightURLs;
+
+      /// the colour to use for URL highlighting (if highlightURLs is true)
+      wxColour UrlCol;
+
       /// URL viewer
       String browser;
@@ -561,13 +530,15 @@
 #ifdef OS_UNIX
       /// Is URL viewer of the netscape variety?
-      bool browserIsNS;
+      bool browserIsNS:1;
 #endif // Unix
 
       /// open netscape in new window?
-      bool browserInNewWindow;
+      bool browserInNewWindow:1;
+
       //@}
 
       /// @name Address autocollection
       //@{
+
       /// Autocollect email addresses?
       int autocollect;
@@ -581,4 +552,5 @@
       /// Name of the ADB book to use for autocollect.
       String autocollectBookName;
+
       //@}
 

Index: MessageViewer.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageViewer.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -b -u -2 -r1.13 -r1.14
--- MessageViewer.h     30 Nov 2002 01:47:40 -0000      1.13
+++ MessageViewer.h     1 Dec 2002 00:27:34 -0000       1.14
@@ -23,4 +23,5 @@
 #include "MModule.h"
 #include "MTextStyle.h"
+#include "MessageView.h"      // we use MessageView in inline funcs below
 
 // the message viewer module interface name

Index: ViewFilter.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/ViewFilter.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -u -2 -r1.3 -r1.4
--- ViewFilter.h        30 Nov 2002 02:20:25 -0000      1.3
+++ ViewFilter.h        1 Dec 2002 00:27:34 -0000       1.4
@@ -16,4 +16,6 @@
 
 #include "MModule.h"
+
+class MessageView;
 class MessageViewer;
 class MTextStyle;
@@ -73,9 +75,10 @@
       the one with Priority_Last) installed by MessageView itself.
 
+      @param msgView the message view we're associated with
       @param next the next filter in the chain
       @param enable true to enable the filter initially, false to disable it
     */
-   ViewFilter(ViewFilter *next, bool enable)
-      { m_next = next; m_active = enable; }
+   ViewFilter(MessageView *msgView, ViewFilter *next, bool enable)
+      { m_msgView = msgView; m_next = next; m_active = enable; }
 
    /// virtual dtor for any base class
@@ -127,4 +130,7 @@
                           MTextStyle& style) = 0;
 
+   /// the message view we're associated with
+   MessageView *m_msgView;
+
    /// pointer to the next filter or NULL if this is the last one
    ViewFilter *m_next;
@@ -150,5 +156,5 @@
 
    /// creates the new filter object, to be deleted by the caller
-   virtual ViewFilter *Create(ViewFilter *next) const = 0;
+   virtual ViewFilter *Create(MessageView *msgView, ViewFilter *next) const = 0;
 };
 
@@ -168,6 +174,7 @@
       virtual int GetPriority() const { return prio; }                     \
       virtual bool GetDefaultState() const { return state; }               \
-      virtual ViewFilter *Create(ViewFilter *next) const                   \
-         { return new cname(next, state); }                                \
+      virtual ViewFilter *Create(MessageView *msgView,                     \
+                                 ViewFilter *next) const                   \
+         { return new cname(msgView, next, state); }                       \
                                                                            \
       MMODULE_DEFINE();                                                    \



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to