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...
 
bool getUnoObject (SdrUnoObj *&_out_rpObject) const
 returns the SdrUnoObject associated with the ViewContact More...
 
void ensureControl (const basegfx::B2DHomMatrix *_pInitialViewTransformationOrNULL)
 ensures that we have an ->XControl More...
 
const ControlHoldergetExistentControl () 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 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 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 494 of file viewobjectcontactofunocontrol.cxx.

Member Enumeration Documentation

Enumerator
eDesign 
eAlive 
eUnknown 

Definition at line 522 of file viewobjectcontactofunocontrol.cxx.

Constructor & Destructor Documentation

sdr::contact::ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl ( ViewObjectContactOfUnoControl _pAntiImpl)
explicit
sdr::contact::ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl ( const ViewObjectContactOfUnoControl_Impl )
delete
sdr::contact::ViewObjectContactOfUnoControl_Impl::~ViewObjectContactOfUnoControl_Impl ( )
overrideprotectedvirtual

Definition at line 859 of file viewobjectcontactofunocontrol.cxx.

References dispose(), and impl_isDisposed_nofail().

Member Function Documentation

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
void sdr::contact::ViewObjectContactOfUnoControl_Impl::dispose ( void  )

disposes the instance, which is nonfunctional afterwards

Definition at line 894 of file viewobjectcontactofunocontrol.cxx.

References impl_dispose_nothrow().

Referenced by ~ViewObjectContactOfUnoControl_Impl().

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

Definition at line 1382 of file viewobjectcontactofunocontrol.cxx.

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::elementRemoved ( const css::container::ContainerEvent &  Event)
overrideprotectedvirtual
void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::elementReplaced ( const css::container::ContainerEvent &  Event)
overrideprotectedvirtual
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 940 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.

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 570 of file viewobjectcontactofunocontrol.cxx.

References m_aControl.

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::getUnoObject ( SdrUnoObj *&  _out_rpObject) const
const ViewContactOfUnoControl& sdr::contact::ViewObjectContactOfUnoControl_Impl::getViewContact ( ) const
inline
bool sdr::contact::ViewObjectContactOfUnoControl_Impl::hasControl ( ) const
inline
void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_adjustControlVisibilityToLayerVisibility_throw ( )
private

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

->m_aControl is not <NULL>

We're not disposed.

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 1147 of file viewobjectcontactofunocontrol.cxx.

References getUnoObject(), impl_getPageView_nothrow(), sdr::contact::ControlHolder::is(), m_aControl, and m_bControlIsVisible.

Referenced by createControlForDevice(), and modeChanged().

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

We're not disposed.

Definition at line 1165 of file viewobjectcontactofunocontrol.cxx.

References SdrObject::GetLayer(), sdr::contact::ControlHolder::isDesignMode(), sdr::contact::IPageViewAccess::isLayerVisible(), SdrObject::IsVisible(), and sdr::contact::ControlHolder::setVisible().

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_dispose_nothrow ( bool  _bAlsoDisposeControl)
private
bool sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow ( IPageViewAccess const &  _rPageView,
const OutputDevice _rDevice,
const basegfx::B2DHomMatrix _rInitialViewTransformation 
)
private
const OutputDevice & sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_getOutputDevice_throw ( ) const
private
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

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.

We're not disposed.

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

Definition at line 1130 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().

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

determines whether the control currently is in design mode

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 757 of file viewobjectcontactofunocontrol.cxx.

References DBG_ASSERT, eDesign, and eUnknown.

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

bool sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_isDisposed_nofail ( ) const
inlineprivate
void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_switchContainerListening_nothrow ( bool  _bStart)
private

starts or stops listening at our control container

->m_xContainer is not <NULL>

Definition at line 1186 of file viewobjectcontactofunocontrol.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, and m_xContainer.

Referenced by impl_dispose_nothrow(), and impl_ensureControl_nothrow().

void sdr::contact::ViewObjectContactOfUnoControl_Impl::impl_switchControlListening_nothrow ( bool  _bStart)
private
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 1237 of file viewobjectcontactofunocontrol.cxx.

References impl_switchPropertyListening_nothrow(), and m_bIsDesignModeListening.

Referenced by impl_switchControlListening_nothrow(), and modeChanged().

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

->m_aControl is not <NULL>

Definition at line 1247 of file viewobjectcontactofunocontrol.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, sdr::contact::ControlHolder::getModel(), sdr::contact::ControlHolder::is(), and m_aControl.

Referenced by impl_switchDesignModeListening_nothrow().

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

determines whether our control is currently visible

Definition at line 598 of file viewobjectcontactofunocontrol.cxx.

References m_bControlIsVisible.

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

determines whether the instance is disposed

Definition at line 544 of file viewobjectcontactofunocontrol.cxx.

References impl_isDisposed_nofail().

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 1268 of file viewobjectcontactofunocontrol.cxx.

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

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::modeChanged ( const ModeChangeEvent &  _rSource)
overrideprotectedvirtual
ViewObjectContactOfUnoControl_Impl& sdr::contact::ViewObjectContactOfUnoControl_Impl::operator= ( const ViewObjectContactOfUnoControl_Impl )
delete
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

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

Definition at line 916 of file viewobjectcontactofunocontrol.cxx.

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

void SAL_CALL sdr::contact::ViewObjectContactOfUnoControl_Impl::propertyChange ( const PropertyChangeEvent &  evt)
overrideprotectedvirtual
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 1437 of file viewobjectcontactofunocontrol.cxx.

References DBG_UNHANDLED_EXCEPTION, eAlive, eDesign, eUnknown, Exception, impl_isControlDesignMode_nothrow(), sdr::contact::ControlHolder::is(), m_aControl, m_eControlDesignMode, and sdr::contact::ControlHolder::setDesignMode().

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

Definition at line 1332 of file viewobjectcontactofunocontrol.cxx.

References m_bControlIsVisible.

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

Definition at line 1319 of file viewobjectcontactofunocontrol.cxx.

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

Definition at line 1313 of file viewobjectcontactofunocontrol.cxx.

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

Definition at line 1325 of file viewobjectcontactofunocontrol.cxx.

References m_bControlIsVisible.

Member Data Documentation

ControlHolder sdr::contact::ViewObjectContactOfUnoControl_Impl::m_aControl
private
::basegfx::B2DHomMatrix sdr::contact::ViewObjectContactOfUnoControl_Impl::m_aZoomLevelNormalization
private
bool sdr::contact::ViewObjectContactOfUnoControl_Impl::m_bControlIsVisible
private
bool sdr::contact::ViewObjectContactOfUnoControl_Impl::m_bCreatingControl
private

are we currently inside impl_ensureControl_nothrow?

Definition at line 505 of file viewobjectcontactofunocontrol.cxx.

Referenced by impl_ensureControl_nothrow().

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

are we currently listening at a design mode control?

Definition at line 520 of file viewobjectcontactofunocontrol.cxx.

Referenced by impl_switchDesignModeListening_nothrow().

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

is the control currently in design mode?

Definition at line 529 of file viewobjectcontactofunocontrol.cxx.

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

ViewObjectContactOfUnoControl* sdr::contact::ViewObjectContactOfUnoControl_Impl::m_pAntiImpl
private
VclPtr<OutputDevice> sdr::contact::ViewObjectContactOfUnoControl_Impl::m_pOutputDeviceForWindow
private

the output device for which the control was created

Definition at line 514 of file viewobjectcontactofunocontrol.cxx.

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

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

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