LibreOffice Module svtools (master) 1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SvEventDescriptor Class Referenceabstract

SvEventDescriptor: Implement the XNameReplace that is delivered by the XEventsSupplier::getEvents() method. More...

#include <unoevent.hxx>

Inheritance diagram for SvEventDescriptor:
[legend]
Collaboration diagram for SvEventDescriptor:
[legend]

Public Member Functions

 SvEventDescriptor (css::uno::XInterface &rParent, const SvEventDescription *pSupportedMacroItems)
 
virtual ~SvEventDescriptor () override
 
- Public Member Functions inherited from SvBaseEventDescriptor
 SvBaseEventDescriptor (const SvEventDescription *pSupportedMacroItems)
 
virtual ~SvBaseEventDescriptor () override
 
virtual void SAL_CALL replaceByName (const OUString &rName, const css::uno::Any &rElement) override
 calls replaceByName(const sal_uInt16, const SvxMacro&) More...
 
virtual css::uno::Any SAL_CALL getByName (const OUString &rName) override
 calls getByName(sal_uInt16) More...
 
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames () override
 
virtual sal_Bool SAL_CALL hasByName (const OUString &rName) override
 
virtual css::uno::Type SAL_CALL getElementType () override
 
virtual sal_Bool SAL_CALL hasElements () override
 
virtual OUString SAL_CALL getImplementationName () override=0
 must be implemented in subclass More...
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 

Protected Member Functions

virtual void replaceByName (const SvMacroItemId nEvent, const SvxMacro &rMacro) override
 event (will be copied) More...
 
virtual void getByName (SvxMacro &rMacros, const SvMacroItemId nEvent) override
 item ID of event More...
 
virtual const SvxMacroItemgetMacroItem ()=0
 Get the SvxMacroItem from the parent. More...
 
virtual void setMacroItem (const SvxMacroItem &rItem)=0
 Set the SvxMacroItem at the parent. More...
 
virtual sal_uInt16 getMacroItemWhich () const =0
 Get the SvxMacroItem Which Id needed for the current application must be implemented by subclass. More...
 
virtual void SAL_CALL replaceByName (const OUString &rName, const css::uno::Any &rElement) override
 calls replaceByName(const sal_uInt16, const SvxMacro&) More...
 
virtual void replaceByName (const SvMacroItemId nEvent, const SvxMacro &rMacro)=0
 Must be implemented in subclass. More...
 
virtual css::uno::Any SAL_CALL getByName (const OUString &rName) override
 calls getByName(sal_uInt16) More...
 
virtual void getByName (SvxMacro &rMacro, const SvMacroItemId nEvent)=0
 Must be implemented in subclass. More...
 
- Protected Member Functions inherited from SvBaseEventDescriptor
virtual void replaceByName (const SvMacroItemId nEvent, const SvxMacro &rMacro)=0
 Must be implemented in subclass. More...
 
virtual void getByName (SvxMacro &rMacro, const SvMacroItemId nEvent)=0
 Must be implemented in subclass. More...
 
SvMacroItemId mapNameToEventID (std::u16string_view rName) const
 convert an API event name to the event ID as used by SvxMacroItem More...
 
SvMacroItemId getMacroID (std::u16string_view rName) const
 get the event ID for the name; return 0 if not supported More...
 

Private Attributes

css::uno::Reference< css::uno::XInterface > xParentRef
 keep reference to parent to prevent it from being destroyed More...
 

Additional Inherited Members

- Protected Attributes inherited from SvBaseEventDescriptor
const SvEventDescriptionmpSupportedMacroItems
 last element is 0, 0 More...
 
sal_Int16 mnMacroItems
 

Detailed Description

SvEventDescriptor: Implement the XNameReplace that is delivered by the XEventsSupplier::getEvents() method.

The SvEventDescriptor has to be subclassed to implement the events for a specific objects. The subclass has to 1) supply the super class constructor with a list of known events (item IDs) 2) supply the super class constructor with a reference of its parent object (to prevent destruction) 3) implement getItem() and setItem(...) methods.

If no object is available to which the SvEventDescriptor can attach itself, the class SvDetachedEventDescriptor should be used.

Definition at line 159 of file unoevent.hxx.

Constructor & Destructor Documentation

◆ SvEventDescriptor()

SvEventDescriptor::SvEventDescriptor ( css::uno::XInterface &  rParent,
const SvEventDescription pSupportedMacroItems 
)

Definition at line 308 of file unoevent.cxx.

◆ ~SvEventDescriptor()

SvEventDescriptor::~SvEventDescriptor ( )
overridevirtual

Definition at line 317 of file unoevent.cxx.

Member Function Documentation

◆ getByName() [1/3]

Any SvBaseEventDescriptor::getByName ( const OUString &  rName)
overrideprotectedvirtual

calls getByName(sal_uInt16)

API name of event

Reimplemented from SvBaseEventDescriptor.

Definition at line 87 of file unoevent.cxx.

◆ getByName() [2/3]

virtual void SvBaseEventDescriptor::getByName ( SvxMacro rMacro,
const SvMacroItemId  nEvent 
)
protectedvirtual

Must be implemented in subclass.

Exceptions
css::container::NoSuchElementException
css::lang::WrappedTargetException
css::uno::RuntimeException

Implements SvBaseEventDescriptor.

◆ getByName() [3/3]

void SvEventDescriptor::getByName ( SvxMacro rMacros,
const SvMacroItemId  nEvent 
)
overrideprotectedvirtual

item ID of event

Parameters
nEventmacro to be filled with values

Implements SvBaseEventDescriptor.

Definition at line 332 of file unoevent.cxx.

References SvxMacroItem::GetMacro(), getMacroItem(), and SvxMacroItem::HasMacro().

◆ getMacroItem()

virtual const SvxMacroItem & SvEventDescriptor::getMacroItem ( )
protectedpure virtual

Get the SvxMacroItem from the parent.

must be implemented by subclass

Referenced by getByName(), and replaceByName().

◆ getMacroItemWhich()

virtual sal_uInt16 SvEventDescriptor::getMacroItemWhich ( ) const
protectedpure virtual

Get the SvxMacroItem Which Id needed for the current application must be implemented by subclass.

Referenced by replaceByName().

◆ replaceByName() [1/3]

virtual void SAL_CALL SvBaseEventDescriptor::replaceByName ( const OUString &  rName,
const css::uno::Any &  rElement 
)
overrideprotectedvirtual

calls replaceByName(const sal_uInt16, const SvxMacro&)

event (PropertyValues)

Parameters
rElementAPI name of event

Reimplemented from SvBaseEventDescriptor.

◆ replaceByName() [2/3]

void SvEventDescriptor::replaceByName ( const SvMacroItemId  nEvent,
const SvxMacro rMacro 
)
overrideprotectedvirtual

event (will be copied)

Parameters
rMacroitem ID of event

Implements SvBaseEventDescriptor.

Definition at line 322 of file unoevent.cxx.

References getMacroItem(), getMacroItemWhich(), SvxMacroItem::SetMacro(), setMacroItem(), and SvxMacroItem::SetMacroTable().

◆ replaceByName() [3/3]

virtual void SvBaseEventDescriptor::replaceByName ( const SvMacroItemId  nEvent,
const SvxMacro rMacro 
)
protectedvirtual

Must be implemented in subclass.

Exceptions
css::lang::IllegalArgumentException
css::container::NoSuchElementException
css::lang::WrappedTargetException
css::uno::RuntimeExceptionevent (will be copied)
Parameters
rMacroitem ID of event

Implements SvBaseEventDescriptor.

◆ setMacroItem()

virtual void SvEventDescriptor::setMacroItem ( const SvxMacroItem rItem)
protectedpure virtual

Set the SvxMacroItem at the parent.

must be implemented by subclass

Referenced by replaceByName().

Member Data Documentation

◆ xParentRef

css::uno::Reference< css::uno::XInterface > SvEventDescriptor::xParentRef
private

keep reference to parent to prevent it from being destroyed

Definition at line 162 of file unoevent.hxx.


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