LibreOffice Module sd (master) 1
DrawController.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 <DrawController.hxx>
21
22#include <sdpage.hxx>
23#include <ViewShell.hxx>
24#include <ViewShellBase.hxx>
25#include <ViewShellManager.hxx>
26#include <FormShellManager.hxx>
27#include <Window.hxx>
30
36
37#include <com/sun/star/beans/PropertyAttribute.hpp>
38#include <com/sun/star/drawing/XDrawSubController.hpp>
39#include <com/sun/star/drawing/XLayer.hpp>
40
41#include <slideshow.hxx>
42
43#include <sal/log.hxx>
44#include <svx/fmshell.hxx>
45#include <vcl/svapp.hxx>
46#include <vcl/EnumContext.hxx>
49
50#include <memory>
51
52using namespace ::cppu;
53using namespace ::com::sun::star;
54using namespace ::com::sun::star::uno;
57
58namespace sd {
59
62 BroadcastHelperOwner(SfxBaseController::m_aMutex),
64 mpCurrentLayer(nullptr),
65 m_aSelectionTypeIdentifier(
67 mpBase(&rBase),
68 mpCurrentPage(nullptr),
69 mbMasterPageMode(false),
70 mbLayerMode(false),
71 mbDisposing(false)
72{
73 ProvideFrameworkControllers();
74}
75
77{
78}
79
81 const Reference<drawing::XDrawSubController>& rxSubController)
82{
83 // Update the internal state.
84 mxSubController = rxSubController;
87
88 // Inform listeners about the changed state.
90}
91
92// XInterface
93
97 OPropertySetHelper);
98
99// XTypeProvider
100
101Sequence<Type> SAL_CALL DrawController::getTypes()
102{
104 // OPropertySetHelper does not provide getTypes, so we have to
105 // implement this method manually and list its three interfaces.
106 OTypeCollection aTypeCollection (
110
111 return ::comphelper::concatSequences(
112 SfxBaseController::getTypes(),
113 aTypeCollection.getTypes(),
114 DrawControllerInterfaceBase::getTypes());
115}
116
118
119// XComponent
120
122{
123 if( mbDisposing )
124 return;
125
126 SolarMutexGuard aGuard;
127
128 if( mbDisposing )
129 return;
130
131 mbDisposing = true;
132
133 std::shared_ptr<ViewShell> pViewShell;
134 if (mpBase)
135 pViewShell = mpBase->GetMainViewShell();
136 if ( pViewShell )
137 {
138 pViewShell->DeactivateCurrentFunction();
139 auto* pView = pViewShell->GetView();
140 if (pView)
141 pView->getSearchContext().resetSearchFunction();
142 }
143 pViewShell.reset();
144
145 // When the controller has not been detached from its view
146 // shell, i.e. mpViewShell is not NULL, then tell PaneManager
147 // and ViewShellManager to clear the shell stack.
148 if (mxSubController.is() && mpBase!=nullptr)
149 {
151 mpBase->GetViewShellManager()->Shutdown();
152 }
153
154 OPropertySetHelper::disposing();
155
157
159}
160
162 const Reference<lang::XEventListener >& xListener)
163{
166}
167
169 const Reference<lang::XEventListener >& aListener)
170{
173}
174
175// XController
177{
178 if( Suspend )
179 {
180 ViewShellBase* pViewShellBase = GetViewShellBase();
181 if( pViewShellBase )
182 {
183 // do not allow suspend if a slideshow needs this controller!
184 rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( *pViewShellBase ) );
185 if( xSlideShow.is() && xSlideShow->dependsOn(pViewShellBase) )
186 return false;
187 }
188 }
189
190 return SfxBaseController::suspend( Suspend );
191}
192
193// XServiceInfo
195{
196 // Do not throw an exception at the moment. This leads to a crash
197 // under Solaris on reload. See issue i70929 for details.
198 // ThrowIfDisposed();
199 return "DrawController" ;
200}
201
202constexpr OUStringLiteral ssServiceName = u"com.sun.star.drawing.DrawingDocumentDrawView";
203
204sal_Bool SAL_CALL DrawController::supportsService (const OUString& rsServiceName)
205{
206 return cppu::supportsService(this, rsServiceName);
207}
208
209Sequence<OUString> SAL_CALL DrawController::getSupportedServiceNames()
210{
212 Sequence<OUString> aSupportedServices { ssServiceName };
213 return aSupportedServices;
214}
215
216//------ XSelectionSupplier --------------------------------------------
217sal_Bool SAL_CALL DrawController::select (const Any& aSelection)
218{
220 SolarMutexGuard aGuard;
221
222 if (mxSubController.is())
223 return mxSubController->select(aSelection);
224 else
225 return false;
226}
227
229{
231 SolarMutexGuard aGuard;
232
233 if (mxSubController.is())
234 return mxSubController->getSelection();
235 else
236 return Any();
237}
238
240 const Reference< view::XSelectionChangeListener >& xListener)
241{
242 if( mbDisposing )
243 throw lang::DisposedException();
244
246}
247
249 const Reference< view::XSelectionChangeListener >& xListener )
250{
252 throw lang::DisposedException();
253
255}
256
257//===== lang::XEventListener ================================================
258
259void SAL_CALL
260 DrawController::disposing (const lang::EventObject& )
261{
262}
263
264//===== view::XSelectionChangeListener ======================================
265
266void SAL_CALL
267 DrawController::selectionChanged (const lang::EventObject& rEvent)
268{
270 // Have to forward the event to our selection change listeners.
271 OInterfaceContainerHelper* pListeners = BroadcastHelperOwner::maBroadcastHelper.getContainer(
273 if (!pListeners)
274 return;
275
276 // Re-send the event to all of our listeners.
277 OInterfaceIteratorHelper aIterator (*pListeners);
278 while (aIterator.hasMoreElements())
279 {
280 try
281 {
282 view::XSelectionChangeListener* pListener =
283 static_cast<view::XSelectionChangeListener*>(
284 aIterator.next());
285 if (pListener != nullptr)
286 pListener->selectionChanged (rEvent);
287 }
288 catch (const RuntimeException&)
289 {
290 }
291 }
292}
293
294// XDrawView
295
296void SAL_CALL DrawController::setCurrentPage( const Reference< drawing::XDrawPage >& xPage )
297{
299 SolarMutexGuard aGuard;
300
301 if (mxSubController.is())
302 mxSubController->setCurrentPage(xPage);
303}
304
305Reference< drawing::XDrawPage > SAL_CALL DrawController::getCurrentPage()
306{
308 SolarMutexGuard aGuard;
309 Reference<drawing::XDrawPage> xPage;
310
311 // Get current page from sub controller.
312 if (mxSubController.is())
313 xPage = mxSubController->getCurrentPage();
314
315 // When there is not yet a sub controller (during initialization) then fall back
316 // to the current page in mpCurrentPage.
317 if ( ! xPage.is() )
319 xPage.set(pPage->getUnoPage(), UNO_QUERY);
320
321 return xPage;
322}
323
324void DrawController::FireVisAreaChanged (const ::tools::Rectangle& rVisArea) noexcept
325{
326 if( maLastVisArea == rVisArea )
327 return;
328
329 Any aNewValue;
330 aNewValue <<= awt::Rectangle(
331 rVisArea.Left(),
332 rVisArea.Top(),
333 rVisArea.GetWidth(),
334 rVisArea.GetHeight() );
335
336 Any aOldValue;
337 aOldValue <<= awt::Rectangle(
338 maLastVisArea.Left(),
339 maLastVisArea.Top(),
340 maLastVisArea.GetWidth(),
341 maLastVisArea.GetHeight() );
342
343 FirePropertyChange (PROPERTY_WORKAREA, aNewValue, aOldValue);
344
345 maLastVisArea = rVisArea;
346}
347
349{
350 OInterfaceContainerHelper * pLC = BroadcastHelperOwner::maBroadcastHelper.getContainer(
352 if( !pLC )
353 return;
354
355 Reference< XInterface > xSource( static_cast<XWeak*>(this) );
356 const lang::EventObject aEvent( xSource );
357
358 // iterate over all listeners and send events
359 OInterfaceIteratorHelper aIt( *pLC);
360 while( aIt.hasMoreElements() )
361 {
362 try
363 {
364 view::XSelectionChangeListener * pL =
365 static_cast<view::XSelectionChangeListener*>(aIt.next());
366 if (pL != nullptr)
367 pL->selectionChanged( aEvent );
368 }
369 catch (const RuntimeException&)
370 {
371 }
372 }
373}
374
375void DrawController::FireChangeEditMode (bool bMasterPageMode) noexcept
376{
377 if (bMasterPageMode != mbMasterPageMode )
378 {
379 FirePropertyChange(
380 PROPERTY_MASTERPAGEMODE,
381 Any(bMasterPageMode),
382 Any(mbMasterPageMode));
383
384 mbMasterPageMode = bMasterPageMode;
385 }
386}
387
388void DrawController::FireChangeLayerMode (bool bLayerMode) noexcept
389{
390 if (bLayerMode != mbLayerMode)
391 {
392 FirePropertyChange(
393 PROPERTY_LAYERMODE,
394 Any(bLayerMode),
395 Any(mbLayerMode));
396
397 mbLayerMode = bLayerMode;
398 }
399}
400
401void DrawController::FireSwitchCurrentPage (SdPage* pNewCurrentPage) noexcept
402{
403 rtl::Reference<SdrPage> pCurrentPage = mpCurrentPage.get();
404 if (pNewCurrentPage == pCurrentPage.get())
405 return;
406
407 try
408 {
409 Any aNewValue (
410 Any(Reference<drawing::XDrawPage>(pNewCurrentPage->getUnoPage(), UNO_QUERY)));
411
412 Any aOldValue;
413 if (pCurrentPage != nullptr)
414 {
415 Reference<drawing::XDrawPage> xOldPage (pCurrentPage->getUnoPage(), UNO_QUERY);
416 aOldValue <<= xOldPage;
417 }
418
419 FirePropertyChange(PROPERTY_CURRENTPAGE, aNewValue, aOldValue);
420
421 mpCurrentPage = pNewCurrentPage;
422 }
423 catch (const uno::Exception&)
424 {
425 TOOLS_WARN_EXCEPTION("sd", "sd::SdUnoDrawView::FireSwitchCurrentPage()");
426 }
427}
428
430{
431 sal_Int32 nHandle = PROPERTY_UPDATEACC;
432 Any aNewValue, aOldValue;
433 fire (&nHandle, &aNewValue, &aOldValue, 1, false);
434}
435
436void DrawController::fireChangeLayer( css::uno::Reference< css::drawing::XLayer>* pCurrentLayer ) noexcept
437{
438 if( pCurrentLayer != mpCurrentLayer )
439 {
440 sal_Int32 nHandle = PROPERTY_ACTIVE_LAYER;
441
442 Any aNewValue ( *pCurrentLayer);
443
444 Any aOldValue ;
445
446 fire (&nHandle, &aNewValue, &aOldValue, 1, false);
447
448 mpCurrentLayer = pCurrentLayer;
449 }
450}
451
452// This method is only called in slide show and outline view
453//void DrawController::fireSwitchCurrentPage(String pageName ) throw()
454void DrawController::fireSwitchCurrentPage(sal_Int32 pageIndex ) noexcept
455{
456 Any aNewValue;
457 Any aOldValue;
458 //OUString aPageName( pageName );
459 //aNewValue <<= aPageName ;
460 aNewValue <<= pageIndex;
461
462 // Use new property to handle page change event
463 sal_Int32 nHandles = PROPERTY_PAGE_CHANGE;
464 fire( &nHandles, &aNewValue, &aOldValue, 1, false );
465}
466
468 sal_Int32 nHandle,
469 const Any& rNewValue,
470 const Any& rOldValue)
471{
472 try
473 {
474 fire (&nHandle, &rNewValue, &rOldValue, 1, false);
475 }
476 catch (const RuntimeException&)
477 {
478 // Ignore this exception. Exceptions should be handled in the
479 // fire() function so that all listeners are called. This is
480 // not the case at the moment, so we simply ignore the
481 // exception.
482 }
483
484}
485
487{
488 std::shared_ptr<ViewShell> pViewShell (mpBase->GetMainViewShell());
489 if ( ! pViewShell)
490 return;
491
492 EnumContext::Context eContext (EnumContext::Context::Unknown);
493 switch (pViewShell->GetShellType())
494 {
499 else
500 eContext = EnumContext::Context::DrawPage;
501 break;
502
504 eContext = EnumContext::Context::NotesPage;
505 break;
506
508 eContext = EnumContext::Context::HandoutPage;
509 break;
510
512 eContext = EnumContext::Context::OutlineText;
513 break;
514
516 eContext = EnumContext::Context::SlidesorterPage;
517 break;
518
521 default:
522 eContext = EnumContext::Context::Empty;
523 break;
524 }
525
527}
528
530{
532 mpBase = nullptr;
533}
534
535//===== XControllerManager ==============================================================
536
537Reference<XConfigurationController> SAL_CALL
539{
541
543}
544
545Reference<XModuleController> SAL_CALL
547{
549
550 return mxModuleController;
551}
552
553//===== Properties ============================================================
554
556 ::std::vector<beans::Property>& rProperties)
557{
558 rProperties.emplace_back("VisibleArea",
561 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY);
562 rProperties.emplace_back(
563 "SubController",
566 beans::PropertyAttribute::BOUND);
567 rProperties.emplace_back(
568 "CurrentPage",
571 beans::PropertyAttribute::BOUND );
572 rProperties.emplace_back("IsLayerMode",
575 beans::PropertyAttribute::BOUND );
576 rProperties.emplace_back("IsMasterPageMode",
579 beans::PropertyAttribute::BOUND );
580 rProperties.emplace_back("ActiveLayer",
583 beans::PropertyAttribute::BOUND );
584 rProperties.emplace_back("ZoomValue",
587 beans::PropertyAttribute::BOUND );
588 rProperties.emplace_back("ZoomType",
591 beans::PropertyAttribute::BOUND );
592 rProperties.emplace_back("ViewOffset",
595 beans::PropertyAttribute::BOUND );
596 rProperties.emplace_back("DrawViewMode",
599 beans::PropertyAttribute::BOUND|beans::PropertyAttribute::READONLY|beans::PropertyAttribute::MAYBEVOID );
600 // add new property to update current page's acc information
601 rProperties.emplace_back( "UpdateAcc",
604 beans::PropertyAttribute::BOUND );
605 rProperties.emplace_back( "PageChange",
608 beans::PropertyAttribute::BOUND );
609}
610
611IPropertyArrayHelper & DrawController::getInfoHelper()
612{
613 SolarMutexGuard aGuard;
614
615 if (mpPropertyArrayHelper == nullptr)
616 {
617 ::std::vector<beans::Property> aProperties;
619 mpPropertyArrayHelper.reset(new OPropertyArrayHelper(comphelper::containerToSequence(aProperties), false));
620 }
621
622 return *mpPropertyArrayHelper;
623}
624
625Reference < beans::XPropertySetInfo > DrawController::getPropertySetInfo()
626{
627 SolarMutexGuard aGuard;
628
629 static Reference < beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
630 return xInfo;
631}
632
633uno::Reference< form::runtime::XFormController > SAL_CALL DrawController::getFormController( const uno::Reference< form::XForm >& Form )
634{
635 SolarMutexGuard aGuard;
636
637 FmFormShell* pFormShell = mpBase->GetFormShellManager()->GetFormShell();
638 SdrView* pSdrView = mpBase->GetDrawView();
639 std::shared_ptr<ViewShell> pViewShell = mpBase->GetMainViewShell();
640 ::sd::Window* pWindow = pViewShell ? pViewShell->GetActiveWindow() : nullptr;
641
642 uno::Reference< form::runtime::XFormController > xController;
643 if ( pFormShell && pSdrView && pWindow )
644 xController = FmFormShell::GetFormController( Form, *pSdrView, *pWindow->GetOutDev() );
645 return xController;
646}
647
649{
650 SolarMutexGuard aGuard;
651
652 bool bIsDesignMode = true;
653
654 FmFormShell* pFormShell = mpBase->GetFormShellManager()->GetFormShell();
655 if ( pFormShell )
656 bIsDesignMode = pFormShell->IsDesignMode();
657
658 return bIsDesignMode;
659}
660
662{
663 SolarMutexGuard aGuard;
664
665 FmFormShell* pFormShell = mpBase->GetFormShellManager()->GetFormShell();
666 if ( pFormShell )
667 pFormShell->SetDesignMode( DesignMode );
668}
669
670uno::Reference< awt::XControl > SAL_CALL DrawController::getControl( const uno::Reference< awt::XControlModel >& xModel )
671{
672 SolarMutexGuard aGuard;
673
674 FmFormShell* pFormShell = mpBase->GetFormShellManager()->GetFormShell();
675 SdrView* pSdrView = mpBase->GetDrawView();
676 std::shared_ptr<ViewShell> pViewShell = mpBase->GetMainViewShell();
677 ::sd::Window* pWindow = pViewShell ? pViewShell->GetActiveWindow() : nullptr;
678
679 uno::Reference< awt::XControl > xControl;
680 if ( pFormShell && pSdrView && pWindow )
681 pFormShell->GetFormControl( xModel, *pSdrView, *pWindow->GetOutDev(), xControl );
682 return xControl;
683}
684
686 Any & rConvertedValue,
687 Any & rOldValue,
688 sal_Int32 nHandle,
689 const Any& rValue)
690{
691 bool bResult = false;
692
694 {
695 rOldValue <<= mxSubController;
696 rConvertedValue <<= Reference<drawing::XDrawSubController>(rValue, UNO_QUERY);
697 bResult = (rOldValue != rConvertedValue);
698 }
699 else if (mxSubController.is())
700 {
701 rConvertedValue = rValue;
702 try
703 {
704 rOldValue = mxSubController->getFastPropertyValue(nHandle);
705 bResult = (rOldValue != rConvertedValue);
706 }
707 catch (const beans::UnknownPropertyException&)
708 {
709 // The property is unknown and thus an illegal argument to this method.
710 throw css::lang::IllegalArgumentException();
711 }
712 }
713
714 return bResult;
715}
716
718 sal_Int32 nHandle,
719 const Any& rValue)
720{
721 SolarMutexGuard aGuard;
723 SetSubController(Reference<drawing::XDrawSubController>(rValue, UNO_QUERY));
724 else if (mxSubController.is())
725 mxSubController->setFastPropertyValue(nHandle, rValue);
726}
727
729 Any & rRet,
730 sal_Int32 nHandle ) const
731{
732 SolarMutexGuard aGuard;
733
734 switch( nHandle )
735 {
737 rRet <<= awt::Rectangle(
742 break;
743
745 rRet <<= mxSubController;
746 break;
747
748 default:
749 if (mxSubController.is())
750 rRet = mxSubController->getFastPropertyValue(nHandle);
751 break;
752 }
753}
754
756{
757 SolarMutexGuard aGuard;
758 try
759 {
762 }
763 catch (const RuntimeException&)
764 {
766 mxModuleController = nullptr;
767 }
768}
769
771{
772 if (mxModuleController.is())
773 mxModuleController->dispose();
774
776 mxConfigurationController->dispose();
777}
778
780{
782 {
783 SAL_WARN("sd", "Calling disposed DrawController object. Throwing exception.");
784 throw lang::DisposedException (
785 "DrawController object has already been disposed",
786 const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
787 }
788}
789
790} // end of namespace sd
791
792/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
AnyEventRef aEvent
static void NotifyContextChange(const css::uno::Reference< css::frame::XController > &rxController, const vcl::EnumContext::Context eContext)
SdrUnoObj * GetFormControl(const css::uno::Reference< css::awt::XControlModel > &_rxModel, const SdrView &_rView, const OutputDevice &_rDevice, css::uno::Reference< css::awt::XControl > &_out_rxControl) const
virtual bool IsDesignMode() const override
void SetDesignMode(bool _bDesignMode)
static css::uno::Reference< css::form::runtime::XFormController > GetFormController(const css::uno::Reference< css::form::XForm > &_rxForm, const SdrView &_rView, const OutputDevice &_rDevice)
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
virtual void SAL_CALL dispose() override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
void DisconnectAllClients()
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
void SAL_CALL disposing()
OBroadcastHelper & rBHelper
void SAL_CALL fire(sal_Int32 *pnHandles, const css::uno::Any *pNewValues, const css::uno::Any *pOldValues, sal_Int32 nCount, sal_Bool bVetoable)
css::uno::Sequence< css::uno::Type > getTypes()
::cppu::OBroadcastHelper maBroadcastHelper
The DrawController is the UNO controller for Impress and Draw.
virtual sal_Bool SAL_CALL select(const css::uno::Any &aSelection) override
bool mbDisposing
This flag indicates whether the called DrawController is being disposed or already has been disposed.
virtual void SAL_CALL dispose() override
virtual css::uno::Reference< css::form::runtime::XFormController > SAL_CALL getFormController(const css::uno::Reference< css::form::XForm > &Form) override
void BroadcastContextChange() const
Broadcast a sidebar context change that is caused by a view switch.
virtual css::uno::Reference< css::drawing::framework::XModuleController > SAL_CALL getModuleController() override
virtual sal_Bool SAL_CALL isFormDesignMode() override
void FireChangeEditMode(bool bMasterPageMode) noexcept
Call this method when the edit mode has changed.
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Any SAL_CALL getSelection() override
void ThrowIfDisposed() const
When the called object has been disposed already this method throws a Disposed exception and does not...
virtual void SAL_CALL setCurrentPage(const css::uno::Reference< css::drawing::XDrawPage > &xPage) override
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
ViewShellBase * mpBase
This pointer to the ViewShellBase can be NULL (after a call to ReleaseViewShellBase()).
void FireSelectionChangeListener() noexcept
Call this method when the selection has changed.
css::uno::Reference< css::drawing::XDrawSubController > mxSubController
The current sub controller.
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
Convert the value rValue and return the result in rConvertedValue and the old value in rOldValue.
void FireVisAreaChanged(const ::tools::Rectangle &rVisArea) noexcept
Call this method when the VisArea has changed.
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getCurrentPage() override
void fireChangeLayer(css::uno::Reference< css::drawing::XLayer > *pCurrentLayer) noexcept
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
This method must return the name to index table.
void SetSubController(const css::uno::Reference< css::drawing::XDrawSubController > &rxSubController)
Replace the currently used sub controller with the given one.
virtual ~DrawController() noexcept override
void FireChangeLayerMode(bool bLayerMode) noexcept
Call this method when the layer mode has changed.
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
void DisposeFrameworkControllers()
virtual void SAL_CALL setFormDesignMode(sal_Bool DesignMode) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
rtl::Reference< sd::framework::ModuleController > mxModuleController
ViewShellBase * GetViewShellBase()
Return a pointer to the ViewShellBase object that the DrawController is connected to.
void ProvideFrameworkControllers()
static void FillPropertyTable(::std::vector< css::beans::Property > &rProperties)
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
void fireSwitchCurrentPage(sal_Int32 pageIndex) noexcept
::std::unique_ptr< ::cppu::IPropertyArrayHelper > mpPropertyArrayHelper
void FirePropertyChange(sal_Int32 nHandle, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue)
Send an event to all relevant property listeners that a property has changed its value.
rtl::Reference< sd::framework::ConfigurationController > mxConfigurationController
virtual css::uno::Reference< css::awt::XControl > SAL_CALL getControl(const css::uno::Reference< css::awt::XControlModel > &xModel) override
void FireSwitchCurrentPage(SdPage *pCurrentPage) noexcept
Call this method when there is a new current page.
::unotools::WeakReference< SdPage > mpCurrentPage
const css::uno::Type m_aSelectionTypeIdentifier
::tools::Rectangle maLastVisArea
virtual css::uno::Reference< css::drawing::framework::XConfigurationController > SAL_CALL getConfigurationController() override
virtual sal_Bool SAL_CALL suspend(sal_Bool Suspend) override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
The same as getFastPropertyValue, but return the value through rValue and nHandle is always valid.
DrawController(ViewShellBase &rBase) noexcept
Create a new DrawController object for the given ViewShellBase.
void ReleaseViewShellBase()
This method is typically called from the destructor of ViewShellBase to tell the DrawController that ...
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
The same as setFastPropertyValue, but no exception is thrown and nHandle is always valid.
static rtl::Reference< SlideShow > GetSlideShow(SdDrawDocument const *pDocument)
Definition: slideshow.cxx:157
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
std::shared_ptr< FormShellManager > const & GetFormShellManager() const
std::shared_ptr< ViewShellManager > const & GetViewShellManager() const
virtual SdrView * GetDrawView() const override
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
The configuration controller is responsible for maintaining the current configuration.
The ModuleController has two tasks:
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
rtl::Reference< interface_type > SAL_CALL get() const
::OutputDevice const * GetOutDev() const
#define TOOLS_WARN_EXCEPTION(area, stream)
float u
constexpr OUStringLiteral PROPERTY_CURRENTPAGE
#define SAL_WARN(area, stream)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr OUStringLiteral ssServiceName
IMPLEMENT_GET_IMPLEMENTATION_ID(DrawController)
::cppu::ImplInheritanceHelper< SfxBaseController, css::view::XSelectionSupplier, css::lang::XServiceInfo, css::drawing::XDrawView, css::view::XSelectionChangeListener, css::view::XFormLayerAccess, css::drawing::framework::XControllerManager > DrawControllerInterfaceBase
IMPLEMENT_FORWARD_XINTERFACE2(DrawController, DrawControllerInterfaceBase, OPropertySetHelper)
sal_Int32 nHandle
void addListener(const keyType &key, const css::uno::Reference< css::uno::XInterface > &r)
void removeListener(const keyType &key, const css::uno::Reference< css::uno::XInterface > &r)
OInterfaceContainerHelper *SAL_CALL getContainer(const keyType &key) const
Reference< XController > xController
Reference< XModel > xModel
unsigned char sal_Bool
@ MasterPage
Definition: unomodel.hxx:388