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

SvBaseEventDescriptor: Abstract class that implements the basics of an XNameReplace that is delivered by the XEventsSupplier::getEvents() method. More...

#include <unoevent.hxx>

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

Public Member Functions

 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)=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...
 

Protected Attributes

const SvEventDescriptionmpSupportedMacroItems
 last element is 0, 0 More...
 
sal_Int16 mnMacroItems
 

Detailed Description

SvBaseEventDescriptor: Abstract class that implements the basics of an XNameReplace that is delivered by the XEventsSupplier::getEvents() method.

The functionality this class provides is: 1) Which elements are in the XNameReplace? 2) Mapping from Api names to item IDs. 3) conversion from SvxMacroItem to Any and vice versa.

All details of how to actually get and set SvxMacroItem(s) have to be supplied by the base class.

Definition at line 60 of file unoevent.hxx.

Constructor & Destructor Documentation

◆ SvBaseEventDescriptor()

SvBaseEventDescriptor::SvBaseEventDescriptor ( const SvEventDescription pSupportedMacroItems)

Definition at line 195 of file unoevent.cxx.

References SvEventDescription::mnEvent, mnMacroItems, and mpSupportedMacroItems.

◆ ~SvBaseEventDescriptor()

SvBaseEventDescriptor::~SvBaseEventDescriptor ( )
overridevirtual

Definition at line 205 of file unoevent.cxx.

Member Function Documentation

◆ getByName() [1/2]

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

calls getByName(sal_uInt16)

API name of event

Reimplemented in SvEventDescriptor, and SvDetachedEventDescriptor.

Definition at line 231 of file unoevent.cxx.

References Any, getByName(), and getMacroID().

Referenced by getByName().

◆ getByName() [2/2]

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

Must be implemented in subclass.

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

Implemented in SvDetachedEventDescriptor, SvEventDescriptor, SvDetachedEventDescriptor, and SvEventDescriptor.

◆ getElementNames()

Sequence< OUString > SvBaseEventDescriptor::getElementNames ( )
overridevirtual

Definition at line 248 of file unoevent.cxx.

References i, mnMacroItems, and mpSupportedMacroItems.

◆ getElementType()

Type SvBaseEventDescriptor::getElementType ( )
overridevirtual

Definition at line 268 of file unoevent.cxx.

◆ getImplementationName()

virtual OUString SAL_CALL SvBaseEventDescriptor::getImplementationName ( )
overridepure virtual

must be implemented in subclass

Implemented in SvDetachedEventDescriptor.

References getSupportedServiceNames(), and supportsService().

◆ getMacroID()

SvMacroItemId SvBaseEventDescriptor::getMacroID ( std::u16string_view  rName) const
protected

get the event ID for the name; return 0 if not supported

Definition at line 303 of file unoevent.cxx.

References mapNameToEventID().

Referenced by getByName(), and hasByName().

◆ getSupportedServiceNames()

Sequence< OUString > SvBaseEventDescriptor::getSupportedServiceNames ( )
overridevirtual

Definition at line 283 of file unoevent.cxx.

References sAPI_ServiceName.

◆ hasByName()

sal_Bool SvBaseEventDescriptor::hasByName ( const OUString &  rName)
overridevirtual

Definition at line 261 of file unoevent.cxx.

References getMacroID().

◆ hasElements()

sal_Bool SvBaseEventDescriptor::hasElements ( )
overridevirtual

Definition at line 273 of file unoevent.cxx.

References mnMacroItems.

◆ mapNameToEventID()

SvMacroItemId SvBaseEventDescriptor::mapNameToEventID ( std::u16string_view  rName) const
protected

convert an API event name to the event ID as used by SvxMacroItem

Definition at line 288 of file unoevent.cxx.

References o3tl::equalsAscii(), i, SvEventDescription::mnEvent, mnMacroItems, and mpSupportedMacroItems.

Referenced by getMacroID().

◆ replaceByName() [1/2]

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

calls replaceByName(const sal_uInt16, const SvxMacro&)

event (PropertyValues)

Parameters
rElementAPI name of event

Reimplemented in SvEventDescriptor, and SvDetachedEventDescriptor.

◆ replaceByName() [2/2]

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

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

Implemented in SvEventDescriptor, SvDetachedEventDescriptor, SvEventDescriptor, and SvDetachedEventDescriptor.

◆ supportsService()

sal_Bool SvBaseEventDescriptor::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 278 of file unoevent.cxx.

References cppu::supportsService().

Member Data Documentation

◆ mnMacroItems

sal_Int16 SvBaseEventDescriptor::mnMacroItems
protected

◆ mpSupportedMacroItems

const SvEventDescription* SvBaseEventDescriptor::mpSupportedMacroItems
protected

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