diff options
author | Ariel Constenla-Haile <arielch@apache.org> | 2012-10-16 20:28:22 +0000 |
---|---|---|
committer | Ariel Constenla-Haile <arielch@apache.org> | 2012-10-16 20:28:22 +0000 |
commit | 093977b1171fae4eaef13a6d32929451fc64ae66 (patch) | |
tree | dfd3acd6b6747d70ddc1d4d9a6e7edbe99005403 | |
parent | 7a652a2b2ab5e0d37e32185c8c5fac3af482bb76 (diff) |
#i93995# - Allow setting Body of a simple mail message
Notes
Notes:
merged as: a47a153a7f75edfe3bce33f0d34b723cbd2d5195
-rwxr-xr-x | offapi/com/sun/star/system/XSimpleMailMessage2.idl | 42 | ||||
-rw-r--r-- | offapi/com/sun/star/system/makefile.mk | 1 | ||||
-rw-r--r-- | shell/source/cmdmail/cmdmailmsg.cxx | 149 | ||||
-rw-r--r-- | shell/source/cmdmail/cmdmailmsg.hxx | 15 | ||||
-rw-r--r-- | shell/source/cmdmail/cmdmailsuppl.cxx | 13 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailclient.cxx | 42 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailclient.hxx | 3 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailmsg.cxx | 12 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailmsg.hxx | 14 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailsuppl.hxx | 3 |
10 files changed, 162 insertions, 132 deletions
diff --git a/offapi/com/sun/star/system/XSimpleMailMessage2.idl b/offapi/com/sun/star/system/XSimpleMailMessage2.idl new file mode 100755 index 000000000000..4560488a1804 --- /dev/null +++ b/offapi/com/sun/star/system/XSimpleMailMessage2.idl @@ -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 diff --git a/offapi/com/sun/star/system/makefile.mk b/offapi/com/sun/star/system/makefile.mk index 74a557596838..d0c152f580d6 100644 --- a/offapi/com/sun/star/system/makefile.mk +++ b/offapi/com/sun/star/system/makefile.mk @@ -40,6 +40,7 @@ IDLFILES=\ XSystemShellExecute.idl\ SimpleMailClientFlags.idl\ XSimpleMailMessage.idl\ + XSimpleMailMessage2.idl\ XSimpleMailClient.idl\ XSimpleMailClientSupplier.idl\ SimpleCommandMail.idl \ diff --git a/shell/source/cmdmail/cmdmailmsg.cxx b/shell/source/cmdmail/cmdmailmsg.cxx index 356447ca204d..f32271c9b1fb 100644 --- a/shell/source/cmdmail/cmdmailmsg.cxx +++ b/shell/source/cmdmail/cmdmailmsg.cxx @@ -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( const Sequence< OUString >& aCcRecipie m_CcRecipients = aCcRecipient; } -//------------------------------------------------ -// -//------------------------------------------------ - Sequence< OUString > SAL_CALL CmdMailMsg::getCcRecipient( ) throw (RuntimeException) { @@ -93,10 +79,6 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getCcRecipient( ) return m_CcRecipients; } -//------------------------------------------------ -// -//------------------------------------------------ - void SAL_CALL CmdMailMsg::setBccRecipient( const Sequence< OUString >& aBccRecipient ) throw (RuntimeException) { @@ -104,10 +86,6 @@ void SAL_CALL CmdMailMsg::setBccRecipient( const Sequence< OUString >& aBccRecip m_BccRecipients = aBccRecipient; } -//------------------------------------------------ -// -//------------------------------------------------ - Sequence< OUString > SAL_CALL CmdMailMsg::getBccRecipient( ) throw (RuntimeException) { @@ -115,10 +93,6 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getBccRecipient( ) return m_BccRecipients; } -//------------------------------------------------ -// -//------------------------------------------------ - void SAL_CALL CmdMailMsg::setOriginator( const OUString& aOriginator ) throw (RuntimeException) { @@ -126,10 +100,6 @@ void SAL_CALL CmdMailMsg::setOriginator( const OUString& aOriginator ) m_aOriginator = aOriginator; } -//------------------------------------------------ -// -//------------------------------------------------ - OUString SAL_CALL CmdMailMsg::getOriginator( ) throw (RuntimeException) { @@ -137,10 +107,6 @@ OUString SAL_CALL CmdMailMsg::getOriginator( ) return m_aOriginator; } -//------------------------------------------------ -// -//------------------------------------------------ - void SAL_CALL CmdMailMsg::setSubject( const OUString& aSubject ) throw (RuntimeException) { @@ -148,10 +114,6 @@ void SAL_CALL CmdMailMsg::setSubject( const OUString& aSubject ) 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::getAttachement( ) 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; } -//------------------------------------------------ -// -//------------------------------------------------ - - 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) { diff --git a/shell/source/cmdmail/cmdmailmsg.hxx b/shell/source/cmdmail/cmdmailmsg.hxx index baf2d3b1b919..75ff09559187 100644 --- a/shell/source/cmdmail/cmdmailmsg.hxx +++ b/shell/source/cmdmail/cmdmailmsg.hxx @@ -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,9 +40,10 @@ 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; @@ -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); @@ -96,7 +103,7 @@ public: virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAttachement( ) throw (::com::sun::star::uno::RuntimeException); - //------------------------------------------------ + //------------------------------------------------ // XNameAccess //------------------------------------------------ @@ -109,7 +116,7 @@ public: virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); - //------------------------------------------------ + //------------------------------------------------ // XElementAccess //------------------------------------------------ diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx b/shell/source/cmdmail/cmdmailsuppl.cxx index 0020b3d851c6..bda87405d82d 100644 --- a/shell/source/cmdmail/cmdmailsuppl.cxx +++ b/shell/source/cmdmail/cmdmailsuppl.cxx @@ -54,6 +54,7 @@ using com::sun::star::beans::PropertyValue; 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; @@ -219,6 +220,18 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM 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 ) { diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index fd4262ee991c..84d235da5964 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -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::IllegalArgumentException; 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 */ { @@ -185,6 +188,17 @@ void CSmplMailClient::assembleCommandLine( { 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::assembleCommandLine( 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::sendSimpleMailMessage( 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); } diff --git a/shell/source/win32/simplemail/smplmailclient.hxx b/shell/source/win32/simplemail/smplmailclient.hxx index a4012e8a97c2..9b69ef45eac1 100644 --- a/shell/source/win32/simplemail/smplmailclient.hxx +++ b/shell/source/win32/simplemail/smplmailclient.hxx @@ -26,10 +26,7 @@ #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; diff --git a/shell/source/win32/simplemail/smplmailmsg.cxx b/shell/source/win32/simplemail/smplmailmsg.cxx index 7b2b540fcba3..07939771a3dd 100644 --- a/shell/source/win32/simplemail/smplmailmsg.cxx +++ b/shell/source/win32/simplemail/smplmailmsg.cxx @@ -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; +} + //------------------------------------------------ // //------------------------------------------------ diff --git a/shell/source/win32/simplemail/smplmailmsg.hxx b/shell/source/win32/simplemail/smplmailmsg.hxx index 783f2f0540aa..5bbb1c3d296c 100644 --- a/shell/source/win32/simplemail/smplmailmsg.hxx +++ b/shell/source/win32/simplemail/smplmailmsg.hxx @@ -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; diff --git a/shell/source/win32/simplemail/smplmailsuppl.hxx b/shell/source/win32/simplemail/smplmailsuppl.hxx index d5adccea5015..a3c51ee8ebcf 100644 --- a/shell/source/win32/simplemail/smplmailsuppl.hxx +++ b/shell/source/win32/simplemail/smplmailsuppl.hxx @@ -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" |