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