LibreOffice Module sd (master) 1
drviews1.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>
22
23#include <DrawController.hxx>
24#include <com/sun/star/embed/XEmbeddedObject.hpp>
25
27#include <rtl/ref.hxx>
28
29#include <svx/svxids.hrc>
30#include <svx/svdpagv.hxx>
31#include <sfx2/viewfrm.hxx>
32#include <sfx2/bindings.hxx>
33#include <svx/svdoole2.hxx>
34#include <sfx2/dispatch.hxx>
35#include <sfx2/module.hxx>
37#include <svx/svdopage.hxx>
38#include <svx/fmshell.hxx>
39#include <tools/debug.hxx>
41#include <vcl/graphicfilter.hxx>
42
44
45#include <app.hrc>
46
47#include <fupoor.hxx>
48#include <unokywds.hxx>
49#include <sdpage.hxx>
50#include <FrameView.hxx>
51#include <Window.hxx>
52#include <drawview.hxx>
53#include <drawdoc.hxx>
54#include <DrawDocShell.hxx>
55#include <Ruler.hxx>
56#include <Client.hxx>
57#include <slideshow.hxx>
59#include <ToolBarManager.hxx>
60#include <FormShellManager.hxx>
61#include <ViewShellBase.hxx>
62#include <LayerTabBar.hxx>
63#include <ViewShellManager.hxx>
64#include <ViewShellHint.hxx>
65#include <SlideSorter.hxx>
69
70#include <comphelper/lok.hxx>
71#include <LibreOfficeKit/LibreOfficeKitEnums.h>
72#include <vcl/uitest/logger.hxx>
74
75using namespace com::sun::star;
76
77namespace sd {
78
79void DrawViewShell::Activate(bool bIsMDIActivate)
80{
81 ViewShell::Activate(bIsMDIActivate);
82
83 // tdf#150773: do not grab focus on loading
86 else
87 {
88
89 // When the mode is switched to normal the main view shell grabs focus.
90 // This is done for getting cut/copy/paste commands on slides in the left
91 // pane (slide sorter view shell) to work properly.
92 SfxShell* pTopViewShell = GetViewShellBase().GetViewShellManager()->GetTopViewShell();
93 if (pTopViewShell == this)
94 {
96 }
97 }
98}
99
101{
103
104 // Disable own controls
105 maTabControl->Disable();
106 if (GetLayerTabControl() != nullptr)
107 GetLayerTabControl()->Disable();
108}
109
111{
112 // Enable own controls
113 maTabControl->Enable();
114 if (GetLayerTabControl() != nullptr)
115 GetLayerTabControl()->Enable();
116
118}
119
120void DrawViewShell::Deactivate(bool bIsMDIActivate)
121{
122 // Temporarily disable context broadcasting while the Deactivate()
123 // call is forwarded to our base class.
124 const bool bIsContextBroadcasterEnabled (SfxShell::SetContextBroadcasterEnabled(false));
125
126 ViewShell::Deactivate(bIsMDIActivate);
127
128 SfxShell::SetContextBroadcasterEnabled(bIsContextBroadcasterEnabled);
129}
130
131namespace
132{
133 class LockUI
134 {
135 private:
136 void Lock(bool bLock);
137 SfxViewFrame *mpFrame;
138 public:
139 explicit LockUI(SfxViewFrame *pFrame) : mpFrame(pFrame) { Lock(true); }
140 ~LockUI() { Lock(false); }
141
142 };
143
144 void LockUI::Lock(bool bLock)
145 {
146 if (!mpFrame)
147 return;
148 mpFrame->Enable( !bLock );
149 }
150}
151
157{
158 Invalidate();
159
160 //Update3DWindow(); // 3D-Controller
161 SfxBoolItem aItem( SID_3D_STATE, true );
163 SID_3D_STATE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
164
165 SdrOle2Obj* pOleObj = nullptr;
166
167 if ( mpDrawView->AreObjectsMarked() )
168 {
169 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
170
171 if (rMarkList.GetMarkCount() == 1)
172 {
173 SdrMark* pMark = rMarkList.GetMark(0);
174 SdrObject* pObj = pMark->GetMarkedSdrObj();
175
176 SdrInventor nInv = pObj->GetObjInventor();
177 SdrObjKind nSdrObjKind = pObj->GetObjIdentifier();
178
179 if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2)
180 {
181 pOleObj = static_cast<SdrOle2Obj*>(pObj);
182 UpdateIMapDlg( pObj );
183 }
184 else if (nSdrObjKind == SdrObjKind::Graphic)
185 UpdateIMapDlg( pObj );
186 }
187 }
188
190 rBase.SetVerbs( uno::Sequence< embed::VerbDescriptor >() );
191
192 try
193 {
194 Client* pIPClient = static_cast<Client*>(rBase.GetIPClient());
195 if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
196 {
197 // as appropriate take ole-objects into account and deactivate
198
199 // this means we recently deselected an inplace active ole object so
200 // we need to deselect it now
201 if (!pOleObj)
202 {
203 //#i47279# disable frame until after object has completed unload
204 LockUI aUILock(GetViewFrame());
205 pIPClient->DeactivateObject();
206 //HMHmpDrView->ShowMarkHdl();
207 }
208 else
209 {
210 const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->GetObjRef();
211 if ( xObj.is() )
212 {
213 rBase.SetVerbs( xObj->getSupportedVerbs() );
214 }
215 else
216 {
217 rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
218 }
219 }
220 }
221 else
222 {
223 if ( pOleObj )
224 {
225 const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->GetObjRef();
226 if ( xObj.is() )
227 {
228 rBase.SetVerbs( xObj->getSupportedVerbs() );
229 }
230 else
231 {
232 rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
233 }
234 }
235 else
236 {
237 rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
238 }
239 }
240 }
241 catch( css::uno::Exception& )
242 {
243 TOOLS_WARN_EXCEPTION( "sd", "sd::DrawViewShell::SelectionHasChanged()" );
244 }
245
246 if( HasCurrentFunction() )
247 {
248 GetCurrentFunction()->SelectionHasChanged();
249 }
250 else
251 {
252 GetViewShellBase().GetToolBarManager()->SelectionHasChanged(*this,*mpDrawView);
253 }
254
255 // Invalidate for every subshell
256 GetViewShellBase().GetViewShellManager()->InvalidateAllSubShells(this);
257
258 mpDrawView->UpdateSelectionClipboard();
259
261}
262
263namespace {
264
265void collectUIInformation(const OUString& aZoom)
266{
267 EventDescription aDescription;
268 aDescription.aID = "impress_win";
269 aDescription.aParameters = {{"ZOOM", aZoom}};
270 aDescription.aAction = "SET";
271 aDescription.aKeyWord = "ImpressWindowUIObject";
272 aDescription.aParent = "MainWindow";
273
274 UITestLogger::getInstance().logEvent(aDescription);
275}
276
277}
278
283{
284 // Make sure that the zoom factor will not be recalculated on
285 // following window resizings.
286 mbZoomOnPage = false;
287 ViewShell::SetZoom( nZoom );
288 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
289 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
290 mpViewOverlayManager->onZoomChanged();
291 collectUIInformation(OUString::number(nZoom));
292}
293
298void DrawViewShell::SetZoomRect( const ::tools::Rectangle& rZoomRect )
299{
300 ViewShell::SetZoomRect( rZoomRect );
301 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
302 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
303 mpViewOverlayManager->onZoomChanged();
304}
305
312{
313 if ( !ViewShell::PrepareClose(bUI) )
314 return false;
315
316 if( HasCurrentFunction() )
317 {
318 sal_uInt16 nID = GetCurrentFunction()->GetSlotID();
319 if (nID == SID_TEXTEDIT || nID == SID_ATTR_CHAR)
320 {
321 mpDrawView->SdrEndTextEdit();
322 }
323 }
324
325 return true;
326}
327
328
333void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
334{
335 if (meEditMode == eEMode && mbIsLayerModeActive == bIsLayerModeActive)
336 return;
337
338 ViewShellManager::UpdateLock aLock (GetViewShellBase().GetViewShellManager());
339
340 sal_uInt16 nActualPageId = maTabControl->GetPageId(0);
341
343 {
344 // at handouts only allow MasterPage
345 eEMode = EditMode::MasterPage;
346 }
347
350
351 if ( mpDrawView->IsTextEdit() )
352 {
353 // This exits the text edit mode when going in and out of window focus, which is not needed
354 // Let's keep this call as comment for now as it probably just needs a better conditional.
355 // mpDrawView->SdrEndTextEdit();
356 }
357
358 LayerTabBar* pLayerBar = GetLayerTabControl();
359 if (pLayerBar != nullptr)
360 pLayerBar->EndEditMode();
361 maTabControl->EndEditMode();
362
364
365 meEditMode = eEMode;
366
367 if(pLayerBar)
368 {
369 // #i87182# only switch activation mode of LayerTabBar when there is one,
370 // else it will not get initialized with the current set of Layers as needed
371 mbIsLayerModeActive = bIsLayerModeActive;
372 }
373
374 // Determine whether to show the master view toolbar. The master
375 // page mode has to be active and the shell must not be a handout
376 // view.
377 bool bShowMasterViewToolbar (meEditMode == EditMode::MasterPage
379 bool bShowPresentationToolbar (meEditMode != EditMode::MasterPage
382
383 // If the master view toolbar is not shown we hide it before
384 // switching the edit mode.
385 if (::sd::ViewShell::mpImpl->mbIsInitialized
386 && IsMainViewShell())
387 {
388 if ( !bShowMasterViewToolbar )
390 if ( !bShowPresentationToolbar )
392 }
393
395
397 {
398 /******************************************************************
399 * PAGEMODE
400 ******************************************************************/
401
402 maTabControl->Clear();
403
404 SdPage* pPage;
405 sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
406
407 for (sal_uInt16 i = 0; i < nPageCnt; i++)
408 {
409 pPage = GetDoc()->GetSdPage(i, mePageKind);
410 OUString aPageName = pPage->GetName();
411 maTabControl->InsertPage(pPage->getPageId(), aPageName);
412
414 {
415 nActualPageId = pPage->getPageId();
416 }
417 }
418
419 maTabControl->SetCurPageId(nActualPageId);
420
421 SwitchPage(maTabControl->GetPagePos(nActualPageId));
422
423 //tdf#102343 re-enable common undo on switch back from master mode
424 mpDrawView->GetModel().SetDisableTextEditUsesCommonUndoManager(false);
425 }
426 else
427 {
428 /******************************************************************
429 * MASTERPAGE
430 ******************************************************************/
432 AnimationChildWindow::GetChildWindowId(), false );
433
435 GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
436 ".uno:SlideMasterPage=true");
437 if (!mpActualPage)
438 {
439 // as long as there is no mpActualPage, take first
441 }
442
443 maTabControl->Clear();
444 sal_uInt16 nActualMasterPageId = maTabControl->GetPageId(0);
445 sal_uInt16 nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
446
447 for (sal_uInt16 i = 0; i < nMasterPageCnt; i++)
448 {
449 SdPage* pMaster = GetDoc()->GetMasterSdPage(i, mePageKind);
450 OUString aLayoutName = pMaster->GetLayoutName();
451 sal_Int32 nPos = aLayoutName.indexOf(SD_LT_SEPARATOR);
452 if (nPos != -1)
453 aLayoutName = aLayoutName.copy(0, nPos);
454
455 maTabControl->InsertPage(pMaster->getPageId(), aLayoutName);
456
457 if (&(mpActualPage->TRG_GetMasterPage()) == pMaster)
458 {
459 nActualMasterPageId = pMaster->getPageId();
460 }
461 }
462
463 maTabControl->SetCurPageId(nActualMasterPageId);
464 SwitchPage(maTabControl->GetPagePos(nActualMasterPageId));
465
466 //tdf#102343 changing attributes of textboxes in master typically
467 //changes the stylesheet they are linked to, so if the common
468 //undo manager is in use, those stylesheet changes are thrown
469 //away at present
470 mpDrawView->GetModel().SetDisableTextEditUsesCommonUndoManager(true);
471 }
472
473 // If the master view toolbar is to be shown we turn it on after the
474 // edit mode has been changed.
476 && IsMainViewShell())
477 {
478 if (bShowMasterViewToolbar)
479 GetViewShellBase().GetToolBarManager()->SetToolBar(
482 if (bShowPresentationToolbar)
483 GetViewShellBase().GetToolBarManager()->SetToolBar(
486 }
487
488 if ( ! mbIsLayerModeActive)
489 {
490 maTabControl->Show();
491 // Set the tab control only for draw pages. For master page
492 // this has been done already above.
494 maTabControl->SetCurPageId (nActualPageId);
495 }
496
498
499 Invalidate( SID_PAGEMODE );
500 Invalidate( SID_LAYERMODE );
501 Invalidate( SID_MASTERPAGE );
502 Invalidate( SID_DELETE_MASTER_PAGE );
503 Invalidate( SID_DELETE_PAGE );
504 Invalidate( SID_SLIDE_MASTER_MODE );
505 Invalidate( SID_NOTES_MASTER_MODE );
506 Invalidate( SID_HANDOUT_MASTER_MODE );
508
511
513
514}
515
521{
522 VclPtr<Ruler> pRuler;
523 WinBits aWBits;
524 SvxRulerSupportFlags nFlags = SvxRulerSupportFlags::OBJECT;
525
527 nFlags |= SvxRulerSupportFlags::SET_NULLOFFSET |
528 SvxRulerSupportFlags::TABS |
529 SvxRulerSupportFlags::PARAGRAPH_MARGINS; // new
530
531 pRuler = VclPtr<Ruler>::Create(*this, GetParentWindow(), pWin, nFlags,
532 GetViewFrame()->GetBindings(), aWBits);
533
534 // Metric ...
535 sal_uInt16 nMetric = static_cast<sal_uInt16>(GetDoc()->GetUIUnit());
536
537 if( nMetric == 0xffff )
538 nMetric = static_cast<sal_uInt16>(GetViewShellBase().GetViewFrame().GetDispatcher()->GetModule()->GetFieldUnit());
539
540 pRuler->SetUnit( FieldUnit( nMetric ) );
541
542 // ... and also set DefTab at the ruler
543 pRuler->SetDefTabDist( GetDoc()->GetDefaultTabulator() ); // new
544
545 Fraction aUIScale(pWin->GetMapMode().GetScaleX());
546 aUIScale *= GetDoc()->GetUIScale();
547 pRuler->SetZoom(aUIScale);
548
549 return pRuler;
550}
551
557{
558 VclPtr<SvxRuler> pRuler;
560 SvxRulerSupportFlags nFlags = SvxRulerSupportFlags::OBJECT;
561
562 pRuler = VclPtr<Ruler>::Create(*this, GetParentWindow(), pWin, nFlags,
563 GetViewFrame()->GetBindings(), aWBits);
564
565 // Metric same as HRuler, use document setting
566 sal_uInt16 nMetric = static_cast<sal_uInt16>(GetDoc()->GetUIUnit());
567
568 if( nMetric == 0xffff )
569 nMetric = static_cast<sal_uInt16>(GetViewShellBase().GetViewFrame().GetDispatcher()->GetModule()->GetFieldUnit());
570
571 pRuler->SetUnit( FieldUnit( nMetric ) );
572
573 Fraction aUIScale(pWin->GetMapMode().GetScaleY());
574 aUIScale *= GetDoc()->GetUIScale();
575 pRuler->SetZoom(aUIScale);
576
577 return pRuler;
578}
579
585{
586 Invalidate( SID_ATTR_LONG_LRSPACE );
587 Invalidate( SID_RULER_PAGE_POS );
588 Invalidate( SID_RULER_OBJECT );
589 Invalidate( SID_RULER_TEXT_RIGHT_TO_LEFT );
590
592 mpHorizontalRuler->ForceUpdate();
593}
594
600{
601 Invalidate( SID_ATTR_LONG_LRSPACE );
602 Invalidate( SID_RULER_PAGE_POS );
603 Invalidate( SID_RULER_OBJECT );
604
605 if (mpVerticalRuler)
606 mpVerticalRuler->ForceUpdate();
607}
608
613IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab, void )
614{
615 const ::tools::Long nMax = maViewSize.Width() - maScrBarWH.Width()
616 - maTabControl->GetPosPixel().X() ;
617
618 Size aTabSize = maTabControl->GetSizePixel();
619 aTabSize.setWidth( std::min(pTab->GetSplitSize(), static_cast<::tools::Long>(nMax-1)) );
620
621 maTabControl->SetSizePixel(aTabSize);
622
623 if(GetLayerTabControl()) // #i87182#
624 {
625 GetLayerTabControl()->SetSizePixel(aTabSize);
626 }
627
628 Point aPos = maTabControl->GetPosPixel();
629 aPos.AdjustX(aTabSize.Width() );
630
631 Size aScrSize(nMax - aTabSize.Width(), maScrBarWH.Height());
632 mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize);
633}
634
637{
638 const sal_uInt16 nPageCount = (meEditMode == EditMode::Page)?
641
642 sal_uInt16 nCurrentPage = maTabControl->GetCurPagePos();
643 DBG_ASSERT((nCurrentPage<nPageCount), "sd::DrawViewShell::getCurrentPage(), illegal page index!");
644 if (nCurrentPage >= nPageCount)
645 nCurrentPage = 0; // play safe here
646
648 {
649 return GetDoc()->GetSdPage(nCurrentPage, mePageKind);
650 }
651 else // EditMode::MasterPage
652 {
653 return GetDoc()->GetMasterSdPage(nCurrentPage, mePageKind);
654 }
655}
656
662{
663 if (!GetDoc())
664 return;
665
666 sal_uInt16 nCurrentPageId = maTabControl->GetCurPageId();
667 sal_uInt16 nNewPageId;
668 sal_uInt16 nCurrentPageNum = maTabControl->GetPagePos(nCurrentPageId);
670
672 {
673
674 // Update for TabControl
675 maTabControl->Clear();
676
677 SdPage* pPage = nullptr;
678
679 for (sal_uInt16 i = 0; i < nPageCount; i++)
680 {
681 pPage = GetDoc()->GetSdPage(i, mePageKind);
682 OUString aPageName = pPage->GetName();
683 maTabControl->InsertPage(pPage->getPageId(), aPageName);
684
685 if (nCurrentPageId == pPage->getPageId())
686 {
687 nCurrentPageNum = i;
688 GetDoc()->SetSelected(pPage, true);
689 }
690 else
691 GetDoc()->SetSelected(pPage, false);
692 }
693
694 nNewPageId = maTabControl->GetPageId(nCurrentPageNum);
695 maTabControl->SetCurPageId(nNewPageId);
696 }
697 else // EditMode::MasterPage
698 {
699 maTabControl->Clear();
700
701 sal_uInt16 nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
702 for (sal_uInt16 i = 0; i < nMasterPageCnt; i++)
703 {
704 SdPage* pMaster = GetDoc()->GetMasterSdPage(i, mePageKind);
705 OUString aLayoutName = pMaster->GetLayoutName();
706 sal_Int32 nPos = aLayoutName.indexOf(SD_LT_SEPARATOR);
707 if (nPos != -1)
708 aLayoutName = aLayoutName.copy(0, nPos);
709 maTabControl->InsertPage(pMaster->getPageId(), aLayoutName);
710
711 if (pMaster->getPageId() == nCurrentPageId)
712 nCurrentPageNum = i;
713 }
714
715 nNewPageId = maTabControl->GetPageId(nCurrentPageNum);
716 maTabControl->SetCurPageId(nNewPageId);
717 SwitchPage(nCurrentPageNum);
718 }
719
720 bool bAllowChangeFocus = nNewPageId != nCurrentPageId;
721 SfxBoolItem aI(SID_SWITCHPAGE, bAllowChangeFocus);
722 GetViewFrame()->GetDispatcher()->ExecuteList(SID_SWITCHPAGE,
723 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
724 { &aI });
725}
726
731{
732 if ( mpDrawView->AreObjectsMarked() )
733 {
734 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
735
736 if (rMarkList.GetMarkCount() == 1)
737 {
738 SdrMark* pMark = rMarkList.GetMark(0);
739 SdrObject* pObj = pMark->GetMarkedSdrObj();
740
741 SdrInventor nInv = pObj->GetObjInventor();
742 SdrObjKind nSdrObjKind = pObj->GetObjIdentifier();
743
744 if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2)
745 {
746 ActivateObject( static_cast<SdrOle2Obj*>(pObj), nVerb);
747 }
748 }
749 }
750
751 return ERRCODE_NONE;
752}
753
757bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, sal_Int32 nVerb)
758{
759 bool bActivated = false;
760
761 if ( !GetDocSh()->IsUIActive() )
762 {
763 ToolBarManager::UpdateLock aLock (GetViewShellBase().GetToolBarManager());
764
765 bActivated = ViewShell::ActivateObject(pObj, nVerb);
766 }
767
768 return bActivated;
769}
770
775bool DrawViewShell::SelectPage(sal_uInt16 nPage, sal_uInt16 nSelect)
776{
777 SdPage* pPage = GetDoc()->GetSdPage(nPage, PageKind::Standard);
778
779 //page selector marks pages to selected in view
781
782 if (pPage)
783 {
784 if (nSelect == 0)
785 {
786 GetDoc()->SetSelected(pPage, false); // Deselect.
787 pageSelector.DeselectPage(nPage);
788 }
789 else if (nSelect == 1)
790 {
791 GetDoc()->SetSelected(pPage, true); // Select.
792 pageSelector.SelectPage(nPage);
793 }
794 else
795 {
796 // Toggle.
797 if (pPage->IsSelected())
798 {
799 GetDoc()->SetSelected(pPage, false);
800 pageSelector.DeselectPage(nPage);
801 }
802 else
803 {
804 GetDoc()->SetSelected(pPage, true);
805 pageSelector.SelectPage(nPage);
806 }
807 }
808 return true;
809 }
810
811 return false;
812}
813
814bool DrawViewShell::IsSelected(sal_uInt16 nPage)
815{
818 if (pVShell != nullptr)
819 return pVShell->GetSlideSorter().GetController().GetPageSelector().IsPageSelected(nPage);
820
821 return false;
822}
823
831bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus)
832{
841 return false;
842 mbIsInSwitchPage = true;
844 [this] () { this->mbIsInSwitchPage = false; } );
845
846 if (GetActiveWindow()->IsInPaint())
847 {
848 // Switching the current page while a Paint is being executed is
849 // dangerous. So, post it for later execution and return.
851 [this, nSelectedPage] () { this->SwitchPage(nSelectedPage); } );
852 return false;
853 }
854
855 bool bOK = false;
856
857 // With the current implementation of FuSlideShow there is a problem
858 // when it displays the show in a window: when the show is stopped it
859 // returns at one point in time SDRPAGE_NOTFOUND as current page index.
860 // Because FuSlideShow is currently being rewritten this bug is fixed
861 // here.
862 // This is not as bad a hack as it may look because making SwitchPage()
863 // more robust with respect to invalid page numbers is a good thing
864 // anyway.
865 if (nSelectedPage == SDRPAGE_NOTFOUND)
866 {
867 nSelectedPage = 0;
868 }
869 else
870 {
871 // Make sure that the given page index points to an existing page. Move
872 // the index into the valid range if necessary.
873 sal_uInt16 nPageCount = (meEditMode == EditMode::Page)
876 if (nSelectedPage >= nPageCount)
877 nSelectedPage = nPageCount-1;
878 }
879
881 {
882 ModifyGuard aGuard2( GetDoc() );
883
884 bOK = true;
885
886 if (mpActualPage)
887 {
888 SdPage* pNewPage = nullptr;
889
891 {
892 if( GetDoc()->GetMasterSdPageCount(mePageKind) > nSelectedPage )
893 pNewPage = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
894
895 if( pNewPage )
896 {
897 SdrPageView* pPV = mpDrawView->GetSdrPageView();
898 OUString sPageText(pNewPage->GetLayoutName());
899 sal_Int32 nPos = sPageText.indexOf(SD_LT_SEPARATOR);
900 if (nPos != -1)
901 sPageText = sPageText.copy(0, nPos);
902 if (pPV
903 && pNewPage == dynamic_cast< SdPage* >( pPV->GetPage() )
904 && sPageText == maTabControl->GetPageText(maTabControl->GetPageId(nSelectedPage)))
905 {
906 // this slide is already visible
907 return true;
908 }
909 }
910 }
911 else
912 {
913 OSL_ASSERT(mpFrameView!=nullptr);
914 mpFrameView->SetSelectedPage(nSelectedPage);
915
916 if (GetDoc()->GetSdPageCount(mePageKind) > nSelectedPage)
917 pNewPage = GetDoc()->GetSdPage(nSelectedPage, mePageKind);
918
919 if (mpActualPage == pNewPage)
920 {
921 SdrPageView* pPV = mpDrawView->GetSdrPageView();
922
923 SdPage* pCurrentPage = pPV ? dynamic_cast<SdPage*>(pPV->GetPage()) : nullptr;
924 if (pCurrentPage
925 && pNewPage == pCurrentPage
926 && maTabControl->GetPageText(maTabControl->GetPageId(nSelectedPage)) == pNewPage->GetName())
927 {
928 // this slide is already visible
929 return true;
930 }
931 }
932 }
933 }
934
935 if (bAllowChangeFocus)
936 mpDrawView->SdrEndTextEdit();
937
938 mpActualPage = nullptr;
939
941 {
942 mpActualPage = GetDoc()->GetSdPage(nSelectedPage, mePageKind);
943 }
944 else
945 {
946 SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
947
948 // does the selected page fit to the masterpage?
949 sal_uInt16 nPageCount = GetDoc()->GetSdPageCount(mePageKind);
950 for (sal_uInt16 i = 0; i < nPageCount; i++)
951 {
952 SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
953 if(pPage && pPage->IsSelected() && pMaster == &(pPage->TRG_GetMasterPage()))
954 {
955 mpActualPage = pPage;
956 break;
957 }
958 }
959
960 if (!mpActualPage)
961 {
962 // take the first page, that fits to the masterpage
963 for (sal_uInt16 i = 0; i < nPageCount; i++)
964 {
965 SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
966 if(pPage && pMaster == &(pPage->TRG_GetMasterPage()))
967 {
968 mpActualPage = pPage;
969 break;
970 }
971 }
972 }
973 }
974
975 for (sal_uInt16 i = 0; i < GetDoc()->GetSdPageCount(mePageKind); i++)
976 {
977 // deselect all pages
978 GetDoc()->SetSelected( GetDoc()->GetSdPage(i, mePageKind), false);
979 }
980
981 if (!mpActualPage)
982 {
983 // as far as there is no mpActualPage, take the first
985 }
986
987 // also select this page (mpActualPage always points at a drawing page,
988 // never at a masterpage)
990
992 {
993 // notify LibreOfficeKit about changed page
994 OString aPayload = OString::number(nSelectedPage);
995 if (SfxViewShell* pViewShell = GetViewShell())
996 pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload);
997 }
998
1000 if( !xSlideshow.is() || !xSlideshow->isRunning() || ( xSlideshow->getAnimationMode() != ANIMATIONMODE_SHOW ) )
1001 {
1002 // tighten VisArea, to possibly deactivate objects
1003 // !!! only if we are not in presentation mode (#96279) !!!
1004 OSL_ASSERT (GetViewShell()!=nullptr);
1007 }
1008
1009 // Try to prefetch all graphics for the active page. This will be done
1010 // in threads to be more efficient than loading them on-demand one by one.
1011 std::vector<Graphic*> graphics;
1013 if(graphics.size() > 1) // threading does not help with loading just one
1015
1017 {
1018 /**********************************************************************
1019 * PAGEMODE
1020 **********************************************************************/
1022
1023 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
1024
1025 if (pPageView)
1026 {
1030
1032 {
1034 }
1035 else if (mePageKind == PageKind::Handout)
1036 {
1038 }
1039 else
1040 {
1042 }
1043 }
1044
1045 mpDrawView->HideSdrPage();
1046 maTabControl->SetCurPageId(maTabControl->GetPageId(nSelectedPage));
1047 mpDrawView->ShowSdrPage(mpActualPage);
1049
1050 SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
1051
1052 if (pNewPageView)
1053 {
1054 pNewPageView->SetVisibleLayers( mpFrameView->GetVisibleLayers() );
1056 pNewPageView->SetLockedLayers( mpFrameView->GetLockedLayers() );
1057
1059 {
1060 pNewPageView->SetHelpLines( mpFrameView->GetNotesHelpLines() );
1061 }
1062 else if (mePageKind == PageKind::Handout)
1063 {
1064 pNewPageView->SetHelpLines( mpFrameView->GetHandoutHelpLines() );
1065 }
1066 else
1067 {
1068 pNewPageView->SetHelpLines( mpFrameView->GetStandardHelpLines() );
1069 }
1070 }
1071
1072 OUString aPageName = mpActualPage->GetName();
1073
1074 if (maTabControl->GetPageText(maTabControl->GetPageId(nSelectedPage)) != aPageName)
1075 {
1076 maTabControl->SetPageText(maTabControl->GetPageId(nSelectedPage), aPageName);
1077 }
1078 }
1079 else
1080 {
1081 /**********************************************************************
1082 * MASTERPAGE
1083 **********************************************************************/
1084 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
1085
1086 if (pPageView)
1087 {
1091
1093 {
1095 }
1096 else if (mePageKind == PageKind::Handout)
1097 {
1099 }
1100 else
1101 {
1103 }
1104 }
1105
1106 mpDrawView->HideSdrPage();
1107 maTabControl->SetCurPageId(maTabControl->GetPageId(nSelectedPage));
1108
1109 SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
1110
1111 if( !pMaster ) // if this page should not exist
1112 pMaster = GetDoc()->GetMasterSdPage(0, mePageKind);
1113
1114 sal_uInt16 nNum = pMaster->GetPageNum();
1115 mpDrawView->ShowSdrPage(mpDrawView->GetModel().GetMasterPage(nNum));
1116
1118
1119 SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
1120
1121 if (pNewPageView)
1122 {
1123 pNewPageView->SetVisibleLayers( mpFrameView->GetVisibleLayers() );
1125 pNewPageView->SetLockedLayers( mpFrameView->GetLockedLayers() );
1126
1128 {
1129 pNewPageView->SetHelpLines( mpFrameView->GetNotesHelpLines() );
1130 }
1131 else if (mePageKind == PageKind::Handout)
1132 {
1133 pNewPageView->SetHelpLines( mpFrameView->GetHandoutHelpLines() );
1134 }
1135 else
1136 {
1137 pNewPageView->SetHelpLines( mpFrameView->GetStandardHelpLines() );
1138 }
1139 }
1140
1141 OUString aLayoutName(pMaster->GetLayoutName());
1142 sal_Int32 nPos = aLayoutName.indexOf(SD_LT_SEPARATOR);
1143 if (nPos != -1)
1144 aLayoutName = aLayoutName.copy(0, nPos);
1145
1146 if (maTabControl->GetPageText(maTabControl->GetPageId(nSelectedPage)) != aLayoutName)
1147 {
1148 maTabControl->SetPageText(maTabControl->GetPageId(nSelectedPage), aLayoutName);
1149 }
1150
1152 {
1153 // set pages for all available handout presentation objects
1154 sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList();
1155 SdrObject* pObj = nullptr;
1156 rShapeList.seekShape(0);
1157
1158 while( (pObj = rShapeList.getNextShape()) )
1159 {
1160 if( pMaster->GetPresObjKind(pObj) == PresObjKind::Handout )
1161 {
1162 // #i105146# We want no content to be displayed for PageKind::Handout,
1163 // so just never set a page as content
1164 static_cast<SdrPageObj*>(pObj)->SetReferencedPage(nullptr);
1165 }
1166 }
1167 }
1168 }
1169
1170 Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
1171 ::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( ::tools::Rectangle( Point(0,0), aVisSizePixel) );
1172 VisAreaChanged(aVisAreaWin);
1173 mpDrawView->VisAreaChanged(GetActiveWindow()->GetOutDev());
1174
1175 // so navigator (and effect window) notice that
1176 SfxBindings& rBindings = GetViewFrame()->GetBindings();
1177 rBindings.Invalidate(SID_NAVIGATOR_STATE, true);
1178 rBindings.Invalidate(SID_NAVIGATOR_PAGENAME, true);
1179 rBindings.Invalidate(SID_STATUS_PAGE, true);
1180 rBindings.Invalidate(SID_DELETE_MASTER_PAGE, true);
1181 rBindings.Invalidate(SID_DELETE_PAGE, true);
1182 rBindings.Invalidate(SID_ASSIGN_LAYOUT, true);
1183 rBindings.Invalidate(SID_INSERTPAGE, true);
1185
1186 mpDrawView->AdjustMarkHdl();
1187 }
1188
1189 return bOK;
1190}
1191
1197{
1198 bool bOK = true;
1199
1200 FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
1201 if (pFormShell != nullptr && !pFormShell->PrepareClose(false))
1202 bOK = false;
1203
1204 return bOK;
1205}
1206
1212{
1213 LayerTabBar* pLayerBar = GetLayerTabControl();
1214 if (pLayerBar == nullptr)
1215 return;
1216
1217 // remember old tab count and current tab id
1218 // this is needed when one layer is renamed to
1219 // restore current tab
1220 sal_uInt16 nOldLayerCnt = pLayerBar->GetPageCount(); // actually it is tab count
1221 sal_uInt16 nOldLayerPos = pLayerBar->GetCurPageId(); // actually it is a tab nId
1222
1226 pLayerBar->Clear();
1227
1228 OUString aName; // a real layer name
1229 OUString aActiveLayer = mpDrawView->GetActiveLayer();
1230 sal_uInt16 nActiveLayerPos = SDRLAYERPOS_NOTFOUND;
1231 SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
1232 sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount();
1233
1234 for ( sal_uInt16 nLayerPos = 0; nLayerPos < nLayerCnt; nLayerPos++ )
1235 {
1236 aName = rLayerAdmin.GetLayer(nLayerPos)->GetName();
1237
1238 if ( aName == aActiveLayer )
1239 {
1240 nActiveLayerPos = nLayerPos;
1241 }
1242
1243 if ( aName != sUNO_LayerName_background ) // layer "background" has never a tab
1244 {
1246 {
1247 // don't show page layer onto the masterpage
1251 {
1252 TabBarPageBits nBits = TabBarPageBits::NONE;
1253 SdrPageView* pPV = mpDrawView->GetSdrPageView();
1254 if (pPV)
1255 {
1256 if (!pPV->IsLayerVisible(aName))
1257 {
1258 nBits |= TabBarPageBits::Blue;
1259 }
1260 if (pPV->IsLayerLocked(aName))
1261 {
1262 nBits |= TabBarPageBits::Italic;
1263 }
1264 if (!pPV->IsLayerPrintable(aName))
1265 {
1266 nBits |= TabBarPageBits::Underline;
1267 }
1268 }
1269
1270 pLayerBar->InsertPage(nLayerPos+1, aName, nBits); // why +1? It is a nId, not a position. Position is APPEND.
1271 }
1272 }
1273 else
1274 {
1275 // don't show masterpage layer onto the page
1277 {
1278 TabBarPageBits nBits = TabBarPageBits::NONE;
1279 if (!mpDrawView->GetSdrPageView()->IsLayerVisible(aName))
1280 {
1281 nBits = TabBarPageBits::Blue;
1282 }
1283 if (mpDrawView->GetSdrPageView()->IsLayerLocked(aName))
1284 {
1285 nBits |= TabBarPageBits::Italic;
1286 }
1287 if (!mpDrawView->GetSdrPageView()->IsLayerPrintable(aName))
1288 {
1289 nBits |= TabBarPageBits::Underline;
1290 }
1291
1292 pLayerBar->InsertPage(nLayerPos+1, aName, nBits);// why +1?
1293 }
1294 }
1295 }
1296 }
1297
1298 if ( nActiveLayerPos == SDRLAYERPOS_NOTFOUND )
1299 {
1300 if( nOldLayerCnt == pLayerBar->GetPageCount() )
1301 {
1302 nActiveLayerPos = nOldLayerPos - 1;
1303 }
1304 else
1305 {
1306 nActiveLayerPos = ( meEditMode == EditMode::MasterPage ) ? 2 : 0;
1307 }
1308
1309 mpDrawView->SetActiveLayer( pLayerBar->GetLayerName(nActiveLayerPos + 1) );// why +1?
1310 }
1311
1312 pLayerBar->SetCurPageId(nActiveLayerPos + 1);
1313 GetViewFrame()->GetBindings().Invalidate( SID_TOGGLELAYERVISIBILITY );
1314 GetViewFrame()->GetBindings().Invalidate( SID_MODIFYLAYER );
1315 GetViewFrame()->GetBindings().Invalidate( SID_DELETE_LAYER );
1316}
1317
1323 const AcceptDropEvent& rEvt,
1324 DropTargetHelper& rTargetHelper,
1325 ::sd::Window* /*pTargetWindow*/,
1326 sal_uInt16 /*nPage*/,
1327 SdrLayerID nLayer )
1328{
1330 return DND_ACTION_NONE;
1331
1332 return mpDrawView->AcceptDrop( rEvt, rTargetHelper, nLayer );
1333}
1334
1340 const ExecuteDropEvent& rEvt,
1341 DropTargetHelper& /*rTargetHelper*/,
1342 ::sd::Window* pTargetWindow,
1343 sal_uInt16 nPage,
1344 SdrLayerID nLayer)
1345{
1346 if( nPage != SDRPAGE_NOTFOUND )
1347 nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum();
1348
1350 return DND_ACTION_NONE;
1351
1353 sal_Int8 nResult (mpDrawView->ExecuteDrop( rEvt, pTargetWindow, nPage, nLayer ));
1355
1356 return nResult;
1357}
1358
1359} // end of namespace sd
1360
1361/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool PrepareClose(bool bUI=true)
void MakeGraphicsAvailableThreaded(std::vector< Graphic * > &rGraphics)
static GraphicFilter & GetGraphicFilter()
const Fraction & GetScaleX() const
const Fraction & GetScaleY() const
tools::Long AdjustX(tools::Long nHorzMove)
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:222
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
Definition: drawdoc2.cxx:217
SAL_DLLPRIVATE void SetSelected(SdPage *pPage, bool bSelect)
Definition: drawdoc2.cxx:461
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:212
sd::ShapeList & GetPresentationShapeList()
Definition: sdpage.hxx:166
bool IsSelected() const
Definition: sdpage.hxx:208
PresObjKind GetPresObjKind(SdrObject *pObj) const
Definition: sdpage.cxx:2309
virtual OUString GetLayoutName() const override
Definition: sdpage.hxx:255
const OUString & GetName() const
Definition: sdpage.cxx:2505
sal_uInt16 getPageId() const
Definition: sdpage.hxx:376
void getGraphicsForPrefetch(std::vector< Graphic * > &graphics) const
Returns graphics objects from the page that can be prefetched before it's painted.
Definition: sdpage2.cxx:611
sal_uInt16 GetLayerCount() const
SdrLayer * GetLayer(sal_uInt16 i)
const OUString & GetName() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
sal_uInt16 GetDefaultTabulator() const
FieldUnit GetUIUnit() const
const Fraction & GetUIScale() const
const SdrLayerAdmin & GetLayerAdmin() const
virtual SdrInventor GetObjInventor() const
virtual SdrObjKind GetObjIdentifier() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
const SdrLayerIDSet & GetVisibleLayers() const
void SetLockedLayers(const SdrLayerIDSet &rSet)
void SetVisibleLayers(const SdrLayerIDSet &rSet)
bool IsLayerVisible(const OUString &rName) const
void SetPrintableLayers(const SdrLayerIDSet &rSet)
const SdrHelpLineList & GetHelpLines() const
const SdrLayerIDSet & GetLockedLayers() const
SdrPage * GetPage() const
bool IsLayerLocked(const OUString &rName) const
const SdrLayerIDSet & GetPrintableLayers() const
bool IsLayerPrintable(const OUString &rName) const
void SetHelpLines(const SdrHelpLineList &rHLL)
SdrPage & TRG_GetMasterPage() const
sal_uInt16 GetPageNum() 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 * >())
SfxModule * GetModule() const
bool IsObjectInPlaceActive() const
void DeactivateObject()
FieldUnit GetFieldUnit() const
bool SetContextBroadcasterEnabled(const bool bIsEnabled)
void SetVerbs(const css::uno::Sequence< css::embed::VerbDescriptor > &aVerbs)
void SetContextName(const OUString &rsContextName)
virtual void Invalidate(sal_uInt16 nId=0)
SfxViewShell * GetViewShell() const
void UIFeatureChanged()
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxDispatcher * GetDispatcher()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
void DisconnectAllClients()
SfxViewFrame & GetViewFrame() const
SfxInPlaceClient * GetIPClient() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
void SetCurPageId(sal_uInt16 nPageId)
void EndEditMode(bool bCancel=false)
void Clear()
sal_uInt16 GetPageCount() const
sal_uInt16 GetCurPageId() const
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
static VclPtr< reference_type > Create(Arg &&... arg)
void BroadcastContextChange() const
Broadcast a sidebar context change that is caused by a view switch.
void FireChangeEditMode(bool bMasterPageMode) noexcept
Call this method when the edit mode has changed.
void FireSelectionChangeListener() noexcept
Call this method when the selection has changed.
void FireChangeLayerMode(bool bLayerMode) noexcept
Call this method when the layer mode has changed.
void FireSwitchCurrentPage(SdPage *pCurrentPage) noexcept
Call this method when there is a new current page.
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
bool mbIsInSwitchPage
This flag is used to prevent nested calls to SwitchPage().
bool IsSelected(sal_uInt16 nPage)
Definition: drviews1.cxx:814
virtual void UIActivating(SfxInPlaceClient *) override
Definition: drviews1.cxx:100
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
Definition: drviews1.cxx:636
std::unique_ptr< DrawView > mpDrawView
void UpdateIMapDlg(SdrObject *pObj)
Definition: drviewsc.cxx:36
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect) override
Set zoom rectangle for active window.
Definition: drviews1.cxx:298
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
virtual void Activate(bool bIsMDIActivate) override
set focus to working window
Definition: drviews1.cxx:79
virtual ErrCode DoVerb(sal_Int32 nVerb) override
Apply "Verb" on OLE-object.
Definition: drviews1.cxx:730
::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) override
AcceptDrop.
Definition: drviews1.cxx:1322
virtual void UpdateVRuler() override
Refresh vertical ruler.
Definition: drviews1.cxx:599
VclPtr< TabControl > maTabControl
bool mbFirstTimeActivation
Prevents grabbing focus while loading - see tdf#83773 that introduced the grabbing,...
virtual void ChangeEditMode(EditMode eMode, bool bIsLayerModeActive)
Set status (enabled/disabled) of menu SfxSlots.
Definition: drviews1.cxx:333
bool mbIsLayerModeActive
This flag controls whether the layer mode is active, i.e.
virtual VclPtr< SvxRuler > CreateVRuler(::sd::Window *pWin) override
Generate vertical ruler.
Definition: drviews1.cxx:556
tools::AsynchronousCall maAsynchronousSwitchPageCall
On some occasions it is necessary to make SwitchPage calls asynchronously.
virtual VclPtr< SvxRuler > CreateHRuler(::sd::Window *pWin) override
Generate horizontal ruler.
Definition: drviews1.cxx:520
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) override
ExecuteDrop.
Definition: drviews1.cxx:1339
SD_DLLPUBLIC LayerTabBar * GetLayerTabControl()
Return a pointer to the tab control for layers.
Definition: drviews5.cxx:636
virtual void UIDeactivated(SfxInPlaceClient *) override
Definition: drviews1.cxx:110
OUString const & GetSidebarContextName() const
Definition: drviewsa.cxx:773
bool SelectPage(sal_uInt16 nPage, sal_uInt16 nSelect)
Mark the desired page as selected (1), deselected (0), toggle (2).
Definition: drviews1.cxx:775
void ConfigureAppBackgroundColor(svtools::ColorConfig *pColorConfig=nullptr)
Definition: drviewsk.cxx:45
bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus=true)
Switch to desired page.
Definition: drviews1.cxx:831
virtual bool PrepareClose(bool bUI=true) override
PrepareClose, as appropriate end text input, so other viewshells discover a refreshed text object.
Definition: drviews1.cxx:311
void ResetActualPage()
Select new refreshed page, in case of a page order change (eg.
Definition: drviews1.cxx:661
bool IsSwitchPageAllowed() const
Check if page change is allowed.
Definition: drviews1.cxx:1196
void SelectionHasChanged()
Called, if state of selection of view is changed.
Definition: drviews1.cxx:156
virtual bool ActivateObject(SdrOle2Obj *pObj, sal_Int32 nVerb) override
Activate OLE-object.
Definition: drviews1.cxx:757
virtual void UpdateHRuler() override
Refresh horizontal ruler.
Definition: drviews1.cxx:584
void ResetActualLayer()
Select new refreshed page, in case of a page order change (eg.
Definition: drviews1.cxx:1211
virtual void SetZoom(::tools::Long nZoom) override
set zoom factor
Definition: drviews1.cxx:282
virtual void Deactivate(bool IsMDIActivate) override
Definition: drviews1.cxx:120
void SetLockedLayers(const SdrLayerIDSet &rLockedLayers)
Definition: FrameView.hxx:61
void SetNotesHelpLines(const SdrHelpLineList &rHelpLines)
Definition: FrameView.hxx:50
const SdrHelpLineList & GetStandardHelpLines() const
Definition: FrameView.hxx:49
void SetPrintableLayers(const SdrLayerIDSet &rPrintableLayers)
Definition: FrameView.hxx:65
const SdrHelpLineList & GetHandoutHelpLines() const
Definition: FrameView.hxx:55
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
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
OUString GetLayerName(sal_uInt16 nPageId) const
Definition: LayerTabBar.cxx:90
virtual void InsertPage(sal_uInt16 nPageId, const OUString &rText, TabBarPageBits nBits=TabBarPageBits::NONE, sal_uInt16 nPos=TabBar::APPEND) override
an instance of this guard disables modification of a document during its lifetime
Definition: drawdoc.hxx:705
SdrObject * getNextShape()
returns the shape the internal iterator points to, or 0 if the list end is reached.
Definition: shapelist.cxx:116
void seekShape(sal_uInt32 nIndex)
Sets the internal iterator to the shape at given index.
Definition: shapelist.cxx:128
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
Definition: slideshow.cxx:208
static rtl::Reference< SlideShow > GetSlideShow(SdDrawDocument const *pDocument)
Definition: slideshow.cxx:157
Use this class to prevent the visible tool bars from being updated (and thus causing repaints and GUI...
static constexpr OUStringLiteral msCommonTaskToolBar
static constexpr OUStringLiteral msMasterViewToolBar
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
DrawController * GetDrawController() const
std::shared_ptr< ToolBarManager > const & GetToolBarManager() const
std::shared_ptr< FormShellManager > const & GetFormShellManager() const
std::shared_ptr< ViewShellManager > const & GetViewShellManager() const
Local derivation of the SfxHint class that defines some hint ids that are used by the ViewShell class...
Use this class to safely lock updates of the view shell stack.
virtual void UpdatePreview(SdPage *pPage)
This method is still used by the OutlineViewShell to update the model according to the content of the...
Definition: viewshel.cxx:1087
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
Definition: viewshel.cxx:1407
VclPtr< SvxRuler > mpHorizontalRuler
Horizontal ruler is not shown by default.
Definition: ViewShell.hxx:441
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
Definition: viewshel.cxx:1493
const rtl::Reference< FuPoor > & GetCurrentFunction() const
Definition: ViewShell.hxx:250
FrameView * mpFrameView
Definition: ViewShell.hxx:453
SdDrawDocument * GetDoc() const
Definition: viewshel.cxx:1412
virtual void SetZoom(::tools::Long nZoom)
Set zoom factor for all split windows.
Definition: viewshe2.cxx:309
std::unique_ptr< Implementation, o3tl::default_delete< Implementation > > mpImpl
Definition: ViewShell.hxx:485
virtual bool ActivateObject(SdrOle2Obj *pObj, sal_Int32 nVerb)
Definition: viewshe2.cxx:624
VclPtr< SvxRuler > mpVerticalRuler
Vertical ruler is not shown by default.
Definition: ViewShell.hxx:443
void InvalidateWindows()
Invalidate all split windows below the ?provided rectangle.
Definition: viewshe2.cxx:433
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
Definition: ViewShell.hxx:155
virtual bool PrepareClose(bool bUI=true)
Tell the FmFormShell that the view shell is closing.
Definition: viewshel.cxx:1076
vcl::Window * GetParentWindow() const
Return the window that is the parent of all controls of this view shell.
Definition: ViewShell.hxx:140
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect)
Set zoom rectangle for active window.
Definition: viewshe2.cxx:358
virtual void UIActivating(SfxInPlaceClient *)
Definition: viewshel.cxx:338
virtual void Activate(bool IsMDIActivate) override
set focus to working window
Definition: viewshel.cxx:289
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
virtual void UIDeactivated(SfxInPlaceClient *)
Definition: viewshel.cxx:344
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
bool HasCurrentFunction() const
Definition: ViewShell.hxx:252
SD_DLLPUBLIC ShellType GetShellType() const
Return the type of the shell.
Definition: viewshel.cxx:1402
virtual void Deactivate(bool IsMDIActivate) override
Definition: viewshel.cxx:352
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
void GrabFocus()
Activate window.
Definition: sdwindow.cxx:750
SD_DLLPUBLIC SlideSorter & GetSlideSorter() const
static SD_DLLPUBLIC SlideSorterViewShell * GetSlideSorter(ViewShellBase &rBase)
Return a slide sorter that is currently displayed in one of the panes that belong to the given ViewSh...
SD_DLLPUBLIC controller::SlideSorterController & GetController() const
void Post(const AsynchronousFunction &rFunction)
static bool IsActive(bool bConsiderSingleToolbar=false)
const MapMode & GetMapMode() const
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual SfxBindings & GetBindings() override
#define ERRCODE_NONE
FieldUnit
constexpr OUStringLiteral SD_LT_SEPARATOR
Definition: glob.hxx:49
OUString aName
sal_uInt16 nPos
int i
@ ANIMATIONMODE_SHOW
Definition: slideshow.hxx:72
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
long Long
EditMode
Definition: pres.hxx:53
constexpr WinBits WB_EXTRAFIELD
SvxRulerSupportFlags
std::map< OUString, OUString > aParameters
#define SDRLAYERPOS_NOTFOUND
SdrInventor
SdrObjKind
#define SDRPAGE_NOTFOUND
TabBarPageBits
#define DND_ACTION_NONE
signed char sal_Int8
constexpr OUStringLiteral sUNO_LayerName_measurelines
Definition: unokywds.hxx:33
constexpr OUStringLiteral sUNO_LayerName_background_objects
Definition: unokywds.hxx:30
constexpr OUStringLiteral sUNO_LayerName_layout
Definition: unokywds.hxx:31
constexpr OUStringLiteral sUNO_LayerName_controls
Definition: unokywds.hxx:32
constexpr OUStringLiteral sUNO_LayerName_background
Definition: unokywds.hxx:29
sal_Int64 WinBits
WinBits const WB_3DLOOK
WinBits const WB_BORDER
WinBits const WB_VSCROLL
WinBits const WB_HSCROLL