/************************************************************************* * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: framecontainer.hxx,v $ * * $Revision: 1.17 $ * * last change: $Author: rt $ $Date: 2005-09-09 00:04:49 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. * * * GNU Lesser General Public License Version 2.1 * ============================================= * Copyright 2005 by Sun Microsystems, Inc. * 901 San Antonio Road, Palo Alto, CA 94303, USA * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * ************************************************************************/ #ifndef __FRAMEWORK_CLASSES_FRAMECONTAINER_HXX_ #define __FRAMEWORK_CLASSES_FRAMECONTAINER_HXX_ /** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble with solaris headers ... */ #include #include #include //_________________________________________________________________________________________________________________ // my own includes //_________________________________________________________________________________________________________________ #ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_ #include #endif #ifndef __FRAMEWORK_THREADHELP_TRANSACTIONBASE_HXX_ #include #endif #ifndef __FRAMEWORK_CLASSES_TARGETFINDER_HXX_ #include #endif #ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ #include #endif #ifndef __FRAMEWORK_GENERAL_H_ #include #endif //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ #include #endif #ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_ #include #endif #ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_ #include #endif //_________________________________________________________________________________________________________________ // other includes //_________________________________________________________________________________________________________________ #ifndef _CPPUHELPER_WEAKREF_HXX_ #include #endif #ifndef _VOS_REF_HXX_ #include #endif #ifndef _RTL_USTRING_ #include #endif #ifndef _VCL_EVNTPOST_HXX #include #endif //_________________________________________________________________________________________________________________ // namespace //_________________________________________________________________________________________________________________ namespace framework{ //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ //_________________________________________________________________________________________________________________ // exported definitions //_________________________________________________________________________________________________________________ typedef ::std::vector< css::uno::Reference< css::frame::XFrame > > TFrameContainer ; typedef TFrameContainer::iterator TFrameIterator ; typedef TFrameContainer::const_iterator TConstFrameIterator ; /*-************************************************************************************************************//** @short implement a container to hold childs of frame, task or desktop @descr Every object of frame, task or desktop hold reference to his childs. These container is used as helper to do this. Some helper-classe like OFrames or OTasksAccess use it to. They hold a pointer to an instance of this class, which is a member of a frame, task or desktop! You can append and remove frames. It's possible to set one of these frames as active or deactive. You could have full index-access to container-items. @base ThreadHelpBase guarantee right initialized lock member during boostrap! @devstatus ready to use @threadsafe yes @modified 01.07.2002 14:39, as96863 *//*-*************************************************************************************************************/ class FrameContainer : private ThreadHelpBase { //_______________________________________ // member private: /// list to hold all frames TFrameContainer m_aContainer; /// one container item can be the current active frame. Its neccessary for Desktop or Frame implementation. css::uno::Reference< css::frame::XFrame > m_xActiveFrame; /*DEPRECATEME /// indicates using of the automatic async quit feature in case last task will be closed sal_Bool m_bAsyncQuit; /// used to execute the terminate request asyncronous ::vcl::EventPoster m_aAsyncCall; /// used for async quit feature (must be weak to prevent us against strange situations!) css::uno::WeakReference< css::frame::XDesktop > m_xDesktop; */ //_______________________________________ // interface public: /// constructor / destructor FrameContainer(); virtual ~FrameContainer(); /// add/remove/mark container items void append ( const css::uno::Reference< css::frame::XFrame >& xFrame ); void remove ( const css::uno::Reference< css::frame::XFrame >& xFrame ); void setActive ( const css::uno::Reference< css::frame::XFrame >& xFrame ); css::uno::Reference< css::frame::XFrame > getActive ( ) const; /// checks and free memory sal_Bool exist ( const css::uno::Reference< css::frame::XFrame >& xFrame ) const; sal_Bool hasElements( ) const; void clear ( ); /// deprecated IndexAccess! sal_uInt32 getCount ( ) const; css::uno::Reference< css::frame::XFrame > operator[]( sal_uInt32 nIndex ) const; /// replacement for deprectaed index access css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > getAllElements() const; /// for special feature "async quit timer" of desktop only! void enableQuitTimer ( const css::uno::Reference< css::frame::XDesktop >& xDesktop ); void disableQuitTimer(); /*DEPRECATEME DECL_LINK( implts_asyncQuit, void* ); */ /// special helper for Frame::findFrame() css::uno::Reference< css::frame::XFrame > searchOnAllChildrens ( const ::rtl::OUString& sName ) const; css::uno::Reference< css::frame::XFrame > searchOnDirectChildrens( const ::rtl::OUString& sName ) const; }; // class FrameContainer } // namespace framework #endif // #ifndef __FRAMEWORK_CLASSES_FRAMECONTAINER_HXX_