LibreOffice Module sw (master) 1
uivwimp.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#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_UIVWIMP_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_UIVWIMP_HXX
21
22#include <view.hxx>
23
24#include <sfx2/objsh.hxx>
25#include <com/sun/star/view/XSelectionSupplier.hpp>
26#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
29
30class SwXTextView;
31class SfxRequest;
32class SwTransferable;
33class SfxRequest;
34
35namespace sfx2 { class DocumentInserter; }
36namespace com::sun::star {
37 namespace frame {
38 class XDispatchProviderInterceptor;
39 }
40 namespace lang {
41 class XUnoTunnel;
42 }
43}
44
45class SwScannerEventListener final : public ::cppu::WeakImplHelper<
46 css::lang::XEventListener >
47{
49
50public:
51
52 SwScannerEventListener( SwView& rView ) : m_pView( &rView ) {}
53 virtual ~SwScannerEventListener() override;
54
55 // XEventListener
56 virtual void SAL_CALL disposing(
57 const css::lang::EventObject& rEventObject ) override;
58
59 void ViewDestroyed() { m_pView = nullptr; }
60};
61
62// Clipboard EventListener
63class SwClipboardChangeListener final : public ::cppu::WeakImplHelper<
64 css::datatransfer::clipboard::XClipboardListener >
65{
67
68 // XEventListener
69 virtual void SAL_CALL disposing( const css::lang::EventObject& rEventObject ) override;
70
71 // XClipboardListener
72 virtual void SAL_CALL changedContents( const css::datatransfer::clipboard::ClipboardEvent& rEventObject ) override;
73
74public:
75 SwClipboardChangeListener( SwView& rView ) : m_pView( &rView ) {}
76 virtual ~SwClipboardChangeListener() override;
77
78 void ViewDestroyed() { m_pView = nullptr; }
79
80 void AddRemoveListener( bool bAdd );
81};
82
84
86{
87 css::uno::Reference< css::frame::XDispatchProviderInterceptor > m_xDispatchProviderInterceptor;
88 css::uno::Reference< css::view::XSelectionSupplier > mxXTextView; // UNO object
89 std::vector< css::uno::WeakReference< css::lang::XUnoTunnel > > mxTransferables;
90
91 // temporary document for printing text of selection / multi selection
92 // in PDF export.
94
101
102 std::shared_ptr<SwMailMergeConfigItem>
104
105 std::unique_ptr<sfx2::DocumentInserter> m_pDocInserter;
106 std::unique_ptr<SfxRequest> m_pRequest;
107 sal_Int16 m_nParam;
108
112
113public:
116
117 SwView_Impl(SwView* pShell);
118 ~SwView_Impl();
119
120 void SetShellMode(ShellMode eSet);
121
122 css::view::XSelectionSupplier* GetUNOObject();
124 void Invalidate();
125
127
128 void ExecuteScan(SfxRequest& rReq);
130
132
133 void AddTransferable(SwTransferable& rTransferable);
134
135 void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem> const & rItem)
136 {
137 m_xConfigItem = rItem;
138 }
139 std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const {return m_xConfigItem;}
140
141 //#i33307# restore editing position
142 void SetRestorePosition(const Point& rCursorPos, bool bSelectObj)
143 {
144 m_aEditingPosition = rCursorPos;
145 m_bSelectObject = bSelectObj;
147 }
148 bool GetRestorePosition(Point& rCursorPos, bool& rbSelectObj)
149 {
150 rCursorPos = m_aEditingPosition;
151 rbSelectObj = m_bSelectObject;
153 }
154
156 const OUString& rFactory,
157 const Link<sfx2::FileDialogHelper*,void>& rEndDialogHdl,
158 const sal_uInt16 nSlotId
159 );
160 std::unique_ptr<SfxMedium> CreateMedium();
161 void InitRequest( const SfxRequest& rRequest );
162
163 SfxRequest* GetRequest() const { return m_pRequest.get(); }
164 sal_Int16 GetParam() const { return m_nParam; }
165 void SetParam( sal_Int16 nParam ) { m_nParam = nParam; }
166};
167#endif
168
169/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~SwClipboardChangeListener() override
Definition: uivwimp.cxx:284
virtual void SAL_CALL disposing(const css::lang::EventObject &rEventObject) override
Definition: uivwimp.cxx:288
SwClipboardChangeListener(SwView &rView)
Definition: uivwimp.hxx:75
virtual void SAL_CALL changedContents(const css::datatransfer::clipboard::ClipboardEvent &rEventObject) override
Definition: uivwimp.cxx:294
void AddRemoveListener(bool bAdd)
Definition: uivwimp.cxx:319
virtual ~SwScannerEventListener() override
Definition: uivwimp.cxx:271
SwScannerEventListener(SwView &rView)
Definition: uivwimp.hxx:52
virtual void SAL_CALL disposing(const css::lang::EventObject &rEventObject) override
Definition: uivwimp.cxx:275
ShellMode m_eShellMode
Definition: uivwimp.hxx:100
~SwView_Impl()
Definition: uivwimp.cxx:62
rtl::Reference< SwScannerEventListener > mxScanEvtLstnr
Definition: uivwimp.hxx:97
void SetShellMode(ShellMode eSet)
Definition: uivwimp.cxx:84
std::unique_ptr< SfxRequest > m_pRequest
Definition: uivwimp.hxx:106
std::shared_ptr< SwMailMergeConfigItem > const & GetMailMergeConfigItem() const
Definition: uivwimp.hxx:139
SfxObjectShellLock m_xTmpSelDocShell
Definition: uivwimp.hxx:93
css::view::XSelectionSupplier * GetUNOObject()
Definition: uivwimp.cxx:89
OUString m_sRedlineAuthor
Redline author that's specific to this view.
Definition: uivwimp.hxx:115
SwView * m_pView
Definition: uivwimp.hxx:95
void SetMailMergeConfigItem(std::shared_ptr< SwMailMergeConfigItem > const &rItem)
Definition: uivwimp.hxx:135
sal_Int16 m_nParam
Definition: uivwimp.hxx:107
bool GetRestorePosition(Point &rCursorPos, bool &rbSelectObj)
Definition: uivwimp.hxx:148
SwView_Impl(SwView *pShell)
Definition: uivwimp.cxx:51
void StartDocumentInserter(const OUString &rFactory, const Link< sfx2::FileDialogHelper *, void > &rEndDialogHdl, const sal_uInt16 nSlotId)
Definition: uivwimp.cxx:238
void AddTransferable(SwTransferable &rTransferable)
Definition: uivwimp.cxx:221
void AddClipboardListener()
Definition: uivwimp.cxx:201
std::vector< css::uno::WeakReference< css::lang::XUnoTunnel > > mxTransferables
Definition: uivwimp.hxx:89
Point m_aEditingPosition
Definition: uivwimp.hxx:109
void SetParam(sal_Int16 nParam)
Definition: uivwimp.hxx:165
SwXTextView * GetUNOObject_Impl()
Definition: uivwimp.cxx:94
std::unique_ptr< sfx2::DocumentInserter > m_pDocInserter
Definition: uivwimp.hxx:105
void SetRestorePosition(const Point &rCursorPos, bool bSelectObj)
Definition: uivwimp.hxx:142
void InitRequest(const SfxRequest &rRequest)
Definition: uivwimp.cxx:266
SwScannerEventListener & GetScannerEventListener()
Definition: uivwimp.cxx:194
ShellMode GetShellMode() const
Definition: uivwimp.hxx:126
void ExecuteScan(SfxRequest &rReq)
Definition: uivwimp.cxx:100
css::uno::Reference< css::view::XSelectionSupplier > mxXTextView
Definition: uivwimp.hxx:88
css::uno::Reference< css::frame::XDispatchProviderInterceptor > m_xDispatchProviderInterceptor
Definition: uivwimp.hxx:87
std::unique_ptr< SfxMedium > CreateMedium()
Definition: uivwimp.cxx:261
std::shared_ptr< SwMailMergeConfigItem > m_xConfigItem
Definition: uivwimp.hxx:103
rtl::Reference< SwClipboardChangeListener > mxClipEvtLstnr
Definition: uivwimp.hxx:99
SfxRequest * GetRequest() const
Definition: uivwimp.hxx:163
bool m_bSelectObject
Definition: uivwimp.hxx:110
bool m_bEditingPositionSet
Definition: uivwimp.hxx:111
sal_Int16 GetParam() const
Definition: uivwimp.hxx:164
void Invalidate()
Definition: uivwimp.cxx:210
Definition: view.hxx:146
ShellMode
Definition: view.hxx:87