LibreOffice Module sd (master) 1
View.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#pragma once
21
22#include <memory>
23#include <pres.hxx>
24#include <tools/gen.hxx>
25#include <vcl/transfer.hxx>
26#include <svx/fmview.hxx>
27#include <svx/svdpage.hxx>
28#include <vcl/idle.hxx>
29
30#include "smarttag.hxx"
31#include "fusearch.hxx"
32
33class SdDrawDocument;
34class SdPage;
35class SdrOle2Obj;
36class SdrGrafObj;
37class SdrMediaObj;
38class OutputDevice;
39class ImageMap;
40class Graphic;
41class SdrOutliner;
42
43namespace avmedia { class PlayerListener; }
44
45namespace sd {
46
47class DrawDocShell;
48class ViewShell;
49class Window;
50class ViewClipboard;
51
52//For master view we want to force that master
53//textboxes have readonly text, because the
54//text is the auto-generated click-here-to-edit
55//and it doesn't help to change it
57{
58private:
61public:
63 : m_pOutl(nullptr)
64 , m_bReadOnly(false)
65 {
66 }
67 void Start(SdrOutliner *pOutl);
68 void End();
69};
70
72{
73private:
75
76public:
78 {
79 return maFunctionSearch;
80 }
81
83 {
85 maFunctionSearch = xFunction;
86 }
87
89 {
90 if (maFunctionSearch.is())
91 maFunctionSearch->Dispose();
92 }
93};
94
95class SAL_DLLPUBLIC_RTTI View : public FmFormView
96{
97public:
98
99 View (
100 SdDrawDocument& rDrawDoc,
101 OutputDevice* pOutDev,
102 ViewShell* pViewSh=nullptr);
103 virtual ~View() override;
104
105 void CompleteRedraw( OutputDevice* pOutDev, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr) override;
106
107 virtual void GetAttributes( SfxItemSet& rTargetSet, bool bOnlyHardAttr = false ) const;
108 virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false, bool bSlide = false, bool bMaster = false);
109 virtual void MarkListHasChanged() override;
110 void SelectAll();
111 void DoCut();
112 void DoCopy();
113 void DoPaste(::sd::Window* pWindow=nullptr);
114 virtual void DoConnect(SdrOle2Obj* pOleObj) override;
115 virtual bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr = false);
116 void StartDrag( const Point& rStartPos, vcl::Window* pWindow );
117 virtual void DragFinished( sal_Int8 nDropAction );
118 virtual sal_Int8 AcceptDrop (
119 const AcceptDropEvent& rEvt,
120 DropTargetHelper& rTargetHelper,
121 SdrLayerID nLayer);
122 virtual sal_Int8 ExecuteDrop (
123 const ExecuteDropEvent& rEvt,
124 ::sd::Window* pTargetWindow,
125 sal_uInt16 nPage,
126 SdrLayerID nLayer);
127
128 css::uno::Reference<css::datatransfer::XTransferable>
129 CreateClipboardDataObject ();
130 css::uno::Reference<css::datatransfer::XTransferable>
131 CreateDragDataObject (::sd::View*, vcl::Window& rWindow,
132 const Point& rDragPos);
133 css::uno::Reference<css::datatransfer::XTransferable>
134 CreateSelectionDataObject (::sd::View*);
135
136 // update clipboard to what is selected
137 void UpdateSelectionClipboard();
138
139 // release content of clipboard, if we own the content
140 void ClearSelectionClipboard();
141
142 DrawDocShell* GetDocSh() const { return mpDocSh; }
143 inline SdDrawDocument& GetDoc() const;
144 ViewShell* GetViewShell() const { return mpViewSh; }
145 SfxViewShell* GetSfxViewShell() const override;
146
147 // Create a local UndoManager
148 std::unique_ptr<SdrUndoManager> createLocalTextUndoManager() override;
149
150 virtual bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = nullptr, vcl::Window* pWin = nullptr, bool bIsNewObj = false,
151 SdrOutliner* pGivenOutliner = nullptr, OutlinerView* pGivenOutlinerView = nullptr,
152 bool bDontDeleteOutliner = false, bool bOnlyOneView = false, bool bGrabFocus = true) override;
153
154 virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally = false) override;
155
156 bool RestoreDefaultText( SdrTextObj* pTextObj );
157
158 bool InsertData( const TransferableDataHelper& rDataHelper,
159 const Point& rPos, sal_Int8& rDnDAction, bool bDrag,
160 SotClipboardFormatId nFormat = SotClipboardFormatId::NONE,
161 sal_uInt16 nPage = SDRPAGE_NOTFOUND, SdrLayerID nLayer = SDRLAYER_NOTFOUND );
166 bool InsertMetaFile( const TransferableDataHelper& rDataHelper,
167 const Point& rInsertPos,
168 ImageMap const * pImageMap, bool bOptimize );
169 SdrGrafObj* InsertGraphic( const Graphic& rGraphic,
170 sal_Int8& rAction, const Point& rPos,
171 SdrObject* pSelectedObj, ImageMap const * pImageMap );
172 void InsertMediaURL( const OUString& rMediaURL, sal_Int8& rAction,
173 const Point& rPos, const Size& rSize,
174 bool const bLink );
175 SdrMediaObj* InsertMediaObj(const OUString& rURL, sal_Int8& rAction,
176 const Point& rPos, const Size& rSize );
177
178 bool PasteRTFTable( const ::tools::SvRef<SotTempStream>& xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions );
179
180 bool IsPresObjSelected(bool bOnPage = true, bool bOnMasterPage = true, bool bCheckPresObjListOnly = false, bool bCheckLayoutOnly = false) const;
181
182 void SetMarkedOriginalSize();
183
184 bool IsMorphingAllowed() const;
185 bool IsVectorizeAllowed() const;
186
187 virtual SfxStyleSheet* GetStyleSheet() const;
188
196 bool GetExchangeList( std::vector<OUString> &rExchangeList,
197 std::vector<OUString> &rBookmarkList,
198 const sal_uInt16 nType );
199
200 virtual void onAccessibilityOptionsChanged() override;
201
203 bool isRecordingUndo() const;
204
205 virtual void AddCustomHdl() override;
206
207 SmartTagSet& getSmartTags() { return maSmartTags; }
208 void updateHandles();
209
210 virtual SdrViewContext GetContext() const override;
211 virtual bool HasMarkablePoints() const override;
212 virtual sal_Int32 GetMarkablePointCount() const override;
213 virtual bool HasMarkedPoints() const override;
214 virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark=false) override;
215 virtual void CheckPossibilities() override;
216 virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark) override;
218
219 bool ShouldToggleOn(
220 const bool bBulletOnOffMode,
221 const bool bNormalBullet);
222
235 void ChangeMarkedObjectsBulletsNumbering(
236 const bool bToggle,
237 const bool bHandleBullets,
238 const SvxNumRule* pNumRule);
239
240 void SetPossibilitiesDirty() { m_bPossibilitiesDirty = true; }
241 void SetMoveAllowed( bool bSet ) { m_bMoveAllowed = bSet; }
242 void SetMoveProtected( bool bSet ) { m_bMoveProtect = bSet; }
243 void SetResizeFreeAllowed( bool bSet ) { m_bResizeFreeAllowed = bSet; }
244 void SetResizePropAllowed( bool bSet ) { m_bResizePropAllowed = bSet; }
245 void SetResizeProtected( bool bSet ) { m_bResizeProtect = bSet; }
246
247 SdrObject* GetEmptyPresentationObject( PresObjKind eKind );
248 SdPage* GetPage();
249 SdrObject* GetSelectedSingleObject(SdPage const * pPage);
250 void SetAuthor(const OUString& rAuthor) { m_sAuthor = rAuthor; }
251 const OUString& GetAuthor() const { return m_sAuthor; }
252
253 SearchContext& getSearchContext() { return maSearchContext; }
254protected:
255 DECL_DLLPRIVATE_LINK( OnParagraphInsertedHdl, ::Outliner::ParagraphHdlParam, void );
256 DECL_DLLPRIVATE_LINK( OnParagraphRemovingHdl, ::Outliner::ParagraphHdlParam, void );
257
258 virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfo ) override;
259 virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfo ) override;
260
264 std::unique_ptr<SdrMarkList> mpDragSrcMarkList;
266 std::unique_ptr<SdrDropMarkerOverlay> mpDropMarker;
267 sal_uInt16 mnDragSrcPgNum;
269 ::std::vector<OUString> maDropFileVector;
276
277 DECL_DLLPRIVATE_LINK( DropErrorHdl, Timer*, void );
278 DECL_DLLPRIVATE_LINK( DropInsertFileHdl, Timer*, void );
279 DECL_DLLPRIVATE_LINK( ExecuteNavigatorDrop, void*, void );
280
281 void ImplClearDrawDropMarker();
282
284
285private:
286 ::std::unique_ptr<ViewClipboard> mpClipboard;
289
290 OUString m_sAuthor;
291};
292
294{
295 return mrDoc;
296}
297
298} // end of namespace sd
299
300/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool MarkPoints(const tools::Rectangle *pRect, bool bUnmark)
SdrOutliner * m_pOutl
Definition: View.hxx:59
void Start(SdrOutliner *pOutl)
Definition: sdview.cxx:621
rtl::Reference< FuSearch > & getFunctionSearch()
Definition: View.hxx:77
void resetSearchFunction()
Definition: View.hxx:88
rtl::Reference< FuSearch > maFunctionSearch
Definition: View.hxx:74
void setSearchFunction(rtl::Reference< FuSearch > const &xFunction)
Definition: View.hxx:82
class to administrate the available smart tags for a single view.
Definition: smarttag.hxx:91
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
DrawDocShell * GetDocSh() const
Definition: View.hxx:142
rtl::Reference< avmedia::PlayerListener > mxDropMediaSizeListener
Definition: View.hxx:273
DECL_DLLPRIVATE_LINK(ExecuteNavigatorDrop, void *, void)
SdrObject * mpDropMarkerObj
Definition: View.hxx:265
void SetPossibilitiesDirty()
Definition: View.hxx:240
SearchContext maSearchContext
Definition: View.hxx:288
DrawDocShell * mpDocSh
Definition: View.hxx:262
ViewShell * GetViewShell() const
Definition: View.hxx:144
DECL_DLLPRIVATE_LINK(DropInsertFileHdl, Timer *, void)
sal_Int8 mnAction
Definition: View.hxx:270
sal_uInt16 mnLockRedrawSmph
Definition: View.hxx:274
const OUString & GetAuthor() const
Definition: View.hxx:251
::std::unique_ptr< ViewClipboard > mpClipboard
Definition: View.hxx:286
ViewShell * mpViewSh
Definition: View.hxx:263
void SetAuthor(const OUString &rAuthor)
Definition: View.hxx:250
bool mbIsDropAllowed
Definition: View.hxx:275
std::unique_ptr< SdrMarkList > mpDragSrcMarkList
Definition: View.hxx:264
void SetResizeFreeAllowed(bool bSet)
Definition: View.hxx:243
void SetResizePropAllowed(bool bSet)
Definition: View.hxx:244
void SetMoveProtected(bool bSet)
Definition: View.hxx:242
SearchContext & getSearchContext()
Definition: View.hxx:253
DECL_DLLPRIVATE_LINK(OnParagraphInsertedHdl, ::Outliner::ParagraphHdlParam, void)
void SetMoveAllowed(bool bSet)
Definition: View.hxx:241
DECL_DLLPRIVATE_LINK(OnParagraphRemovingHdl, ::Outliner::ParagraphHdlParam, void)
DECL_DLLPRIVATE_LINK(DropErrorHdl, Timer *, void)
std::unique_ptr< SdrDropMarkerOverlay > mpDropMarker
Definition: View.hxx:266
SdDrawDocument & mrDoc
Definition: View.hxx:261
sal_uInt16 mnDragSrcPgNum
Definition: View.hxx:267
::std::vector< OUString > maDropFileVector
Definition: View.hxx:269
Point maDropPos
Definition: View.hxx:268
OutlinerMasterViewFilter maMasterViewFilter
Definition: View.hxx:287
SmartTagSet & getSmartTags()
Definition: View.hxx:207
Idle maDropErrorIdle
Definition: View.hxx:271
void SetResizeProtected(bool bSet)
Definition: View.hxx:245
SdDrawDocument & GetDoc() const
Definition: View.hxx:293
OUString m_sAuthor
Definition: View.hxx:290
SmartTagSet maSmartTags
Definition: View.hxx:283
Idle maDropInsertFileIdle
Definition: View.hxx:272
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
SotClipboardFormatId
PresObjKind
Definition: pres.hxx:22
static SfxItemSet & rSet
SdrInsertFlags
SdrEndTextEditKind
SdrViewContext
signed char sal_Int8