LibreOffice Module svx (master) 1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
sdr::contact::ViewObjectContactOfUnoControl_Impl Class Reference
Inheritance diagram for sdr::contact::ViewObjectContactOfUnoControl_Impl:
[legend]
Collaboration diagram for sdr::contact::ViewObjectContactOfUnoControl_Impl:
[legend]

Public Member Functions

 ViewObjectContactOfUnoControl_Impl (ViewObjectContactOfUnoControl *_pAntiImpl)
 
 ViewObjectContactOfUnoControl_Impl (const ViewObjectContactOfUnoControl_Impl &)=delete
 
ViewObjectContactOfUnoControl_Imploperator= (const ViewObjectContactOfUnoControl_Impl &)=delete
 
void dispose ()
 disposes the instance, which is nonfunctional afterwards More...
 
bool isDisposed () const
 determines whether the instance is disposed More...
 
SdrUnoObjgetUnoObject () const
 returns the SdrUnoObject associated with the ViewContact More...
 
void ensureControl (const basegfx::B2DHomMatrix *_pInitialViewTransformationOrNULL)
 ensures that we have an ->XControl More...
 
const ControlHolder & getExistentControl () const
 returns our XControl, if it already has been created More...
 
bool hasControl () const
 
void positionAndZoomControl (const basegfx::B2DHomMatrix &_rViewTransformation) const
 positions our XControl according to the geometry settings in the SdrUnoObj, modified by the given transformation, and sets proper zoom settings according to our device More...
 
bool isPrintableControl () const
 determines whether or not our control is printable More...
 
void setControlDesignMode (bool _bDesignMode) const
 sets the design mode on the control, or at least remembers the flag for the time the control is created More...
 
bool isControlVisible () const
 determines whether our control is currently visible @nofail More...
 
const ViewContactOfUnoControlgetViewContact () const
 

Static Public Member Functions

static bool createControlForDevice (IPageViewAccess const &_rPageView, const OutputDevice &_rDevice, const SdrUnoObj &_rUnoObject, const basegfx::B2DHomMatrix &_rInitialViewTransformation, const basegfx::B2DHomMatrix &_rInitialZoomNormalization, ControlHolder &_out_rControl)
 creates an XControl for the given device and SdrUnoObj More...
 

Protected Member Functions

virtual ~ViewObjectContactOfUnoControl_Impl () override
 
virtual void SAL_CALL disposing (const EventObject &Source) override
 
virtual void SAL_CALL windowResized (const WindowEvent &e) override
 
virtual void SAL_CALL windowMoved (const WindowEvent &e) override
 
virtual void SAL_CALL windowShown (const EventObject &e) override
 
virtual void SAL_CALL windowHidden (const EventObject &e) override
 
virtual void SAL_CALL propertyChange (const PropertyChangeEvent &evt) override
 
virtual void SAL_CALL modeChanged (const ModeChangeEvent &_rSource) override
 
virtual void SAL_CALL elementInserted (const css::container::ContainerEvent &Event) override
 
virtual void SAL_CALL elementRemoved (const css::container::ContainerEvent &Event) override
 
virtual void SAL_CALL elementReplaced (const css::container::ContainerEvent &Event) override
 

Private Types

enum  ViewControlMode {
  eDesign ,
  eAlive ,
  eUnknown
}
 

Private Member Functions

bool impl_getPageView_nothrow (SdrPageView *&_out_rpPageView)
 retrieves the SdrPageView which our associated SdrPageViewWindow belongs to More...
 
void impl_adjustControlVisibilityToLayerVisibility_throw ()
 adjusts the control visibility so it respects its layer's visibility More...
 
void impl_switchControlListening_nothrow (bool _bStart)
 starts or stops listening at various aspects of our control More...
 
void impl_switchContainerListening_nothrow (bool _bStart)
 starts or stops listening at our control container More...
 
void impl_switchDesignModeListening_nothrow (bool _bStart)
 starts or stops listening at the control for design-mode relevant facets More...
 
void impl_switchPropertyListening_nothrow (bool _bStart)
 starts or stops listening for all properties at our control More...
 
void impl_dispose_nothrow (bool _bAlsoDisposeControl)
 disposes the instance More...
 
bool impl_isDisposed_nofail () const
 determines whether the instance is disposed @nofail More...
 
bool impl_isControlDesignMode_nothrow () const
 determines whether the control currently is in design mode More...
 
bool impl_ensureControl_nothrow (IPageViewAccess const &_rPageView, const OutputDevice &_rDevice, const basegfx::B2DHomMatrix &_rInitialViewTransformation)
 ensures that we have a control for the given PageView/OutputDevice More...
 
const OutputDeviceimpl_getOutputDevice_throw () const
 

Static Private Member Functions

static void impl_adjustControlVisibilityToLayerVisibility_throw (const ControlHolder &_rxControl, const SdrUnoObj &_rUnoObject, IPageViewAccess const &_rPageView, bool _bIsCurrentlyVisible, bool _bForce)
 adjusts the control visibility so it respects its layer's visibility More...
 

Private Attributes

ViewObjectContactOfUnoControlm_pAntiImpl
 the instance whose IMPL we are More...
 
bool m_bCreatingControl
 are we currently inside impl_ensureControl_nothrow? More...
 
ControlHolder m_aControl
 the control we're responsible for More...
 
Reference< XContainer > m_xContainer
 the ControlContainer where we inserted our control More...
 
VclPtr< OutputDevicem_pOutputDeviceForWindow
 the output device for which the control was created More...
 
bool m_bControlIsVisible
 flag indicating whether the control is currently visible More...
 
bool m_bIsDesignModeListening
 are we currently listening at a design mode control? More...
 
ViewControlMode m_eControlDesignMode
 is the control currently in design mode? More...
 
::basegfx::B2DHomMatrix m_aZoomLevelNormalization
 

Detailed Description

Definition at line 498 of file viewobjectcontactofunocontrol.cxx.

Member Enumeration Documentation

◆ ViewControlMode

Enumerator
eDesign 
eAlive 
eUnknown 

Definition at line 526 of file viewobjectcontactofunocontrol.cxx.

Constructor & Destructor Documentation

◆ ViewObjectContactOfUnoControl_Impl() [1/2]

sdr::contact::ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl ( ViewObjectContactOfUnoControl _pAntiImpl)
explicit

◆ ViewObjectContactOfUnoControl_Impl() [2/2]

sdr::contact::ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl ( const ViewObjectContactOfUnoControl_Impl )
delete

◆ ~ViewObjectContactOfUnoControl_Impl()

sdr::contact::ViewObjectContactOfUnoControl_Impl::~ViewObjectContactOfUnoControl_Impl ( )
overrideprotectedvirtual

Definition at line 866 of file viewobjectcontactofunocontrol.cxx.

References dispose(), and impl_isDisposed_nofail().

Member Function Documentation

◆ createControlForDevice()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::createControlForDevice ( IPageViewAccess const &  _rPageView,
const OutputDevice _rDevice,
const SdrUnoObj _rUnoObject,
const basegfx::B2DHomMatrix _rInitialViewTransformation,
const basegfx::B2DHomMatrix _rInitialZoomNormalization,
ControlHolder &  _out_rControl 
)
static

◆ dispose()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::dispose ( void  )

disposes the instance, which is nonfunctional afterwards

Definition at line 901 of file viewobjectcontactofunocontrol.cxx.

References impl_dispose_nothrow().

Referenced by ~ViewObjectContactOfUnoControl_Impl().

◆ disposing()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::disposing ( const EventObject &  Source)
overrideprotectedvirtual

◆ elementInserted()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::elementInserted ( const css::container::ContainerEvent &  Event)
overrideprotectedvirtual

Definition at line 1386 of file viewobjectcontactofunocontrol.cxx.

◆ elementRemoved()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::elementRemoved ( const css::container::ContainerEvent &  Event)
overrideprotectedvirtual

◆ elementReplaced()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::elementReplaced ( const css::container::ContainerEvent &  Event)
overrideprotectedvirtual

◆ ensureControl()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::ensureControl ( const basegfx::B2DHomMatrix _pInitialViewTransformationOrNULL)

ensures that we have an ->XControl

Must only be called if a control is needed when no DisplayInfo is present, yet.

For creating a control, an ->OutputDevice is needed, and an ->SdrPageView. Both will be obtained from a ->ObjectContactOfPageView. So, if our (anti-impl's) object contact is not a ->ObjectContactOfPageView, this method fill fail.

Failure of this method will be reported via an assertion in a non-product version.

Definition at line 944 of file viewobjectcontactofunocontrol.cxx.

References sdr::contact::ViewObjectContact::GetObjectContact(), SdrPageWindow::GetPageView(), sdr::contact::ViewObjectContactOfSdrObj::getPageViewOutputDevice(), sdr::contact::ObjectContactOfPageView::GetPageWindow(), OutputDevice::GetViewTransformation(), impl_ensureControl_nothrow(), impl_getOutputDevice_throw(), impl_isDisposed_nofail(), and m_pAntiImpl.

◆ getExistentControl()

const ControlHolder & sdr::contact::ViewObjectContactOfUnoControl_Impl::getExistentControl ( ) const
inline

returns our XControl, if it already has been created

If you want to ensure that the control exists before accessing it, use ->ensureControl

Definition at line 574 of file viewobjectcontactofunocontrol.cxx.

References m_aControl.

◆ getUnoObject()

SdrUnoObj * sdr::contact::ViewObjectContactOfUnoControl_Impl::getUnoObject ( ) const

◆ getViewContact()

const ViewContactOfUnoControl & sdr::contact::ViewObjectContactOfUnoControl_Impl::getViewContact ( ) const
inline

◆ hasControl()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::hasControl ( ) const
inline

Definition at line 577 of file viewobjectcontactofunocontrol.cxx.

References m_aControl.

◆ impl_adjustControlVisibilityToLayerVisibility_throw() [1/2]

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_adjustControlVisibilityToLayerVisibility_throw ( )
private

adjusts the control visibility so it respects its layer's visibility

@precond ->m_aControl is not <NULL>

@precond We're not disposed.

@precond We really belong to an SdrPageViewWindow. There are instance for which this might not be true, but those instances should never have a need to call this method.

Definition at line 1151 of file viewobjectcontactofunocontrol.cxx.

References getUnoObject(), impl_adjustControlVisibilityToLayerVisibility_throw(), impl_getPageView_nothrow(), m_aControl, and m_bControlIsVisible.

Referenced by createControlForDevice(), impl_adjustControlVisibilityToLayerVisibility_throw(), and modeChanged().

◆ impl_adjustControlVisibilityToLayerVisibility_throw() [2/2]

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_adjustControlVisibilityToLayerVisibility_throw ( const ControlHolder &  _rxControl,
const SdrUnoObj _rUnoObject,
IPageViewAccess const &  _rPageView,
bool  _bIsCurrentlyVisible,
bool  _bForce 
)
staticprivate

adjusts the control visibility so it respects its layer's visibility

The control must never be visible if it's in design mode. In alive mode, it must be visibility if and only it's on a visible layer.

Parameters
_rxControlthe control whose visibility is to be adjusted
_rPageViewprovides access to the attributes of the SdrPageView which the control finally belongs to
_rUnoObjectour SdrUnoObj
_bIsCurrentlyVisibledetermines whether the control is currently visible. Note that this is only a shortcut for querying _rxControl for the XWindow2 interface, and calling isVisible at this interface. This shortcut has been chosen since the caller usually already has this information. If _bForce is <TRUE>, _bIsCurrentlyVisible is ignored.
_bForceset to <TRUE> if you want to force a ->XWindow::setVisible call, no matter if the control visibility is already correct

@precond We're not disposed.

Definition at line 1169 of file viewobjectcontactofunocontrol.cxx.

References SdrObject::GetLayer(), and SdrObject::IsVisible().

◆ impl_dispose_nothrow()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_dispose_nothrow ( bool  _bAlsoDisposeControl)
private

◆ impl_ensureControl_nothrow()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow ( IPageViewAccess const &  _rPageView,
const OutputDevice _rDevice,
const basegfx::B2DHomMatrix _rInitialViewTransformation 
)
private

◆ impl_getOutputDevice_throw()

const OutputDevice & sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_getOutputDevice_throw ( ) const
private

◆ impl_getPageView_nothrow()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_getPageView_nothrow ( SdrPageView *&  _out_rpPageView)
private

retrieves the SdrPageView which our associated SdrPageViewWindow belongs to

Parameters
out_rpPageViewa reference to a pointer holding, upon return, the desired SdrPageView
Returns
<TRUE> if and only if a ->SdrPageView could be obtained

@precond We really belong to an SdrPageViewWindow. Perhaps (I'm not sure ATM :) there are instance for which this might not be true, but those instances should never have a need to call this method.

@precond We're not disposed.

@postcond The method expects success, if it returns with <FALSE>, this will have been asserted.

@nothrow

Definition at line 1134 of file viewobjectcontactofunocontrol.cxx.

References DBG_ASSERT, sdr::contact::ViewObjectContact::GetObjectContact(), SdrPageWindow::GetPageView(), sdr::contact::ObjectContactOfPageView::GetPageWindow(), impl_isDisposed_nofail(), and m_pAntiImpl.

Referenced by impl_adjustControlVisibilityToLayerVisibility_throw().

◆ impl_isControlDesignMode_nothrow()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_isControlDesignMode_nothrow ( ) const
inlineprivate

determines whether the control currently is in design mode

@precond The design mode must already be known. It is known when we first had access to an SdrPageView (which carries this flag), or somebody explicitly set it from outside.

Definition at line 761 of file viewobjectcontactofunocontrol.cxx.

References DBG_ASSERT, eDesign, eUnknown, and m_eControlDesignMode.

Referenced by elementReplaced(), impl_switchControlListening_nothrow(), modeChanged(), propertyChange(), and setControlDesignMode().

◆ impl_isDisposed_nofail()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_isDisposed_nofail ( ) const
inlineprivate

◆ impl_switchContainerListening_nothrow()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_switchContainerListening_nothrow ( bool  _bStart)
private

starts or stops listening at our control container

@precond ->m_xContainer is not <NULL>

Definition at line 1190 of file viewobjectcontactofunocontrol.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, and m_xContainer.

Referenced by impl_dispose_nothrow(), and impl_ensureControl_nothrow().

◆ impl_switchControlListening_nothrow()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_switchControlListening_nothrow ( bool  _bStart)
private

starts or stops listening at various aspects of our control

@precond ->m_aControl is not <NULL>

Definition at line 1210 of file viewobjectcontactofunocontrol.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, impl_isControlDesignMode_nothrow(), impl_switchDesignModeListening_nothrow(), and m_aControl.

Referenced by elementReplaced(), impl_dispose_nothrow(), and impl_ensureControl_nothrow().

◆ impl_switchDesignModeListening_nothrow()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_switchDesignModeListening_nothrow ( bool  _bStart)
private

starts or stops listening at the control for design-mode relevant facets

Definition at line 1241 of file viewobjectcontactofunocontrol.cxx.

References impl_switchPropertyListening_nothrow(), and m_bIsDesignModeListening.

Referenced by impl_switchControlListening_nothrow(), and modeChanged().

◆ impl_switchPropertyListening_nothrow()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_switchPropertyListening_nothrow ( bool  _bStart)
private

starts or stops listening for all properties at our control

Parameters
_bStartdetermines whether to start or to stop listening

@precond ->m_aControl is not <NULL>

Definition at line 1251 of file viewobjectcontactofunocontrol.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, and m_aControl.

Referenced by impl_switchDesignModeListening_nothrow().

◆ isControlVisible()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::isControlVisible ( ) const
inline

determines whether our control is currently visible @nofail

Definition at line 602 of file viewobjectcontactofunocontrol.cxx.

References m_bControlIsVisible.

◆ isDisposed()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::isDisposed ( ) const
inline

determines whether the instance is disposed

Definition at line 548 of file viewobjectcontactofunocontrol.cxx.

References impl_isDisposed_nofail().

◆ isPrintableControl()

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::isPrintableControl ( ) const

determines whether or not our control is printable

Effectively, this method returns the value of the "Printable" property of the control's model. If we have no control, <FALSE> is returned.

Definition at line 1272 of file viewobjectcontactofunocontrol.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, SdrUnoObj::GetUnoControlModel(), and getUnoObject().

◆ modeChanged()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::modeChanged ( const ModeChangeEvent &  _rSource)
overrideprotectedvirtual

◆ operator=()

ViewObjectContactOfUnoControl_Impl & sdr::contact::ViewObjectContactOfUnoControl_Impl::operator= ( const ViewObjectContactOfUnoControl_Impl )
delete

◆ positionAndZoomControl()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::positionAndZoomControl ( const basegfx::B2DHomMatrix _rViewTransformation) const

positions our XControl according to the geometry settings in the SdrUnoObj, modified by the given transformation, and sets proper zoom settings according to our device

@precond ->m_pOutputDeviceForWindow and ->m_aControl are not <NULL>

Definition at line 920 of file viewobjectcontactofunocontrol.cxx.

References sdr::contact::UnoControlContactHelper::adjustControlGeometry_throw(), DBG_UNHANDLED_EXCEPTION, Exception, SdrTextObj::GetLogicRect(), getUnoObject(), m_aControl, and m_aZoomLevelNormalization.

◆ propertyChange()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::propertyChange ( const PropertyChangeEvent &  evt)
overrideprotectedvirtual

◆ setControlDesignMode()

void sdr::contact::ViewObjectContactOfUnoControl_Impl::setControlDesignMode ( bool  _bDesignMode) const

sets the design mode on the control, or at least remembers the flag for the time the control is created

Definition at line 1441 of file viewobjectcontactofunocontrol.cxx.

References DBG_UNHANDLED_EXCEPTION, eAlive, eDesign, eUnknown, Exception, impl_isControlDesignMode_nothrow(), m_aControl, and m_eControlDesignMode.

◆ windowHidden()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::windowHidden ( const EventObject &  e)
overrideprotectedvirtual

Definition at line 1336 of file viewobjectcontactofunocontrol.cxx.

References m_bControlIsVisible.

◆ windowMoved()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::windowMoved ( const WindowEvent &  e)
overrideprotectedvirtual

Definition at line 1323 of file viewobjectcontactofunocontrol.cxx.

◆ windowResized()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::windowResized ( const WindowEvent &  e)
overrideprotectedvirtual

Definition at line 1317 of file viewobjectcontactofunocontrol.cxx.

◆ windowShown()

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::windowShown ( const EventObject &  e)
overrideprotectedvirtual

Definition at line 1329 of file viewobjectcontactofunocontrol.cxx.

References m_bControlIsVisible.

Member Data Documentation

◆ m_aControl

ControlHolder sdr::contact::ViewObjectContactOfUnoControl_Impl::m_aControl
private

◆ m_aZoomLevelNormalization

::basegfx::B2DHomMatrix sdr::contact::ViewObjectContactOfUnoControl_Impl::m_aZoomLevelNormalization
private

◆ m_bControlIsVisible

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::m_bControlIsVisible
private

◆ m_bCreatingControl

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::m_bCreatingControl
private

are we currently inside impl_ensureControl_nothrow?

Definition at line 509 of file viewobjectcontactofunocontrol.cxx.

Referenced by impl_ensureControl_nothrow().

◆ m_bIsDesignModeListening

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::m_bIsDesignModeListening
private

are we currently listening at a design mode control?

Definition at line 524 of file viewobjectcontactofunocontrol.cxx.

Referenced by impl_switchDesignModeListening_nothrow().

◆ m_eControlDesignMode

ViewControlMode sdr::contact::ViewObjectContactOfUnoControl_Impl::m_eControlDesignMode
mutableprivate

is the control currently in design mode?

Definition at line 533 of file viewobjectcontactofunocontrol.cxx.

Referenced by impl_ensureControl_nothrow(), impl_isControlDesignMode_nothrow(), modeChanged(), and setControlDesignMode().

◆ m_pAntiImpl

ViewObjectContactOfUnoControl* sdr::contact::ViewObjectContactOfUnoControl_Impl::m_pAntiImpl
private

◆ m_pOutputDeviceForWindow

VclPtr<OutputDevice> sdr::contact::ViewObjectContactOfUnoControl_Impl::m_pOutputDeviceForWindow
private

the output device for which the control was created

Definition at line 518 of file viewobjectcontactofunocontrol.cxx.

Referenced by elementReplaced(), impl_dispose_nothrow(), and impl_ensureControl_nothrow().

◆ m_xContainer

Reference< XContainer > sdr::contact::ViewObjectContactOfUnoControl_Impl::m_xContainer
private

The documentation for this class was generated from the following file: