LibreOffice Module toolkit (master) 1
|
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, ControlInfo > | ControlMap |
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 |
Definition at line 63 of file unocontrolcontainer.cxx.
typedef sal_Int32 UnoControlHolderList::ControlIdentifier |
Definition at line 66 of file unocontrolcontainer.cxx.
|
private |
Definition at line 68 of file unocontrolcontainer.cxx.
|
private |
Definition at line 69 of file unocontrolcontainer.cxx.
UnoControlHolderList::UnoControlHolderList | ( | ) |
Definition at line 162 of file unocontrolcontainer.cxx.
UnoControlHolderList::ControlIdentifier UnoControlHolderList::addControl | ( | const uno::Reference< awt::XControl > & | _rxControl, |
const OUString * | _pName | ||
) |
adds a control with the given name to the list
_rxControl | the control to add. Must not be <NULL> |
_pBName | the name of the control, or <NULL> if an automatic name should be generated |
Definition at line 167 of file unocontrolcontainer.cxx.
References impl_addControl().
|
inline |
determines whether or not the list is empty
Definition at line 89 of file unocontrolcontainer.cxx.
References maControls.
bool UnoControlHolderList::getControlForIdentifier | ( | UnoControlHolderList::ControlIdentifier | _nIdentifier, |
uno::Reference< awt::XControl > & | _out_rxControl | ||
) | const |
retrieves the control for a given id
_nIdentifier | the identifier for the control |
_out_rxControl | takes the XControl upon successful return |
Definition at line 217 of file unocontrolcontainer.cxx.
References maControls, and pos.
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.
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.
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.
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.
|
private |
adds a control
_rxControl | the control to add to the container |
_pName | pointer to the name of the control. Might be <NULL>, in this case, a name is generated. |
Definition at line 251 of file unocontrolcontainer.cxx.
References DBG_ASSERT, impl_getFreeIdentifier_throw(), impl_getFreeName_throw(), maControls, nId, and sName.
Referenced by addControl().
|
private |
finds a free identifier
uno::RuntimeException | if no free identifier can be found |
Definition at line 263 of file unocontrolcontainer.cxx.
References maControls.
Referenced by impl_addControl().
|
private |
finds a free name
uno::RuntimeException | if no free name can be found |
Definition at line 275 of file unocontrolcontainer.cxx.
References maControls.
Referenced by impl_addControl().
void UnoControlHolderList::removeControlById | ( | UnoControlHolderList::ControlIdentifier | _nId | ) |
removes a control from the list, given by id
_nId | The identifier of the control to remove. |
Definition at line 227 of file unocontrolcontainer.cxx.
References DBG_ASSERT, maControls, and pos.
void UnoControlHolderList::replaceControlById | ( | ControlIdentifier | _nId, |
const uno::Reference< awt::XControl > & | _rxNewControl | ||
) |
replaces a control from the list with another one
_nId | The identifier of the control to replace |
_rxNewControl | the new control to put into the list |
Definition at line 238 of file unocontrolcontainer.cxx.
References DBG_ASSERT, maControls, and pos.
|
private |
Definition at line 72 of file unocontrolcontainer.cxx.
Referenced by empty(), getControlForIdentifier(), getControlForName(), getControlIdentifier(), getControls(), getIdentifiers(), impl_addControl(), impl_getFreeIdentifier_throw(), impl_getFreeName_throw(), removeControlById(), and replaceControlById().