1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _CMDMAILMSG_HXX_
25 #define _CMDMAILMSG_HXX_
26 
27 #include <cppuhelper/implbase2.hxx>
28 #include <com/sun/star/lang/IllegalArgumentException.hpp>
29 #include <com/sun/star/container/XNameAccess.hpp>
30 
31 #ifndef _COM_SUN_STAR_SYS_SHELL_XSYSTEMSHELLEXECUTE_HPP_
32 #include <com/sun/star/system/XSimpleMailMessage2.hpp>
33 #endif
34 #include <com/sun/star/uno/XComponentContext.hpp>
35 #include <com/sun/star/uno/Reference.hxx>
36 
37 //----------------------------------------------------------
38 // class declaration
39 //----------------------------------------------------------
40 
41 class CmdMailMsg :
42 	public  cppu::WeakImplHelper2<
43         ::com::sun::star::system::XSimpleMailMessage2,
44         ::com::sun::star::container::XNameAccess >
45 {
46     ::rtl::OUString                                   m_aBody;
47     ::rtl::OUString                                   m_aRecipient;
48     ::rtl::OUString                                   m_aOriginator;
49     ::rtl::OUString                                   m_aSubject;
50     ::com::sun::star::uno::Sequence< rtl::OUString >  m_CcRecipients;
51     ::com::sun::star::uno::Sequence< rtl::OUString >  m_BccRecipients;
52     ::com::sun::star::uno::Sequence< rtl::OUString >  m_Attachments;
53 
54     ::osl::Mutex m_aMutex;
55 
56 public:
57 
58     CmdMailMsg() {};
59 
60     //------------------------------------------------
61     // XSimpleMailMessage
62     //------------------------------------------------
63 
64     virtual void SAL_CALL setBody( const ::rtl::OUString& aBody )
65         throw (::com::sun::star::uno::RuntimeException);
66 
67     virtual ::rtl::OUString SAL_CALL getBody(  )
68         throw (::com::sun::star::uno::RuntimeException);
69 
70     virtual void SAL_CALL setRecipient( const ::rtl::OUString& aRecipient )
71         throw (::com::sun::star::uno::RuntimeException);
72 
73     virtual ::rtl::OUString SAL_CALL getRecipient(  )
74         throw (::com::sun::star::uno::RuntimeException);
75 
76     virtual void SAL_CALL setCcRecipient( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCcRecipient )
77         throw (::com::sun::star::uno::RuntimeException);
78 
79     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCcRecipient(  )
80         throw (::com::sun::star::uno::RuntimeException);
81 
82     virtual void SAL_CALL setBccRecipient( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aBccRecipient )
83         throw (::com::sun::star::uno::RuntimeException);
84 
85     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getBccRecipient(  )
86         throw (::com::sun::star::uno::RuntimeException);
87 
88     virtual void SAL_CALL setOriginator( const ::rtl::OUString& aOriginator )
89         throw (::com::sun::star::uno::RuntimeException);
90 
91     virtual ::rtl::OUString SAL_CALL getOriginator(  )
92         throw (::com::sun::star::uno::RuntimeException);
93 
94     virtual void SAL_CALL setSubject( const ::rtl::OUString& aSubject )
95         throw (::com::sun::star::uno::RuntimeException);
96 
97     virtual ::rtl::OUString SAL_CALL getSubject(  )
98         throw (::com::sun::star::uno::RuntimeException);
99 
100     virtual void SAL_CALL setAttachement( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aAttachement )
101         throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
102 
103     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAttachement(  )
104         throw (::com::sun::star::uno::RuntimeException);
105 
106     //------------------------------------------------
107     // XNameAccess
108     //------------------------------------------------
109 
110     virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
111         throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
112 
113     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(  )
114         throw (::com::sun::star::uno::RuntimeException) ;
115 
116     virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
117         throw (::com::sun::star::uno::RuntimeException);
118 
119     //------------------------------------------------
120     // XElementAccess
121     //------------------------------------------------
122 
123     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  )
124         throw (::com::sun::star::uno::RuntimeException);
125 
126     virtual sal_Bool SAL_CALL hasElements(  )
127         throw (::com::sun::star::uno::RuntimeException);
128 
129 };
130 
131 #endif
132