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/XSimpleMailMessage.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::XSimpleMailMessage,
44         ::com::sun::star::container::XNameAccess >
45 {
46     ::rtl::OUString                                   m_aRecipient;
47     ::rtl::OUString                                   m_aOriginator;
48     ::rtl::OUString                                   m_aSubject;
49     ::com::sun::star::uno::Sequence< rtl::OUString >  m_CcRecipients;
50     ::com::sun::star::uno::Sequence< rtl::OUString >  m_BccRecipients;
51     ::com::sun::star::uno::Sequence< rtl::OUString >  m_Attachments;
52 
53     ::osl::Mutex m_aMutex;
54 
55 public:
56 
57     CmdMailMsg() {};
58 
59     //------------------------------------------------
60     // XSimpleMailMessage
61     //------------------------------------------------
62 
63     virtual void SAL_CALL setRecipient( const ::rtl::OUString& aRecipient )
64         throw (::com::sun::star::uno::RuntimeException);
65 
66     virtual ::rtl::OUString SAL_CALL getRecipient(  )
67         throw (::com::sun::star::uno::RuntimeException);
68 
69     virtual void SAL_CALL setCcRecipient( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCcRecipient )
70         throw (::com::sun::star::uno::RuntimeException);
71 
72     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCcRecipient(  )
73         throw (::com::sun::star::uno::RuntimeException);
74 
75     virtual void SAL_CALL setBccRecipient( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aBccRecipient )
76         throw (::com::sun::star::uno::RuntimeException);
77 
78     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getBccRecipient(  )
79         throw (::com::sun::star::uno::RuntimeException);
80 
81     virtual void SAL_CALL setOriginator( const ::rtl::OUString& aOriginator )
82         throw (::com::sun::star::uno::RuntimeException);
83 
84     virtual ::rtl::OUString SAL_CALL getOriginator(  )
85         throw (::com::sun::star::uno::RuntimeException);
86 
87     virtual void SAL_CALL setSubject( const ::rtl::OUString& aSubject )
88         throw (::com::sun::star::uno::RuntimeException);
89 
90     virtual ::rtl::OUString SAL_CALL getSubject(  )
91         throw (::com::sun::star::uno::RuntimeException);
92 
93     virtual void SAL_CALL setAttachement( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aAttachement )
94         throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
95 
96     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAttachement(  )
97         throw (::com::sun::star::uno::RuntimeException);
98 
99    	//------------------------------------------------
100 	// XNameAccess
101 	//------------------------------------------------
102 
103     virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
104         throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
105 
106     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(  )
107         throw (::com::sun::star::uno::RuntimeException) ;
108 
109     virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
110         throw (::com::sun::star::uno::RuntimeException);
111 
112    	//------------------------------------------------
113 	// XElementAccess
114 	//------------------------------------------------
115 
116     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  )
117         throw (::com::sun::star::uno::RuntimeException);
118 
119     virtual sal_Bool SAL_CALL hasElements(  )
120         throw (::com::sun::star::uno::RuntimeException);
121 
122 };
123 
124 #endif
125