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/uno/Reference.hxx>
23 #include <rtl/ustring.hxx>
24 #include <sfx2/dllapi.h>
26 #include <string_view>
29 namespace com::sun::star::beans
{ struct PropertyValue
; }
30 namespace com::sun::star::frame
{ class XFrame
; }
31 namespace com::sun::star::frame
{ class XModel
; }
32 namespace com::sun::star::lang
{ class XMultiServiceFactory
; }
33 namespace com::sun::star::uno
{ class XInterface
; }
34 namespace com::sun::star::uno
{ template <class E
> class Sequence
; }
36 // class AddressList_Impl ------------------------------------------------
37 typedef ::std::vector
< OUString
> AddressList_Impl
;
39 // class SfxMailModel_Impl -----------------------------------------------
41 class SFX2_DLLPUBLIC SfxMailModel
50 ::std::vector
< OUString
> maAttachedDocuments
;
51 static SaveResult
SaveDocumentAsFormat( const OUString
& aSaveFileName
,
52 const css::uno::Reference
< css::uno::XInterface
>& xFrameOrModel
,
53 const OUString
& rType
,
54 OUString
& rFileNamePath
);
57 std::unique_ptr
<AddressList_Impl
> mpToList
;
58 OUString maFromAddress
;
60 static SaveResult
ShowFilterOptionsDialog( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xSMGR
,
61 const css::uno::Reference
< css::frame::XModel
>& xModel
,
62 const OUString
& rFilterName
,
63 std::u16string_view rType
,
66 css::uno::Sequence
< css::beans::PropertyValue
>& rArgs
);
79 void AddToAddress( const OUString
& rAddress
);
81 /** attaches a document to the current attachment list, can be called more than once.
82 * at the moment there will be a dialog for export executed for every model which is going to be attached.
85 The current model to attach
86 * \param sAttachmentTitle
87 The title which will be used as attachment title
88 * \return @see error code
90 SendMailResult
AttachDocument( const css::uno::Reference
< css::uno::XInterface
>& xFrameOrModel
,
91 const OUString
& sAttachmentTitle
);
93 SendMailResult
SaveAndSend( const css::uno::Reference
< css::frame::XFrame
>& xFrame
,
94 const OUString
& rType
);
95 SendMailResult
Send( const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
100 bool CreateFromAddress_Impl( OUString
& rFrom
);
102 #endif // INCLUDED_SFX2_MAILMODELAPI_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */