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 <com/sun/star/lang/XMultiServiceFactory.hpp>
25 #include <rtl/ustring.hxx>
26 #include <sfx2/dllapi.h>
27 #include <tools/link.hxx>
30 // class AddressList_Impl ------------------------------------------------
31 typedef ::std::vector
< OUString
> AddressList_Impl
;
33 // class SfxMailModel_Impl -----------------------------------------------
35 class SFX2_DLLPUBLIC SfxMailModel
67 ::std::vector
< OUString
> maAttachedDocuments
;
68 static SaveResult
SaveDocumentAsFormat( const OUString
& aSaveFileName
,
69 const css::uno::Reference
< css::uno::XInterface
>& xFrameOrModel
,
70 const OUString
& rType
,
71 OUString
& rFileNamePath
);
74 AddressList_Impl
* mpToList
;
75 AddressList_Impl
* mpCcList
;
76 AddressList_Impl
* mpBccList
;
77 OUString maFromAddress
;
80 static SaveResult
ShowFilterOptionsDialog( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xSMGR
,
81 const css::uno::Reference
< css::frame::XModel
>& xModel
,
82 const OUString
& rFilterName
,
83 const OUString
& rType
,
86 css::uno::Sequence
< css::beans::PropertyValue
>& rArgs
);
99 void AddAddress( const OUString
& rAddress
, AddressRole eRole
);
100 void SetSubject( const OUString
& rSubject
) { maSubject
= rSubject
; }
102 /** attaches a document to the current attachment list, can be called more than once.
103 * at the moment there will be a dialog for export executed for every model which is going to be attached.
105 * \param sDocumentType
106 The doc type to export. PDF will be at the moment only a direct export (no dialog).
108 The current model to attach
109 * \param sAttachmentTitle
110 The title which will be used as attachment title
111 * \return @see error code
113 SendMailResult
AttachDocument( const OUString
& sDocumentType
,
114 const css::uno::Reference
< css::uno::XInterface
>& xFrameOrModel
,
115 const OUString
& sAttachmentTitle
);
117 SendMailResult
SaveAndSend( const css::uno::Reference
< css::frame::XFrame
>& xFrame
,
118 const OUString
& rType
);
119 SendMailResult
Send( const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
121 bool IsEmpty() const;
124 bool CreateFromAddress_Impl( OUString
& rFrom
);
126 #endif // INCLUDED_SFX2_MAILMODELAPI_HXX
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */