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_SFX_MAILMODEL_HXX
20 #define INCLUDED_SFX_MAILMODEL_HXX
23 #include <com/sun/star/frame/XFrame.hpp>
24 #include <com/sun/star/frame/XModel.hpp>
25 #include "tools/link.hxx"
26 #include <tools/string.hxx>
27 #include "sfx2/dllapi.h"
29 // class AddressList_Impl ------------------------------------------------
30 typedef String
* AddressItemPtr_Impl
;
31 typedef ::std::vector
< AddressItemPtr_Impl
> AddressList_Impl
;
33 // class SfxMailModel_Impl -----------------------------------------------
35 class SFX2_DLLPUBLIC SfxMailModel
67 ::std::vector
< OUString
> maAttachedDocuments
;
68 SaveResult
SaveDocumentAsFormat( const OUString
& aSaveFileName
,
69 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xFrameOrModel
,
70 const OUString
& rType
,
71 OUString
& rFileNamePath
);
74 AddressList_Impl
* mpToList
;
75 AddressList_Impl
* mpCcList
;
76 AddressList_Impl
* mpBccList
;
79 MailPriority mePriority
;
83 void ClearList( AddressList_Impl
* pList
);
84 SaveResult
ShowFilterOptionsDialog( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> xSMGR
,
85 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> xModel
,
86 const OUString
& rFilterName
,
87 const OUString
& rType
,
90 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rArgs
);
92 DECL_LINK( DoneHdl
, void* );
105 void AddAddress( const String
& rAddress
, AddressRole eRole
);
106 void SetFromAddress( const String
& rAddress
) { maFromAddress
= rAddress
; }
107 void SetSubject( const String
& rSubject
) { maSubject
= rSubject
; }
108 void SetPriority( MailPriority ePrio
) { mePriority
= ePrio
; }
110 /** attaches a document to the current attachment list, can be called more than once.
111 * at the moment there will be a dialog for export executed for every model which is going to be attached.
113 * \param sDocumentType
114 The doc type to export. PDF will be at the moment only a direct export (no dialog).
116 The current model to attach
117 * \param sAttachmentTitle
118 The title which will be used as attachment title
119 * \return @see error code
121 SendMailResult
AttachDocument( const OUString
& sDocumentType
,
122 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xFrameOrModel
,
123 const OUString
& sAttachmentTitle
);
125 SendMailResult
SaveAndSend( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& xFrame
,
126 const OUString
& rType
);
127 SendMailResult
Send( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& xFrame
);
129 sal_Bool
IsEmpty() const;
132 sal_Bool
CreateFromAddress_Impl( String
& rFrom
);
134 #endif // INCLUDED_SFX_MAILMODEL_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */