Update of /cvsroot/mahogany/M/src/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv581/src/modules

Modified Files:
        HtmlViewer.cpp LayoutViewer.cpp TextViewer.cpp 
Log Message:
1. Removed MessageViewer::InsertSignature(); added EndText()
2. ClickableInfo reorganization:
 a) ClickableInfo is not in a separate header and is now a base class
 b) instead of switch on type of ClickableInfo we now have
    ClickableAttachment and ClickableURL implementations of the base class


Index: HtmlViewer.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/HtmlViewer.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -b -u -2 -r1.42 -r1.43
--- HtmlViewer.cpp      6 Nov 2002 00:28:24 -0000       1.42
+++ HtmlViewer.cpp      5 Dec 2002 19:47:32 -0000       1.43
@@ -34,4 +34,5 @@
 #include "MessageView.h"
 #include "MessageViewer.h"
+#include "ClickURL.h"
 
 #include <wx/dynarray.h>
@@ -114,5 +115,5 @@
    virtual void InsertText(const String& text, const MTextStyle& style);
    virtual void InsertURL(const String& text, const String& url);
-   virtual void InsertSignature(const String& signature);
+   virtual void EndText();
    virtual void EndPart();
    virtual void EndBody();
@@ -129,9 +130,6 @@
 
    // methods used by HtmlViewerWindow only
+   MessageView *GetMessageView() const { return m_msgView; }
    bool ShouldInlineImage(const String& url) const;
-   void DoMouseCommand(int id, const ClickableInfo *ci, const wxPoint& pt)
-   {
-      m_msgView->DoMouseCommand(id, ci, pt);
-   }
 
 private:
@@ -398,5 +396,5 @@
    {
       ClickableInfo *ci = GetClickable(link->GetHref());
-      if ( !ci || ci->GetType() == ClickableInfo::CI_URL )
+      if ( ci )
       {
          // let the base class process it
@@ -421,5 +419,5 @@
       if ( !ci )
       {
-         ci = new ClickableInfo(url);
+         ci = new ClickableURL(m_viewer->GetMessageView(), url);
          StoreClickable(ci, url);
       }
@@ -427,9 +425,11 @@
       // left click becomes double click as we want to open the URLs on simple
       // click
-      m_viewer->DoMouseCommand(event.LeftDown()
-                                 ? WXMENU_LAYOUT_DBLCLICK
+      m_viewer->GetMessageView()->DoMouseCommand
+                                  (
+                                    event.LeftDown() ? WXMENU_LAYOUT_DBLCLICK
                                  : WXMENU_LAYOUT_RCLICK,
                                ci,
-                               event.GetPosition());
+                                    event.GetPosition()
+                                  );
    }
 
@@ -893,9 +893,7 @@
 }
 
-void HtmlViewer::InsertSignature(const String& signature)
+void HtmlViewer::EndText()
 {
-   // this is not called by MessageView yet, but should be implemented when it
-   // starts recognizing signatures in the messages
-   FAIL_MSG( _T("not implemented") );
+   // nothing to do here
 }
 

Index: LayoutViewer.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/LayoutViewer.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -b -u -2 -r1.27 -r1.28
--- LayoutViewer.cpp    6 Nov 2002 00:28:24 -0000       1.27
+++ LayoutViewer.cpp    5 Dec 2002 19:47:32 -0000       1.28
@@ -36,4 +36,5 @@
 #include "MessageView.h"
 #include "MessageViewer.h"
+#include "ClickURL.h"
 
 #include "gui/wxllist.h"
@@ -96,5 +97,5 @@
    virtual void InsertText(const String& text, const MTextStyle& style);
    virtual void InsertURL(const String& text, const String& url);
-   virtual void InsertSignature(const String& signature);
+   virtual void EndText();
    virtual void EndPart();
    virtual void EndBody();
@@ -163,6 +164,5 @@
       m_ci = ci;
 
-      SetLabel(m_ci->GetType() == ClickableInfo::CI_URL ? m_ci->GetUrl()
-                                                        : m_ci->GetLabel());
+      SetLabel(m_ci->GetLabel());
    }
 
@@ -556,5 +556,5 @@
    wxLayoutList *llist = m_window->GetLayoutList();
 
-   LayoutUserData* data = new LayoutUserData(new ClickableInfo(url));
+   LayoutUserData* data = new LayoutUserData(new ClickableURL(m_msgView, url));
    SetTextColour(GetOptions().UrlCol);
 
@@ -599,8 +599,7 @@
 }
 
-void LayoutViewer::InsertSignature(const String& signature)
+void LayoutViewer::EndText()
 {
-   // this is not called by MessageView yet, but should be implemented when it
-   // starts recognizing signatures in the messages
+   // nothing to do here
 }
 

Index: TextViewer.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/TextViewer.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -b -u -2 -r1.38 -r1.39
--- TextViewer.cpp      30 Nov 2002 22:26:39 -0000      1.38
+++ TextViewer.cpp      5 Dec 2002 19:47:32 -0000       1.39
@@ -38,4 +38,5 @@
 #include "MessageView.h"
 #include "MessageViewer.h"
+#include "ClickURL.h"
 
 class TextViewerWindow;
@@ -97,5 +98,5 @@
    virtual void InsertText(const String& text, const MTextStyle& style);
    virtual void InsertURL(const String& text, const String& url);
-   virtual void InsertSignature(const String& signature);
+   virtual void EndText();
    virtual void EndPart();
    virtual void EndBody();
@@ -595,11 +596,12 @@
 void TextViewer::InsertURL(const String& text, const String& url)
 {
-   m_window->InsertClickable(text, new ClickableInfo(url), GetOptions().UrlCol);
+   m_window->InsertClickable(text,
+                             new ClickableURL(m_msgView, url),
+                             GetOptions().UrlCol);
 }
 
-void TextViewer::InsertSignature(const String& signature)
+void TextViewer::EndText()
 {
-   // this is not called by MessageView yet, but should be implemented when it
-   // starts recognizing signatures in the messages
+   // we don't need to do anything special here
 }
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to