update emoji autocorrect entries from po-files
[LibreOffice.git] / include / sfx2 / mailmodelapi.hxx
blobcf8183d14ecdb0fa1bdd780c61eb1371616aab58
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/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>
27 #include <vector>
29 // class AddressList_Impl ------------------------------------------------
30 typedef ::std::vector< OUString > AddressList_Impl;
32 // class SfxMailModel_Impl -----------------------------------------------
34 class SFX2_DLLPUBLIC SfxMailModel
36 public:
37 enum MailPriority
39 PRIO_HIGHEST,
40 PRIO_HIGH,
41 PRIO_NORMAL,
42 PRIO_LOW,
43 PRIO_LOWEST
46 enum AddressRole
48 ROLE_TO,
49 ROLE_CC,
50 ROLE_BCC
53 enum MailDocType
55 TYPE_SELF,
56 TYPE_ASPDF
59 protected:
60 enum SaveResult
62 SAVE_SUCCESSFULL,
63 SAVE_CANCELLED,
64 SAVE_ERROR
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 );
72 private:
73 AddressList_Impl* mpToList;
74 AddressList_Impl* mpCcList;
75 AddressList_Impl* mpBccList;
76 OUString maFromAddress;
77 OUString maSubject;
78 MailPriority mePriority;
80 bool mbLoadDone;
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,
86 bool bModified,
87 sal_Int32& rNumArgs,
88 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
90 DECL_LINK( DoneHdl, void* );
92 public:
93 enum SendMailResult
95 SEND_MAIL_OK,
96 SEND_MAIL_CANCELLED,
97 SEND_MAIL_ERROR
100 SfxMailModel();
101 ~SfxMailModel();
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).
113 * \param xModel
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: */