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 2012/10/16 23:28:23 UTC
svn commit: r1398997 - in /incubator/ooo/trunk/main:
offapi/com/sun/star/system/ shell/source/cmdmail/
shell/source/win32/simplemail/
Author: arielch
Date: Tue Oct 16 21:28:22 2012
New Revision: 1398997
URL: http://svn.apache.org/viewvc?rev=1398997&view=rev
Log:
#i93995# - Allow setting Body of a simple mail message
Added:
incubator/ooo/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl (with props)
Modified:
incubator/ooo/trunk/main/offapi/com/sun/star/system/makefile.mk
incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx
incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx
incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailsuppl.cxx
incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.cxx
incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.hxx
incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.cxx
incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.hxx
incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailsuppl.hxx
Added: incubator/ooo/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl?rev=1398997&view=auto
==============================================================================
--- incubator/ooo/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl (added)
+++ incubator/ooo/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl Tue Oct 16 21:28:22 2012
@@ -0,0 +1,42 @@
+/**************************************************************
+ *
+ * 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_XSimpleMailMessage2_idl__
+#define __com_sun_star_system_XSimpleMailMessage2_idl__
+
+#include <com/sun/star/system/XSimpleMailMessage.idl>
+
+module com { module sun { module star { module system {
+
+/** This interface extends <type>XSimpleMailMessage</type>.
+
+ @since Apache OpenOffice 3.5
+*/
+interface XSimpleMailMessage2: XSimpleMailMessage
+{
+ [attribute] string Body;
+};
+
+}; }; }; };
+
+#endif
Propchange: incubator/ooo/trunk/main/offapi/com/sun/star/system/XSimpleMailMessage2.idl
------------------------------------------------------------------------------
svn:executable = *
Modified: incubator/ooo/trunk/main/offapi/com/sun/star/system/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/system/makefile.mk?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/offapi/com/sun/star/system/makefile.mk (original)
+++ incubator/ooo/trunk/main/offapi/com/sun/star/system/makefile.mk Tue Oct 16 21:28:22 2012
@@ -40,6 +40,7 @@ IDLFILES=\
XSystemShellExecute.idl\
SimpleMailClientFlags.idl\
XSimpleMailMessage.idl\
+ XSimpleMailMessage2.idl\
XSimpleMailClient.idl\
XSimpleMailClientSupplier.idl\
SimpleCommandMail.idl \
Modified: incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx (original)
+++ incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.cxx Tue Oct 16 21:28:22 2012
@@ -24,19 +24,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
-//------------------------------------------------------------------------
-// includes
-//------------------------------------------------------------------------
-#include <osl/diagnose.h>
#include "cmdmailmsg.hxx"
-#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
-#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
-
-//------------------------------------------------------------------------
-// namespace directives
-//------------------------------------------------------------------------
using com::sun::star::lang::IllegalArgumentException;
using com::sun::star::lang::WrappedTargetException;
@@ -49,32 +37,34 @@ using namespace cppu;
using namespace com::sun::star::uno;
-//------------------------------------------------
-//
-//------------------------------------------------
+void SAL_CALL CmdMailMsg::setBody( const OUString& aBody )
+ throw (RuntimeException)
+{
+ MutexGuard aGuard( m_aMutex );
+ m_aBody = aBody;
+}
-void SAL_CALL CmdMailMsg::setRecipient( const ::rtl::OUString& aRecipient )
+OUString SAL_CALL CmdMailMsg::getBody( )
throw (RuntimeException)
{
MutexGuard aGuard( m_aMutex );
- m_aRecipient = aRecipient;
+ return m_aBody;
}
-//------------------------------------------------
-//
-//------------------------------------------------
+void SAL_CALL CmdMailMsg::setRecipient( const OUString& aRecipient )
+ throw (RuntimeException)
+{
+ MutexGuard aGuard( m_aMutex );
+ m_aRecipient = aRecipient;
+}
-::rtl::OUString SAL_CALL CmdMailMsg::getRecipient( )
+OUString SAL_CALL CmdMailMsg::getRecipient( )
throw (RuntimeException)
{
MutexGuard aGuard( m_aMutex );
return m_aRecipient;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
void SAL_CALL CmdMailMsg::setCcRecipient( const Sequence< OUString >& aCcRecipient )
throw (RuntimeException)
{
@@ -82,10 +72,6 @@ void SAL_CALL CmdMailMsg::setCcRecipient
m_CcRecipients = aCcRecipient;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
Sequence< OUString > SAL_CALL CmdMailMsg::getCcRecipient( )
throw (RuntimeException)
{
@@ -93,10 +79,6 @@ Sequence< OUString > SAL_CALL CmdMailMsg
return m_CcRecipients;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
void SAL_CALL CmdMailMsg::setBccRecipient( const Sequence< OUString >& aBccRecipient )
throw (RuntimeException)
{
@@ -104,20 +86,12 @@ void SAL_CALL CmdMailMsg::setBccRecipien
m_BccRecipients = aBccRecipient;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
Sequence< OUString > SAL_CALL CmdMailMsg::getBccRecipient( )
throw (RuntimeException)
{
MutexGuard aGuard( m_aMutex );
return m_BccRecipients;
}
-
-//------------------------------------------------
-//
-//------------------------------------------------
void SAL_CALL CmdMailMsg::setOriginator( const OUString& aOriginator )
throw (RuntimeException)
@@ -126,20 +100,12 @@ void SAL_CALL CmdMailMsg::setOriginator(
m_aOriginator = aOriginator;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
OUString SAL_CALL CmdMailMsg::getOriginator( )
throw (RuntimeException)
{
MutexGuard aGuard( m_aMutex );
return m_aOriginator;
}
-
-//------------------------------------------------
-//
-//------------------------------------------------
void SAL_CALL CmdMailMsg::setSubject( const OUString& aSubject )
throw (RuntimeException)
@@ -148,10 +114,6 @@ void SAL_CALL CmdMailMsg::setSubject( co
m_aSubject = aSubject;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
OUString SAL_CALL CmdMailMsg::getSubject( )
throw (RuntimeException)
{
@@ -159,21 +121,13 @@ OUString SAL_CALL CmdMailMsg::getSubject
return m_aSubject;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
-void SAL_CALL CmdMailMsg::setAttachement( const Sequence< ::rtl::OUString >& aAttachment )
+void SAL_CALL CmdMailMsg::setAttachement( const Sequence< OUString >& aAttachment )
throw (IllegalArgumentException, RuntimeException)
{
MutexGuard aGuard( m_aMutex );
m_Attachments = aAttachment;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
Sequence< OUString > SAL_CALL CmdMailMsg::getAttachement( )
throw (RuntimeException)
{
@@ -181,105 +135,98 @@ Sequence< OUString > SAL_CALL CmdMailMsg
return m_Attachments;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
Any SAL_CALL CmdMailMsg::getByName( const OUString& aName )
throw (NoSuchElementException, WrappedTargetException, RuntimeException)
{
MutexGuard aGuard( m_aMutex );
- if( 0 == aName.compareToAscii( "from" ) && m_aOriginator.getLength() )
+ 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( "to" ) && m_aRecipient.getLength() )
+ else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "to" )) && m_aRecipient.getLength() )
return makeAny( m_aRecipient );
- else if( 0 == aName.compareToAscii( "cc" ) && m_CcRecipients.getLength() )
+ else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "cc" )) && m_CcRecipients.getLength() )
return makeAny( m_CcRecipients );
-
- else if( 0 == aName.compareToAscii( "bcc" ) && m_BccRecipients.getLength() )
+
+ else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "bcc" )) && m_BccRecipients.getLength() )
return makeAny( m_BccRecipients );
-
- else if( 0 == aName.compareToAscii( "subject" ) && m_aSubject.getLength() )
+
+ else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "subject" )) && m_aSubject.getLength() )
return makeAny( m_aSubject );
-
- else if( 0 == aName.compareToAscii( "attachment" ) && m_Attachments.getLength() )
+
+ else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "attachment" )) && m_Attachments.getLength() )
return makeAny( m_Attachments );
-
- throw NoSuchElementException( OUString::createFromAscii( "key not found: ") + aName,
+
+ 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( 6 );
-
+ Sequence< OUString > aRet( 7 );
+
+ if( m_aBody.getLength() )
+ aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "body" ));
+
if( m_aOriginator.getLength() )
- aRet[nItems++] = OUString::createFromAscii( "from" );
+ aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "from" ));
if( m_aRecipient.getLength() )
- aRet[nItems++] = OUString::createFromAscii( "to" );
+ aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "to" ));
if( m_CcRecipients.getLength() )
- aRet[nItems++] = OUString::createFromAscii( "cc" );
+ aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "cc" ));
if( m_BccRecipients.getLength() )
- aRet[nItems++] = OUString::createFromAscii( "bcc" );
+ aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "bcc" ));
if( m_aSubject.getLength() )
- aRet[nItems++] = OUString::createFromAscii( "subject" );
+ aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "subject" ));
if( m_Attachments.getLength() )
- aRet[nItems++] = OUString::createFromAscii( "attachment" );
+ aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM( "attachment" ));
aRet.realloc( nItems );
- return aRet;
+ return aRet;
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
- sal_Bool SAL_CALL CmdMailMsg::hasByName( const ::rtl::OUString& aName )
+ sal_Bool SAL_CALL CmdMailMsg::hasByName( const OUString& aName )
throw (RuntimeException)
{
MutexGuard aGuard( m_aMutex );
- if( 0 == aName.compareToAscii( "from" ) && m_aOriginator.getLength() )
+ if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "body" )) && m_aBody.getLength() )
return sal_True;
- else if( 0 == aName.compareToAscii( "to" ) && m_aRecipient.getLength() )
+ if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "from" )) && m_aOriginator.getLength() )
return sal_True;
- else if( 0 == aName.compareToAscii( "cc" ) && m_CcRecipients.getLength() )
+ else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "to" )) && m_aRecipient.getLength() )
return sal_True;
-
- else if( 0 == aName.compareToAscii( "bcc" ) && m_BccRecipients.getLength() )
+
+ else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "cc" )) && m_CcRecipients.getLength() )
return sal_True;
-
- else if( 0 == aName.compareToAscii( "subject" ) && m_aSubject.getLength() )
+
+ else if( 0 == aName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "bcc" )) && m_BccRecipients.getLength() )
return sal_True;
-
- else if( 0 == aName.compareToAscii( "attachment" ) && m_Attachments.getLength() )
+
+ 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)
{
@@ -287,10 +234,6 @@ Type SAL_CALL CmdMailMsg::getElementType
return Type();
}
-//------------------------------------------------
-//
-//------------------------------------------------
-
sal_Bool SAL_CALL CmdMailMsg::hasElements( )
throw (RuntimeException)
{
Modified: incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx (original)
+++ incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailmsg.hxx Tue Oct 16 21:28:22 2012
@@ -29,7 +29,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#ifndef _COM_SUN_STAR_SYS_SHELL_XSYSTEMSHELLEXECUTE_HPP_
-#include <com/sun/star/system/XSimpleMailMessage.hpp>
+#include <com/sun/star/system/XSimpleMailMessage2.hpp>
#endif
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/Reference.hxx>
@@ -40,18 +40,19 @@
class CmdMailMsg :
public cppu::WeakImplHelper2<
- ::com::sun::star::system::XSimpleMailMessage,
+ ::com::sun::star::system::XSimpleMailMessage2,
::com::sun::star::container::XNameAccess >
{
+ ::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() {};
@@ -60,6 +61,12 @@ public:
// XSimpleMailMessage
//------------------------------------------------
+ virtual void SAL_CALL setBody( const ::rtl::OUString& aBody )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::rtl::OUString SAL_CALL getBody( )
+ throw (::com::sun::star::uno::RuntimeException);
+
virtual void SAL_CALL setRecipient( const ::rtl::OUString& aRecipient )
throw (::com::sun::star::uno::RuntimeException);
@@ -95,10 +102,10 @@ public:
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAttachement( )
throw (::com::sun::star::uno::RuntimeException);
-
- //------------------------------------------------
- // XNameAccess
- //------------------------------------------------
+
+ //------------------------------------------------
+ // XNameAccess
+ //------------------------------------------------
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);
@@ -108,10 +115,10 @@ public:
virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
throw (::com::sun::star::uno::RuntimeException);
-
- //------------------------------------------------
- // XElementAccess
- //------------------------------------------------
+
+ //------------------------------------------------
+ // XElementAccess
+ //------------------------------------------------
virtual ::com::sun::star::uno::Type SAL_CALL getElementType( )
throw (::com::sun::star::uno::RuntimeException);
Modified: incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailsuppl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailsuppl.cxx?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailsuppl.cxx (original)
+++ incubator/ooo/trunk/main/shell/source/cmdmail/cmdmailsuppl.cxx Tue Oct 16 21:28:22 2012
@@ -54,6 +54,7 @@ using com::sun::star::beans::PropertyVal
using com::sun::star::system::XSimpleMailClientSupplier;
using com::sun::star::system::XSimpleMailClient;
using com::sun::star::system::XSimpleMailMessage;
+using com::sun::star::system::XSimpleMailMessage2;
using com::sun::star::container::XNameAccess;
using com::sun::star::container::NoSuchElementException;
using rtl::OUString;
@@ -216,9 +217,21 @@ void SAL_CALL CmdMailSuppl::sendSimpleMa
m_xConfigurationProvider.clear();
OSL_TRACE( "RuntimeException caught accessing configuration provider." );
OSL_TRACE( OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
- throw e;
+ throw e;
}
-
+
+ Reference< XSimpleMailMessage2 > xMessage( xSimpleMailMessage, UNO_QUERY );
+ if ( xMessage.is() )
+ {
+ rtl::OUString sBody = xMessage->getBody();
+ if ( sBody.getLength() > 0 )
+ {
+ aBuffer.append("--body \"");
+ aBuffer.append(OUStringToOString(sBody, osl_getThreadTextEncoding()));
+ aBuffer.append("\" ");
+ }
+ }
+
// Append originator if set in the message
if ( xSimpleMailMessage->getOriginator().getLength() > 0 )
{
Modified: incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.cxx?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.cxx (original)
+++ incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.cxx Tue Oct 16 21:28:22 2012
@@ -29,6 +29,7 @@
#include "smplmailclient.hxx"
#include "smplmailmsg.hxx"
#include <com/sun/star/system/SimpleMailClientFlags.hpp>
+#include <com/sun/star/system/XSimpleMailMessage2.hpp>
#include <osl/file.hxx>
#define WIN32_LEAN_AND_MEAN
@@ -44,6 +45,7 @@
#include <process.h>
#include <vector>
+using css::uno::UNO_QUERY;
using css::uno::Reference;
using css::uno::Exception;
using css::uno::RuntimeException;
@@ -52,21 +54,22 @@ using css::lang::IllegalArgumentExceptio
using css::system::XSimpleMailClient;
using css::system::XSimpleMailMessage;
+using css::system::XSimpleMailMessage2;
using css::system::SimpleMailClientFlags::NO_USER_INTERFACE;
using css::system::SimpleMailClientFlags::NO_LOGON_DIALOG;
typedef std::vector<rtl::OUString> StringList_t;
typedef StringList_t::const_iterator StringListIterator_t;
-const rtl::OUString TO = rtl::OUString::createFromAscii("--to");
-const rtl::OUString CC = rtl::OUString::createFromAscii("--cc");
-const rtl::OUString BCC = rtl::OUString::createFromAscii("--bcc");
-const rtl::OUString FROM = rtl::OUString::createFromAscii("--from");
-const rtl::OUString SUBJECT = rtl::OUString::createFromAscii("--subject");
-const rtl::OUString BODY = rtl::OUString::createFromAscii("--body");
-const rtl::OUString ATTACH = rtl::OUString::createFromAscii("--attach");
-const rtl::OUString FLAG_MAPI_DIALOG = rtl::OUString::createFromAscii("--mapi-dialog");
-const rtl::OUString FLAG_MAPI_LOGON_UI = rtl::OUString::createFromAscii("--mapi-logon-ui");
+const rtl::OUString TO = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--to"));
+const rtl::OUString CC = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--cc"));
+const rtl::OUString BCC = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--bcc"));
+const rtl::OUString FROM = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--from"));
+const rtl::OUString SUBJECT = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--subject"));
+const rtl::OUString BODY = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--body"));
+const rtl::OUString ATTACH = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--attach"));
+const rtl::OUString FLAG_MAPI_DIALOG = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--mapi-dialog"));
+const rtl::OUString FLAG_MAPI_LOGON_UI = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--mapi-logon-ui"));
namespace /* private */
{
@@ -184,7 +187,18 @@ void CSmplMailClient::assembleCommandLin
sal_Int32 aFlag, StringList_t& rCommandArgs)
{
OSL_ENSURE(rCommandArgs.size() == 0, "Provided command argument buffer not empty");
-
+
+ Reference<XSimpleMailMessage2> xMessage( xSimpleMailMessage, UNO_QUERY );
+ if (xMessage.is())
+ {
+ rtl::OUString body = xMessage->getBody();
+ if (body.getLength()>0)
+ {
+ rCommandArgs.push_back(BODY);
+ rCommandArgs.push_back(body);
+ }
+ }
+
rtl::OUString to = xSimpleMailMessage->getRecipient();
if (to.getLength() > 0)
{
@@ -227,7 +241,7 @@ void CSmplMailClient::assembleCommandLin
osl::FileBase::RC err = osl::FileBase::getSystemPathFromFileURL(attachments[i], sysPath);
if (err != osl::FileBase::E_None)
throw IllegalArgumentException(
- rtl::OUString::createFromAscii("Invalid attachment file URL"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid attachment file URL")),
static_cast<XSimpleMailClient*>(this),
1);
@@ -253,7 +267,7 @@ void SAL_CALL CSmplMailClient::sendSimpl
if (!executeSenddoc(senddocParams))
throw Exception(
- rtl::OUString::createFromAscii("Send email failed"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Send email failed")),
static_cast<XSimpleMailClient*>(this));
}
@@ -262,7 +276,7 @@ void CSmplMailClient::validateParameter(
{
if (!xSimpleMailMessage.is())
throw IllegalArgumentException(
- rtl::OUString::createFromAscii("Empty mail message reference"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Empty mail message reference")),
static_cast<XSimpleMailClient*>(this),
1);
@@ -272,14 +286,14 @@ void CSmplMailClient::validateParameter(
// check the flags, the allowed range is 0 - (2^n - 1)
if (aFlag < 0 || aFlag > 3)
throw IllegalArgumentException(
- rtl::OUString::createFromAscii("Invalid flag value"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid flag value")),
static_cast<XSimpleMailClient*>(this),
2);
// check if a recipient is specified of the flags NO_USER_INTERFACE is specified
if ((aFlag & NO_USER_INTERFACE) && !xSimpleMailMessage->getRecipient().getLength())
throw IllegalArgumentException(
- rtl::OUString::createFromAscii("No recipient specified"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No recipient specified")),
static_cast<XSimpleMailClient*>(this),
1);
}
Modified: incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.hxx?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.hxx (original)
+++ incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailclient.hxx Tue Oct 16 21:28:22 2012
@@ -26,17 +26,14 @@
#include <cppuhelper/compbase1.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-
-#ifndef _COM_SUN_STAR_SYS_SHELL_XSYSTEMSHELLEXECUTE_HPP_
#include <com/sun/star/system/XSimpleMailClient.hpp>
-#endif
namespace css = ::com::sun::star;
class CSmplMailClient : public cppu::WeakImplHelper1<css::system::XSimpleMailClient>
{
public:
- virtual css::uno::Reference<css::system::XSimpleMailMessage> SAL_CALL createSimpleMailMessage()
+ virtual css::uno::Reference<css::system::XSimpleMailMessage> SAL_CALL createSimpleMailMessage()
throw (css::uno::RuntimeException);
virtual void SAL_CALL sendSimpleMailMessage(const css::uno::Reference<css::system::XSimpleMailMessage>& xSimpleMailMessage, sal_Int32 aFlag)
Modified: incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.cxx?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.cxx (original)
+++ incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.cxx Tue Oct 16 21:28:22 2012
@@ -54,6 +54,18 @@ CSmplMailMsg::CSmplMailMsg( )
{
}
+void SAL_CALL CSmplMailMsg::setBody( const ::rtl::OUString& aBody )
+ throw (RuntimeException)
+{
+ m_aBody = aBody;
+}
+
+::rtl::OUString SAL_CALL CSmplMailMsg::getBody( )
+ throw (RuntimeException)
+{
+ return m_aBody;
+}
+
//------------------------------------------------
//
//------------------------------------------------
Modified: incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.hxx?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.hxx (original)
+++ incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailmsg.hxx Tue Oct 16 21:28:22 2012
@@ -31,21 +31,24 @@
#include <cppuhelper/compbase1.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-#ifndef _COM_SUN_STAR_SYS_SHELL_XSYSTEMSHELLEXECUTE_HPP_
-#include <com/sun/star/system/XSimpleMailMessage.hpp>
-#endif
+#include <com/sun/star/system/XSimpleMailMessage2.hpp>
//----------------------------------------------------------
// class declaration
//----------------------------------------------------------
class CSmplMailMsg :
- public cppu::WeakImplHelper1< com::sun::star::system::XSimpleMailMessage >
+ public cppu::WeakImplHelper1< com::sun::star::system::XSimpleMailMessage2 >
{
public:
CSmplMailMsg( );
-
+
+ virtual void SAL_CALL setBody( const ::rtl::OUString& aBody )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::rtl::OUString SAL_CALL getBody( )
+ throw (::com::sun::star::uno::RuntimeException);
+
//------------------------------------------------
//
//------------------------------------------------
@@ -107,6 +110,7 @@ public:
throw (::com::sun::star::uno::RuntimeException);
private:
+ rtl::OUString m_aBody;
rtl::OUString m_aRecipient;
rtl::OUString m_aOriginator;
rtl::OUString m_aSubject;
Modified: incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailsuppl.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailsuppl.hxx?rev=1398997&r1=1398996&r2=1398997&view=diff
==============================================================================
--- incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailsuppl.hxx (original)
+++ incubator/ooo/trunk/main/shell/source/win32/simplemail/smplmailsuppl.hxx Tue Oct 16 21:28:22 2012
@@ -27,10 +27,7 @@
#include <cppuhelper/compbase2.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-
-#ifndef _COM_SUN_STAR_SYS_SHELL_XSYSTEMSHELLEXECUTE_HPP_
#include <com/sun/star/system/XSimpleMailClientSupplier.hpp>
-#endif
#ifndef _SIMPLEMAPI_HXX_
#include "simplemapi.hxx"