LibreOffice Module sd (master) 1
drviews5.cxx
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#include <DrawViewShell.hxx>
21#include <editeng/outliner.hxx>
22#include <svx/svxids.hrc>
23#include <sfx2/request.hxx>
24#include <sfx2/dispatch.hxx>
25#include <svx/svdpagv.hxx>
26#include <svx/svdoutl.hxx>
27
28#include <vcl/settings.hxx>
29#include <vcl/svapp.hxx>
30#include <sdcommands.h>
31#include <sal/log.hxx>
32
33#include <svx/fmshell.hxx>
34#include <editeng/eeitem.hxx>
36
37#include <sfx2/viewfrm.hxx>
38#include <LayerTabBar.hxx>
39
40#include <app.hrc>
41#include <helpids.h>
42#include <optsitem.hxx>
43#include <sdmod.hxx>
44#include <FrameView.hxx>
45#include <Window.hxx>
46#include <drawview.hxx>
47#include <drawdoc.hxx>
48#include <DrawDocShell.hxx>
49#include <Client.hxx>
50#include <slideshow.hxx>
51#include <unokywds.hxx>
52#include <sdpage.hxx>
53#include <SdUnoDrawView.hxx>
54#include <ViewShellBase.hxx>
55#include <FormShellManager.hxx>
56#include <DrawController.hxx>
57#include <memory>
58#include <comphelper/lok.hxx>
59
60namespace sd {
61
63{
64 Invalidate();
65 // that the navigator also gets an up to date state
66 GetViewFrame()->GetBindings().Invalidate( SID_NAVIGATOR_STATE, true );
67
68 SfxBoolItem aItem( SID_3D_STATE, true );
70 SID_3D_STATE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
71
72 // now initialize the TextEditOutliner which was newly created by the draw engine
73 ::Outliner* pOutliner = mpDrawView->GetTextEditOutliner();
74 if (pOutliner)
75 {
76 SfxStyleSheetPool* pSPool = static_cast<SfxStyleSheetPool*>( GetDocSh()->GetStyleSheetPool() );
77 pOutliner->SetStyleSheetPool(pSPool);
78 }
79}
80
82{
84
85 // tdf#151621 Do not set if the embedded object is opening in a new window.
86 if (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED
87 && GetDocSh()->IsInPlaceActive())
88 {
89 SetZoomRect(GetDocSh()->GetVisArea(ASPECT_CONTENT));
90 }
91
93 if( xSlideshow.is() && xSlideshow->isRunning() && !xSlideshow->isFullScreen() )
94 {
95 xSlideshow->resize(maViewSize);
96 }
97}
98
100{
101 // Retrieve the current size (thickness) of the scroll bars. That is
102 // the width of the vertical and the height of the horizontal scroll
103 // bar.
104 int nScrollBarSize = GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize();
105 maScrBarWH = Size (nScrollBarSize, nScrollBarSize);
106
108
109 maTabControl->Hide();
110
111 OSL_ASSERT (GetViewShell()!=nullptr);
112 Client* pIPClient = static_cast<Client*>(GetViewShell()->GetIPClient());
113 bool bClientActive = false;
114 if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
115 bClientActive = true;
116
117 bool bInPlaceActive = GetViewFrame()->GetFrame().IsInPlace();
118
119 if ( mbZoomOnPage && !bInPlaceActive && !bClientActive )
120 {
121 // with split, always resize first window
122 //af pWindow = mpContentWindow.get();
123 SfxRequest aReq(SID_SIZE_PAGE, SfxCallMode::SLOT, GetDoc()->GetItemPool());
124 ExecuteSlot( aReq );
125 }
126}
127
132{
133 ModifyGuard aGuard( GetDoc() );
134
135 // this option has to be adjust at the model
137 SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType())->IsPickThrough());
138
139 // initialization of the Character-(Screen-) attribute
140 if (HasRuler() != pView->HasRuler())
141 SetRuler( pView->HasRuler() );
142
143 if (mpDrawView->GetGridCoarse() != pView->GetGridCoarse())
144 mpDrawView->SetGridCoarse( pView->GetGridCoarse() );
145
146 if (mpDrawView->GetGridFine() != pView->GetGridFine())
147 mpDrawView->SetGridFine( pView->GetGridFine() );
148
149 if (mpDrawView->GetSnapGridWidthX() != pView->GetSnapGridWidthX() || mpDrawView->GetSnapGridWidthY() != pView->GetSnapGridWidthY())
150 mpDrawView->SetSnapGridWidth(pView->GetSnapGridWidthX(), pView->GetSnapGridWidthY());
151
152 if (mpDrawView->IsGridVisible() != pView->IsGridVisible())
153 mpDrawView->SetGridVisible( pView->IsGridVisible() );
154
155 if (mpDrawView->IsGridFront() != pView->IsGridFront())
156 mpDrawView->SetGridFront( pView->IsGridFront() );
157
158 if (mpDrawView->GetSnapAngle() != pView->GetSnapAngle())
159 mpDrawView->SetSnapAngle( pView->GetSnapAngle() );
160
161 if (mpDrawView->IsGridSnap() != pView->IsGridSnap() )
162 mpDrawView->SetGridSnap( pView->IsGridSnap() );
163
164 if (mpDrawView->IsBordSnap() != pView->IsBordSnap() )
165 mpDrawView->SetBordSnap( pView->IsBordSnap() );
166
167 if (mpDrawView->IsHlplSnap() != pView->IsHlplSnap() )
168 mpDrawView->SetHlplSnap( pView->IsHlplSnap() );
169
170 if (mpDrawView->IsOFrmSnap() != pView->IsOFrmSnap() )
171 mpDrawView->SetOFrmSnap( pView->IsOFrmSnap() );
172
173 if (mpDrawView->IsOPntSnap() != pView->IsOPntSnap() )
174 mpDrawView->SetOPntSnap( pView->IsOPntSnap() );
175
176 if (mpDrawView->IsOConSnap() != pView->IsOConSnap() )
177 mpDrawView->SetOConSnap( pView->IsOConSnap() );
178
179 if (mpDrawView->IsHlplVisible() != pView->IsHlplVisible() )
180 mpDrawView->SetHlplVisible( pView->IsHlplVisible() );
181
182 if (mpDrawView->IsDragStripes() != pView->IsDragStripes() )
183 mpDrawView->SetDragStripes( pView->IsDragStripes() );
184
185 if (mpDrawView->IsPlusHandlesAlwaysVisible() != pView->IsPlusHandlesAlwaysVisible() )
186 mpDrawView->SetPlusHandlesAlwaysVisible( pView->IsPlusHandlesAlwaysVisible() );
187
188 if (mpDrawView->GetSnapMagneticPixel() != pView->GetSnapMagneticPixel() )
189 mpDrawView->SetSnapMagneticPixel( pView->GetSnapMagneticPixel() );
190
191 if (mpDrawView->IsMarkedHitMovesAlways() != pView->IsMarkedHitMovesAlways() )
192 mpDrawView->SetMarkedHitMovesAlways( pView->IsMarkedHitMovesAlways() );
193
194 if (mpDrawView->IsMoveOnlyDragging() != pView->IsMoveOnlyDragging() )
195 mpDrawView->SetMoveOnlyDragging( pView->IsMoveOnlyDragging() );
196
197 if (mpDrawView->IsNoDragXorPolys() != pView->IsNoDragXorPolys() )
198 mpDrawView->SetNoDragXorPolys( pView->IsNoDragXorPolys() );
199
200 if (mpDrawView->IsCrookNoContortion() != pView->IsCrookNoContortion() )
201 mpDrawView->SetCrookNoContortion( pView->IsCrookNoContortion() );
202
203 if (mpDrawView->IsAngleSnapEnabled() != pView->IsAngleSnapEnabled() )
204 mpDrawView->SetAngleSnapEnabled( pView->IsAngleSnapEnabled() );
205
206 if (mpDrawView->IsBigOrtho() != pView->IsBigOrtho() )
207 mpDrawView->SetBigOrtho( pView->IsBigOrtho() );
208
209 if (mpDrawView->IsOrtho() != pView->IsOrtho() )
210 mpDrawView->SetOrtho( pView->IsOrtho() );
211
212 if (mpDrawView->GetEliminatePolyPointLimitAngle() != pView->GetEliminatePolyPointLimitAngle() )
213 mpDrawView->SetEliminatePolyPointLimitAngle( pView->GetEliminatePolyPointLimitAngle() );
214
215 if (mpDrawView->IsEliminatePolyPoints() != pView->IsEliminatePolyPoints() )
216 mpDrawView->SetEliminatePolyPoints( pView->IsEliminatePolyPoints() );
217
218 if (mpDrawView->IsSolidDragging() != pView->IsSolidDragging() )
219 mpDrawView->SetSolidDragging( pView->IsSolidDragging() );
220
221 if (mpDrawView->IsQuickTextEditMode() != pView->IsQuickEdit())
222 mpDrawView->SetQuickTextEditMode( pView->IsQuickEdit() );
223
224 // #i26631#
225 if (mpDrawView->IsMasterPagePaintCaching() != pView->IsMasterPagePaintCaching())
226 mpDrawView->SetMasterPagePaintCaching( pView->IsMasterPagePaintCaching() );
227
228 if (mpDrawView->GetDragThresholdPixels() != pView->GetDragThresholdPixels())
229 mpDrawView->SetDragThresholdPixels( pView->GetDragThresholdPixels() );
230
231 // handle size: 9 pixels
232 sal_uInt16 nTmp = mpDrawView->GetMarkHdlSizePixel();
233 if( nTmp != 9 )
234 mpDrawView->SetMarkHdlSizePixel( 9 );
235
236 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
237 if (pPageView)
238 {
239 if ( pPageView->GetVisibleLayers() != pView->GetVisibleLayers() )
240 pPageView->SetVisibleLayers( pView->GetVisibleLayers() );
241
242 if ( pPageView->GetPrintableLayers() != pView->GetPrintableLayers() )
243 pPageView->SetPrintableLayers( pView->GetPrintableLayers() );
244
245 if ( pPageView->GetLockedLayers() != pView->GetLockedLayers() )
246 pPageView->SetLockedLayers( pView->GetLockedLayers() );
247
249 {
250 if (pPageView->GetHelpLines() != pView->GetNotesHelpLines())
251 pPageView->SetHelpLines( pView->GetNotesHelpLines() );
252 }
253 else if (mePageKind == PageKind::Handout)
254 {
255 if (pPageView->GetHelpLines() != pView->GetHandoutHelpLines())
256 pPageView->SetHelpLines( pView->GetHandoutHelpLines() );
257 }
258 else
259 {
260 if (pPageView->GetHelpLines() != pView->GetStandardHelpLines())
261 pPageView->SetHelpLines( pView->GetStandardHelpLines() );
262 }
263 }
264
265 if ( mpDrawView->GetActiveLayer() != pView->GetActiveLayer() )
266 mpDrawView->SetActiveLayer( pView->GetActiveLayer() );
267
268 sal_uInt16 nSelectedPage = 0;
269
271 {
272 nSelectedPage = pView->GetSelectedPage();
273 }
274
275 EditMode eNewEditMode = pView->GetViewShEditMode(/*mePageKind*/);
276 bool bNewLayerMode = pView->IsLayerMode();
277
278 if(IsLayerModeActive() && bNewLayerMode)
279 {
280 // #i57936# Force mbIsLayerModeActive to false so that ChangeEditMode
281 // below does something regarding LayerTabBar content refresh. That refresh
282 // is only done when IsLayerModeActive changes. It needs to be done
283 // since e.g. Layer visibility was changed above and this may need
284 // a refresh to show the correct graphical representation
285 mbIsLayerModeActive = false;
286 }
287
288 ChangeEditMode(eNewEditMode, bNewLayerMode);
289 SwitchPage(nSelectedPage);
290
291 // restore DrawMode for 'normal' window
292 if(GetActiveWindow()->GetOutDev()->GetDrawMode() != pView->GetDrawMode())
294
295 if ( mpDrawView->IsDesignMode() != pView->IsDesignMode() )
296 {
297 SfxBoolItem aDesignModeItem( SID_FM_DESIGN_MODE, pView->IsDesignMode() );
298 GetViewFrame()->GetDispatcher()->ExecuteList(SID_FM_DESIGN_MODE,
299 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
300 { &aDesignModeItem });
301 }
302
303 // has to be called in the end, because it executes a WriteFrameViewData()
304 if (mpDrawView->IsFrameDragSingles() != pView->IsFrameDragSingles() )
305 mpDrawView->SetFrameDragSingles( pView->IsFrameDragSingles() );
306}
307
312{
313 // store character-(screen-) attribute of FrameView
315 mpFrameView->SetGridCoarse( mpDrawView->GetGridCoarse() );
316 mpFrameView->SetGridFine( mpDrawView->GetGridFine() );
317 mpFrameView->SetSnapGridWidth(mpDrawView->GetSnapGridWidthX(), mpDrawView->GetSnapGridWidthY());
318 mpFrameView->SetGridVisible( mpDrawView->IsGridVisible() );
319 mpFrameView->SetGridFront( mpDrawView->IsGridFront() );
320 mpFrameView->SetSnapAngle( mpDrawView->GetSnapAngle() );
321 mpFrameView->SetGridSnap( mpDrawView->IsGridSnap() );
322 mpFrameView->SetBordSnap( mpDrawView->IsBordSnap() );
323 mpFrameView->SetHlplSnap( mpDrawView->IsHlplSnap() );
324 mpFrameView->SetOFrmSnap( mpDrawView->IsOFrmSnap() );
325 mpFrameView->SetOPntSnap( mpDrawView->IsOPntSnap() );
326 mpFrameView->SetOConSnap( mpDrawView->IsOConSnap() );
327 mpFrameView->SetHlplVisible( mpDrawView->IsHlplVisible() );
328 mpFrameView->SetDragStripes( mpDrawView->IsDragStripes() );
329 mpFrameView->SetPlusHandlesAlwaysVisible( mpDrawView->IsPlusHandlesAlwaysVisible() );
330 mpFrameView->SetFrameDragSingles( mpDrawView->IsFrameDragSingles() );
331 mpFrameView->SetMarkedHitMovesAlways( mpDrawView->IsMarkedHitMovesAlways() );
332 mpFrameView->SetMoveOnlyDragging( mpDrawView->IsMoveOnlyDragging() );
333 mpFrameView->SetNoDragXorPolys( mpDrawView->IsNoDragXorPolys() );
334 mpFrameView->SetCrookNoContortion( mpDrawView->IsCrookNoContortion() );
335 mpFrameView->SetBigOrtho( mpDrawView->IsBigOrtho() );
336 mpFrameView->SetEliminatePolyPointLimitAngle( mpDrawView->GetEliminatePolyPointLimitAngle() );
337 mpFrameView->SetEliminatePolyPoints( mpDrawView->IsEliminatePolyPoints() );
338
339 mpFrameView->SetSolidDragging( mpDrawView->IsSolidDragging() );
340 mpFrameView->SetQuickEdit( mpDrawView->IsQuickTextEditMode() );
341
342 mpFrameView->SetDesignMode( mpDrawView->IsDesignMode() );
343
344 Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
345 ::tools::Rectangle aVisArea = GetActiveWindow()->PixelToLogic( ::tools::Rectangle( Point(0,0), aVisSizePixel) );
347 {
348 // aVisArea is nonsensical in the LOK case, use the slide size
349 aVisArea = ::tools::Rectangle(Point(), getCurrentPage()->GetSize());
350 }
351
352 mpFrameView->SetVisArea(aVisArea);
353
356 else
357 {
358 mpFrameView->SetSelectedPage( maTabControl->GetCurPagePos() );
359 }
360
363
364 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
365
366 if (pPageView)
367 {
368 if ( mpFrameView->GetVisibleLayers() != pPageView->GetVisibleLayers() )
370
371 if ( mpFrameView->GetPrintableLayers() != pPageView->GetPrintableLayers() )
373
374 if ( mpFrameView->GetLockedLayers() != pPageView->GetLockedLayers() )
376
378 {
380 }
381 else if (mePageKind == PageKind::Handout)
382 {
384 }
385 else
386 {
388 }
389 }
390
391 if ( mpFrameView->GetActiveLayer() != mpDrawView->GetActiveLayer() )
392 mpFrameView->SetActiveLayer( mpDrawView->GetActiveLayer() );
393
394 // store DrawMode for 'normal' window
395 if(mpFrameView->GetDrawMode() != GetActiveWindow()->GetOutDev()->GetDrawMode())
396 mpFrameView->SetDrawMode(GetActiveWindow()->GetOutDev()->GetDrawMode());
397}
398
400{
401 mpDrawView->PrePaint();
402}
403
410void DrawViewShell::Paint(const ::tools::Rectangle& rRect, ::sd::Window* pWin)
411{
412 /* This is done before each text edit, so why not do it before every paint.
413 The default language is only used if the outliner only contains one
414 character in a symbol font */
415 GetDoc()->GetDrawOutliner().SetDefaultLanguage( GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ) );
416
417 // Set Application Background color for usage in SdrPaintView(s)
418 mpDrawView->SetApplicationBackgroundColor( GetViewOptions().mnAppBackgroundColor );
419
420 /* This is done before each text edit, so why not do it before every paint.
421 The default language is only used if the outliner only contains one
422 character in a symbol font */
423 GetDoc()->GetDrawOutliner().SetDefaultLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() );
424
425 mpDrawView->CompleteRedraw( pWin->GetOutDev(), vcl::Region( rRect ) );
426}
427
431void DrawViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction& rZoomY)
432{
433 ViewShell::SetZoomFactor(rZoomX, rZoomY);
434 mbZoomOnPage = false;
435 Point aOrigin = GetActiveWindow()->GetViewOrigin();
436 GetActiveWindow()->SetWinViewPos(aOrigin);
437}
438
440{
441 FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
442 if (pFormShell != nullptr)
443 pFormShell->PrepareClose(false);
444}
445
446void DrawViewShell::WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& rSequence )
447{
449
451
452 const sal_Int32 nIndex = rSequence.getLength();
453 rSequence.realloc( nIndex + 1 );
454 auto pSequence = rSequence.getArray();
455 pSequence[nIndex].Name = sUNO_View_ZoomOnPage ;
456 pSequence[nIndex].Value <<= mbZoomOnPage;
457
458 // Common SdrModel processing
459 GetDocSh()->GetDoc()->WriteUserDataSequence(rSequence);
460}
461
462void DrawViewShell::ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& rSequence )
463{
465
467
468 for (const css::beans::PropertyValue& rValue : rSequence)
469 {
470 if ( rValue.Name == sUNO_View_ZoomOnPage )
471 {
472 bool bZoomPage = false;
473 if( rValue.Value >>= bZoomPage )
474 {
475 mbZoomOnPage = bZoomPage;
476 }
477 }
478 // Fallback to common SdrModel processing
479 else GetDocSh()->GetDoc()->ReadUserDataSequenceValue(&rValue);
480 }
481
482 // The parameter rSequence contains the config-items from
483 // <config:config-item-set config:name="ooo:view-settings">. Determine, whether
484 // they contain "VisibleLayers", "PrintableLayers" and "LockedLayers". If not, it
485 // is a foreign document or a new document after transition period and the corresponding
486 // information were read from <draw:layer-set>. In that case we need to bring
487 // the information from model to view.
488 bool bHasVisiPrnLockSettings(false);
489 for ( auto & rPropertyValue : rSequence )
490 {
491 if ( rPropertyValue.Name == sUNO_View_VisibleLayers
492 || rPropertyValue.Name == sUNO_View_PrintableLayers
493 || rPropertyValue.Name == sUNO_View_LockedLayers )
494 {
495 bHasVisiPrnLockSettings = true;
496 break;
497 }
498 }
499 if ( !bHasVisiPrnLockSettings )
500 {
501 const SdrLayerAdmin& rLayerAdmin = GetDocSh()->GetDoc()->GetLayerAdmin();
502 SdrLayerIDSet aSdrLayerIDSet;
503 rLayerAdmin.getVisibleLayersODF( aSdrLayerIDSet );
504 mpFrameView -> SetVisibleLayers( aSdrLayerIDSet );
505 rLayerAdmin.getPrintableLayersODF( aSdrLayerIDSet );
506 mpFrameView -> SetPrintableLayers( aSdrLayerIDSet );
507 rLayerAdmin.getLockedLayersODF( aSdrLayerIDSet );
508 mpFrameView -> SetLockedLayers( aSdrLayerIDSet );
509 }
510 else
511 {
512 // tdf#129898 repair layer "DrawnInSlideshow", which was wrongly written
513 // in LO 6.2 to 6.4. The ODF defaults were corrected when reading draw:layer-set, but
514 // not in reading config settings, because there the name is not known.
515 const SdrLayerAdmin& rLayerAdmin = GetDocSh()->GetDoc()->GetLayerAdmin();
516 if (rLayerAdmin.GetLayer("DrawnInSlideshow"))
517 {
518 SdrLayerIDSet aSdrLayerIDSet;
519 rLayerAdmin.getVisibleLayersODF( aSdrLayerIDSet );
520 mpFrameView -> SetVisibleLayers( aSdrLayerIDSet );
521 rLayerAdmin.getPrintableLayersODF( aSdrLayerIDSet );
522 mpFrameView -> SetPrintableLayers( aSdrLayerIDSet );
523 rLayerAdmin.getLockedLayersODF( aSdrLayerIDSet );
524 mpFrameView -> SetLockedLayers( aSdrLayerIDSet );
525 }
526 }
527
528
530 {
532
534 {
536 }
537 else if (mePageKind == PageKind::Handout)
538 {
540 }
541 else
542 {
544 }
545 }
546
548
549 if( !mbZoomOnPage )
550 {
551 const ::tools::Rectangle aVisArea( mpFrameView->GetVisArea() );
552
553 // tdf#151621 Do not set if the embedded object is opening in a new window.
554 if (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED
555 && GetDocSh()->IsInPlaceActive())
556 {
557 GetDocSh()->SetVisArea(aVisArea);
558 }
559
560 VisAreaChanged(aVisArea);
561
562 ::sd::View* pView = GetView();
563
564 if (pView)
565 {
566 pView->VisAreaChanged(GetActiveWindow()->GetOutDev());
567 }
568
569 SetZoomRect(aVisArea);
570 }
573}
574
575void DrawViewShell::VisAreaChanged(const ::tools::Rectangle& rRect)
576{
578
580 rController.FireVisAreaChanged (rRect);
581}
582
587css::uno::Reference<css::accessibility::XAccessible>
589{
590 if (GetViewShellBase().GetController() != nullptr)
591 {
594 pWindow,
595 this,
598 pDocumentView->Init();
599 return pDocumentView;
600 }
601
602 SAL_WARN("sd", "DrawViewShell::CreateAccessibleDocumentView: no controller");
603 return css::uno::Reference< css::accessibility::XAccessible>();
604}
605
607{
608 const LayerTabBar* pBar
609 = const_cast<DrawViewShell*>(this)->GetLayerTabControl ();
610 if (pBar != nullptr)
611 return pBar->GetPagePos (pBar->GetCurPageId());
612 else
613 return -1;
614}
615
617{
619 if (pBar == nullptr)
620 return;
621
622 // Ignore invalid indices silently.
623 if (nIndex>=0 && nIndex<pBar->GetPageCount())
624 {
625 // Tell the draw view and the tab control of the new active layer.
626 mpDrawView->SetActiveLayer (pBar->GetLayerName (pBar->GetPageId (static_cast<sal_uInt16>(nIndex))));
627 pBar->SetCurPageId (pBar->GetPageId (static_cast<sal_uInt16>(nIndex)));
629 *this,
630 *GetView()));
631 css::uno::Reference< css::drawing::XLayer> rLayer = pUnoDrawView->getActiveLayer();
633 }
634}
635
637{
638 return mpLayerTabBar.get();
639}
640
642{
643 const LayerTabBar* pBar
644 = const_cast<DrawViewShell*>(this)->GetLayerTabControl ();
645 if (pBar != nullptr)
646 return pBar->GetPageCount();
647 else
648 return 0;
649}
650
651} // end of namespace sd
652
653/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
bool PrepareClose(bool bUI=true)
void SetStyleSheetPool(SfxStyleSheetPool *pSPool)
void SetDrawMode(DrawModeFlags nDrawMode)
sal_Int32 GetDragThresholdPixels() const
void SetDragStripes(bool bOn)
void SetNoDragXorPolys(bool bOn)
bool IsSolidDragging() const
bool IsNoDragXorPolys() const
bool IsDragStripes() const
void SetSolidDragging(bool bOn)
void SetMarkedHitMovesAlways(bool bOn)
bool IsMarkedHitMovesAlways() const
void getPrintableLayersODF(SdrLayerIDSet &rOutSet) const
SdrLayer * GetLayer(sal_uInt16 i)
void getLockedLayersODF(SdrLayerIDSet &rOutSet) const
void getVisibleLayersODF(SdrLayerIDSet &rOutSet) const
void SetFrameDragSingles(bool bOn=true)
bool IsFrameDragSingles() const
bool IsDesignMode() const
void SetPlusHandlesAlwaysVisible(bool bOn)
void SetDesignMode(bool bOn=true)
bool IsPlusHandlesAlwaysVisible() const
void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &rValues)
void SetPickThroughTransparentTextFrames(bool bOn)
const SdrLayerAdmin & GetLayerAdmin() const
const SdrLayerIDSet & GetVisibleLayers() const
void SetLockedLayers(const SdrLayerIDSet &rSet)
void SetVisibleLayers(const SdrLayerIDSet &rSet)
void SetPrintableLayers(const SdrLayerIDSet &rSet)
const SdrHelpLineList & GetHelpLines() const
const SdrLayerIDSet & GetLockedLayers() const
const SdrLayerIDSet & GetPrintableLayers() const
void SetHelpLines(const SdrHelpLineList &rHLL)
bool IsGridFront() const
void VisAreaChanged(const OutputDevice *pOut)
void SetHlplVisible(bool bOn=true)
const Size & GetGridFine() const
void SetActiveLayer(const OUString &rName)
const Size & GetGridCoarse() const
void SetGridFine(const Size &rSiz)
void SetGridFront(bool bOn)
bool IsHlplVisible() const
void SetGridCoarse(const Size &rSiz)
const OUString & GetActiveLayer() const
void SetGridVisible(bool bOn)
bool IsGridVisible() const
bool IsCrookNoContortion() const
void SetOFrmSnap(bool bOn)
Degree100 GetEliminatePolyPointLimitAngle() const
bool IsBigOrtho() const
void SetSnapGridWidth(const Fraction &rX, const Fraction &rY)
void SetOPntSnap(bool bOn)
void SetHlplSnap(bool bOn)
bool IsOrtho() const
const Fraction & GetSnapGridWidthY() const
void SetBordSnap(bool bOn)
void SetGridSnap(bool bOn)
void SetSnapAngle(Degree100 nAngle)
bool IsHlplSnap() const
bool IsAngleSnapEnabled() const
bool IsOFrmSnap() const
Degree100 GetSnapAngle() const
bool IsGridSnap() const
bool IsOPntSnap() const
void SetBigOrtho(bool bOn)
void SetMoveOnlyDragging(bool bOn)
void SetEliminatePolyPointLimitAngle(Degree100 nAngle)
bool IsMoveOnlyDragging() const
bool IsOConSnap() const
const Fraction & GetSnapGridWidthX() const
void SetEliminatePolyPoints(bool bOn)
bool IsBordSnap() const
void SetOConSnap(bool bOn)
void SetCrookNoContortion(bool bOn)
sal_uInt16 GetSnapMagneticPixel() const
bool IsEliminatePolyPoints() const
bool IsMasterPagePaintCaching() const
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
bool IsInPlace() const
bool IsObjectInPlaceActive() const
virtual void SetVisArea(const tools::Rectangle &rVisArea)
virtual void Invalidate(sal_uInt16 nId=0)
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxViewShell * GetViewShell() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxFrame & GetFrame() const
SfxInPlaceClient * GetIPClient() const
sal_Int32 GetScrollBarSize() const
void SetCurPageId(sal_uInt16 nPageId)
sal_uInt16 GetPagePos(sal_uInt16 nPageId) const
sal_uInt16 GetPageCount() const
sal_uInt16 GetPageId(sal_uInt16 nPos) const
sal_uInt16 GetCurPageId() const
This class makes draw documents in the general view modes accessible.
The DrawController is the UNO controller for Impress and Draw.
void FireVisAreaChanged(const ::tools::Rectangle &rVisArea) noexcept
Call this method when the VisArea has changed.
void fireChangeLayer(css::uno::Reference< css::drawing::XLayer > *pCurrentLayer) noexcept
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
Definition: docshel4.cxx:690
SdDrawDocument * GetDoc()
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: drviews5.cxx:446
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY) override
adjust zoom factor for InPlace
Definition: drviews5.cxx:431
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
Definition: drviews1.cxx:636
std::unique_ptr< DrawView > mpDrawView
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect) override
Set zoom rectangle for active window.
Definition: drviews1.cxx:298
bool IsLayerModeActive() const
virtual void VisAreaChanged(const ::tools::Rectangle &rRect) override
this method is called when the visible area of the view from this viewshell is changed
Definition: drviews5.cxx:575
void SetActiveTabLayerIndex(int nId)
Set the active layer at the layer tab control and update the control accordingly to reflect the chang...
Definition: drviews5.cxx:616
virtual void WriteFrameViewData() override
Apply data of the current view on the FrameView.
Definition: drviews5.cxx:311
const SdViewOptions & GetViewOptions() const
virtual void Resize() override
Notify the view shell that its parent window has been resized.
Definition: drviews5.cxx:81
VclPtr< TabControl > maTabControl
virtual void ChangeEditMode(EditMode eMode, bool bIsLayerModeActive)
Set status (enabled/disabled) of menu SfxSlots.
Definition: drviews1.cxx:333
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: drviews5.cxx:462
bool mbIsLayerModeActive
This flag controls whether the layer mode is active, i.e.
void PrePaint() override
Definition: drviews5.cxx:399
SD_DLLPUBLIC LayerTabBar * GetLayerTabControl()
Return a pointer to the tab control for layers.
Definition: drviews5.cxx:636
virtual void Paint(const ::tools::Rectangle &rRect, ::sd::Window *pWin) override
The event is forwarded to the Viewshell and the current function by the window pWin.
Definition: drviews5.cxx:410
int GetActiveTabLayerIndex() const
Return the numerical id of the currently active layer as seen by the layer tab control.
Definition: drviews5.cxx:606
int GetTabLayerCount() const
Return the number of layers managed by the layer tab control.
Definition: drviews5.cxx:641
void ModelHasChanged()
Definition: drviews5.cxx:62
bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus=true)
Switch to desired page.
Definition: drviews1.cxx:831
virtual void ReadFrameViewData(FrameView *pView) override
Apply data of the FrameView on the current view.
Definition: drviews5.cxx:131
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleDocumentView(::sd::Window *pWindow) override
Create an accessible object representing the specified window.
Definition: drviews5.cxx:588
void ResetActualLayer()
Select new refreshed page, in case of a page order change (eg.
Definition: drviews1.cxx:1211
virtual void ArrangeGUIElements() override
Arrange and resize the GUI elements like rulers, sliders, and buttons as well as the actual document ...
Definition: drviews5.cxx:99
View for MDIFrame.
Definition: FrameView.hxx:36
EditMode GetViewShEditMode() const
Return EditMode (Page or MasterPage) of working mode.
Definition: frmview.cxx:334
sal_uInt16 GetSelectedPage() const
Definition: FrameView.hxx:96
void SetLockedLayers(const SdrLayerIDSet &rLockedLayers)
Definition: FrameView.hxx:61
void SetLayerMode(bool bMode)
Definition: FrameView.hxx:118
bool HasRuler() const
Definition: FrameView.hxx:71
void SetDrawMode(DrawModeFlags nNewDrawMode)
Definition: FrameView.hxx:159
void SetNotesHelpLines(const SdrHelpLineList &rHelpLines)
Definition: FrameView.hxx:50
const SdrHelpLineList & GetStandardHelpLines() const
Definition: FrameView.hxx:49
void SetQuickEdit(bool bQEdit)
Definition: FrameView.hxx:122
void SetPrintableLayers(const SdrLayerIDSet &rPrintableLayers)
Definition: FrameView.hxx:65
const ::tools::Rectangle & GetVisArea() const
Definition: FrameView.hxx:83
const SdrHelpLineList & GetHandoutHelpLines() const
Definition: FrameView.hxx:55
bool IsLayerMode() const
Definition: FrameView.hxx:120
const SdrLayerIDSet & GetLockedLayers() const
Definition: FrameView.hxx:63
const SdrLayerIDSet & GetVisibleLayers() const
Definition: FrameView.hxx:59
const SdrHelpLineList & GetNotesHelpLines() const
Definition: FrameView.hxx:52
void SetSelectedPage(sal_uInt16 nPage)
Definition: frmview.cxx:907
PageKind GetPageKind() const
Definition: FrameView.hxx:86
bool IsQuickEdit() const
Definition: FrameView.hxx:124
DrawModeFlags GetDrawMode() const
Definition: FrameView.hxx:160
void SetViewShEditMode(EditMode eMode)
Set EditMode (Page or MasterPage) of working mode.
Definition: frmview.cxx:326
void SetHandoutHelpLines(const SdrHelpLineList &rHelpLines)
Definition: FrameView.hxx:53
void SetStandardHelpLines(const SdrHelpLineList &rHelpLines)
Definition: FrameView.hxx:47
void SetVisibleLayers(const SdrLayerIDSet &rVisibleLayers)
Definition: FrameView.hxx:57
const SdrLayerIDSet & GetPrintableLayers() const
Definition: FrameView.hxx:67
void SetVisArea(const ::tools::Rectangle &rVisArea)
Definition: FrameView.hxx:81
void SetRuler(const bool bRulerOn)
Definition: FrameView.hxx:69
OUString GetLayerName(sal_uInt16 nPageId) const
Definition: LayerTabBar.cxx:90
an instance of this guard disables modification of a document during its lifetime
Definition: drawdoc.hxx:705
This class implements the DrawViewShell specific part of the controller.
static rtl::Reference< SlideShow > GetSlideShow(SdDrawDocument const *pDocument)
Definition: slideshow.cxx:157
DrawController * GetDrawController() const
std::shared_ptr< FormShellManager > const & GetFormShellManager() const
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
Definition: viewshel.cxx:1407
FrameView * mpFrameView
Definition: ViewShell.hxx:453
SdDrawDocument * GetDoc() const
Definition: viewshel.cxx:1412
void SetRuler(bool bRuler)
Switch ruler on/off.
Definition: viewshe2.cxx:814
virtual void ArrangeGUIElements()
Set position and size of the GUI elements that are controlled by the view shell like rulers and scrol...
Definition: viewshel.cxx:965
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
Definition: viewshe2.cxx:897
virtual void VisAreaChanged(const ::tools::Rectangle &rRect)
this method is called when the visible area of the view from this viewshell is changed
Definition: viewshe2.cxx:902
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
Definition: ViewShell.hxx:155
::sd::View * GetView() const
Definition: ViewShell.hxx:144
vcl::Window * GetParentWindow() const
Return the window that is the parent of all controls of this view shell.
Definition: ViewShell.hxx:140
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
Definition: viewshe2.cxx:878
VclPtr< LayerTabBar > mpLayerTabBar
Layer tab bar.
Definition: ViewShell.hxx:445
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY)
Set zoom factor for InPlace.
Definition: viewshe2.cxx:543
virtual void Resize()
Notify the view shell that its parent window has been resized.
Definition: viewshel.cxx:908
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
bool HasRuler() const
Definition: ViewShell.hxx:191
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
const Point & GetViewOrigin() const
Definition: Window.hxx:111
void SetWinViewPos(const Point &rPnt)
Set the position of the upper left corner from the visible area of the window.
Definition: sdwindow.cxx:304
vcl::Window * GetAccessibleParentWindow() const
const AllSettings & GetSettings() const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
Size GetOutputSizePixel() const
void SetHelpId(const OUString &)
virtual std::shared_ptr< SfxDialogController > GetController() override
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr OUStringLiteral HID_SDDRAWVIEWSHELL
Definition: helpids.h:24
sal_Int32 nIndex
#define SAL_WARN(area, stream)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
#define ASPECT_CONTENT
EditMode
Definition: pres.hxx:53
constexpr OUStringLiteral CMD_SID_HANDOUT_MASTER_MODE
Definition: sdcommands.h:23
constexpr OUStringLiteral CMD_SID_NOTES_MODE
Definition: sdcommands.h:24
#define SD_MOD()
Definition: sdmod.hxx:184
constexpr OUStringLiteral sUNO_View_LockedLayers
Definition: unokywds.hxx:110
constexpr OUStringLiteral sUNO_View_ZoomOnPage
Definition: unokywds.hxx:117
constexpr OUStringLiteral sUNO_View_PrintableLayers
Definition: unokywds.hxx:109
constexpr OUStringLiteral sUNO_View_VisibleLayers
Definition: unokywds.hxx:108