sc: filter: rtf: add method "AddFont"
[LibreOffice.git] / include / sfx2 / mailmodelapi.hxx
blob47d5b408659fe1b289be5b96a2eb0c3c25143339
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
25 #include <vector>
26 #include <string_view>
27 #include <memory>
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
43 protected:
44 enum SaveResult
46 SAVE_SUCCESSFUL,
47 SAVE_CANCELLED,
48 SAVE_ERROR
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 );
56 private:
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,
64 bool bModified,
65 sal_Int32& rNumArgs,
66 css::uno::Sequence< css::beans::PropertyValue >& rArgs );
68 public:
69 enum SendMailResult
71 SEND_MAIL_OK,
72 SEND_MAIL_CANCELLED,
73 SEND_MAIL_ERROR
76 SfxMailModel();
77 ~SfxMailModel();
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.
84 * \param xModel
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 );
97 bool IsEmpty() const;
100 bool CreateFromAddress_Impl( OUString& rFrom );
102 #endif // INCLUDED_SFX2_MAILMODELAPI_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */