xref: /aoo4110/main/sfx2/source/inc/mailmodel.hxx (revision b1cdbd2c)
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 #ifndef INCLUDED_SFX_MAILMODEL_HXX
24 #define INCLUDED_SFX_MAILMODEL_HXX
25 
26 #include <com/sun/star/frame/XFrame.hpp>
27 
28 // class SfxMailModel_Impl -----------------------------------------------
29 
30 class AddressList_Impl;
31 
32 class SfxMailModel_Impl
33 {
34 public:
35 	enum MailPriority
36 	{
37 		PRIO_HIGHEST,
38 		PRIO_HIGH,
39 		PRIO_NORMAL,
40 		PRIO_LOW,
41 		PRIO_LOWEST
42 	};
43 
44 	enum AddressRole
45 	{
46 		ROLE_TO,
47 		ROLE_CC,
48 		ROLE_BCC
49 	};
50 
51 	enum MailDocType
52 	{
53 		TYPE_SELF,
54 		TYPE_ASPDF
55 	};
56 
57 private:
58 	enum SaveResult
59 	{
60 		SAVE_SUCCESSFULL,
61 		SAVE_CANCELLED,
62 		SAVE_ERROR
63 	};
64 
65 	AddressList_Impl*	mpToList;
66 	AddressList_Impl*	mpCcList;
67 	AddressList_Impl*	mpBccList;
68 	String				maFromAddress;
69 	String				maSubject;
70 	MailPriority		mePriority;
71 
72 	sal_Bool			mbLoadDone;
73 
74 	void				ClearList( AddressList_Impl* pList );
75 	void				MakeValueList( AddressList_Impl* pList, String& rValueList );
76     SaveResult			SaveDocumentAsFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType, rtl::OUString& rFileNamePath );
77 
78 	DECL_LINK( DoneHdl, void* );
79 
80 public:
81 	enum SendMailResult
82 	{
83 		SEND_MAIL_OK,
84 		SEND_MAIL_CANCELLED,
85 		SEND_MAIL_ERROR
86 	};
87 
88 	SfxMailModel_Impl();
89 	~SfxMailModel_Impl();
90 
91 	void				AddAddress( const String& rAddress, AddressRole eRole );
SetFromAddress(const String & rAddress)92 	void				SetFromAddress( const String& rAddress )	{ maFromAddress = rAddress; }
SetSubject(const String & rSubject)93 	void				SetSubject( const String& rSubject )		{ maSubject = rSubject; }
SetPriority(MailPriority ePrio)94 	void				SetPriority( MailPriority ePrio )			{ mePriority = ePrio; }
95 
96     SendMailResult		Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType );
97 };
98 
99 sal_Bool CreateFromAddress_Impl( String& rFrom );
100 
101 #endif // INCLUDED_SFX_MAILMODEL_HXX
102