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 
23 #include <cppuhelper/implbase.hxx>
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 
38 namespace 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 
63 class SwDBManager;
65 
66 class SwXMailMerge final :
67  public cppu::WeakImplHelper
68  <
69  css::task::XJob,
70  css::util::XCancellable,
71  css::beans::XPropertySet,
72  css::text::XMailMergeBroadcaster,
73  css::lang::XComponent,
74  css::lang::XServiceInfo
75  >
76 {
78 
82 
84 
85  SfxObjectShellRef m_xDocSh; // the document
86 
87  OUString m_aTmpFileName;
88 
89  // properties of mail merge service
90  css::uno::Sequence< css::uno::Any > m_aSelection;
91  css::uno::Reference< css::sdbc::XResultSet > m_xResultSet;
92  css::uno::Reference< css::sdbc::XConnection > m_xConnection;
93  css::uno::Reference< css::frame::XModel > m_xModel;
95  OUString m_aDataCommand;
96  OUString m_aFilter;
97  OUString m_aDocumentURL;
98  OUString m_aOutputURL;
101  sal_Int16 m_nOutputType;
105 
108  OUString m_sSubject;
110  OUString m_sMailBody;
113  css::uno::Sequence< OUString > m_aCopiesTo;
114  css::uno::Sequence< OUString > m_aBlindCopiesTo;
117 
118  css::uno::Sequence< css::beans::PropertyValue > m_aPrintSettings;
119 
121  OUString m_sSaveFilter;
123  css::uno::Sequence< css::beans::PropertyValue > m_aSaveFilterData;
124 
127 
128  void launchEvent( const css::beans::PropertyChangeEvent &rEvt ) const;
129 
130  SwXMailMerge( const SwXMailMerge & ) = delete;
131  SwXMailMerge & operator = ( const SwXMailMerge & ) = delete;
132 
133  virtual ~SwXMailMerge() override;
134 public:
135  SwXMailMerge();
136 
137  void LaunchMailMergeEvent( const css::text::MailMergeEvent &rData ) const;
138 
139  // XJob
140  virtual css::uno::Any SAL_CALL execute( const css::uno::Sequence< css::beans::NamedValue >& Arguments ) override;
141 
142  // XCancellable
143  virtual void SAL_CALL cancel() override;
144 
145  // XPropertySet
146  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
147  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
148  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
149  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
150  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
151  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
152  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
153 
154  // XMailMergeBroadcaster
155  virtual void SAL_CALL addMailMergeEventListener( const css::uno::Reference< css::text::XMailMergeListener >& xListener ) override;
156  virtual void SAL_CALL removeMailMergeEventListener( const css::uno::Reference< css::text::XMailMergeListener >& xListener ) override;
157 
158  // XComponent
159  virtual void SAL_CALL dispose( ) override;
160  virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
161  virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
162 
163  // XServiceInfo
164  virtual OUString SAL_CALL getImplementationName( ) override;
165  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
166  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
167 };
168 
169 #endif
170 
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString m_aDocumentURL
virtual void SAL_CALL removeMailMergeEventListener(const css::uno::Reference< css::text::XMailMergeListener > &xListener) override
exports com.sun.star. sdbc
OUString m_sAttachmentName
SwXMailMerge & operator=(const SwXMailMerge &)=delete
OUString m_sOutServerPassword
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
const SfxItemPropertySet * m_pPropSet
OUString m_sSaveFilter
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString m_sAddressFromColumn
sal_Int16 m_nOutputType
OUString m_sMailBody
virtual css::uno::Any SAL_CALL execute(const css::uno::Sequence< css::beans::NamedValue > &Arguments) override
css::uno::Reference< css::frame::XModel > m_xModel
virtual ~SwXMailMerge() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
OUString m_sAttachmentFilter
bool m_bSendAsAttachment
exports com.sun.star. frame
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
void launchEvent(const css::beans::PropertyChangeEvent &rEvt) const
virtual void SAL_CALL addMailMergeEventListener(const css::uno::Reference< css::text::XMailMergeListener > &xListener) override
css::uno::Sequence< css::beans::PropertyValue > m_aSaveFilterData
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
css::uno::Reference< css::sdbc::XConnection > m_xConnection
OUString m_sSubject
exports com.sun.star. text
sal_Int32 m_nDataCommandType
OUString m_aFileNamePrefix
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
OUString m_aDataSourceName
OUString m_aOutputURL
unsigned char sal_Bool
SfxObjectShellRef m_xDocSh
void LaunchMailMergeEvent(const css::text::MailMergeEvent &rData) const
bool m_bEscapeProcessing
virtual void SAL_CALL dispose() override
css::uno::Sequence< OUString > m_aCopiesTo
css::uno::Sequence< css::beans::PropertyValue > m_aPrintSettings
exports com.sun.star. beans
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
OUString m_sInServerPassword
exports com.sun.star. lang
bool m_bSinglePrintJobs
OUString m_sSaveFilterOptions
comphelper::OInterfaceContainerHelper2 m_aMergeListeners
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
css::uno::Sequence< OUString > m_aBlindCopiesTo
OUString m_aDataCommand
OUString m_aTmpFileName
OUString m_aFilter
OPropertyListenerContainerHelper m_aPropListeners
virtual void SAL_CALL cancel() override
bool m_bSaveAsSingleFile
comphelper::OMultiTypeInterfaceContainerHelperVar2< sal_Int32 > OPropertyListenerContainerHelper
css::uno::Reference< css::sdbc::XResultSet > m_xResultSet
css::uno::Sequence< css::uno::Any > m_aSelection
comphelper::OInterfaceContainerHelper2 m_aEvtListeners
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
bool m_bFileNameFromColumn
SwDBManager * m_pMgr