LibreOffice Module framework (master) 1
Public Member Functions | Private Attributes | List of all members
framework::FrameContainer Class Referencefinal

#include <framecontainer.hxx>

Public Member Functions

 FrameContainer ()
 constructor / destructor More...
 
 ~FrameContainer ()
 -*************************************************************************************************************** More...
 
void append (const css::uno::Reference< css::frame::XFrame > &xFrame)
 add/remove/mark container items More...
 
void remove (const css::uno::Reference< css::frame::XFrame > &xFrame)
 -*************************************************************************************************************** More...
 
void setActive (const css::uno::Reference< css::frame::XFrame > &xFrame)
 -*************************************************************************************************************** More...
 
css::uno::Reference< css::frame::XFrame > getActive () const
 -*************************************************************************************************************** More...
 
bool exist (const css::uno::Reference< css::frame::XFrame > &xFrame) const
 checks and free memory More...
 
void clear ()
 -*************************************************************************************************************** More...
 
sal_uInt32 getCount () const
 deprecated IndexAccess! More...
 
css::uno::Reference< css::frame::XFrame > operator[] (sal_uInt32 nIndex) const
 -*************************************************************************************************************** More...
 
css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > getAllElements () const
 replacement for deprecated index access More...
 
css::uno::Reference< css::frame::XFrame > searchOnAllChildrens (const OUString &sName) const
 special helper for Frame::findFrame() More...
 
css::uno::Reference< css::frame::XFrame > searchOnDirectChildrens (std::u16string_view sName) const
 -*************************************************************************************************************** More...
 

Private Attributes

TFrameContainer m_aContainer
 list to hold all frames More...
 
css::uno::Reference< css::frame::XFrame > m_xActiveFrame
 one container item can be the current active frame. It's necessary for Desktop or Frame implementation. More...
 

Detailed Description

Definition at line 46 of file framecontainer.hxx.

Constructor & Destructor Documentation

◆ FrameContainer()

framework::FrameContainer::FrameContainer ( )

constructor / destructor

-***************************************************************************************************************

initialize an empty container @descr The container will be empty then - special features (e.g. the async quit mechanism) are disabled.

@threadsafe not necessary - it's not a singleton

Definition at line 36 of file framecontainer.cxx.

◆ ~FrameContainer()

framework::FrameContainer::~FrameContainer ( )

-***************************************************************************************************************

deinitialize may a filled container @descr Special features (if the currently are running) will be disabled and we free all used other resources.

@threadsafe not necessary - it's not a singleton

Definition at line 50 of file framecontainer.cxx.

References m_aContainer, and m_xActiveFrame.

Member Function Documentation

◆ append()

void framework::FrameContainer::append ( const css::uno::Reference< css::frame::XFrame > &  xFrame)

add/remove/mark container items

-***************************************************************************************************************

append a new frame to the container @descr We accept the incoming frame only, if it is a valid reference and doesn't exist already.

Parameters
xFrameframe, which should be added to this container Must be a valid reference.

@threadsafe yes

Definition at line 67 of file framecontainer.cxx.

References exist(), m_aContainer, and xFrame.

Referenced by framework::OFrames::append().

◆ clear()

void framework::FrameContainer::clear ( )

-***************************************************************************************************************

delete all existing items of the container @threadsafe yes

Definition at line 123 of file framecontainer.cxx.

References m_aContainer, and m_xActiveFrame.

Referenced by framework::Desktop::disposing().

◆ exist()

bool framework::FrameContainer::exist ( const css::uno::Reference< css::frame::XFrame > &  xFrame) const

checks and free memory

-***************************************************************************************************************

check if the given frame currently exist inside the container

Parameters
xFramereference to the queried frame
Returns
<TRUE> if frame is part of this container <FALSE> otherwise

@threadsafe yes

Definition at line 113 of file framecontainer.cxx.

References m_aContainer, and xFrame.

Referenced by append(), and setActive().

◆ getActive()

css::uno::Reference< css::frame::XFrame > framework::FrameContainer::getActive ( ) const

-***************************************************************************************************************

return the current active frame of this container @descr Value can be null in case the frame was removed from the container and nobody from outside decide which of all others should be the new one...

Returns
a reference to the current active frame Value can be NULL!

@threadsafe yes

Definition at line 223 of file framecontainer.cxx.

References m_xActiveFrame.

Referenced by framework::Desktop::getActiveFrame(), framework::Desktop::getFastPropertyValue(), and framework::Desktop::setActiveFrame().

◆ getAllElements()

css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > framework::FrameContainer::getAllElements ( ) const

replacement for deprecated index access

-***************************************************************************************************************

returns a snapshot of all currently existing frames inside this container @descr Should be used to replace the deprecated functions getCount()/operator[]!

Returns
a list of all frame references inside this container

@threadsafe yes

Definition at line 188 of file framecontainer.cxx.

References comphelper::containerToSequence(), and m_aContainer.

Referenced by framework::Desktop::impl_closeFrames().

◆ getCount()

sal_uInt32 framework::FrameContainer::getCount ( ) const

deprecated IndexAccess!

-***************************************************************************************************************

returns count of all current existing frames

Deprecated:
This value can't be guaranteed for multithreading environments. So it will be marked as deprecated and should be replaced by "getAllElements()".
Returns
the count of existing container items

@threadsafe yes

Definition at line 143 of file framecontainer.cxx.

References m_aContainer.

Referenced by framework::OFrames::getByIndex(), framework::OFrames::getCount(), framework::OFrames::hasElements(), and framework::OFrames::queryFrames().

◆ operator[]()

css::uno::Reference< css::frame::XFrame > framework::FrameContainer::operator[] ( sal_uInt32  nIndex) const

-***************************************************************************************************************

returns one item of this container

Deprecated:
This value can't be guaranteed for multithreading environments. So it will be marked as deprecated and should be replaced by "getAllElements()".
Parameters
nIndexa value between 0 and (getCount()-1) to address one container item
Returns
a reference to a frame inside the container, which match with given index

@threadsafe yes

Definition at line 161 of file framecontainer.cxx.

References m_aContainer, nIndex, SAL_INFO, and xFrame.

◆ remove()

void framework::FrameContainer::remove ( const css::uno::Reference< css::frame::XFrame > &  xFrame)

-***************************************************************************************************************

remove a frame from the container @descr In case we remove the last frame and our internal special feature (the async quit mechanism) was enabled by the desktop instance, we start it.

Parameters
xFrameframe, which should be deleted from this container Must be a valid reference.

@threadsafe yes

Definition at line 87 of file framecontainer.cxx.

References m_aContainer, m_xActiveFrame, and xFrame.

Referenced by framework::OFrames::remove().

◆ searchOnAllChildrens()

css::uno::Reference< css::frame::XFrame > framework::FrameContainer::searchOnAllChildrens ( const OUString &  sName) const

special helper for Frame::findFrame()

-***************************************************************************************************************

implements a simple search based on current container items @descr It can be used for findFrame() and implements a deep down search.

Parameters
sNametarget name, which is searched
Returns
reference to the found frame or NULL if not.

@threadsafe yes

Definition at line 241 of file framecontainer.cxx.

References m_aContainer, and sName.

Referenced by framework::Desktop::findFrame().

◆ searchOnDirectChildrens()

css::uno::Reference< css::frame::XFrame > framework::FrameContainer::searchOnDirectChildrens ( std::u16string_view  sName) const

-***************************************************************************************************************

implements a simple search based on current container items @descr It can be used for findFrame() and search on members of this container only!

Parameters
sNametarget name, which is searched
Returns
reference to the found frame or NULL if not.

@threadsafe yes

Definition at line 276 of file framecontainer.cxx.

References m_aContainer, and sName.

Referenced by framework::Desktop::findFrame().

◆ setActive()

void framework::FrameContainer::setActive ( const css::uno::Reference< css::frame::XFrame > &  xFrame)

-***************************************************************************************************************

set the given frame as the new active one inside this container @descr We accept this frame only, if it's already a part of this container.

Parameters
xFramereference to the new active frame Must be a valid reference and already part of this container.

@threadsafe yes

Definition at line 204 of file framecontainer.cxx.

References exist(), m_xActiveFrame, and xFrame.

Referenced by framework::Desktop::setActiveFrame().

Member Data Documentation

◆ m_aContainer

TFrameContainer framework::FrameContainer::m_aContainer
private

◆ m_xActiveFrame

css::uno::Reference< css::frame::XFrame > framework::FrameContainer::m_xActiveFrame
private

one container item can be the current active frame. It's necessary for Desktop or Frame implementation.

Definition at line 56 of file framecontainer.hxx.

Referenced by clear(), getActive(), remove(), setActive(), and ~FrameContainer().


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