Revision: 7208
          http://svn.sourceforge.net/mahogany/?rev=7208&view=rev
Author:   nerijus
Date:     2007-01-08 14:10:54 -0800 (Mon, 08 Jan 2007)

Log Message:
-----------
fixed non PCH compilation; converted newly added files to unix line endings

Modified Paths:
--------------
    trunk/M/include/RecipientType.h
    trunk/M/include/adb/AdbManager.h
    trunk/M/include/gui/AddressExpander.h
    trunk/M/src/adb/AdbManager.cpp
    trunk/M/src/gui/AddressExpander.cpp

Modified: trunk/M/include/RecipientType.h
===================================================================
--- trunk/M/include/RecipientType.h     2007-01-08 22:05:46 UTC (rev 7207)
+++ trunk/M/include/RecipientType.h     2007-01-08 22:10:54 UTC (rev 7208)
@@ -1,33 +1,33 @@
-///////////////////////////////////////////////////////////////////////////////
-// Project:     M - cross platform e-mail GUI client
-// File name:   RecipientType.h
-// Purpose:     declaration of RecipientType enum
-// Author:      Vadim Zeitlin
-// Created:     2007-01-08 (extracted from Composer.h)
-// CVS-ID:      $Id$
-// Copyright:   (c) 1998-2007 Mahogany team
-// Licence:     M license
-///////////////////////////////////////////////////////////////////////////////
-
-/**
-   @file RecipientType.h
-   @brief Declaration of RecipientType enum.
- */
-
-#ifndef MAHOGANY_RECIPIENTTYPE_H_
-#define MAHOGANY_RECIPIENTTYPE_H_
-
-/// Recipient address types
-enum RecipientType
-{
-  Recipient_To,
-  Recipient_Cc,
-  Recipient_Bcc,
-  Recipient_Newsgroup,
-  Recipient_Fcc,
-  Recipient_None,
-  Recipient_Max
-};
-
-#endif // MAHOGANY_RECIPIENTTYPE_H_
-
+///////////////////////////////////////////////////////////////////////////////
+// Project:     M - cross platform e-mail GUI client
+// File name:   RecipientType.h
+// Purpose:     declaration of RecipientType enum
+// Author:      Vadim Zeitlin
+// Created:     2007-01-08 (extracted from Composer.h)
+// CVS-ID:      $Id$
+// Copyright:   (c) 1998-2007 Mahogany team
+// Licence:     M license
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+   @file RecipientType.h
+   @brief Declaration of RecipientType enum.
+ */
+
+#ifndef MAHOGANY_RECIPIENTTYPE_H_
+#define MAHOGANY_RECIPIENTTYPE_H_
+
+/// Recipient address types
+enum RecipientType
+{
+  Recipient_To,
+  Recipient_Cc,
+  Recipient_Bcc,
+  Recipient_Newsgroup,
+  Recipient_Fcc,
+  Recipient_None,
+  Recipient_Max
+};
+
+#endif // MAHOGANY_RECIPIENTTYPE_H_
+

Modified: trunk/M/include/adb/AdbManager.h
===================================================================
--- trunk/M/include/adb/AdbManager.h    2007-01-08 22:05:46 UTC (rev 7207)
+++ trunk/M/include/adb/AdbManager.h    2007-01-08 22:10:54 UTC (rev 7208)
@@ -20,6 +20,7 @@
 #include "RecipientType.h"
 
 #ifndef USE_PCH
+#  include "Profile.h"      // for Profile
 #  include <wx/dynarray.h>
 #endif // USE_PCH
 

Modified: trunk/M/include/gui/AddressExpander.h
===================================================================
--- trunk/M/include/gui/AddressExpander.h       2007-01-08 22:05:46 UTC (rev 
7207)
+++ trunk/M/include/gui/AddressExpander.h       2007-01-08 22:10:54 UTC (rev 
7208)
@@ -1,73 +1,77 @@
-///////////////////////////////////////////////////////////////////////////////
-// Project:     M - cross platform e-mail GUI client
-// File name:   gui/AddressExpander.h
-// Purpose:     declaration of AddressExpander class
-// Author:      Vadim Zeitlin
-// Created:     2007-01-08
-// CVS-ID:      $Id$
-// Copyright:   (c) 1998-2007 Mahogany team
-// Licence:     M license
-///////////////////////////////////////////////////////////////////////////////
-
-/**
-   @file gui/AddressExpander.h
-   @brief Declaration of AddressExpander helper.
-
-   AddressExpander can be used with any control which needs to expand email
-   addresses entered into it by user by looking them up in the address books.
- */
-
-#ifndef _M_GUI_ADDRESSEXPANDER_H_
-#define _M_GUI_ADDRESSEXPANDER_H_
-
-#include "RecipientType.h"
-
-class WXDLLEXPORT wxFrame;
-class WXDLLEXPORT wxTextCtrl;
-
-/**
-   AddressExpander is not a control but can be associated with an existing
-   control to add support for expanding addresses in it.
- */
-class AddressExpander
-{
-public:
-   /**
-      Create an AddressExpander associated with the given text entry zone.
-
-      @param text the associated text control
-      @param profile for expansion options
-    */
-   AddressExpander(wxTextCtrl *text, Profile *profile);
-
-   /**
-      Calls AdbExpandAllRecipients() for the control contents.
-
-      Doesn't modify the control contents.
-    */
-   int ExpandAll(wxArrayString& addresses,
-                 wxArrayInt& rcptTypes,
-                 String *subject) const;
-
-   /**
-      Replaces the last address entered into the control with its expansion.
-
-      @param subject filled in with the subject if the recipient contains it
-      @return type of the recipient if explicitly specified, Recipient_None if
-              none and Recipient_Max if nothing was expanded
-    */
-   RecipientType ExpandLast(String *subject);
-
-private:
-   // return the parent window for ADB functions
-   wxFrame *GetParentFrame() const;
-
-
-   wxTextCtrl *m_text;
-   Profile_obj m_profile;
-
-   DECLARE_NO_COPY_CLASS(AddressExpander)
-};
-
-#endif // _M_GUI_ADDRESSEXPANDER_H_
-
+///////////////////////////////////////////////////////////////////////////////
+// Project:     M - cross platform e-mail GUI client
+// File name:   gui/AddressExpander.h
+// Purpose:     declaration of AddressExpander class
+// Author:      Vadim Zeitlin
+// Created:     2007-01-08
+// CVS-ID:      $Id$
+// Copyright:   (c) 1998-2007 Mahogany team
+// Licence:     M license
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+   @file gui/AddressExpander.h
+   @brief Declaration of AddressExpander helper.
+
+   AddressExpander can be used with any control which needs to expand email
+   addresses entered into it by user by looking them up in the address books.
+ */
+
+#ifndef _M_GUI_ADDRESSEXPANDER_H_
+#define _M_GUI_ADDRESSEXPANDER_H_
+
+#include "RecipientType.h"
+
+#ifndef USE_PCH
+#   include "Profile.h"        // for Profile_obj
+#endif // USE_PCH
+
+class WXDLLEXPORT wxFrame;
+class WXDLLEXPORT wxTextCtrl;
+
+/**
+   AddressExpander is not a control but can be associated with an existing
+   control to add support for expanding addresses in it.
+ */
+class AddressExpander
+{
+public:
+   /**
+      Create an AddressExpander associated with the given text entry zone.
+
+      @param text the associated text control
+      @param profile for expansion options
+    */
+   AddressExpander(wxTextCtrl *text, Profile *profile);
+
+   /**
+      Calls AdbExpandAllRecipients() for the control contents.
+
+      Doesn't modify the control contents.
+    */
+   int ExpandAll(wxArrayString& addresses,
+                 wxArrayInt& rcptTypes,
+                 String *subject) const;
+
+   /**
+      Replaces the last address entered into the control with its expansion.
+
+      @param subject filled in with the subject if the recipient contains it
+      @return type of the recipient if explicitly specified, Recipient_None if
+              none and Recipient_Max if nothing was expanded
+    */
+   RecipientType ExpandLast(String *subject);
+
+private:
+   // return the parent window for ADB functions
+   wxFrame *GetParentFrame() const;
+
+
+   wxTextCtrl *m_text;
+   Profile_obj m_profile;
+
+   DECLARE_NO_COPY_CLASS(AddressExpander)
+};
+
+#endif // _M_GUI_ADDRESSEXPANDER_H_
+

Modified: trunk/M/src/adb/AdbManager.cpp
===================================================================
--- trunk/M/src/adb/AdbManager.cpp      2007-01-08 22:05:46 UTC (rev 7207)
+++ trunk/M/src/adb/AdbManager.cpp      2007-01-08 22:10:54 UTC (rev 7208)
@@ -25,6 +25,8 @@
 #  include "Profile.h"
 #  include "MApplication.h"
 #  include "guidef.h"
+#  include "Moptions.h"                // for MOption
+#  include "Mdefaults.h"       // for READ_CONFIG
 
 #  include <wx/log.h>           // for wxLogStatus
 #  include <wx/config.h>

Modified: trunk/M/src/gui/AddressExpander.cpp
===================================================================
--- trunk/M/src/gui/AddressExpander.cpp 2007-01-08 22:05:46 UTC (rev 7207)
+++ trunk/M/src/gui/AddressExpander.cpp 2007-01-08 22:10:54 UTC (rev 7208)
@@ -1,125 +1,126 @@
-///////////////////////////////////////////////////////////////////////////////
-// Project:     M - cross platform e-mail GUI client
-// File name:   gui/AddressExpander.cpp
-// Purpose:     AddressExpander implementation
-// Author:      Vadim Zeitlin
-// Created:     2007-01-08
-// CVS-ID:      $Id: wxComposeView.cpp 7203 2007-01-08 00:09:32Z vadz $
-// Copyright:   (c) 1998-2007 Mahogany team
-// Licence:     M license
-///////////////////////////////////////////////////////////////////////////////
-
-// ============================================================================
-// declarations
-// ============================================================================
-
-// ----------------------------------------------------------------------------
-// headers
-// ----------------------------------------------------------------------------
-
-#include "Mpch.h"
-
-#ifndef USE_PCH
-#  include "Mcommon.h"
-#endif
-
-#include "adb/AdbManager.h"
-
-#include "gui/AddressExpander.h"
-
-// ============================================================================
-// AddressExpander implementation
-// ============================================================================
-
-AddressExpander::AddressExpander(wxTextCtrl *text, Profile *profile)
-               : m_profile(profile)
-{
-   SafeIncRef(profile);
-
-   m_text = text;
-
-   // TODO: connect to TAB and Enter events to handle them automatically?
-}
-
-wxFrame *AddressExpander::GetParentFrame() const
-{
-   return (wxFrame *)wxGetTopLevelParent(m_text);
-}
-
-int
-AddressExpander::ExpandAll(wxArrayString& addresses,
-                           wxArrayInt& rcptTypes,
-                           String *subject) const
-{
-   return AdbExpandAllRecipients
-          (
-            m_text->GetValue(),
-            addresses,
-            rcptTypes,
-            subject,
-            m_profile,
-            GetParentFrame()
-          );
-}
-
-RecipientType AddressExpander::ExpandLast(String *subject)
-{
-   // find the last address
-   String text = m_text->GetValue();
-   const size_t len = text.length();
-   size_t start = 0;
-   bool quoted = false;
-   for ( size_t n = 0; n < len; n++ )
-   {
-      switch ( text[n] )
-      {
-         case '\\':
-            // skip the next character, even if it's a quote or separator
-            n++;
-            break;
-
-         case '"':
-            quoted = !quoted;
-            break;
-
-         case ',':
-         case ';':
-            if ( !quoted )
-            {
-               // keep the space if there is one following the separator
-               if ( n < len - 1 && text[n + 1] == ' ' )
-                  n++;
-
-               start = n;
-            }
-            break;
-      }
-   }
-
-   // if we didn't find the final quote, skip over the initial one too
-   if ( quoted )
-      start++;
-
-   if ( start == len )
-      return Recipient_Max; // nothing to expand
-
-   // preserve the part before the address start
-   String textBefore;
-   start++;
-   textBefore.assign(text, 0, start);
-   text.erase(0, start);
-   text.Trim(false /* from left */);
-
-   // expand the address
-   RecipientType rcptType =
-      AdbExpandSingleRecipient(&text, subject, m_profile, GetParentFrame());
-
-   if ( rcptType != Recipient_Max )
-   {
-      m_text->SetValue(textBefore + text);
-      m_text->SetInsertionPointEnd();
-   }
-
-   return rcptType;
-}
-
+///////////////////////////////////////////////////////////////////////////////
+// Project:     M - cross platform e-mail GUI client
+// File name:   gui/AddressExpander.cpp
+// Purpose:     AddressExpander implementation
+// Author:      Vadim Zeitlin
+// Created:     2007-01-08
+// CVS-ID:      $Id: wxComposeView.cpp 7203 2007-01-08 00:09:32Z vadz $
+// Copyright:   (c) 1998-2007 Mahogany team
+// Licence:     M license
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#include "Mpch.h"
+
+#ifndef USE_PCH
+#  include "Mcommon.h"
+#  include <wx/textctrl.h>        // for wxTextCtrl
+#endif
+
+#include "adb/AdbManager.h"
+
+#include "gui/AddressExpander.h"
+
+// ============================================================================
+// AddressExpander implementation
+// ============================================================================
+
+AddressExpander::AddressExpander(wxTextCtrl *text, Profile *profile)
+               : m_profile(profile)
+{
+   SafeIncRef(profile);
+
+   m_text = text;
+
+   // TODO: connect to TAB and Enter events to handle them automatically?
+}
+
+wxFrame *AddressExpander::GetParentFrame() const
+{
+   return (wxFrame *)wxGetTopLevelParent(m_text);
+}
+
+int
+AddressExpander::ExpandAll(wxArrayString& addresses,
+                           wxArrayInt& rcptTypes,
+                           String *subject) const
+{
+   return AdbExpandAllRecipients
+          (
+            m_text->GetValue(),
+            addresses,
+            rcptTypes,
+            subject,
+            m_profile,
+            GetParentFrame()
+          );
+}
+
+RecipientType AddressExpander::ExpandLast(String *subject)
+{
+   // find the last address
+   String text = m_text->GetValue();
+   const size_t len = text.length();
+   size_t start = 0;
+   bool quoted = false;
+   for ( size_t n = 0; n < len; n++ )
+   {
+      switch ( text[n] )
+      {
+         case '\\':
+            // skip the next character, even if it's a quote or separator
+            n++;
+            break;
+
+         case '"':
+            quoted = !quoted;
+            break;
+
+         case ',':
+         case ';':
+            if ( !quoted )
+            {
+               // keep the space if there is one following the separator
+               if ( n < len - 1 && text[n + 1] == ' ' )
+                  n++;
+
+               start = n;
+            }
+            break;
+      }
+   }
+
+   // if we didn't find the final quote, skip over the initial one too
+   if ( quoted )
+      start++;
+
+   if ( start == len )
+      return Recipient_Max; // nothing to expand
+
+   // preserve the part before the address start
+   String textBefore;
+   start++;
+   textBefore.assign(text, 0, start);
+   text.erase(0, start);
+   text.Trim(false /* from left */);
+
+   // expand the address
+   RecipientType rcptType =
+      AdbExpandSingleRecipient(&text, subject, m_profile, GetParentFrame());
+
+   if ( rcptType != Recipient_Max )
+   {
+      m_text->SetValue(textBefore + text);
+      m_text->SetInsertionPointEnd();
+   }
+
+   return rcptType;
+}
+


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to