LibreOffice Module sw (master) 1
unomailmerge.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_UNOMAILMERGE_HXX
21#define INCLUDED_SW_SOURCE_UIBASE_INC_UNOMAILMERGE_HXX
22
27
28#include <com/sun/star/task/XJob.hpp>
29#include <com/sun/star/beans/XPropertySet.hpp>
30#include <com/sun/star/lang/XComponent.hpp>
31#include <com/sun/star/lang/XServiceInfo.hpp>
32#include <com/sun/star/beans/PropertyChangeEvent.hpp>
33#include <com/sun/star/text/XMailMergeBroadcaster.hpp>
34#include <com/sun/star/util/XCancellable.hpp>
35#include <svl/itemprop.hxx>
36#include <sfx2/objsh.hxx>
37
38namespace com::sun::star {
39
40 namespace sdbc {
41 class XResultSet;
42 class XConnection;
43 }
44 namespace frame {
45 class XModel;
46 }
47 namespace lang {
48 class XMultiServiceFactory;
49 }
50 namespace text {
51 class XMailMergeListener;
52 struct MailMergeEvent;
53 }
54 namespace beans{
55 struct PropertyValue;
56 }
57
58}
59
62
63class SwDBManager;
65
70class SwXMailMerge final :
71 public cppu::WeakImplHelper
72 <
73 css::task::XJob,
74 css::util::XCancellable,
75 css::beans::XPropertySet,
76 css::text::XMailMergeBroadcaster,
77 css::lang::XComponent,
78 css::lang::XServiceInfo
79 >
80{
82
86
88
89 SfxObjectShellRef m_xDocSh; // the document
90
92
93 // properties of mail merge service
94 css::uno::Sequence< css::uno::Any > m_aSelection;
95 css::uno::Reference< css::sdbc::XResultSet > m_xResultSet;
96 css::uno::Reference< css::sdbc::XConnection > m_xConnection;
97 css::uno::Reference< css::frame::XModel > m_xModel;
100 OUString m_aFilter;
102 OUString m_aOutputURL;
105 sal_Int16 m_nOutputType;
109
112 OUString m_sSubject;
114 OUString m_sMailBody;
117 css::uno::Sequence< OUString > m_aCopiesTo;
118 css::uno::Sequence< OUString > m_aBlindCopiesTo;
121
122 css::uno::Sequence< css::beans::PropertyValue > m_aPrintSettings;
123
127 css::uno::Sequence< css::beans::PropertyValue > m_aSaveFilterData;
128
131
132 void launchEvent( const css::beans::PropertyChangeEvent &rEvt ) const;
133
134 SwXMailMerge( const SwXMailMerge & ) = delete;
135 SwXMailMerge & operator = ( const SwXMailMerge & ) = delete;
136
137 virtual ~SwXMailMerge() override;
138public:
139 SwXMailMerge();
140
141 void LaunchMailMergeEvent( const css::text::MailMergeEvent &rData ) const;
142
143 // XJob
144 virtual css::uno::Any SAL_CALL execute( const css::uno::Sequence< css::beans::NamedValue >& Arguments ) override;
145
146 // XCancellable
147 virtual void SAL_CALL cancel() override;
148
149 // XPropertySet
150 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
151 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
152 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
153 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
154 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
155 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
156 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
157
158 // XMailMergeBroadcaster
159 virtual void SAL_CALL addMailMergeEventListener( const css::uno::Reference< css::text::XMailMergeListener >& xListener ) override;
160 virtual void SAL_CALL removeMailMergeEventListener( const css::uno::Reference< css::text::XMailMergeListener >& xListener ) override;
161
162 // XComponent
163 virtual void SAL_CALL dispose( ) override;
164 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
165 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
166
167 // XServiceInfo
168 virtual OUString SAL_CALL getImplementationName( ) override;
169 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
170 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
171};
172
173#endif
174
175/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Gives UNO access to the global mail merge functionality, via the com.sun.star.text....
css::uno::Reference< css::frame::XModel > m_xModel
void LaunchMailMergeEvent(const css::text::MailMergeEvent &rData) const
OUString m_aOutputURL
SwXMailMerge & operator=(const SwXMailMerge &)=delete
SfxObjectShellRef m_xDocSh
OUString m_aFileNamePrefix
OUString m_sAttachmentName
OUString m_sAttachmentFilter
virtual void SAL_CALL addMailMergeEventListener(const css::uno::Reference< css::text::XMailMergeListener > &xListener) override
sal_Int32 m_nDataCommandType
bool m_bSinglePrintJobs
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString m_aDataSourceName
bool m_bSendAsAttachment
virtual void SAL_CALL removeMailMergeEventListener(const css::uno::Reference< css::text::XMailMergeListener > &xListener) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
css::uno::Sequence< OUString > m_aBlindCopiesTo
virtual void SAL_CALL dispose() override
css::uno::Sequence< css::beans::PropertyValue > m_aPrintSettings
css::uno::Sequence< css::uno::Any > m_aSelection
virtual ~SwXMailMerge() override
SwDBManager * m_pMgr
bool m_bSaveAsSingleFile
css::uno::Reference< css::sdbc::XResultSet > m_xResultSet
OUString m_aDataCommand
void launchEvent(const css::beans::PropertyChangeEvent &rEvt) const
OUString m_sSubject
css::uno::Reference< css::sdbc::XConnection > m_xConnection
bool m_bFileNameFromColumn
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
OUString m_aFilter
css::uno::Sequence< css::beans::PropertyValue > m_aSaveFilterData
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
OUString m_sOutServerPassword
comphelper::OInterfaceContainerHelper2 m_aMergeListeners
virtual OUString SAL_CALL getImplementationName() override
OPropertyListenerContainerHelper m_aPropListeners
OUString m_aTmpFileName
css::uno::Sequence< OUString > m_aCopiesTo
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
bool m_bEscapeProcessing
virtual void SAL_CALL cancel() override
OUString m_sSaveFilterOptions
comphelper::OInterfaceContainerHelper3< css::lang::XEventListener > m_aEvtListeners
SwXMailMerge(const SwXMailMerge &)=delete
sal_Int16 m_nOutputType
const SfxItemPropertySet * m_pPropSet
OUString m_sAddressFromColumn
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
OUString m_sMailBody
virtual css::uno::Any SAL_CALL execute(const css::uno::Sequence< css::beans::NamedValue > &Arguments) override
OUString m_aDocumentURL
OUString m_sSaveFilter
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
OUString m_sInServerPassword
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
def text(shape, orig_st)
unsigned char sal_Bool
comphelper::OMultiTypeInterfaceContainerHelperVar3< css::beans::XPropertyChangeListener, sal_Int32 > OPropertyListenerContainerHelper