LibreOffice Module toolkit (master) 1
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
UnoControlHolderList Class Reference

Public Types

typedef sal_Int32 ControlIdentifier
 

Public Member Functions

 UnoControlHolderList ()
 
ControlIdentifier addControl (const uno::Reference< awt::XControl > &_rxControl, const OUString *_pName)
 adds a control with the given name to the list More...
 
bool empty () const
 determines whether or not the list is empty More...
 
void getControls (uno::Sequence< uno::Reference< awt::XControl > > &_out_rControls) const
 retrieves all controls currently in the list More...
 
void getIdentifiers (uno::Sequence< sal_Int32 > &_out_rIdentifiers) const
 retrieves all identifiers of all controls currently in the list More...
 
uno::Reference< awt::XControl > getControlForName (const OUString &_rName) const
 returns the first control which is registered under the given name More...
 
ControlIdentifier getControlIdentifier (const uno::Reference< awt::XControl > &_rxControl)
 returns the identifier which a control is registered for, or -1 if the control isn't registered More...
 
bool getControlForIdentifier (ControlIdentifier _nIdentifier, uno::Reference< awt::XControl > &_out_rxControl) const
 retrieves the control for a given id More...
 
void removeControlById (ControlIdentifier _nId)
 removes a control from the list, given by id More...
 
void replaceControlById (ControlIdentifier _nId, const uno::Reference< awt::XControl > &_rxNewControl)
 replaces a control from the list with another one More...
 

Private Types

typedef std::shared_ptr< UnoControlHolder > ControlInfo
 
typedef ::std::map< ControlIdentifier, ControlInfoControlMap
 

Private Member Functions

ControlIdentifier impl_addControl (const uno::Reference< awt::XControl > &_rxControl, const OUString *_pName)
 adds a control More...
 
ControlIdentifier impl_getFreeIdentifier_throw ()
 finds a free identifier More...
 
OUString impl_getFreeName_throw ()
 finds a free name More...
 

Private Attributes

ControlMap maControls
 

Detailed Description

Definition at line 63 of file unocontrolcontainer.cxx.

Member Typedef Documentation

◆ ControlIdentifier

Definition at line 66 of file unocontrolcontainer.cxx.

◆ ControlInfo

typedef std::shared_ptr< UnoControlHolder > UnoControlHolderList::ControlInfo
private

Definition at line 68 of file unocontrolcontainer.cxx.

◆ ControlMap

Definition at line 69 of file unocontrolcontainer.cxx.

Constructor & Destructor Documentation

◆ UnoControlHolderList()

UnoControlHolderList::UnoControlHolderList ( )

Definition at line 162 of file unocontrolcontainer.cxx.

Member Function Documentation

◆ addControl()

UnoControlHolderList::ControlIdentifier UnoControlHolderList::addControl ( const uno::Reference< awt::XControl > &  _rxControl,
const OUString *  _pName 
)

adds a control with the given name to the list

Parameters
_rxControlthe control to add. Must not be <NULL>
_pBNamethe name of the control, or <NULL> if an automatic name should be generated
Returns
the identifier of the newly added control

Definition at line 167 of file unocontrolcontainer.cxx.

References impl_addControl().

◆ empty()

bool UnoControlHolderList::empty ( ) const
inline

determines whether or not the list is empty

Definition at line 89 of file unocontrolcontainer.cxx.

References maControls.

◆ getControlForIdentifier()

bool UnoControlHolderList::getControlForIdentifier ( UnoControlHolderList::ControlIdentifier  _nIdentifier,
uno::Reference< awt::XControl > &  _out_rxControl 
) const

retrieves the control for a given id

Parameters
_nIdentifierthe identifier for the control
_out_rxControltakes the XControl upon successful return
Returns
<TRUE> if and only if a control with the given id is part of the list

Definition at line 217 of file unocontrolcontainer.cxx.

References maControls, and pos.

◆ getControlForName()

uno::Reference< awt::XControl > UnoControlHolderList::getControlForName ( const OUString &  _rName) const

returns the first control which is registered under the given name

Definition at line 197 of file unocontrolcontainer.cxx.

References maControls.

◆ getControlIdentifier()

UnoControlHolderList::ControlIdentifier UnoControlHolderList::getControlIdentifier ( const uno::Reference< awt::XControl > &  _rxControl)

returns the identifier which a control is registered for, or -1 if the control isn't registered

Definition at line 207 of file unocontrolcontainer.cxx.

References maControls.

◆ getControls()

void UnoControlHolderList::getControls ( uno::Sequence< uno::Reference< awt::XControl > > &  _out_rControls) const

retrieves all controls currently in the list

Definition at line 173 of file unocontrolcontainer.cxx.

References maControls.

◆ getIdentifiers()

void UnoControlHolderList::getIdentifiers ( uno::Sequence< sal_Int32 > &  _out_rIdentifiers) const

retrieves all identifiers of all controls currently in the list

Definition at line 185 of file unocontrolcontainer.cxx.

References maControls.

◆ impl_addControl()

UnoControlHolderList::ControlIdentifier UnoControlHolderList::impl_addControl ( const uno::Reference< awt::XControl > &  _rxControl,
const OUString *  _pName 
)
private

adds a control

Parameters
_rxControlthe control to add to the container
_pNamepointer to the name of the control. Might be <NULL>, in this case, a name is generated.
Returns
the identifier of the newly inserted control

Definition at line 251 of file unocontrolcontainer.cxx.

References DBG_ASSERT, impl_getFreeIdentifier_throw(), impl_getFreeName_throw(), maControls, nId, and sName.

Referenced by addControl().

◆ impl_getFreeIdentifier_throw()

UnoControlHolderList::ControlIdentifier UnoControlHolderList::impl_getFreeIdentifier_throw ( )
private

finds a free identifier

Exceptions
uno::RuntimeExceptionif no free identifier can be found

Definition at line 263 of file unocontrolcontainer.cxx.

References maControls.

Referenced by impl_addControl().

◆ impl_getFreeName_throw()

OUString UnoControlHolderList::impl_getFreeName_throw ( )
private

finds a free name

Exceptions
uno::RuntimeExceptionif no free name can be found

Definition at line 275 of file unocontrolcontainer.cxx.

References maControls.

Referenced by impl_addControl().

◆ removeControlById()

void UnoControlHolderList::removeControlById ( UnoControlHolderList::ControlIdentifier  _nId)

removes a control from the list, given by id

Parameters
_nIdThe identifier of the control to remove.

Definition at line 227 of file unocontrolcontainer.cxx.

References DBG_ASSERT, maControls, and pos.

◆ replaceControlById()

void UnoControlHolderList::replaceControlById ( ControlIdentifier  _nId,
const uno::Reference< awt::XControl > &  _rxNewControl 
)

replaces a control from the list with another one

Parameters
_nIdThe identifier of the control to replace
_rxNewControlthe new control to put into the list

Definition at line 238 of file unocontrolcontainer.cxx.

References DBG_ASSERT, maControls, and pos.

Member Data Documentation

◆ maControls

ControlMap UnoControlHolderList::maControls
private

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