LibreOffice Module framework (master) 1
|
implement XFrames, XIndexAccess and XElementAccess interfaces as helper for services @descr Use this class as helper for these interfaces. More...
#include <oframes.hxx>
Public Member Functions | |
OFrames (const css::uno::Reference< css::frame::XFrame > &xOwner, FrameContainer *pFrameContainer) | |
standard ctor @descr These initialize a new instance of this class with all needed information for work. More... | |
virtual void SAL_CALL | append (const css::uno::Reference< css::frame::XFrame > &xFrame) override |
append frame to container @descr We share the container with our owner. More... | |
virtual void SAL_CALL | remove (const css::uno::Reference< css::frame::XFrame > &xFrame) override |
remove frame from container @descr This is the companion to append(). More... | |
virtual css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > SAL_CALL | queryFrames (sal_Int32 nSearchFlags) override |
return list of all applicable frames for given flags @descr Call these to get a list of all frames, which are match with given search flags. More... | |
virtual sal_Int32 SAL_CALL | getCount () override |
get count of all current frames in container @descr This is the beginning of full index-access. More... | |
virtual css::uno::Any SAL_CALL | getByIndex (sal_Int32 nIndex) override |
get specified container item by index @descr If you called getCount() successful - this method return the specified element as an Any. More... | |
virtual css::uno::Type SAL_CALL | getElementType () override |
get uno-type of all container items @descr In current implementation type is fixed to XFrame! (container-lock is ignored) More... | |
virtual sal_Bool SAL_CALL | hasElements () override |
get fill state of current container @descr Call these to get information about, if items exist in container or not. More... | |
Private Member Functions | |
virtual | ~OFrames () override |
standard destructor @descr This method destruct an instance of this class and clear some member. More... | |
void | impl_resetObject () |
reset instance to default values @descr There are two ways to delete an instance of this class. More... | |
void | impl_appendSequence (css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > &seqDestination, const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > &seqSource) |
append one sequence to another @descr There is no operation to add to sequences! Use this helper-method to do this. More... | |
Static Private Member Functions | |
static bool | impldbg_checkParameter_queryFrames (sal_Int32 nSearchFlags) |
Private Attributes | |
css::uno::WeakReference< css::frame::XFrame > | m_xOwner |
FrameContainer * | m_pFrameContainer |
reference to owner of this instance (Hold no hard reference!) More... | |
bool | m_bRecursiveSearchProtection |
with owner shared list to hold all direct children of an XFramesSupplier More... | |
implement XFrames, XIndexAccess and XElementAccess interfaces as helper for services @descr Use this class as helper for these interfaces.
We share mutex and framecontainer with our owner. The framecontainer is a member of it from type "FrameContainer". That means; we have the same information as our owner. In current implementation we use mutex and lock-mechanism to prevent against compete access. In future we plan support of semaphore!
@devstatus deprecated
@ATTENTION Don't use this class as direct member - use it dynamically. Do not derive from this class. We hold a weakreference to our owner not to our superclass.
Definition at line 44 of file oframes.hxx.
framework::OFrames::OFrames | ( | const css::uno::Reference< css::frame::XFrame > & | xOwner, |
FrameContainer * | pFrameContainer | ||
) |
standard ctor @descr These initialize a new instance of this class with all needed information for work.
We share framecontainer with owner implementation! It's a threadsafe container.
xOwner,reference | to our owner. We hold a wekreference to prevent us against cross-references! |
pFrameContainer,pointer | to shared framecontainer of owner. It's valid only, if weakreference is valid! |
Definition at line 38 of file oframes.cxx.
References SAL_WARN_IF.
|
overrideprivatevirtual |
standard destructor @descr This method destruct an instance of this class and clear some member.
This method is protected, because it's not allowed to use this class as a member! You MUST use a dynamical instance (pointer). That's the reason for a protected dtor.
Definition at line 52 of file oframes.cxx.
References impl_resetObject().
|
overridevirtual |
append frame to container @descr We share the container with our owner.
We can do this only, if no lock is set on container. Valid references are accepted only!
@seealso class FrameContainer
xFrame,reference | to an existing frame to append. @onerror We do nothing in release or throw an assert in debug version. |
Definition at line 59 of file oframes.cxx.
References framework::FrameContainer::append(), m_pFrameContainer, m_xOwner, SAL_WARN_IF, and xFrame.
|
overridevirtual |
get specified container item by index @descr If you called getCount() successful - this method return the specified element as an Any.
You must observe the range from 0 to count-1! Otherwise an IndexOutOfBoundsException is thrown.
@seealso class FrameContainer @seealso method getCount()
nIndex,valid | index to get container item. |
@onerror If a lock is set, we return an empty Any! @onerror If index out of range, an IndexOutOfBoundsException is thrown.
Definition at line 222 of file oframes.cxx.
References Any, framework::FrameContainer::getCount(), m_pFrameContainer, m_xOwner, nCount, and nIndex.
|
overridevirtual |
get count of all current frames in container @descr This is the beginning of full index-access.
With a count you can step over all items in container. Next call should be getByIndex(). But these mechanism works only, if no lock in container is set!
@seealso class FrameContainer @seealso method getByIndex()
@onerror If a lock is set, we return 0 for prevent further access!
Definition at line 200 of file oframes.cxx.
References framework::FrameContainer::getCount(), m_pFrameContainer, m_xOwner, and nCount.
|
overridevirtual |
get uno-type of all container items @descr In current implementation type is fixed to XFrame! (container-lock is ignored)
Definition at line 249 of file oframes.cxx.
References cppu::UnoType< typename T >::get().
|
overridevirtual |
get fill state of current container @descr Call these to get information about, if items exist in container or not.
(container-lock is ignored)
@onerror We return sal_False.
Definition at line 256 of file oframes.cxx.
References framework::FrameContainer::getCount(), m_pFrameContainer, and m_xOwner.
|
private |
append one sequence to another @descr There is no operation to add to sequences! Use this helper-method to do this.
@seealso class Sequence
seqDestination,reference | to sequence on which operation will append the other sequence. |
seqSource,reference | to sequence for append. |
Definition at line 294 of file oframes.cxx.
Referenced by queryFrames().
|
private |
reset instance to default values @descr There are two ways to delete an instance of this class.
1) delete with destructor
2) dispose from parent or factory ore ...
This method do the same for both ways! It free used memory and release references ...
@seealso method dispose() (if it exist!) @seealso destructor ~TaskEnumeration()
Definition at line 280 of file oframes.cxx.
References m_pFrameContainer, and m_xOwner.
Referenced by ~OFrames().
|
staticprivate |
Definition at line 344 of file oframes.cxx.
Referenced by queryFrames().
|
overridevirtual |
return list of all applicable frames for given flags @descr Call these to get a list of all frames, which are match with given search flags.
nSearchFlag,flags | to search right frames. |
@onerror An empty list is returned.
Definition at line 106 of file oframes.cxx.
References framework::FrameContainer::getCount(), impl_appendSequence(), impldbg_checkParameter_queryFrames(), m_bRecursiveSearchProtection, m_pFrameContainer, m_xOwner, nCount, nIndex, and SAL_WARN_IF.
|
overridevirtual |
remove frame from container @descr This is the companion to append().
We only accept valid references and don't work, if a lock is set.
@seealso class FrameContainer
xFrame,reference | to an existing frame to remove. @onerror We do nothing in release or throw an assert in debug version. |
Definition at line 82 of file oframes.cxx.
References m_pFrameContainer, m_xOwner, framework::FrameContainer::remove(), SAL_WARN_IF, and xFrame.
|
private |
with owner shared list to hold all direct children of an XFramesSupplier
Definition at line 185 of file oframes.hxx.
Referenced by queryFrames().
|
private |
reference to owner of this instance (Hold no hard reference!)
Definition at line 184 of file oframes.hxx.
Referenced by append(), getByIndex(), getCount(), hasElements(), impl_resetObject(), queryFrames(), and remove().
|
private |
Definition at line 183 of file oframes.hxx.
Referenced by append(), getByIndex(), getCount(), hasElements(), impl_resetObject(), queryFrames(), and remove().