You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2013/01/04 20:57:10 UTC

svn commit: r1429067 [1/2] - in /openoffice/trunk/main: framework/qa/complex/api_internal/ offapi/com/sun/star/system/ offapi/type_reference/ postprocess/packcomponents/ postprocess/rebase/ qadevOOo/objdsc/cmdmail/ qadevOOo/objdsc/smplmail/ qadevOOo/te...

Author: arielch
Date: Fri Jan  4 19:57:08 2013
New Revision: 1429067

URL: http://svn.apache.org/viewvc?rev=1429067&view=rev
Log:
i121579 - Clean-up system mail API

Added:
    openoffice/trunk/main/offapi/com/sun/star/system/MailClientFlags.idl
    openoffice/trunk/main/offapi/com/sun/star/system/SystemMailProvider.idl   (contents, props changed)
      - copied, changed from r1429066, openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl
    openoffice/trunk/main/offapi/com/sun/star/system/XMailClient.idl
    openoffice/trunk/main/offapi/com/sun/star/system/XMailMessage.idl
    openoffice/trunk/main/offapi/com/sun/star/system/XSystemMailProvider.idl   (contents, props changed)
      - copied, changed from r1429066, openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl
    openoffice/trunk/main/shell/source/cmdmail/syscmdmail.cxx
    openoffice/trunk/main/shell/source/cmdmail/syscmdmail.hxx
    openoffice/trunk/main/shell/source/win32/sysmail/
    openoffice/trunk/main/shell/source/win32/sysmail/exports.dxp
      - copied, changed from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/exports.dxp
    openoffice/trunk/main/shell/source/win32/sysmail/makefile.mk
      - copied, changed from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/makefile.mk
    openoffice/trunk/main/shell/source/win32/sysmail/senddoc.cxx
      - copied, changed from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/senddoc.cxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmail.component
      - copied, changed from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/smplmail.component
    openoffice/trunk/main/shell/source/win32/sysmail/sysmail.xml   (with props)
    openoffice/trunk/main/shell/source/win32/sysmail/sysmailclient.cxx
      - copied, changed from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/smplmailclient.cxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmailclient.hxx
      - copied, changed from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/smplmailclient.hxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmailentry.cxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmailmsg.cxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmailmsg.hxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmailprov.cxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmailprov.hxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmapi.cxx
      - copied, changed from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/simplemapi.cxx
    openoffice/trunk/main/shell/source/win32/sysmail/sysmapi.hxx
      - copied, changed from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/simplemapi.hxx
Removed:
    openoffice/trunk/main/offapi/com/sun/star/system/SimpleCommandMail.idl
    openoffice/trunk/main/offapi/com/sun/star/system/SimpleMailClientFlags.idl
    openoffice/trunk/main/offapi/com/sun/star/system/SimpleSystemMail.idl
    openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailClient.idl
    openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailClientSupplier.idl
    openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage.idl
    openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl
    openoffice/trunk/main/qadevOOo/objdsc/cmdmail/com.sun.star.comp.system.SimpleCommandMail.csv
    openoffice/trunk/main/qadevOOo/objdsc/smplmail/com.sun.star.comp.system.SimpleSystemMail.csv
    openoffice/trunk/main/qadevOOo/tests/basic/ifc/system/XSimpleMailClientSupplier/script.xlb
    openoffice/trunk/main/qadevOOo/tests/basic/ifc/system/XSimpleMailClientSupplier/system_XSimpleMailClientSupplier.xba
    openoffice/trunk/main/qadevOOo/tests/basic/mod/cmdmail/SimpleCommandMail/cmdmail_SimpleCommandMail.xba
    openoffice/trunk/main/qadevOOo/tests/basic/mod/cmdmail/SimpleCommandMail/script.xlb
    openoffice/trunk/main/qadevOOo/tests/basic/mod/smplmail/SimpleSystemMail/script.xlb
    openoffice/trunk/main/qadevOOo/tests/basic/mod/smplmail/SimpleSystemMail/smplmail_SimpleSystemMail.xba
    openoffice/trunk/main/qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java
    openoffice/trunk/main/qadevOOo/tests/java/mod/_cmdmail/SimpleCommandMail.java
    openoffice/trunk/main/qadevOOo/tests/java/mod/_smplmail/SimpleSystemMail.java
    openoffice/trunk/main/shell/source/cmdmail/cmdmailsuppl.cxx
    openoffice/trunk/main/shell/source/cmdmail/cmdmailsuppl.hxx
    openoffice/trunk/main/shell/source/win32/simplemail/exports.dxp
    openoffice/trunk/main/shell/source/win32/simplemail/makefile.mk
    openoffice/trunk/main/shell/source/win32/simplemail/senddoc.cxx
    openoffice/trunk/main/shell/source/win32/simplemail/simplemapi.cxx
    openoffice/trunk/main/shell/source/win32/simplemail/simplemapi.hxx
    openoffice/trunk/main/shell/source/win32/simplemail/smplmail.component
    openoffice/trunk/main/shell/source/win32/simplemail/smplmail.xml
    openoffice/trunk/main/shell/source/win32/simplemail/smplmailclient.cxx
    openoffice/trunk/main/shell/source/win32/simplemail/smplmailclient.hxx
    openoffice/trunk/main/shell/source/win32/simplemail/smplmailentry.cxx
    openoffice/trunk/main/shell/source/win32/simplemail/smplmailmsg.cxx
    openoffice/trunk/main/shell/source/win32/simplemail/smplmailmsg.hxx
    openoffice/trunk/main/shell/source/win32/simplemail/smplmailsuppl.cxx
    openoffice/trunk/main/shell/source/win32/simplemail/smplmailsuppl.hxx
Modified:
    openoffice/trunk/main/framework/qa/complex/api_internal/api.lst
    openoffice/trunk/main/framework/qa/complex/api_internal/worksforme.sce
    openoffice/trunk/main/offapi/com/sun/star/system/makefile.mk
    openoffice/trunk/main/offapi/type_reference/types.rdb
    openoffice/trunk/main/postprocess/packcomponents/makefile.mk
    openoffice/trunk/main/postprocess/rebase/coffbase.txt
    openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp
    openoffice/trunk/main/sfx2/inc/pch/precompiled_sfx2.hxx
    openoffice/trunk/main/sfx2/source/dialog/mailmodel.cxx
    openoffice/trunk/main/shell/prj/build.lst
    openoffice/trunk/main/shell/prj/d.lst
    openoffice/trunk/main/shell/source/cmdmail/cmdmail.component
    openoffice/trunk/main/shell/source/cmdmail/cmdmail.xml
    openoffice/trunk/main/shell/source/cmdmail/cmdmailentry.cxx
    openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx
    openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx
    openoffice/trunk/main/shell/source/cmdmail/makefile.mk
    openoffice/trunk/main/shell/source/win32/workbench/TestSmplMail.cxx

Modified: openoffice/trunk/main/framework/qa/complex/api_internal/api.lst
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/framework/qa/complex/api_internal/api.lst?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/framework/qa/complex/api_internal/api.lst (original)
+++ openoffice/trunk/main/framework/qa/complex/api_internal/api.lst Fri Jan  4 19:57:08 2013
@@ -2,7 +2,6 @@ job1=cached.CachedContentResultSetFactor
 job2=cached.CachedContentResultSetStubFactory
 job3=cached.CachedDynamicResultSetFactory
 job4=cached.CachedDynamicResultSetStubFactory
-job5=cmdmail.SimpleCommandMail
 job6=corereflection.uno.CoreReflection
 job7=dbaccess.DBContentLoader
 job8=dbaccess.OCommandDefinition

Modified: openoffice/trunk/main/framework/qa/complex/api_internal/worksforme.sce
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/framework/qa/complex/api_internal/worksforme.sce?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/framework/qa/complex/api_internal/worksforme.sce (original)
+++ openoffice/trunk/main/framework/qa/complex/api_internal/worksforme.sce Fri Jan  4 19:57:08 2013
@@ -18,7 +18,6 @@
 #  under the License.
 #  
 # *************************************************************
-job=cmdmail.SimpleCommandMail
 job=fileacc.SimpleFileAccess
 job=sc.ScCellFieldObj
 job=sc.ScCellFieldsObj

Added: openoffice/trunk/main/offapi/com/sun/star/system/MailClientFlags.idl
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/system/MailClientFlags.idl?rev=1429067&view=auto
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/system/MailClientFlags.idl (added)
+++ openoffice/trunk/main/offapi/com/sun/star/system/MailClientFlags.idl Fri Jan  4 19:57:08 2013
@@ -0,0 +1,58 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __com_sun_star_system_MailClientFlags_idl__
+#define __com_sun_star_system_MailClientFlags_idl__
+
+module com { module sun { module star { module system {
+
+/**  These constants are used to specify how the <type>XMailClient</type>
+     should behave.
+ */
+constants MailClientFlags
+{
+    /** Uses the default settings when sending a mail, e.g.
+        launches the current configured system mail client.
+    */
+    const long DEFAULTS = 0;
+
+    /** Does not show the current configured system mail client GUI, but sends
+        the mail without any further user interaction.
+        <p>If this flag is specified, a recipient address must have been
+        specified for the given <type>XMailMessage</type>
+        object given to the method
+        <member scope="com::sun::star::system">XMailClient::sendMailMessage()</member>.</p>
+    */
+    const long NO_USER_INTERFACE = 1;
+
+    /** No logon dialog should be displayed to prompt the user for logon
+        information if necessary.
+        <p>When this flag is specified and the user needs to logon in order
+        to send a mail message via the method
+        <member scope="com::sun::star::system">XMailClient::sendMailMessage()</member>,
+        an <type scope="com::sun::star::uno">Exception</type> will be thrown.</p>
+    */
+    const long NO_LOGON_DIALOG = 2;
+};
+
+}; }; }; };
+
+#endif

Copied: openoffice/trunk/main/offapi/com/sun/star/system/SystemMailProvider.idl (from r1429066, openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl)
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/system/SystemMailProvider.idl?p2=openoffice/trunk/main/offapi/com/sun/star/system/SystemMailProvider.idl&p1=openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl&r1=1429066&r2=1429067&rev=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl (original)
+++ openoffice/trunk/main/offapi/com/sun/star/system/SystemMailProvider.idl Fri Jan  4 19:57:08 2013
@@ -19,22 +19,25 @@
  *
  *************************************************************/
 
+#ifndef __com_sun_star_system_SystemMailProvider_idl__
+#define __com_sun_star_system_SystemMailProvider_idl__
 
-
-#ifndef __com_sun_star_system_XSimpleMailMessage2_idl__
-#define __com_sun_star_system_XSimpleMailMessage2_idl__
-
-#include <com/sun/star/system/XSimpleMailMessage.idl>
+#include <com/sun/star/system/XSystemMailProvider.idl>
 
 module com { module sun { module star { module system {
 
-/** This interface extends <type>XSimpleMailMessage</type>.
+/** A service providing a simple way to send mails using a mail client
+    available on the system.
 
-    @since Apache OpenOffice 3.5
-*/ 
-interface XSimpleMailMessage2: XSimpleMailMessage
+    <p>For a more complex way of sending mails using a SMTP serivce, without the
+    need of a mail client on the system and with no user interaction, use the
+    <type scope="com::sun::star::mail">MailServiceProvider</type>.</p>
+*/
+service SystemMailProvider : XSystemMailProvider
 {
-    [attribute] string Body;
+    /** service constructor
+     */
+    create();
 };
 
 }; }; }; };

Added: openoffice/trunk/main/offapi/com/sun/star/system/XMailClient.idl
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/system/XMailClient.idl?rev=1429067&view=auto
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/system/XMailClient.idl (added)
+++ openoffice/trunk/main/offapi/com/sun/star/system/XMailClient.idl Fri Jan  4 19:57:08 2013
@@ -0,0 +1,80 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __com_sun_star_system_XMailClient_idl__
+#define __com_sun_star_system_XMailClient_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+#include <com/sun/star/system/XMailMessage.idl>
+#include <com/sun/star/system/MailClientFlags.idl>
+
+module com { module sun { module star { module system {
+
+/** Specifies an interface for creating and sending email messages
+    through a mail client.
+ */
+interface XMailClient
+{
+    /** Create a mail message object that implements the interface
+        <type>XMailMessage</type>.
+
+        @returns
+            An object that implements the <type>XMailMessage</type> interface.
+    */
+    XMailMessage createMailMessage();
+
+    /** Sends a given mail message object that implements the interface
+        <type>XMailMessage</type>.
+
+        @param xMailMessage
+            Specifies a configured mail object to be sent.
+
+        @param aFlag
+            Specifies different flags that control the send process.
+            <p>Possible flags are specified in <type>MailClientFlags</type>.</p>
+            <p>If the flag <const scope="com::sun::star::system">MailClientFlags::NO_USER_INTERFACE</const>
+            is specified, a recipient address must have been specified for the
+            given <type>XMailMessage</type>.</p>
+
+        @throws com::sun::star::lang::IllegalArgumentException
+            <ul>
+                <li>If invalid or excluding flags have been specified.</li>
+                <li>The flag <const scope="com::sun::star::system">MailClientFlags::NO_USER_INTERFACE</const>
+                is specified and no recipient address has been specified for the
+                given <type>XMailMessage</type> object.</li>
+                <li>The parameter <type>XMailMessage</type> is <NULL/>.</li>
+            </ul>
+
+        @throws com::sun::star::uno::Exception
+            if an error occurs while sending the mail.
+            <p>The <member scope="com::sun::star::uno">Execption::Message</member>
+            may contain an error description.</p>
+    */
+    void sendMailMessage( [in] XMailMessage xMailMessage,
+                          [in] long aFlag )
+        raises( ::com::sun::star::lang::IllegalArgumentException,
+                ::com::sun::star::uno::Exception );
+};
+
+}; }; }; };
+
+#endif

Added: openoffice/trunk/main/offapi/com/sun/star/system/XMailMessage.idl
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/system/XMailMessage.idl?rev=1429067&view=auto
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/system/XMailMessage.idl (added)
+++ openoffice/trunk/main/offapi/com/sun/star/system/XMailMessage.idl Fri Jan  4 19:57:08 2013
@@ -0,0 +1,75 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __com_sun_star_system_XMailMessage_idl__
+#define __com_sun_star_system_XMailMessage_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+
+module com { module sun { module star { module system {
+
+/** This interface lets a client set or get the information of a mail message.
+*/
+interface XMailMessage
+{
+    /** The recipient of the mail message.
+    */
+    [attribute] string Recipient;
+
+    /** The email address of the originator of the mail.
+    */
+    [attribute] string Originator;
+
+    /** The subject of the mail message.
+    */
+    [attribute] string Subject;
+
+    /** The body of the mail message.
+     */
+    [attribute] string Body;
+
+    /** A sequence with the email addresses of one or more bcc recipients.
+    */
+    [attribute] sequence< string > BccRecipient;
+
+    /** A sequence with the email addresses of one or more cc recipients.
+    */
+    [attribute] sequence< string > CcRecipient;
+
+    /** A sequence of file URLs specifying the files that should be attached to
+        the mail.
+        <p>The file URLs must be conform to
+        <a href="http://www.w3.org/Addressing/rfc1738.txt" target="_blank">Rfc1738</a>.</p>
+
+        @throws ::com::sun::star::lang::IllegalArgumentException
+        if at least one of the given file URLs is invalid (doesn't conform to
+        <a href="http://www.w3.org/Addressing/rfc1738.txt" target="_blank">Rfc1738</a>).
+    */
+    [attribute] sequence< string > Attachement
+    {
+        set raises (::com::sun::star::lang::IllegalArgumentException);
+    };
+};
+
+}; }; }; };
+
+#endif

Copied: openoffice/trunk/main/offapi/com/sun/star/system/XSystemMailProvider.idl (from r1429066, openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl)
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/system/XSystemMailProvider.idl?p2=openoffice/trunk/main/offapi/com/sun/star/system/XSystemMailProvider.idl&p1=openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl&r1=1429066&r2=1429067&rev=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl (original)
+++ openoffice/trunk/main/offapi/com/sun/star/system/XSystemMailProvider.idl Fri Jan  4 19:57:08 2013
@@ -19,22 +19,26 @@
  *
  *************************************************************/
 
+#ifndef __com_sun_star_system_XSystemMailProvider_idl__
+#define __com_sun_star_system_XSystemMailProvider_idl__
 
-
-#ifndef __com_sun_star_system_XSimpleMailMessage2_idl__
-#define __com_sun_star_system_XSimpleMailMessage2_idl__
-
-#include <com/sun/star/system/XSimpleMailMessage.idl>
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/system/XMailClient.idl>
 
 module com { module sun { module star { module system {
 
-/** This interface extends <type>XSimpleMailMessage</type>.
-
-    @since Apache OpenOffice 3.5
-*/ 
-interface XSimpleMailMessage2: XSimpleMailMessage
+/** Provides access to a mail client, if there is one available on the system.
+*/
+interface XSystemMailProvider
 {
-    [attribute] string Body;
+    /** Allows a client to query for an object that implements
+        <type>XMailClient</type>.
+
+        @returns
+            An interface to a mail client if there is one available
+            on the system, or an empty reference otherwise.
+    */
+    XMailClient queryMailClient( );
 };
 
 }; }; }; };

Modified: openoffice/trunk/main/offapi/com/sun/star/system/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/system/makefile.mk?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/system/makefile.mk (original)
+++ openoffice/trunk/main/offapi/com/sun/star/system/makefile.mk Fri Jan  4 19:57:08 2013
@@ -34,17 +34,15 @@ PACKAGE=com$/sun$/star$/system
 # ------------------------------------------------------------------------
 
 IDLFILES=\
+	MailClientFlags.idl\
+	SystemMailProvider.idl\
 	SystemShellExecute.idl\
 	SystemShellExecuteException.idl\
 	SystemShellExecuteFlags.idl\
+	XMailClient.idl\
+	XMailMessage.idl\
+	XSystemMailProvider.idl\
 	XSystemShellExecute.idl\
-	SimpleMailClientFlags.idl\
-	XSimpleMailMessage.idl\
-	XSimpleMailMessage2.idl\
-	XSimpleMailClient.idl\
-	XSimpleMailClientSupplier.idl\
-	SimpleCommandMail.idl \
-	SimpleSystemMail.idl\
 
 # ------------------------------------------------------------------
 

Modified: openoffice/trunk/main/offapi/type_reference/types.rdb
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/type_reference/types.rdb?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/trunk/main/postprocess/packcomponents/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/postprocess/packcomponents/makefile.mk?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/postprocess/packcomponents/makefile.mk (original)
+++ openoffice/trunk/main/postprocess/packcomponents/makefile.mk Fri Jan  4 19:57:08 2013
@@ -311,7 +311,7 @@ my_components += \
     fps \
     ftransl \
     java_uno_accessbridge \
-    smplmail \
+    sysmail \
     sysdtrans \
     wininetbe1
 .END

Modified: openoffice/trunk/main/postprocess/rebase/coffbase.txt
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/postprocess/rebase/coffbase.txt?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/postprocess/rebase/coffbase.txt (original)
+++ openoffice/trunk/main/postprocess/rebase/coffbase.txt Fri Jan  4 19:57:08 2013
@@ -253,7 +253,7 @@ slideshow.uno.dll 0x000000005ec60000 0x0
 slideshowtestmi.dll 0x000000005e8b0000 0x003a0000
 smdmi.dll        0x000000005e890000 0x00010000
 smmi.dll         0x000000005e7f0000 0x00090000
-smplmail.uno.dll 0x000000005e7d0000 0x00010000
+sysmail.uno.dll 0x000000005e7d0000 0x00010000
 sn_tools.dll     0x000000005e7a0000 0x00020000
 so_activex.dll   0x000000005e770000 0x00020000
 socomp.dll       0x000000005e750000 0x00010000

Modified: openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp (original)
+++ openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp Fri Jan  4 19:57:08 2013
@@ -1375,7 +1375,7 @@ File gid_File_Lib_Smplmail
     TXT_FILE_BODY;
     Styles = (PACKED);
     Dir = SCP2_OOO_BIN_DIR;
-    Name = "smplmail.uno.dll";
+    Name = "sysmail.uno.dll";
 End
 
 #endif

Modified: openoffice/trunk/main/sfx2/inc/pch/precompiled_sfx2.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/inc/pch/precompiled_sfx2.hxx?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/inc/pch/precompiled_sfx2.hxx (original)
+++ openoffice/trunk/main/sfx2/inc/pch/precompiled_sfx2.hxx Fri Jan  4 19:57:08 2013
@@ -280,10 +280,8 @@
 #include "com/sun/star/security/XDocumentDigitalSignatures.hpp"
 #include "com/sun/star/style/XStyle.hpp"
 #include "com/sun/star/style/XStyleFamiliesSupplier.hpp"
-#include "com/sun/star/system/SimpleMailClientFlags.hpp"
 #include "com/sun/star/system/SystemShellExecuteException.hpp"
 #include "com/sun/star/system/SystemShellExecuteFlags.hpp"
-#include "com/sun/star/system/XSimpleMailClientSupplier.hpp"
 #include "com/sun/star/system/XSystemShellExecute.hpp"
 #include "com/sun/star/task/ErrorCodeIOException.hpp"
 #include "com/sun/star/task/ErrorCodeRequest.hpp"

Modified: openoffice/trunk/main/sfx2/source/dialog/mailmodel.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/dialog/mailmodel.cxx?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/dialog/mailmodel.cxx (original)
+++ openoffice/trunk/main/sfx2/source/dialog/mailmodel.cxx Fri Jan  4 19:57:08 2013
@@ -32,8 +32,8 @@
 #include <com/sun/star/ucb/CommandAbortedException.hpp>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/util/XURLTransformer.hpp>
-#include <com/sun/star/system/XSimpleMailClientSupplier.hpp>
-#include <com/sun/star/system/SimpleMailClientFlags.hpp>
+#include <com/sun/star/system/SystemMailProvider.hpp>
+#include <com/sun/star/system/MailClientFlags.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
 #include <com/sun/star/embed/ElementModes.hpp>
 #include <com/sun/star/embed/XTransactedObject.hpp>
@@ -87,10 +87,17 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::ucb;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::system;
-using namespace ::rtl;
 
+using ::com::sun::star::system::SystemMailProvider;
+using ::com::sun::star::system::XMailClient;
+using ::com::sun::star::system::XMailMessage;
+using ::com::sun::star::system::XSystemMailProvider;
+using rtl::OUString;
+
+namespace MailClientFlags = ::com::sun::star::system::MailClientFlags;
 namespace css = ::com::sun::star;
+
+
 // - class PrepareListener_Impl ------------------------------------------
 class PrepareListener_Impl : public ::cppu::WeakImplHelper1< css::frame::XStatusListener >
 {
@@ -822,44 +829,32 @@ SfxMailModel::SendMailResult SfxMailMode
 	SendMailResult	eResult = SEND_MAIL_ERROR;
     if ( !maAttachedDocuments.empty() )
 	{
-	    css::uno::Reference < XMultiServiceFactory > xMgr = ::comphelper::getProcessServiceFactory();
-	    if ( xMgr.is() )
+	    css::uno::Reference < XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+	    if ( xContext.is() )
 	    {
-		    css::uno::Reference< XSimpleMailClientSupplier >	xSimpleMailClientSupplier;
-
-            // Prefer the SimpleSystemMail service if available
-            xSimpleMailClientSupplier = css::uno::Reference< XSimpleMailClientSupplier >(
-                xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SimpleSystemMail" ))),
-                UNO_QUERY );
-
-            if ( ! xSimpleMailClientSupplier.is() )
-            {
-                xSimpleMailClientSupplier = css::uno::Reference< XSimpleMailClientSupplier >(
-                    xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SimpleCommandMail" ))),
-                    UNO_QUERY );
-            }
+		    css::uno::Reference< XSystemMailProvider > xSystemMailProvider( SystemMailProvider::create( xContext ) );
 
-		    if ( xSimpleMailClientSupplier.is() )
+		    if ( xSystemMailProvider.is() )
 		    {
-			    css::uno::Reference< XSimpleMailClient > xSimpleMailClient = xSimpleMailClientSupplier->querySimpleMailClient();
+			    css::uno::Reference< XMailClient > xMailClient = xSystemMailProvider->queryMailClient();
 
-			    if ( !xSimpleMailClient.is() )
+			    if ( !xMailClient.is() )
 			    {
 				    // no mail client support => message box!
 				    return SEND_MAIL_ERROR;
 			    }
 
 			    // we have a simple mail client
-			    css::uno::Reference< XSimpleMailMessage > xSimpleMailMessage = xSimpleMailClient->createSimpleMailMessage();
-			    if ( xSimpleMailMessage.is() )
+			    css::uno::Reference< XMailMessage > xMailMessage = xMailClient->createMailMessage();
+			    if ( xMailMessage.is() )
 			    {
-				    sal_Int32 nSendFlags = SimpleMailClientFlags::DEFAULTS;
+				    sal_Int32 nSendFlags = MailClientFlags::DEFAULTS;
 				    if ( maFromAddress.Len() == 0 )
 				    {
 					    // from address not set, try figure out users e-mail address
 					    CreateFromAddress_Impl( maFromAddress );
 				    }
-				    xSimpleMailMessage->setOriginator( maFromAddress );
+				    xMailMessage->setOriginator( maFromAddress );
 
 				    sal_Int32 nToCount		= mpToList ? mpToList->Count() : 0;
 				    sal_Int32 nCcCount		= mpCcList ? mpCcList->Count() : 0;
@@ -869,13 +864,13 @@ SfxMailModel::SendMailResult SfxMailMode
 				    if ( nToCount > 1 )
 				    {
 					    nCcSeqCount = nToCount - 1 + nCcCount;
-					    xSimpleMailMessage->setRecipient( *mpToList->GetObject( 0 ));
-					    nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE;
+					    xMailMessage->setRecipient( *mpToList->GetObject( 0 ));
+					    nSendFlags = MailClientFlags::NO_USER_INTERFACE;
 				    }
 				    else if ( nToCount == 1 )
 				    {
-					    xSimpleMailMessage->setRecipient( *mpToList->GetObject( 0 ));
-					    nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE;
+					    xMailMessage->setRecipient( *mpToList->GetObject( 0 ));
+					    nSendFlags = MailClientFlags::NO_USER_INTERFACE;
 				    }
 
 				    // all other recipient must be handled with CC recipients!
@@ -897,7 +892,7 @@ SfxMailModel::SendMailResult SfxMailMode
 					    {
 						    aCcRecipientSeq[nIndex++] = *mpCcList->GetObject(i);
 					    }
-					    xSimpleMailMessage->setCcRecipient( aCcRecipientSeq );
+					    xMailMessage->setCcRecipient( aCcRecipientSeq );
 				    }
 
 				    sal_Int32 nBccCount = mpBccList ? mpBccList->Count() : 0;
@@ -908,18 +903,18 @@ SfxMailModel::SendMailResult SfxMailMode
 					    {
 						    aBccRecipientSeq[i] = *mpBccList->GetObject(i);
 					    }
-					    xSimpleMailMessage->setBccRecipient( aBccRecipientSeq );
+					    xMailMessage->setBccRecipient( aBccRecipientSeq );
 				    }
 
 					Sequence< OUString > aAttachmentSeq(&(maAttachedDocuments[0]),maAttachedDocuments.size());
 
-				    xSimpleMailMessage->setSubject( maSubject );
-				    xSimpleMailMessage->setAttachement( aAttachmentSeq );
+				    xMailMessage->setSubject( maSubject );
+				    xMailMessage->setAttachement( aAttachmentSeq );
 
 	                sal_Bool bSend( sal_False );
                     try
 	                {
-		                xSimpleMailClient->sendSimpleMailMessage( xSimpleMailMessage, nSendFlags );
+		                xMailClient->sendMailMessage( xMailMessage, nSendFlags );
 		                bSend = sal_True;
 	                }
 	                catch ( IllegalArgumentException& )

Modified: openoffice/trunk/main/shell/prj/build.lst
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/prj/build.lst?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/prj/build.lst (original)
+++ openoffice/trunk/main/shell/prj/build.lst Fri Jan  4 19:57:08 2013
@@ -1,7 +1,7 @@
 sl    shell	:    L10N:l10n offuh rdbmaker tools sal EXPAT:expat LIBXSLT:libxslt NULL
 sl    shell\inc			                           nmake   -   all sl_inc NULL
 sl    shell\source\win32                           nmake   -   w   sl_win32 sl_inc NULL
-sl    shell\source\win32\simplemail                nmake   -   w   sl_win32_simplemail sl_inc NULL
+sl    shell\source\win32\sysmail                   nmake   -   w   sl_win32_sysmail sl_inc NULL
 sl    shell\source\unix\exec                       nmake   -   u   sl_unix sl_inc NULL
 sl    shell\source\unix\exec                       nmake   -   p   sl_unix sl_inc NULL
 sl    shell\source\unix\misc                       nmake   -   u   sl_unix_misc sl_inc NULL

Modified: openoffice/trunk/main/shell/prj/d.lst
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/prj/d.lst?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/prj/d.lst (original)
+++ openoffice/trunk/main/shell/prj/d.lst Fri Jan  4 19:57:08 2013
@@ -29,6 +29,6 @@
 ..\inc\kde_headers.h %_DEST%\inc%_EXT%\shell\kde_headers.h
 ..\%__SRC%\misc\localebe1.component %_DEST%\xml%_EXT%\localebe1.component
 ..\%__SRC%\misc\macbe1.component %_DEST%\xml%_EXT%\macbe1.component
-..\%__SRC%\misc\smplmail.component %_DEST%\xml%_EXT%\smplmail.component
+..\%__SRC%\misc\sysmail.component %_DEST%\xml%_EXT%\sysmail.component
 ..\%__SRC%\misc\syssh.component %_DEST%\xml%_EXT%\syssh.component
 ..\%__SRC%\misc\wininetbe1.component %_DEST%\xml%_EXT%\wininetbe1.component

Modified: openoffice/trunk/main/shell/source/cmdmail/cmdmail.component
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/cmdmail/cmdmail.component?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/source/cmdmail/cmdmail.component (original)
+++ openoffice/trunk/main/shell/source/cmdmail/cmdmail.component Fri Jan  4 19:57:08 2013
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--***********************************************************
- * 
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -8,23 +8,21 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  ***********************************************************-->
 
-
-
 <component loader="com.sun.star.loader.SharedLibrary"
     xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.system.SimpleCommandMail">
-    <service name="com.sun.star.system.SimpleCommandMail"/>
+  <implementation name="com.sun.star.comp.system.unx.SystemMailProvider">
+    <service name="com.sun.star.system.SystemMailProvider"/>
   </implementation>
 </component>

Modified: openoffice/trunk/main/shell/source/cmdmail/cmdmail.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/cmdmail/cmdmail.xml?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/source/cmdmail/cmdmail.xml (original)
+++ openoffice/trunk/main/shell/source/cmdmail/cmdmail.xml Fri Jan  4 19:57:08 2013
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
 <!--***********************************************************
- * 
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -9,61 +9,59 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  ***********************************************************-->
 
 
 <module-description xmlns:xlink="http://www.w3.org/1999/xlink">
-    <module-name>	cmdmail	</module-name>
+    <module-name>cmdmail</module-name>
     <component-description>
-        <author> Oliver Braun </author>
-        <name>com.sun.star.comp.system.SimpleCommandMail</name>
-        <description>
-        	A generic implementation of a SimpleCommandMail service.
-        </description>
+        <author>Oliver Braun</author>
+        <name>com.sun.star.comp.system.unx.SystemMailProvider</name>
+        <description>A generic implementation of a SystemMailProvider service.</description>
         <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
-        <language>	c++	</language>
-        <status value="beta"/>        
-		<supported-service>	com.sun.star.system.SimpleCommandMail </supported-service>		
+        <language>c++</language>
+        <status value="beta"/>
+        <supported-service>com.sun.star.system.SystemMailProvider</supported-service>
         <service-dependency>...</service-dependency>
-		<type>	com.sun.star.system.XSimpleMailClient	</type>
-		<type>	com.sun.star.system.XSimpleMailClientSupplier	</type>
-		<type>	com.sun.star.system.XSimpleMailMessage		</type>        
-		<type>	com.sun.star.system.SimpleMailClientFlags	</type>        
-        <type>	com.sun.star.lang.XEventListener    		</type>
-        <type>	com.sun.star.lang.XMultiServiceFactory		</type>
-        <type>	com.sun.star.lang.XSingleServiceFactory		</type>
-        <type>	com.sun.star.lang.XSingleComponentFactory	</type>
-        <type>	com.sun.star.lang.XServiceInfo				</type>
-        <type>	com.sun.star.lang.XTypeProvider				</type>
-        <type>	com.sun.star.lang.IllegalArgumentException	</type>
-		<type>	com.sun.star.lang.XComponent				</type>
-        <type>  com.sun.star.uno.RuntimeException           </type>
-        <type>	com.sun.star.uno.TypeClass					</type>
-        <type>	com.sun.star.uno.XWeak						</type>
-        <type>	com.sun.star.uno.XAggregation				</type>
-        <type>	com.sun.star.uno.XComponentContext			</type>		
-        <type>	com.sun.star.registry.XRegistryKey			</type>
-        <type>	com.sun.star.container.XNameAccess			</type>
-        <type>	com.sun.star.container.XSet					</type>
-        <type>	com.sun.star.beans.PropertyValue			</type>
-        <type>  com.sun.star.beans.XPropertySet             </type>
-        <type>  com.sun.star.uri.ExternalUriReferenceTranslator </type>
-        <type>  com.sun.star.uri.XExternalUriReferenceTranslator </type>
+        <type>com.sun.star.system.XMailClient</type>
+        <type>com.sun.star.system.SystemMailProvider</type>
+        <type>com.sun.star.system.XMailMessage</type>
+        <type>com.sun.star.system.MailClientFlags</type>
+        <type>com.sun.star.lang.XEventListener</type>
+        <type>com.sun.star.lang.XMultiServiceFactory</type>
+        <type>com.sun.star.lang.XSingleServiceFactory</type>
+        <type>com.sun.star.lang.XSingleComponentFactory</type>
+        <type>com.sun.star.lang.XServiceInfo</type>
+        <type>com.sun.star.lang.XTypeProvider</type>
+        <type>com.sun.star.lang.IllegalArgumentException</type>
+        <type>com.sun.star.lang.XComponent</type>
+        <type>com.sun.star.uno.RuntimeException</type>
+        <type>com.sun.star.uno.TypeClass</type>
+        <type>com.sun.star.uno.XWeak</type>
+        <type>com.sun.star.uno.XAggregation</type>
+        <type>com.sun.star.uno.XComponentContext</type>
+        <type>com.sun.star.registry.XRegistryKey</type>
+        <type>com.sun.star.container.XNameAccess</type>
+        <type>com.sun.star.container.XSet</type>
+        <type>com.sun.star.beans.PropertyValue</type>
+        <type>com.sun.star.beans.XPropertySet</type>
+        <type>com.sun.star.uri.ExternalUriReferenceTranslator</type>
+        <type>com.sun.star.uri.XExternalUriReferenceTranslator</type>
     </component-description>
-    <project-build-dependency>	cppuhelper       </project-build-dependency>
-    <project-build-dependency>	cppu             </project-build-dependency>
-    <project-build-dependency>	sal              </project-build-dependency>
-    <runtime-module-dependency>	cppuhelper$(COM) </runtime-module-dependency>
-    <runtime-module-dependency>	cppu3            </runtime-module-dependency>
-    <runtime-module-dependency>	sal3             </runtime-module-dependency>
+    <project-build-dependency>cppuhelper</project-build-dependency>
+    <project-build-dependency>cppu</project-build-dependency>
+    <project-build-dependency>sal</project-build-dependency>
+    <runtime-module-dependency>cppuhelper$(COM)</runtime-module-dependency>
+    <runtime-module-dependency>cppu3</runtime-module-dependency>
+    <runtime-module-dependency>sal3</runtime-module-dependency>
 </module-description>

Modified: openoffice/trunk/main/shell/source/cmdmail/cmdmailentry.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/cmdmail/cmdmailentry.cxx?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/source/cmdmail/cmdmailentry.cxx (original)
+++ openoffice/trunk/main/shell/source/cmdmail/cmdmailentry.cxx Fri Jan  4 19:57:08 2013
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -7,101 +7,56 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_shell.hxx"
 
-//-----------------------------------------------------------------------
-//	includes of other projects
-//-----------------------------------------------------------------------
-#include <cppuhelper/factory.hxx>
-#include <com/sun/star/container/XSet.hpp>
-#include <osl/diagnose.h>
-#include "cmdmailsuppl.hxx"
-
-//-----------------------------------------------------------------------
-// namespace directives
-//-----------------------------------------------------------------------
-
-using namespace ::rtl						;
-using namespace ::com::sun::star::uno		;
-using namespace ::com::sun::star::container	;
-using namespace ::com::sun::star::lang		;
-using namespace ::com::sun::star::registry	;
-using namespace ::cppu					    ;
-using com::sun::star::system::XSimpleMailClientSupplier;
-
-//-----------------------------------------------------------------------
-// defines
-//-----------------------------------------------------------------------
-
-#define COMP_SERVICE_NAME  "com.sun.star.system.SimpleCommandMail"
-#define COMP_IMPL_NAME     "com.sun.star.comp.system.SimpleCommandMail"
-
-//-----------------------------------------------------------------------
-// 
-//-----------------------------------------------------------------------
-
-namespace
-{
-	Reference< XInterface > SAL_CALL createInstance( const Reference< XComponentContext >& xContext )
-	{		
-		return Reference< XInterface >( static_cast< XSimpleMailClientSupplier* >( new CmdMailSuppl( xContext ) ) );
-	}
-}
-
-//-----------------------------------------------------------------------
-// the 3 important functions which will be exported 
-//-----------------------------------------------------------------------
-
-extern "C" 
-{
+#include "syscmdmail.hxx"
 
-//----------------------------------------------------------------------
-// component_getImplementationEnvironment
-//----------------------------------------------------------------------
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/implementationentry.hxx>
 
-void SAL_CALL component_getImplementationEnvironment(
-	const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
+namespace shell
 {
-	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+    static ::cppu::ImplementationEntry const unxsysmail_impl_entries[] =
+    {
+        {
+            SystemCommandMail::Create,
+            SystemCommandMail::getImplementationName_static,
+            SystemCommandMail::getSupportedServiceNames_static,
+            ::cppu::createSingleComponentFactory,
+            0,
+            0
+        },
+        { 0, 0, 0, 0, 0, 0 }
+    };
 }
 
-//----------------------------------------------------------------------
-// component_getFactory 
-//----------------------------------------------------------------------
-
-void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* /*pSrvManager*/, uno_Interface* /*pRegistryKey*/ )
+extern "C"
 {
-    Reference< XSingleComponentFactory > xFactory;
-
-    if (0 == ::rtl_str_compare( pImplName, COMP_IMPL_NAME ))
+    SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+        const sal_Char **ppEnvTypeName, uno_Environment ** )
     {
-        OUString serviceName( RTL_CONSTASCII_USTRINGPARAM(COMP_SERVICE_NAME) );
-
-        xFactory = ::cppu::createSingleComponentFactory(
-            createInstance,
-            OUString( RTL_CONSTASCII_USTRINGPARAM(COMP_IMPL_NAME) ),
-            Sequence< OUString >( &serviceName, 1 ) );
+        *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
     }
-    
-    if (xFactory.is())
-        xFactory->acquire();
 
-    return xFactory.get();
+    SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
+        const sal_Char *pImplName, void *pServiceManager, void *pRegistryKey )
+    {
+        return ::cppu::component_getFactoryHelper( pImplName,
+                pServiceManager,
+                pRegistryKey ,
+                shell::unxsysmail_impl_entries );
+    }
 }
-
-} // extern "C"

Modified: openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx (original)
+++ openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx Fri Jan  4 19:57:08 2013
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -7,35 +7,36 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_shell.hxx"
 
 #include "cmdmailmsg.hxx"
 
 using com::sun::star::lang::IllegalArgumentException;
-using com::sun::star::lang::WrappedTargetException;
-using com::sun::star::container::NoSuchElementException;
-using com::sun::star::container::XNameAccess;
 using rtl::OUString;
 using osl::MutexGuard;
 
 using namespace cppu;
 using namespace com::sun::star::uno;
 
+namespace shell
+{
+
+CmdMailMsg::CmdMailMsg()
+{
+}
 
 void SAL_CALL CmdMailMsg::setBody( const OUString& aBody )
     throw (RuntimeException)
@@ -65,56 +66,56 @@ OUString SAL_CALL CmdMailMsg::getRecipie
     return m_aRecipient;
 }
 
-void SAL_CALL CmdMailMsg::setCcRecipient( const Sequence< OUString >& aCcRecipient ) 
+void SAL_CALL CmdMailMsg::setCcRecipient( const Sequence< OUString >& aCcRecipient )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
     m_CcRecipients = aCcRecipient;
 }
 
-Sequence< OUString > SAL_CALL CmdMailMsg::getCcRecipient(  ) 
+Sequence< OUString > SAL_CALL CmdMailMsg::getCcRecipient(  )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
     return m_CcRecipients;
 }
 
-void SAL_CALL CmdMailMsg::setBccRecipient( const Sequence< OUString >& aBccRecipient ) 
+void SAL_CALL CmdMailMsg::setBccRecipient( const Sequence< OUString >& aBccRecipient )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
     m_BccRecipients = aBccRecipient;
 }
 
-Sequence< OUString > SAL_CALL CmdMailMsg::getBccRecipient(  ) 
+Sequence< OUString > SAL_CALL CmdMailMsg::getBccRecipient(  )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
     return m_BccRecipients;
 }
 
-void SAL_CALL CmdMailMsg::setOriginator( const OUString& aOriginator ) 
+void SAL_CALL CmdMailMsg::setOriginator( const OUString& aOriginator )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
     m_aOriginator = aOriginator;
 }
 
-OUString SAL_CALL CmdMailMsg::getOriginator(  ) 
+OUString SAL_CALL CmdMailMsg::getOriginator(  )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
     return m_aOriginator;
 }
 
-void SAL_CALL CmdMailMsg::setSubject( const OUString& aSubject ) 
+void SAL_CALL CmdMailMsg::setSubject( const OUString& aSubject )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
     m_aSubject = aSubject;
 }
 
-OUString SAL_CALL CmdMailMsg::getSubject(  ) 
+OUString SAL_CALL CmdMailMsg::getSubject(  )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
@@ -128,114 +129,11 @@ void SAL_CALL CmdMailMsg::setAttachement
     m_Attachments = aAttachment;
 }
 
-Sequence< OUString > SAL_CALL CmdMailMsg::getAttachement(  ) 
+Sequence< OUString > SAL_CALL CmdMailMsg::getAttachement(  )
     throw (RuntimeException)
 {
     MutexGuard aGuard( m_aMutex );
     return m_Attachments;
 }
 
-Any SAL_CALL CmdMailMsg::getByName( const OUString& aName ) 
-    throw (NoSuchElementException, WrappedTargetException, RuntimeException)
-{
-    MutexGuard aGuard( m_aMutex );
-
-    if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "body" )) &&  m_aBody.getLength() )
-        return makeAny( m_aBody );
-
-    if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "from" )) &&  m_aOriginator.getLength() )
-        return makeAny( m_aOriginator );
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "to" )) &&  m_aRecipient.getLength() )
-        return makeAny( m_aRecipient );
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "cc" )) &&  m_CcRecipients.getLength() )
-        return makeAny( m_CcRecipients );
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "bcc" )) &&  m_BccRecipients.getLength() )
-        return makeAny( m_BccRecipients );
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "subject" )) &&  m_aSubject.getLength() )
-        return makeAny( m_aSubject );
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "attachment" )) &&  m_Attachments.getLength() )
-        return makeAny( m_Attachments );
-
-   throw NoSuchElementException( OUString(RTL_CONSTASCII_USTRINGPARAM( "key not found: ")) + aName,
-        static_cast < XNameAccess * > (this) );
-}
-
-Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames(  ) 
-    throw (::com::sun::star::uno::RuntimeException)
-{
-    MutexGuard aGuard( m_aMutex );
-
-    sal_Int32 nItems = 0;
-    Sequence< OUString > aRet( 7 );
-
-    if( m_aBody.getLength() )
-        aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "body" ));
-
-    if( m_aOriginator.getLength() )
-        aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "from" ));
-
-    if( m_aRecipient.getLength() )
-        aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "to" ));
-
-    if( m_CcRecipients.getLength() )
-        aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "cc" ));
-
-    if( m_BccRecipients.getLength() )
-        aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "bcc" ));
-
-    if( m_aSubject.getLength() )
-        aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "subject" ));
-
-    if( m_Attachments.getLength() )
-        aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "attachment" ));
-
-    aRet.realloc( nItems );
-    return aRet;
-}
-
- sal_Bool SAL_CALL CmdMailMsg::hasByName( const OUString& aName )
-    throw (RuntimeException)
-{
-    MutexGuard aGuard( m_aMutex );
-
-    if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "body" )) &&  m_aBody.getLength() )
-        return sal_True;
-
-    if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "from" )) &&  m_aOriginator.getLength() )
-        return sal_True;
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "to" )) &&  m_aRecipient.getLength() )
-        return sal_True;
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "cc" )) &&  m_CcRecipients.getLength() )
-        return sal_True;
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "bcc" )) &&  m_BccRecipients.getLength() )
-        return sal_True;
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "subject" )) &&  m_aSubject.getLength() )
-        return sal_True;
-
-    else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "attachment" )) &&  m_Attachments.getLength() )
-        return sal_True;
-
-    return sal_False;
-}
-
-Type SAL_CALL CmdMailMsg::getElementType(  ) 
-    throw (RuntimeException)
-{
-    // returning void for multi type container
-    return Type();
-}
-
-sal_Bool SAL_CALL CmdMailMsg::hasElements(  ) 
-    throw (RuntimeException)
-{
-    return 0 != getElementNames().getLength();
 }

Modified: openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx (original)
+++ openoffice/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx Fri Jan  4 19:57:08 2013
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -7,125 +7,89 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
-
-
 #ifndef _CMDMAILMSG_HXX_
 #define _CMDMAILMSG_HXX_
 
-#include <cppuhelper/implbase2.hxx>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
 
-#ifndef _COM_SUN_STAR_SYS_SHELL_XSYSTEMSHELLEXECUTE_HPP_
-#include <com/sun/star/system/XSimpleMailMessage2.hpp>
-#endif
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/system/XMailMessage.hpp>
 
-//----------------------------------------------------------
-// class declaration		
-//----------------------------------------------------------
-
-class CmdMailMsg : 
-	public  cppu::WeakImplHelper2< 
-        ::com::sun::star::system::XSimpleMailMessage2,
-        ::com::sun::star::container::XNameAccess >
+namespace shell
 {
-    ::rtl::OUString                                   m_aBody;
-    ::rtl::OUString                                   m_aRecipient;
-    ::rtl::OUString                                   m_aOriginator;
-    ::rtl::OUString                                   m_aSubject;
-    ::com::sun::star::uno::Sequence< rtl::OUString >  m_CcRecipients;
-    ::com::sun::star::uno::Sequence< rtl::OUString >  m_BccRecipients;    
-    ::com::sun::star::uno::Sequence< rtl::OUString >  m_Attachments;    
-
-    ::osl::Mutex m_aMutex;
-
-public:
-
-    CmdMailMsg() {};
-
-    //------------------------------------------------
-    // XSimpleMailMessage
-    //------------------------------------------------ 
+    typedef cppu::WeakImplHelper1<
+            com::sun::star::system::XMailMessage > CmdMailMsg_Base;
 
-    virtual void SAL_CALL setBody( const ::rtl::OUString& aBody )
-        throw (::com::sun::star::uno::RuntimeException);
+    class CmdMailMsg : protected cppu::BaseMutex,
+                       public  CmdMailMsg_Base
+    {
+    private:
+        ::rtl::OUString                                   m_aBody;
+        ::rtl::OUString                                   m_aRecipient;
+        ::rtl::OUString                                   m_aOriginator;
+        ::rtl::OUString                                   m_aSubject;
+        ::com::sun::star::uno::Sequence< rtl::OUString >  m_CcRecipients;
+        ::com::sun::star::uno::Sequence< rtl::OUString >  m_BccRecipients;
+        ::com::sun::star::uno::Sequence< rtl::OUString >  m_Attachments;
 
-    virtual ::rtl::OUString SAL_CALL getBody(  )
-        throw (::com::sun::star::uno::RuntimeException);
+    public:
+        CmdMailMsg();
 
-    virtual void SAL_CALL setRecipient( const ::rtl::OUString& aRecipient ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual void SAL_CALL setBody( const ::rtl::OUString& aBody )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual ::rtl::OUString SAL_CALL getRecipient(  ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual ::rtl::OUString SAL_CALL getBody(  )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual void SAL_CALL setCcRecipient( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCcRecipient ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual void SAL_CALL setRecipient( const ::rtl::OUString& aRecipient )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCcRecipient(  ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual ::rtl::OUString SAL_CALL getRecipient(  )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual void SAL_CALL setBccRecipient( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aBccRecipient ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual void SAL_CALL setCcRecipient( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCcRecipient )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getBccRecipient(  ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCcRecipient(  )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual void SAL_CALL setOriginator( const ::rtl::OUString& aOriginator ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual void SAL_CALL setBccRecipient( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aBccRecipient )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual ::rtl::OUString SAL_CALL getOriginator(  ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getBccRecipient(  )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual void SAL_CALL setSubject( const ::rtl::OUString& aSubject ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual void SAL_CALL setOriginator( const ::rtl::OUString& aOriginator )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual ::rtl::OUString SAL_CALL getSubject(  ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual ::rtl::OUString SAL_CALL getOriginator(  )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual void SAL_CALL setAttachement( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aAttachement ) 
-        throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+        virtual void SAL_CALL setSubject( const ::rtl::OUString& aSubject )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAttachement(  ) 
-        throw (::com::sun::star::uno::RuntimeException);
+        virtual ::rtl::OUString SAL_CALL getSubject(  )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    //------------------------------------------------
-    // XNameAccess
-    //------------------------------------------------
+        virtual void SAL_CALL setAttachement( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aAttachement )
+            throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
 
-    virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) 
-        throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+        virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAttachement(  )
+            throw (::com::sun::star::uno::RuntimeException);
 
-    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(  ) 
-        throw (::com::sun::star::uno::RuntimeException) ;
+    };
+}
 
-    virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) 
-        throw (::com::sun::star::uno::RuntimeException);
-
-    //------------------------------------------------
-    // XElementAccess
-    //------------------------------------------------
-
-    virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) 
-        throw (::com::sun::star::uno::RuntimeException);
-
-    virtual sal_Bool SAL_CALL hasElements(  ) 
-        throw (::com::sun::star::uno::RuntimeException);
-
-}; 
-
-#endif 
+#endif

Modified: openoffice/trunk/main/shell/source/cmdmail/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/cmdmail/makefile.mk?rev=1429067&r1=1429066&r2=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/source/cmdmail/makefile.mk (original)
+++ openoffice/trunk/main/shell/source/cmdmail/makefile.mk Fri Jan  4 19:57:08 2013
@@ -37,7 +37,7 @@ COMP1TYPELIST=$(TARGET)
 DLLPRE=
 
 SLOFILES= \
-    $(SLO)$/cmdmailsuppl.obj \
+    $(SLO)$/syscmdmail.obj \
     $(SLO)$/cmdmailmsg.obj \
     $(SLO)$/cmdmailentry.obj
 SHL1OBJS=$(SLOFILES) 

Added: openoffice/trunk/main/shell/source/cmdmail/syscmdmail.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/cmdmail/syscmdmail.cxx?rev=1429067&view=auto
==============================================================================
--- openoffice/trunk/main/shell/source/cmdmail/syscmdmail.cxx (added)
+++ openoffice/trunk/main/shell/source/cmdmail/syscmdmail.cxx Fri Jan  4 19:57:08 2013
@@ -0,0 +1,355 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include "syscmdmail.hxx"
+#include "cmdmailmsg.hxx"
+
+#include <com/sun/star/system/MailClientFlags.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <osl/file.hxx>
+#include <osl/thread.hxx>
+#include <rtl/bootstrap.hxx>
+#include <rtl/strbuf.hxx>
+
+#include <unistd.h>
+
+using com::sun::star::beans::PropertyValue;
+using com::sun::star::container::XNameAccess;
+using com::sun::star::system::XMailClient;
+using com::sun::star::system::XMailMessage;
+using rtl::OString;
+using rtl::OStringBuffer;
+using rtl::OUString;
+using rtl::OUStringToOString;
+
+using namespace com::sun::star::lang;
+using namespace com::sun::star::system::MailClientFlags;
+using namespace com::sun::star::uno;
+
+#define COMP_SERVICE_NAME  "com.sun.star.system.SystemMailProvider"
+#define COMP_IMPL_NAME     "com.sun.star.comp.system.unx.SystemMailProvider"
+
+namespace shell
+{
+
+namespace
+{
+    static void escapeDoubleQuotes( OStringBuffer &rBuffer,
+                                    const OUString &ustr,
+                                    rtl_TextEncoding iEncoding )
+    {
+        const OString rStr( OUStringToOString( ustr, iEncoding ) );
+        sal_Int32 nIndex = rStr.indexOf('"');
+        if ( nIndex == -1 )
+            rBuffer.append( rStr );
+        else
+        {
+            const sal_Char *pStart = rStr.getStr();
+            const sal_Char *pFrom = pStart;
+            const sal_Int32 nLen = rStr.getLength();
+            sal_Int32 nPrev = 0;;
+            do
+            {
+                rBuffer.append( pFrom, nIndex - nPrev );
+                rBuffer.append( RTL_CONSTASCII_STRINGPARAM( "\\\"" ) );
+                nIndex++;
+                pFrom = pStart + nIndex;
+                nPrev = nIndex;
+            }
+            while ( ( nIndex = rStr.indexOf( '"' , nIndex ) ) != -1  );
+
+            rBuffer.append( pFrom, nLen - nPrev );
+        }
+    }
+}
+
+SystemCommandMail::SystemCommandMail(
+    const Reference< XComponentContext >& xContext )
+    : SystemCommandMail_Base( m_aMutex )
+    , m_xContext( xContext )
+{
+    try
+    {
+        m_xConfigurationProvider.set(
+            m_xContext->getServiceManager()->createInstanceWithContext(
+                OUString( RTL_CONSTASCII_USTRINGPARAM(
+                    "com.sun.star.configuration.ConfigurationProvider") ),
+                m_xContext ),
+            UNO_QUERY );
+    }
+    catch(...){}
+}
+
+SystemCommandMail::~SystemCommandMail()
+{
+    m_xConfigurationProvider.clear();
+    m_xContext.clear();
+}
+
+Reference< XMailClient > SAL_CALL
+SystemCommandMail::queryMailClient()
+throw ( RuntimeException )
+{
+    return Reference< XMailClient >(
+        static_cast < cppu::OWeakObject * >( this ), UNO_QUERY );
+}
+
+
+Reference< XMailMessage > SAL_CALL
+SystemCommandMail::createMailMessage()
+throw ( RuntimeException )
+{
+    return Reference< XMailMessage >(
+        static_cast< cppu::OWeakObject *>(
+            new CmdMailMsg() ),
+        UNO_QUERY );
+}
+
+
+void SAL_CALL
+SystemCommandMail::sendMailMessage(
+    const Reference< XMailMessage >& xMailMessage,
+    sal_Int32 /*aFlag*/ )
+throw (IllegalArgumentException, Exception, RuntimeException)
+{
+    osl::ClearableMutexGuard aGuard( m_aMutex );
+    Reference< XMultiServiceFactory > xConfigurationProvider = m_xConfigurationProvider;
+    aGuard.clear();
+
+    if ( ! xMailMessage.is() )
+    {
+        throw IllegalArgumentException(
+            OUString(RTL_CONSTASCII_USTRINGPARAM( "No message specified" )),
+            static_cast < XMailClient * > (this), 1 );
+    }
+
+    if( ! xConfigurationProvider.is() )
+    {
+        throw Exception(
+            OUString(RTL_CONSTASCII_USTRINGPARAM( "Can not access configuration" )),
+            static_cast < XMailClient * > (this) );
+    }
+
+    OStringBuffer aBuffer;
+    aBuffer.append("\"");
+
+    OUString aProgramURL(RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/program/senddoc"));
+    rtl::Bootstrap::expandMacros(aProgramURL);
+    OUString aProgram;
+    if ( osl::FileBase::E_None != osl::FileBase::getSystemPathFromFileURL(aProgramURL, aProgram))
+    {
+        throw Exception(
+            OUString(RTL_CONSTASCII_USTRINGPARAM("Cound not convert executable path")),
+            static_cast < XMailClient * > (this));
+    }
+
+    const rtl_TextEncoding iEncoding = osl_getThreadTextEncoding();
+    aBuffer.append(OUStringToOString(aProgram, iEncoding));
+    aBuffer.append("\" ");
+
+    try
+    {
+        // Query XNameAccess interface of the org.openoffice.Office.Common/ExternalMailer
+        // configuration node to retriece the users preferred email application. This may
+        // transparently by redirected to e.g. the corresponding GConf setting in GNOME.
+        OUString aConfigRoot = OUString(
+            RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer" ) );
+
+        PropertyValue aProperty;
+        aProperty.Name = OUString( RTL_CONSTASCII_USTRINGPARAM("nodepath" ));
+        aProperty.Value = makeAny( aConfigRoot );
+
+        Sequence< Any > aArgumentList( 1 );
+        aArgumentList[0] = makeAny( aProperty );
+
+        Reference< XNameAccess > xNameAccess =
+            Reference< XNameAccess > (
+                xConfigurationProvider->createInstanceWithArguments(
+                    OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" )),
+                    aArgumentList ),
+                UNO_QUERY );
+
+        if( xNameAccess.is() )
+        {
+            OUString aMailer;
+
+            // Retrieve the value for "Program" node and append it feed senddoc with it
+            // using the (undocumented) --mailclient switch
+            xNameAccess->getByName( OUString( RTL_CONSTASCII_USTRINGPARAM("Program") ) ) >>= aMailer;
+
+            if( aMailer.getLength() )
+            {
+                // make sure we have a system path
+                osl::FileBase::getSystemPathFromFileURL( aMailer, aMailer );
+
+                aBuffer.append("--mailclient ");
+                aBuffer.append(OUStringToOString( aMailer, iEncoding ));
+                aBuffer.append(" ");
+            }
+#ifdef MACOSX
+            else
+                aBuffer.append("--mailclient Mail ");
+#endif
+        }
+
+    }
+    catch( RuntimeException e )
+    {
+        OSL_TRACE( "RuntimeException caught accessing configuration provider." );
+        OSL_TRACE( OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
+        throw e;
+    }
+
+    // Append body if set in the message
+    OUString ustr = xMailMessage->getBody();
+    if ( ustr.getLength() > 0 )
+    {
+        aBuffer.append("--body \"");
+        escapeDoubleQuotes( aBuffer, ustr, iEncoding );
+        aBuffer.append("\" ");
+    }
+
+    // Append subject if set in the message
+    ustr = xMailMessage->getSubject();
+    if ( ustr.getLength() > 0 )
+    {
+        aBuffer.append("--subject \"");
+        escapeDoubleQuotes( aBuffer, ustr, iEncoding );
+        aBuffer.append("\" ");
+    }
+
+    // Append originator if set in the message
+    if ( xMailMessage->getOriginator().getLength() > 0 )
+    {
+        aBuffer.append("--from \"");
+        aBuffer.append(OUStringToOString(xMailMessage->getOriginator(), iEncoding));
+        aBuffer.append("\" ");
+    }
+
+    // Append receipient if set in the message
+    if ( xMailMessage->getRecipient().getLength() > 0 )
+    {
+        aBuffer.append("--to \"");
+        aBuffer.append(OUStringToOString(xMailMessage->getRecipient(), iEncoding));
+        aBuffer.append("\" ");
+    }
+
+    // Append carbon copy receipients set in the message
+    Sequence< OUString > aStringList = xMailMessage->getCcRecipient();
+    sal_Int32 n, nmax = aStringList.getLength();
+    for ( n = 0; n < nmax; n++ )
+    {
+        aBuffer.append("--cc \"");
+        aBuffer.append(OUStringToOString(aStringList[n], iEncoding));
+        aBuffer.append("\" ");
+    }
+
+    // Append blind carbon copy receipients set in the message
+    aStringList = xMailMessage->getBccRecipient();
+    nmax = aStringList.getLength();
+    for ( n = 0; n < nmax; n++ )
+    {
+        aBuffer.append("--bcc \"");
+        aBuffer.append(OUStringToOString(aStringList[n], iEncoding));
+        aBuffer.append("\" ");
+    }
+
+    // Append attachments set in the message
+    aStringList = xMailMessage->getAttachement();
+    nmax = aStringList.getLength();
+    for ( n = 0; n < nmax; n++ )
+    {
+        OUString aSystemPath;
+        if ( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(aStringList[n], aSystemPath) )
+        {
+            aBuffer.append("--attach \"");
+            aBuffer.append(OUStringToOString(aSystemPath, iEncoding));
+            aBuffer.append("\" ");
+        }
+    }
+
+    OString cmd = aBuffer.makeStringAndClear();
+    if ( 0 != pclose(popen(cmd.getStr(), "w")) )
+    {
+        throw ::com::sun::star::uno::Exception(
+            OUString(RTL_CONSTASCII_USTRINGPARAM( "No mail client configured" )),
+            static_cast < XMailClient * > (this) );
+    }
+}
+
+OUString SAL_CALL
+SystemCommandMail::getImplementationName(  )
+throw( RuntimeException )
+{
+    return getImplementationName_static();
+}
+
+sal_Bool SAL_CALL
+SystemCommandMail::supportsService(
+    const OUString& ServiceName )
+throw( RuntimeException )
+{
+    Sequence < OUString > SupportedServicesNames = getSupportedServiceNames_static();
+
+    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
+        if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+            return sal_True;
+
+    return sal_False;
+}
+
+Sequence< OUString > SAL_CALL
+SystemCommandMail::getSupportedServiceNames()
+throw( RuntimeException )
+{
+    return getSupportedServiceNames_static();
+}
+
+Reference< XInterface >
+SystemCommandMail::Create(
+    const Reference< XComponentContext > &xContext)
+{
+    return Reference< XInterface >(
+        static_cast< cppu::OWeakObject *>(
+            new SystemCommandMail( xContext ) ) );
+}
+
+OUString
+SystemCommandMail::getImplementationName_static()
+{
+    return OUString( RTL_CONSTASCII_USTRINGPARAM( COMP_IMPL_NAME ) );
+}
+
+Sequence< OUString >
+SystemCommandMail::getSupportedServiceNames_static()
+{
+    Sequence< OUString > aRet(1);
+    aRet[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( COMP_SERVICE_NAME ) );
+    return aRet;
+}
+
+}

Added: openoffice/trunk/main/shell/source/cmdmail/syscmdmail.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/cmdmail/syscmdmail.hxx?rev=1429067&view=auto
==============================================================================
--- openoffice/trunk/main/shell/source/cmdmail/syscmdmail.hxx (added)
+++ openoffice/trunk/main/shell/source/cmdmail/syscmdmail.hxx Fri Jan  4 19:57:08 2013
@@ -0,0 +1,74 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _SYSTEMCMDMAIL_HXX_
+#define _SYSTEMCMDMAIL_HXX_
+
+#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/system/XSystemMailProvider.hpp>
+
+namespace shell
+{
+    typedef cppu::WeakComponentImplHelper3<
+            com::sun::star::system::XSystemMailProvider,
+            com::sun::star::system::XMailClient,
+            com::sun::star::lang::XServiceInfo > SystemCommandMail_Base;
+
+    class SystemCommandMail : protected cppu::BaseMutex,
+                              public SystemCommandMail_Base
+    {
+    private:
+        ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+        ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xConfigurationProvider;
+
+    public:
+        SystemCommandMail( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
+        ~SystemCommandMail();
+
+        virtual ::com::sun::star::uno::Reference< ::com::sun::star::system::XMailClient > SAL_CALL queryMailClient(  )
+            throw (::com::sun::star::uno::RuntimeException);
+
+        virtual ::com::sun::star::uno::Reference< ::com::sun::star::system::XMailMessage > SAL_CALL createMailMessage(  )
+            throw (::com::sun::star::uno::RuntimeException);
+
+        virtual void SAL_CALL sendMailMessage( const ::com::sun::star::uno::Reference< ::com::sun::star::system::XMailMessage >& xMailMessage, sal_Int32 aFlag )
+            throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+        virtual ::rtl::OUString SAL_CALL getImplementationName()
+            throw(::com::sun::star::uno::RuntimeException);
+
+        virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+            throw(::com::sun::star::uno::RuntimeException);
+
+        virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
+            throw(::com::sun::star::uno::RuntimeException);
+
+        static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > Create( const com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext);
+        static rtl::OUString getImplementationName_static();
+        static com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_static();
+    };
+}
+
+#endif

Copied: openoffice/trunk/main/shell/source/win32/sysmail/exports.dxp (from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/exports.dxp)
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/win32/sysmail/exports.dxp?p2=openoffice/trunk/main/shell/source/win32/sysmail/exports.dxp&p1=openoffice/trunk/main/shell/source/win32/simplemail/exports.dxp&r1=1429066&r2=1429067&rev=1429067&view=diff
==============================================================================
    (empty)

Copied: openoffice/trunk/main/shell/source/win32/sysmail/makefile.mk (from r1429066, openoffice/trunk/main/shell/source/win32/simplemail/makefile.mk)
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/shell/source/win32/sysmail/makefile.mk?p2=openoffice/trunk/main/shell/source/win32/sysmail/makefile.mk&p1=openoffice/trunk/main/shell/source/win32/simplemail/makefile.mk&r1=1429066&r2=1429067&rev=1429067&view=diff
==============================================================================
--- openoffice/trunk/main/shell/source/win32/simplemail/makefile.mk (original)
+++ openoffice/trunk/main/shell/source/win32/sysmail/makefile.mk Fri Jan  4 19:57:08 2013
@@ -1,5 +1,5 @@
 #**************************************************************
-#  
+#
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
 #  distributed with this work for additional information
@@ -7,23 +7,23 @@
 #  to you under the Apache License, Version 2.0 (the
 #  "License"); you may not use this file except in compliance
 #  with the License.  You may obtain a copy of the License at
-#  
+#
 #    http://www.apache.org/licenses/LICENSE-2.0
-#  
+#
 #  Unless required by applicable law or agreed to in writing,
 #  software distributed under the License is distributed on an
 #  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 #  KIND, either express or implied.  See the License for the
 #  specific language governing permissions and limitations
 #  under the License.
-#  
+#
 #**************************************************************
 
 
 
 PRJ=..$/..$/..
 PRJNAME=shell
-TARGET=smplmail
+TARGET=sysmail
 LIBTARGET=NO
 ENABLE_EXCEPTIONS=TRUE
 COMP1TYPELIST=$(TARGET)
@@ -34,12 +34,11 @@ COMP1TYPELIST=$(TARGET)
 
 # --- Files --------------------------------------------------------
 
-SLOFILES=$(SLO)$/smplmailentry.obj\
-		 $(SLO)$/smplmailmsg.obj\
-		 $(SLO)$/smplmailclient.obj\
-		 $(SLO)$/smplmailsuppl.obj\
-		 $(SLO)$/simplemapi.obj
-						
+SLOFILES=$(SLO)$/sysmailentry.obj\
+		 $(SLO)$/sysmailmsg.obj\
+		 $(SLO)$/sysmailclient.obj\
+		 $(SLO)$/sysmailprov.obj
+	
 SHL1TARGET=$(TARGET).uno
 
 SHL1STDLIBS=$(CPPULIB)\
@@ -49,7 +48,7 @@ SHL1STDLIBS=$(CPPULIB)\
 
 SHL1IMPLIB=i$(SHL1TARGET)
 
-SHL1OBJS=$(SLOFILES) 
+SHL1OBJS=$(SLOFILES)
 SHL1DEF=$(MISC)$/$(SHL1TARGET).def
 
 DEF1NAME=$(SHL1TARGET)
@@ -60,13 +59,13 @@ DEF1EXPORTFILE=	exports.dxp
 TARGETTYPE=CUI
 
 OBJFILES=   $(OBJ)$/senddoc.obj\
-            $(OBJ)$/simplemapi.obj
+            $(OBJ)$/sysmapi.obj
 
 APP1TARGET=senddoc
 APP1OBJS=$(OBJFILES)
 APP1STDLIBS=$(KERNEL32LIB)\
             $(SALLIB)
-            
+
 APP1DEF=$(MISC)$/$(APP1TARGET).def
 
 # --- Targets ------------------------------------------------------
@@ -74,10 +73,10 @@ APP1DEF=$(MISC)$/$(APP1TARGET).def
 .INCLUDE :	target.mk
 
 
-ALLTAR : $(MISC)/smplmail.component
+ALLTAR : $(MISC)/sysmail.component
 
-$(MISC)/smplmail.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
-        smplmail.component
+$(MISC)/sysmail.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+        sysmail.component
     $(XSLTPROC) --nonet --stringparam uri \
         '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
-        $(SOLARENV)/bin/createcomponent.xslt smplmail.component
+        $(SOLARENV)/bin/createcomponent.xslt sysmail.component