1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SFX2_MAILMODELAPI_HXX
20 #define INCLUDED_SFX2_MAILMODELAPI_HXX
22 #include <com/sun/star/frame/XFrame.hpp>
23 #include <com/sun/star/frame/XModel.hpp>
24 #include <rtl/ustring.hxx>
25 #include <sfx2/dllapi.h>
26 #include <tools/link.hxx>
29 // class AddressList_Impl ------------------------------------------------
30 typedef ::std::vector
< OUString
> AddressList_Impl
;
32 // class SfxMailModel_Impl -----------------------------------------------
34 class SFX2_DLLPUBLIC SfxMailModel
66 ::std::vector
< OUString
> maAttachedDocuments
;
67 static SaveResult
SaveDocumentAsFormat( const OUString
& aSaveFileName
,
68 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xFrameOrModel
,
69 const OUString
& rType
,
70 OUString
& rFileNamePath
);
73 AddressList_Impl
* mpToList
;
74 AddressList_Impl
* mpCcList
;
75 AddressList_Impl
* mpBccList
;
76 OUString maFromAddress
;
78 MailPriority mePriority
;
82 static SaveResult
ShowFilterOptionsDialog( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> xSMGR
,
83 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> xModel
,
84 const OUString
& rFilterName
,
85 const OUString
& rType
,
88 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rArgs
);
90 DECL_LINK( DoneHdl
, void* );
103 void AddAddress( const OUString
& rAddress
, AddressRole eRole
);
104 void SetFromAddress( const OUString
& rAddress
) { maFromAddress
= rAddress
; }
105 void SetSubject( const OUString
& rSubject
) { maSubject
= rSubject
; }
106 void SetPriority( MailPriority ePrio
) { mePriority
= ePrio
; }
108 /** attaches a document to the current attachment list, can be called more than once.
109 * at the moment there will be a dialog for export executed for every model which is going to be attached.
111 * \param sDocumentType
112 The doc type to export. PDF will be at the moment only a direct export (no dialog).
114 The current model to attach
115 * \param sAttachmentTitle
116 The title which will be used as attachment title
117 * \return @see error code
119 SendMailResult
AttachDocument( const OUString
& sDocumentType
,
120 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xFrameOrModel
,
121 const OUString
& sAttachmentTitle
);
123 SendMailResult
SaveAndSend( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& xFrame
,
124 const OUString
& rType
);
125 SendMailResult
Send( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& xFrame
);
127 bool IsEmpty() const;
130 bool CreateFromAddress_Impl( OUString
& rFrom
);
132 #endif // INCLUDED_SFX2_MAILMODELAPI_HXX
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */