xref: /trunk/main/sfx2/source/inc/mailmodel.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef INCLUDED_SFX_MAILMODEL_HXX
28 #define INCLUDED_SFX_MAILMODEL_HXX
29 
30 #include <com/sun/star/frame/XFrame.hpp>
31 
32 // class SfxMailModel_Impl -----------------------------------------------
33 
34 class AddressList_Impl;
35 
36 class SfxMailModel_Impl
37 {
38 public:
39     enum MailPriority
40     {
41         PRIO_HIGHEST,
42         PRIO_HIGH,
43         PRIO_NORMAL,
44         PRIO_LOW,
45         PRIO_LOWEST
46     };
47 
48     enum AddressRole
49     {
50         ROLE_TO,
51         ROLE_CC,
52         ROLE_BCC
53     };
54 
55     enum MailDocType
56     {
57         TYPE_SELF,
58         TYPE_ASPDF
59     };
60 
61 private:
62     enum SaveResult
63     {
64         SAVE_SUCCESSFULL,
65         SAVE_CANCELLED,
66         SAVE_ERROR
67     };
68 
69     AddressList_Impl*   mpToList;
70     AddressList_Impl*   mpCcList;
71     AddressList_Impl*   mpBccList;
72     String              maFromAddress;
73     String              maSubject;
74     MailPriority        mePriority;
75 
76     sal_Bool            mbLoadDone;
77 
78     void                ClearList( AddressList_Impl* pList );
79     void                MakeValueList( AddressList_Impl* pList, String& rValueList );
80     SaveResult          SaveDocumentAsFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType, rtl::OUString& rFileNamePath );
81 
82     DECL_LINK( DoneHdl, void* );
83 
84 public:
85     enum SendMailResult
86     {
87         SEND_MAIL_OK,
88         SEND_MAIL_CANCELLED,
89         SEND_MAIL_ERROR
90     };
91 
92     SfxMailModel_Impl();
93     ~SfxMailModel_Impl();
94 
95     void                AddAddress( const String& rAddress, AddressRole eRole );
96     void                SetFromAddress( const String& rAddress )    { maFromAddress = rAddress; }
97     void                SetSubject( const String& rSubject )        { maSubject = rSubject; }
98     void                SetPriority( MailPriority ePrio )           { mePriority = ePrio; }
99 
100     SendMailResult      Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType );
101 };
102 
103 sal_Bool CreateFromAddress_Impl( String& rFrom );
104 
105 #endif // INCLUDED_SFX_MAILMODEL_HXX
106