LibreOffice Module extensions (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
pcr::EventHandler Class Referencefinal

#include <eventhandler.hxx>

Inheritance diagram for pcr::EventHandler:
[legend]
Collaboration diagram for pcr::EventHandler:
[legend]

Public Member Functions

 EventHandler (const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
 
virtual ~EventHandler () override
 

Private Member Functions

virtual void SAL_CALL inspect (const css::uno::Reference< css::uno::XInterface > &_rxIntrospectee) override
 
virtual css::uno::Any SAL_CALL getPropertyValue (const OUString &_rPropertyName) override
 
virtual void SAL_CALL setPropertyValue (const OUString &_rPropertyName, const css::uno::Any &_rValue) override
 
virtual css::uno::Any SAL_CALL convertToPropertyValue (const OUString &_rPropertyName, const css::uno::Any &_rControlValue) override
 
virtual css::uno::Any SAL_CALL convertToControlValue (const OUString &_rPropertyName, const css::uno::Any &_rPropertyValue, const css::uno::Type &_rControlValueType) override
 
virtual css::beans::PropertyState SAL_CALL getPropertyState (const OUString &_rPropertyName) override
 
virtual void SAL_CALL addPropertyChangeListener (const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
 
virtual void SAL_CALL removePropertyChangeListener (const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
 
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getSupportedProperties () override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupersededProperties () override
 
virtual css::uno::Sequence< OUString > SAL_CALL getActuatingProperties () override
 
virtual css::inspection::LineDescriptor SAL_CALL describePropertyLine (const OUString &_rPropertyName, const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory) override
 
virtual sal_Bool SAL_CALL isComposable (const OUString &_rPropertyName) override
 
virtual css::inspection::InteractiveSelectionResult SAL_CALL onInteractivePropertySelection (const OUString &_rPropertyName, sal_Bool _bPrimary, css::uno::Any &_rData, const css::uno::Reference< css::inspection::XObjectInspectorUI > &_rxInspectorUI) override
 
virtual void SAL_CALL actuatingPropertyChanged (const OUString &_rActuatingPropertyName, const css::uno::Any &_rNewValue, const css::uno::Any &_rOldValue, const css::uno::Reference< css::inspection::XObjectInspectorUI > &_rxInspectorUI, sal_Bool _bFirstTimeInit) override
 
virtual sal_Bool SAL_CALL suspend (sal_Bool _bSuspend) override
 
virtual void SAL_CALL disposing () override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
void impl_getFormComponentScriptEvents_nothrow (std::vector< css::script::ScriptEventDescriptor > &_out_rEvents) const
 returns the script events associated with our introspectee More...
 
void impl_getDialogElementScriptEvents_nothrow (std::vector< css::script::ScriptEventDescriptor > &_out_rEvents) const
 returns the script events associated with our introspectee More...
 
void impl_getComponentScriptEvents_nothrow (std::vector< css::script::ScriptEventDescriptor > &_out_rEvents) const
 returns the script events associated with our introspectee More...
 
void impl_getComponentListenerTypes_nothrow (std::vector< css::uno::Type > &_out_rTypes) const
 returns the types of the listeners which can be registered at our introspectee More...
 
css::uno::Reference< css::uno::XInterface > impl_getSecondaryComponentForEventInspection_throw () const
 returns a secondary component to be used for event inspection More...
 
const EventDescriptionimpl_getEventForName_throw (const OUString &_rPropertyName) const
 returns the event description for the given (programmatic) property name More...
 
sal_Int32 impl_getComponentIndexInParent_throw () const
 returns the index of our component within its parent, if this parent can be obtained (XChild::getParent) and supports an ->XIndexAccess interface More...
 
void impl_setFormComponentScriptEvent_nothrow (const css::script::ScriptEventDescriptor &_rScriptEvent)
 sets a given script event as event handler at a form component More...
 
void impl_setDialogElementScriptEvent_nothrow (const css::script::ScriptEventDescriptor &_rScriptEvent)
 sets a given script event as event handler at a dialog component More...
 
css::uno::Reference< css::frame::XFrame > impl_getContextFrame_nothrow () const
 returns the frame associated with our context document More...
 
bool impl_filterMethod_nothrow (const EventDescription &_rEvent) const
 approves or denies a certain method to be included in the UI More...
 
 EventHandler (const EventHandler &)=delete
 
EventHandleroperator= (const EventHandler &)=delete
 

Private Attributes

mutable::osl::Mutex m_aMutex
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 the context in which the instance was created More...
 
css::uno::Reference< css::beans::XPropertySetm_xComponent
 the properties of the object we're handling More...
 
PropertyChangeListeners m_aPropertyListeners
 our XPropertyChangeListener(s) More...
 
EventMap m_aEvents
 cache of the events we found at our introspectee More...
 
bool m_bEventsMapInitialized
 has m_aEvents been initialized? More...
 
bool m_bIsDialogElement
 is our introspectee a dialog element? More...
 
sal_Int16 m_nGridColumnType
 (FormComponent) type of the grid column being inspected, or -1 if we're not inspecting a grid column More...
 

Detailed Description

Definition at line 74 of file eventhandler.hxx.

Constructor & Destructor Documentation

◆ EventHandler() [1/2]

pcr::EventHandler::EventHandler ( const css::uno::Reference< css::uno::XComponentContext > &  _rxContext)
explicit

◆ ~EventHandler()

pcr::EventHandler::~EventHandler ( )
overridevirtual

Definition at line 430 of file eventhandler.cxx.

◆ EventHandler() [2/2]

pcr::EventHandler::EventHandler ( const EventHandler )
privatedelete

Member Function Documentation

◆ actuatingPropertyChanged()

void SAL_CALL pcr::EventHandler::actuatingPropertyChanged ( const OUString &  _rActuatingPropertyName,
const css::uno::Any &  _rNewValue,
const css::uno::Any &  _rOldValue,
const css::uno::Reference< css::inspection::XObjectInspectorUI > &  _rxInspectorUI,
sal_Bool  _bFirstTimeInit 
)
overrideprivatevirtual

Definition at line 810 of file eventhandler.cxx.

◆ addPropertyChangeListener()

void SAL_CALL pcr::EventHandler::addPropertyChangeListener ( const css::uno::Reference< css::beans::XPropertyChangeListener > &  _rxListener)
overrideprivatevirtual

Definition at line 633 of file eventhandler.cxx.

References m_aMutex.

◆ convertToControlValue()

Any SAL_CALL pcr::EventHandler::convertToControlValue ( const OUString &  _rPropertyName,
const css::uno::Any &  _rPropertyValue,
const css::uno::Type &  _rControlValueType 
)
overrideprivatevirtual

Definition at line 568 of file eventhandler.cxx.

References Any, DBG_UNHANDLED_EXCEPTION, Exception, m_aMutex, m_xContext, and sScript.

◆ convertToPropertyValue()

Any SAL_CALL pcr::EventHandler::convertToPropertyValue ( const OUString &  _rPropertyName,
const css::uno::Any &  _rControlValue 
)
overrideprivatevirtual

Definition at line 541 of file eventhandler.cxx.

References Any, and m_aMutex.

◆ describePropertyLine()

LineDescriptor SAL_CALL pcr::EventHandler::describePropertyLine ( const OUString &  _rPropertyName,
const css::uno::Reference< css::inspection::XPropertyControlFactory > &  _rxControlFactory 
)
overrideprivatevirtual

◆ disposing()

void SAL_CALL pcr::EventHandler::disposing ( )
overrideprivatevirtual

Definition at line 817 of file eventhandler.cxx.

◆ getActuatingProperties()

Sequence< OUString > SAL_CALL pcr::EventHandler::getActuatingProperties ( )
overrideprivatevirtual

Definition at line 711 of file eventhandler.cxx.

◆ getImplementationName()

OUString SAL_CALL pcr::EventHandler::getImplementationName ( )
overrideprivatevirtual

Definition at line 434 of file eventhandler.cxx.

◆ getPropertyState()

PropertyState SAL_CALL pcr::EventHandler::getPropertyState ( const OUString &  _rPropertyName)
overrideprivatevirtual

Definition at line 628 of file eventhandler.cxx.

◆ getPropertyValue()

Any SAL_CALL pcr::EventHandler::getPropertyValue ( const OUString &  _rPropertyName)
overrideprivatevirtual

◆ getSupersededProperties()

Sequence< OUString > SAL_CALL pcr::EventHandler::getSupersededProperties ( )
overrideprivatevirtual

Definition at line 705 of file eventhandler.cxx.

◆ getSupportedProperties()

Sequence< Property > SAL_CALL pcr::EventHandler::getSupportedProperties ( )
overrideprivatevirtual

◆ getSupportedServiceNames()

Sequence< OUString > SAL_CALL pcr::EventHandler::getSupportedServiceNames ( )
overrideprivatevirtual

Definition at line 444 of file eventhandler.cxx.

◆ impl_filterMethod_nothrow()

bool pcr::EventHandler::impl_filterMethod_nothrow ( const EventDescription _rEvent) const
private

approves or denies a certain method to be included in the UI

Returns
<TRUE> if and only if the given method is allowed.

Definition at line 1075 of file eventhandler.cxx.

References pcr::EventDescription::sUniqueBrowseId, UID_BRWEVT_ACTIONPERFORMED, and UID_BRWEVT_CHANGED.

◆ impl_getComponentIndexInParent_throw()

sal_Int32 pcr::EventHandler::impl_getComponentIndexInParent_throw ( ) const
private

returns the index of our component within its parent, if this parent can be obtained (XChild::getParent) and supports an ->XIndexAccess interface

Definition at line 846 of file eventhandler.cxx.

References i, and nElements.

◆ impl_getComponentListenerTypes_nothrow()

void pcr::EventHandler::impl_getComponentListenerTypes_nothrow ( std::vector< css::uno::Type > &  _out_rTypes) const
private

returns the types of the listeners which can be registered at our introspectee

Parameters
_out_rTypesTakes, upon successful return, the types of possible listeners at the introspectee

Definition at line 884 of file eventhandler.cxx.

References aListeners, DBG_UNHANDLED_EXCEPTION, Exception, m_xContext, and xIntrospection.

◆ impl_getComponentScriptEvents_nothrow()

void pcr::EventHandler::impl_getComponentScriptEvents_nothrow ( std::vector< css::script::ScriptEventDescriptor > &  _out_rEvents) const
inlineprivate

returns the script events associated with our introspectee

Parameters
_out_rEventsTakes, the events currently associated with the introspectee

Definition at line 154 of file eventhandler.hxx.

References impl_getDialogElementScriptEvents_nothrow(), impl_getFormComponentScriptEvents_nothrow(), and m_bIsDialogElement.

◆ impl_getContextFrame_nothrow()

Reference< XFrame > pcr::EventHandler::impl_getContextFrame_nothrow ( ) const
private

returns the frame associated with our context document

Definition at line 828 of file eventhandler.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, m_xContext, and xController.

◆ impl_getDialogElementScriptEvents_nothrow()

void pcr::EventHandler::impl_getDialogElementScriptEvents_nothrow ( std::vector< css::script::ScriptEventDescriptor > &  _out_rEvents) const
private

returns the script events associated with our introspectee

Parameters
_out_rEventsTakes, upon successful return, the events currently associated with the introspectee @precond Our introspectee is a dialog element

Definition at line 914 of file eventhandler.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, and i.

Referenced by impl_getComponentScriptEvents_nothrow().

◆ impl_getEventForName_throw()

const EventDescription & pcr::EventHandler::impl_getEventForName_throw ( const OUString &  _rPropertyName) const
private

returns the event description for the given (programmatic) property name

Parameters
_rPropertyNamethe name whose event description should be looked up
Returns
the event description for the property name
Exceptions
css::beans::UnknownPropertyExceptionif our introspectee does not have an event with the given logical name (see ->getSupportedProperties)

Definition at line 959 of file eventhandler.cxx.

References pos.

◆ impl_getFormComponentScriptEvents_nothrow()

void pcr::EventHandler::impl_getFormComponentScriptEvents_nothrow ( std::vector< css::script::ScriptEventDescriptor > &  _out_rEvents) const
private

returns the script events associated with our introspectee

Parameters
_out_rEventsTakes, upon successful return, the events currently associated with the introspectee @precond Our introspectee is a form component

Definition at line 862 of file eventhandler.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, and comphelper::sequenceToContainer().

Referenced by impl_getComponentScriptEvents_nothrow().

◆ impl_getSecondaryComponentForEventInspection_throw()

Reference< XInterface > pcr::EventHandler::impl_getSecondaryComponentForEventInspection_throw ( ) const
private

returns a secondary component to be used for event inspection

In the UI, we want to mix events for the control model with events for the control. Since our introspectee is a model, this method creates a control for it (if possible).

Returns
the secondary component whose events should be mixed with the introspectee's events The caller takes the ownership of the component (if not <NULL>).
Exceptions
ifan unexpected error occurs during creation of the secondary component. A <NULL> component to be returned is not unexpected, but allowed

@precond ->m_xComponent is not <NULL>

Definition at line 935 of file eventhandler.cxx.

References m_xContext, PROPERTY_DEFAULTCONTROL, and xController.

◆ impl_setDialogElementScriptEvent_nothrow()

void pcr::EventHandler::impl_setDialogElementScriptEvent_nothrow ( const css::script::ScriptEventDescriptor &  _rScriptEvent)
private

sets a given script event as event handler at a dialog component

Parameters
_rScriptEventthe script event to set

Definition at line 1037 of file eventhandler.cxx.

References Any, DBG_UNHANDLED_EXCEPTION, and Exception.

◆ impl_setFormComponentScriptEvent_nothrow()

void pcr::EventHandler::impl_setFormComponentScriptEvent_nothrow ( const css::script::ScriptEventDescriptor &  _rScriptEvent)
private

sets a given script event as event handler at a form component

Parameters
_rScriptEventthe script event to set

Definition at line 980 of file eventhandler.cxx.

References comphelper::containerToSequence(), DBG_UNHANDLED_EXCEPTION, Exception, m_xContext, and comphelper::sequenceToContainer().

◆ inspect()

void SAL_CALL pcr::EventHandler::inspect ( const css::uno::Reference< css::uno::XInterface > &  _rxIntrospectee)
overrideprivatevirtual

◆ isComposable()

sal_Bool SAL_CALL pcr::EventHandler::isComposable ( const OUString &  _rPropertyName)
overrideprivatevirtual

Definition at line 739 of file eventhandler.cxx.

◆ onInteractivePropertySelection()

InteractiveSelectionResult SAL_CALL pcr::EventHandler::onInteractivePropertySelection ( const OUString &  _rPropertyName,
sal_Bool  _bPrimary,
css::uno::Any &  _rData,
const css::uno::Reference< css::inspection::XObjectInspectorUI > &  _rxInspectorUI 
)
overrideprivatevirtual

◆ operator=()

EventHandler & pcr::EventHandler::operator= ( const EventHandler )
privatedelete

◆ removePropertyChangeListener()

void SAL_CALL pcr::EventHandler::removePropertyChangeListener ( const css::uno::Reference< css::beans::XPropertyChangeListener > &  _rxListener)
overrideprivatevirtual

Definition at line 641 of file eventhandler.cxx.

References m_aMutex.

◆ setPropertyValue()

void SAL_CALL pcr::EventHandler::setPropertyValue ( const OUString &  _rPropertyName,
const css::uno::Any &  _rValue 
)
overrideprivatevirtual

◆ supportsService()

sal_Bool SAL_CALL pcr::EventHandler::supportsService ( const OUString &  ServiceName)
overrideprivatevirtual

Definition at line 439 of file eventhandler.cxx.

References ServiceName, and cppu::supportsService().

◆ suspend()

sal_Bool SAL_CALL pcr::EventHandler::suspend ( sal_Bool  _bSuspend)
overrideprivatevirtual

Definition at line 823 of file eventhandler.cxx.

Member Data Documentation

◆ m_aEvents

EventMap pcr::EventHandler::m_aEvents
private

cache of the events we found at our introspectee

Definition at line 86 of file eventhandler.hxx.

◆ m_aMutex

mutable::osl::Mutex pcr::EventHandler::m_aMutex
private

Definition at line 77 of file eventhandler.hxx.

◆ m_aPropertyListeners

PropertyChangeListeners pcr::EventHandler::m_aPropertyListeners
private

our XPropertyChangeListener(s)

Definition at line 84 of file eventhandler.hxx.

◆ m_bEventsMapInitialized

bool pcr::EventHandler::m_bEventsMapInitialized
private

has m_aEvents been initialized?

Definition at line 88 of file eventhandler.hxx.

◆ m_bIsDialogElement

bool pcr::EventHandler::m_bIsDialogElement
private

is our introspectee a dialog element?

Definition at line 90 of file eventhandler.hxx.

Referenced by impl_getComponentScriptEvents_nothrow().

◆ m_nGridColumnType

sal_Int16 pcr::EventHandler::m_nGridColumnType
private

(FormComponent) type of the grid column being inspected, or -1 if we're not inspecting a grid column

Definition at line 93 of file eventhandler.hxx.

◆ m_xComponent

css::uno::Reference< css::beans::XPropertySet > pcr::EventHandler::m_xComponent
private

the properties of the object we're handling

Definition at line 82 of file eventhandler.hxx.

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > pcr::EventHandler::m_xContext
private

the context in which the instance was created

Definition at line 80 of file eventhandler.hxx.


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