diff options
author | Andreas Schlüns <as@openoffice.org> | 2001-03-29 12:17:17 +0000 |
---|---|---|
committer | Andreas Schlüns <as@openoffice.org> | 2001-03-29 12:17:17 +0000 |
commit | 4ffebd2b8e244e1d374fcf55cd062774cfdf1b59 (patch) | |
tree | 11c4a38c479935f3021b51980f61ef0eb79c80c0 | |
parent | 79941ed9d3bcbf33f99bc213cda08453edab05cd (diff) |
no TF_FILTER, split defines.hxx, namespaces, new thread helper, some threadsafe code
63 files changed, 6736 insertions, 2121 deletions
diff --git a/framework/inc/arguments.h b/framework/inc/arguments.h new file mode 100644 index 0000000000..7724c86fdf --- /dev/null +++ b/framework/inc/arguments.h @@ -0,0 +1,178 @@ +/************************************************************************* + * + * $RCSfile: arguments.h,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_ARGUMENTS_H_ +#define __FRAMEWORK_ARGUMENTS_H_ + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ +#include <macros/generic.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +/*-************************************************************************************************************//** + @short These arguments are included in given parameter lists - e.g. at dispatch calls at Sequence< PropertyValue >. + You can use class ArgumentAnalyzer to set/get it from a given list! +*//*-*************************************************************************************************************/ + +#define ARGUMENTNAME_CHARACTERSET DECLARE_ASCII("CharacterSet" ) // string +#define ARGUMENTNAME_MEDIATYPE DECLARE_ASCII("ContentType" ) // string +#define ARGUMENTNAME_DETECTSERVICE DECLARE_ASCII("DetectService" ) // string +#define ARGUMENTNAME_EXTENSION DECLARE_ASCII("Extension" ) // string +#define ARGUMENTNAME_URL DECLARE_ASCII("FileName" ) // string +#define ARGUMENTNAME_FILTERNAME DECLARE_ASCII("FilterName" ) // string +#define ARGUMENTNAME_FORMAT DECLARE_ASCII("Format" ) // string +#define ARGUMENTNAME_FRAMENAME DECLARE_ASCII("FrameName" ) // string +#define ARGUMENTNAME_PATTERN DECLARE_ASCII("Pattern" ) // string +#define ARGUMENTNAME_POSTDATA DECLARE_ASCII("PostData" ) // string +#define ARGUMENTNAME_POSTSTRING DECLARE_ASCII("PostString" ) // string +#define ARGUMENTNAME_REFERRER DECLARE_ASCII("Referer" ) // string +#define ARGUMENTNAME_TEMPLATENAME DECLARE_ASCII("TemplateName" ) // string +#define ARGUMENTNAME_TEMPLATEREGIONNAME DECLARE_ASCII("TemplateRegionName" ) // string +#define ARGUMENTNAME_VERSION DECLARE_ASCII("Version" ) // int16 +#define ARGUMENTNAME_VIEWID DECLARE_ASCII("ViewId" ) // int16 +#define ARGUMENTNAME_FLAGS DECLARE_ASCII("Flags" ) // int32 +#define ARGUMENTNAME_ASTEMPLATE DECLARE_ASCII("AsTemplate" ) // bool +#define ARGUMENTNAME_HIDDEN DECLARE_ASCII("Hidden" ) // bool +#define ARGUMENTNAME_OPENNEWVIEW DECLARE_ASCII("OpenNewView" ) // bool +#define ARGUMENTNAME_READONLY DECLARE_ASCII("ReadOnly" ) // bool +#define ARGUMENTNAME_PREVIEW DECLARE_ASCII("Preview" ) // bool +#define ARGUMENTNAME_SILENT DECLARE_ASCII("Silent" ) // bool +#define ARGUMENTNAME_POSSIZE DECLARE_ASCII("PosSize" ) // rectangle +#define ARGUMENTNAME_INPUTSTREAM DECLARE_ASCII("InputStream" ) // Reference< XInputStream > +#define ARGUMENTNAME_DEEPDETECTION DECLARE_ASCII("DeepDetection" ) // bool +#define ARGUMENTNAME_JUMPMARK DECLARE_ASCII("JumpMark" ) // string +#define ARGUMENTNAME_TYPENAME DECLARE_ASCII("TypeName" ) // string + +/*-************************************************************************************************************//** + @short These values are used by class ArgumentAnalyzer internal to mark existing arguments. + My be they can be usefull for other things ... Thats why I publish it here! +*//*-*************************************************************************************************************/ + +#define ARGUMENTFLAG_CHARACTERSET 0x0000000000000001L +#define ARGUMENTFLAG_MEDIATYPE 0x0000000000000002L +#define ARGUMENTFLAG_DETECTSERVICE 0x0000000000000004L +#define ARGUMENTFLAG_EXTENSION 0x0000000000000008L +#define ARGUMENTFLAG_URL 0x0000000000000010L +#define ARGUMENTFLAG_FILTERNAME 0x0000000000000020L +#define ARGUMENTFLAG_FORMAT 0x0000000000000040L +#define ARGUMENTFLAG_FRAMENAME 0x0000000000000080L +#define ARGUMENTFLAG_PATTERN 0x0000000000000100L +#define ARGUMENTFLAG_POSTDATA 0x0000000000000200L +#define ARGUMENTFLAG_POSTSTRING 0x0000000000000400L +#define ARGUMENTFLAG_REFERRER 0x0000000000000800L +#define ARGUMENTFLAG_TEMPLATENAME 0x0000000000001000L +#define ARGUMENTFLAG_TEMPLATEREGIONNAME 0x0000000000002000L +#define ARGUMENTFLAG_VERSION 0x0000000000004000L +#define ARGUMENTFLAG_VIEWID 0x0000000000008000L +#define ARGUMENTFLAG_FLAGS 0x0000000000010000L +#define ARGUMENTFLAG_ASTEMPLATE 0x0000000000020000L +#define ARGUMENTFLAG_HIDDEN 0x0000000000040000L +#define ARGUMENTFLAG_OPENNEWVIEW 0x0000000000080000L +#define ARGUMENTFLAG_READONLY 0x0000000000100000L +#define ARGUMENTFLAG_PREVIEW 0x0000000000200000L +#define ARGUMENTFLAG_SILENT 0x0000000000400000L +#define ARGUMENTFLAG_POSSIZE 0x0000000000800000L +#define ARGUMENTFLAG_INPUTSTREAM 0x0000000001000000L +#define ARGUMENTFLAG_DEEPDETECTION 0x0000000002000000L +#define ARGUMENTFLAG_JUMPMARK 0x0000000004000000L +#define ARGUMENTFLAG_TYPENAME 0x0000000008000000L + +#define DISABLE_ARGUMENT_CHARACTERSET 0xFFFFFFFFFFFFFFFEL +#define DISABLE_ARGUMENT_MEDIATYPE 0xFFFFFFFFFFFFFFFDL +#define DISABLE_ARGUMENT_DETECTSERVICE 0xFFFFFFFFFFFFFFFBL +#define DISABLE_ARGUMENT_EXTENSION 0xFFFFFFFFFFFFFFF7L +#define DISABLE_ARGUMENT_URL 0xFFFFFFFFFFFFFFEFL +#define DISABLE_ARGUMENT_FILTERNAME 0xFFFFFFFFFFFFFFDFL +#define DISABLE_ARGUMENT_FORMAT 0xFFFFFFFFFFFFFFBFL +#define DISABLE_ARGUMENT_FRAMENAME 0xFFFFFFFFFFFFFF7FL +#define DISABLE_ARGUMENT_PATTERN 0xFFFFFFFFFFFFFEFFL +#define DISABLE_ARGUMENT_POSTDATA 0xFFFFFFFFFFFFFDFFL +#define DISABLE_ARGUMENT_POSTSTRING 0xFFFFFFFFFFFFFBFFL +#define DISABLE_ARGUMENT_REFERRER 0xFFFFFFFFFFFFF7FFL +#define DISABLE_ARGUMENT_TEMPLATENAME 0xFFFFFFFFFFFFEFFFL +#define DISABLE_ARGUMENT_TEMPLATEREGIONNAME 0xFFFFFFFFFFFFDFFFL +#define DISABLE_ARGUMENT_VERSION 0xFFFFFFFFFFFFBFFFL +#define DISABLE_ARGUMENT_VIEWID 0xFFFFFFFFFFFF7FFFL +#define DISABLE_ARGUMENT_FLAGS 0xFFFFFFFFFFFEFFFFL +#define DISABLE_ARGUMENT_ASTEMPLATE 0xFFFFFFFFFFFDFFFFL +#define DISABLE_ARGUMENT_HIDDEN 0xFFFFFFFFFFFBFFFFL +#define DISABLE_ARGUMENT_OPENNEWVIEW 0xFFFFFFFFFFF7FFFFL +#define DISABLE_ARGUMENT_READONLY 0xFFFFFFFFFFEFFFFFL +#define DISABLE_ARGUMENT_PREVIEW 0xFFFFFFFFFFDFFFFFL +#define DISABLE_ARGUMENT_SILENT 0xFFFFFFFFFFBFFFFFL +#define DISABLE_ARGUMENT_POSSIZE 0xFFFFFFFFFF7FFFFFL +#define DISABLE_ARGUMENT_INPUTSTREAM 0xFFFFFFFFFEFFFFFFL +#define DISABLE_ARGUMENT_DEEPDETECTION 0xFFFFFFFFFDFFFFFFL +#define DISABLE_ARGUMENT_JUMPMARK 0xFFFFFFFFFBFFFFFFL +#define DISABLE_ARGUMENT_TYPENAME 0xFFFFFFFFF7FFFFFFL + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_ARGUMENTS_H_ diff --git a/framework/inc/classes/checkediterator.hxx b/framework/inc/classes/checkediterator.hxx index 9ea4441210..c13061851b 100644 --- a/framework/inc/classes/checkediterator.hxx +++ b/framework/inc/classes/checkediterator.hxx @@ -2,9 +2,9 @@ * * $RCSfile: checkediterator.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: svesik $ $Date: 2001-02-12 13:11:47 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -115,6 +115,7 @@ namespace framework{ @base - @devstatus ready to use + @threadsafe no *//*-*************************************************************************************************************/ template< class TContainer > diff --git a/framework/inc/classes/framecontainer.hxx b/framework/inc/classes/framecontainer.hxx index 226863530f..9ee7c44fdf 100644 --- a/framework/inc/classes/framecontainer.hxx +++ b/framework/inc/classes/framecontainer.hxx @@ -2,9 +2,9 @@ * * $RCSfile: framecontainer.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: as $ $Date: 2001-03-09 14:42:23 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,6 +66,10 @@ // my own includes //_________________________________________________________________________________________________________________ +#ifndef __FRAMEWORK_THREADHELP_RWLOCKBASE_HXX_ +#include <threadhelp/rwlockbase.hxx> +#endif + #ifndef __FRAMEWORK_CLASSES_TARGETFINDER_HXX_ #include <classes/targetfinder.hxx> #endif @@ -78,6 +82,10 @@ #include <macros/debug.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -116,12 +124,6 @@ namespace framework{ -#define OREF ::vos::ORef -#define REFERENCE ::com::sun::star::uno::Reference -#define SEQUENCE ::com::sun::star::uno::Sequence -#define XFRAME ::com::sun::star::frame::XFrame -#define OUSTRING ::rtl::OUString - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -130,9 +132,9 @@ namespace framework{ // exported definitions //_________________________________________________________________________________________________________________ -typedef ::std::vector< REFERENCE< XFRAME > > TFrameContainer ; -typedef TFrameContainer::iterator TFrameIterator ; -typedef TFrameContainer::const_iterator TConstFrameIterator ; +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 @@ -140,19 +142,16 @@ typedef TFrameContainer::const_iterator TConstFrameIterator ; 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. To block append- or remove-calls, its possible to set a lock. Nobody can change the container - the lock is set. But don't forget to unlock the container again! - These class is NOT threadsafe! + container-items. @implements - - @base - - - @ATTENTION This class is not threadsafe. + @base FairRWLockBase - @devstatus deprecated + @devstatus ready to use + @threadsafe yes *//*-*************************************************************************************************************/ -class FrameContainer +class FrameContainer : private FairRWLockBase { //------------------------------------------------------------------------------------------------------------- // public methods @@ -206,7 +205,7 @@ class FrameContainer @onerror - *//*-*****************************************************************************************************/ - void append( const REFERENCE< XFRAME >& xFrame ); + void append( const css::uno::Reference< css::frame::XFrame >& xFrame ); /*-****************************************************************************************************//** @short remove an existing frame from the container @@ -222,7 +221,7 @@ class FrameContainer @onerror - *//*-*****************************************************************************************************/ - void remove( const REFERENCE< XFRAME >& xFrame ); + void remove( const css::uno::Reference< css::frame::XFrame >& xFrame ); /*-****************************************************************************************************//** @short ask for an existing frame in container @@ -238,7 +237,7 @@ class FrameContainer @onerror We return sal_False. *//*-*****************************************************************************************************/ - sal_Bool exist( const REFERENCE< XFRAME >& xFrame ) const; + sal_Bool exist( const css::uno::Reference< css::frame::XFrame >& xFrame ) const; /*-****************************************************************************************************//** @short clear the container and free memory @@ -257,38 +256,6 @@ class FrameContainer void clear(); /*-****************************************************************************************************//** - @short lock container - @descr You can use some methods of this class to have full access to the container by index! - But if someone add or remove frames to/from container we have a problem.... - With this method you can LOCK the container and all append()-, remove()- and clear()-calls are blocked. - But ... don't forget to unlock ... !!! - - @seealso method unlock() - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - void lock(); - - /*-****************************************************************************************************//** - @short unlock container - @descr You can use some methods of this class to break full access to the container by index! - From now, all access methods by index are blocked. Append(), remove() and clear() are non blocked. - - @seealso method lock() - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - void unlock(); - - /*-****************************************************************************************************//** @short get count of items in container @descr We ignore the lock - because caller can know these value but he can use it for direct indexaccess only, if a lock is set! @@ -316,7 +283,7 @@ class FrameContainer @onerror We return NULL! *//*-*****************************************************************************************************/ - REFERENCE< XFRAME > operator[]( sal_uInt32 nIndex ) const; + css::uno::Reference< css::frame::XFrame > operator[]( sal_uInt32 nIndex ) const; /*-****************************************************************************************************//** @short get all current items of container as snapshot @@ -330,7 +297,7 @@ class FrameContainer @onerror - *//*-*****************************************************************************************************/ - SEQUENCE< REFERENCE< XFRAME > > getAllElements(); + css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > getAllElements() const; /*-****************************************************************************************************//** @short ask it to get information about existing elements @@ -363,7 +330,7 @@ class FrameContainer @onerror If refrence not valid, we throw an assertion! *//*-*****************************************************************************************************/ - void setActive( const REFERENCE< XFRAME >& xFrame ); + void setActive( const css::uno::Reference< css::frame::XFrame >& xFrame ); /*-****************************************************************************************************//** @short get the current active frame in container. @@ -379,7 +346,7 @@ class FrameContainer @onerror We return a null-reference. *//*-*****************************************************************************************************/ - REFERENCE< XFRAME > getActive() const; + css::uno::Reference< css::frame::XFrame > getActive() const; /*-****************************************************************************************************//** @short Enable or disable automatic termination of desktop if last frame was removed from container @@ -394,8 +361,8 @@ class FrameContainer @onerror - *//*-*****************************************************************************************************/ - void enableQuitTimer( const REFERENCE< XDESKTOP >& xDesktop ); - void disableQuitTimer(); + void enableQuitTimer ( const css::uno::Reference< css::frame::XDesktop >& xDesktop ); + void disableQuitTimer ( ); /*-****************************************************************************************************//** @short implements default searches at children ... @@ -413,9 +380,9 @@ class FrameContainer @onerror A null reference is returned. *//*-*****************************************************************************************************/ - REFERENCE< XFRAME > searchDeepDown ( const OUSTRING& sName ); - REFERENCE< XFRAME > searchFlatDown ( const OUSTRING& sName ); - REFERENCE< XFRAME > searchDirectChildren ( const OUSTRING& sName ); + css::uno::Reference< css::frame::XFrame > searchDeepDown ( const ::rtl::OUString& sName ) const; + css::uno::Reference< css::frame::XFrame > searchFlatDown ( const ::rtl::OUString& sName ) const; + css::uno::Reference< css::frame::XFrame > searchDirectChildren ( const ::rtl::OUString& sName ) const; //------------------------------------------------------------------------------------------------------------- // protected methods @@ -429,6 +396,9 @@ class FrameContainer private: + void impl_clear(); + void impl_disableQuitTimer(); + //------------------------------------------------------------------------------------------------------------- // debug methods // (should be private everyway!) @@ -439,6 +409,8 @@ class FrameContainer @descr The following methods are used to check parameters for other methods of this class. The return value is used directly for an ASSERT(...). + @attention We don't need any mutex/lock here. We check incoming parameter only - no internal member! + @seealso ASSERTs in implementation! @param references to checking variables @@ -454,7 +426,7 @@ class FrameContainer //********************************************************************************************************* // - check for NULL pointer or invalid references - inline sal_Bool implcp_append( const REFERENCE< XFRAME >& xFrame ) const + inline sal_Bool implcp_append( const css::uno::Reference< css::frame::XFrame >& xFrame ) const { return ( ( &xFrame == NULL ) || @@ -465,7 +437,7 @@ class FrameContainer //********************************************************************************************************* // - check for NULL pointer or invalid references only // Don't look for Zombies here! - inline sal_Bool implcp_remove( const REFERENCE< XFRAME >& xFrame ) const + inline sal_Bool implcp_remove( const css::uno::Reference< css::frame::XFrame >& xFrame ) const { return ( ( &xFrame == NULL ) || @@ -475,7 +447,7 @@ class FrameContainer //********************************************************************************************************* // - check for NULL pointer or invalid references - inline sal_Bool implcp_exist( const REFERENCE< XFRAME >& xFrame ) const + inline sal_Bool implcp_exist( const css::uno::Reference< css::frame::XFrame >& xFrame ) const { return ( ( &xFrame == NULL ) || @@ -495,7 +467,7 @@ class FrameContainer //********************************************************************************************************* // - check for NULL pointer or invalid references - inline sal_Bool implcp_setActive( const REFERENCE< XFRAME >& xFrame ) const + inline sal_Bool implcp_setActive( const css::uno::Reference< css::frame::XFrame >& xFrame ) const { return ( ( &xFrame == NULL ) || @@ -507,7 +479,7 @@ class FrameContainer // - check for null pointer // - look for special target names ... some of them are not allowed as valid frame name // Attention: "_beamer" is a valid name. - inline sal_Bool implcp_searchDeepDown( const OUSTRING& sName ) const + inline sal_Bool implcp_searchDeepDown( const ::rtl::OUString& sName ) const { return ( ( &sName == NULL ) || @@ -522,7 +494,7 @@ class FrameContainer // - check for null pointer // - look for special target names ... some of them are not allowed as valid frame name // Attention: "_beamer" is a valid name. - inline sal_Bool implcp_searchFlatDown( const OUSTRING& sName ) const + inline sal_Bool implcp_searchFlatDown( const ::rtl::OUString& sName ) const { return ( ( &sName == NULL ) || @@ -537,7 +509,7 @@ class FrameContainer // - check for null pointer // - look for special target names ... some of them are not allowed as valid frame name // Attention: "_beamer" is a valid name. - inline sal_Bool implcp_searchDirectChildren( const OUSTRING& sName ) const + inline sal_Bool implcp_searchDirectChildren( const ::rtl::OUString& sName ) const { return ( ( &sName == NULL ) || @@ -547,6 +519,10 @@ class FrameContainer ( sName == SPECIALTARGET_PARENT ) ); } +/*TODO + + This method is not threadsafe ... + Correct it! //********************************************************************************************************* // Special debug mode. @@ -566,7 +542,7 @@ class FrameContainer } return bZombieExist; } - +*/ #endif // #ifdef ENABLE_ASSERTIONS //------------------------------------------------------------------------------------------------------------- @@ -576,10 +552,9 @@ class FrameContainer private: - sal_Bool m_bLock ; /// lock to block append()-, remove()- or clear()-calls - TFrameContainer m_aContainer ; /// list to hold all frames - REFERENCE< XFRAME > m_xActiveFrame ; /// one container item can be the current active frame. Its neccessary for Desktop or Frame implementation. - OREF< AsyncQuit > m_rQuitTimer ; /// if an instance of these class used by desktop and last frame will be removed we must terminate the desktop + TFrameContainer m_aContainer ; /// list to hold all frames + css::uno::Reference< css::frame::XFrame > m_xActiveFrame ; /// one container item can be the current active frame. Its neccessary for Desktop or Frame implementation. + ::vos::ORef< AsyncQuit > m_rQuitTimer ; /// if an instance of these class used by desktop and last frame will be removed we must terminate the desktop }; // class FrameContainer diff --git a/framework/inc/classes/targetfinder.hxx b/framework/inc/classes/targetfinder.hxx index bd1ccaf74f..d62a74efee 100644 --- a/framework/inc/classes/targetfinder.hxx +++ b/framework/inc/classes/targetfinder.hxx @@ -2,9 +2,9 @@ * * $RCSfile: targetfinder.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2001-03-09 14:42:23 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,6 +74,10 @@ #include <macros/generic.hxx> #endif +#ifndef __FRAMEWORK_TARGETS_H_ +#include <targets.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -100,10 +104,6 @@ namespace framework{ -#define OUSTRING ::rtl::OUString -#define REFERENCE ::com::sun::star::uno::Reference -#define XFRAME ::com::sun::star::frame::XFrame - //_________________________________________________________________________________________________________________ // declarations //_________________________________________________________________________________________________________________ @@ -122,21 +122,6 @@ enum EFrameType }; /*-************************************************************************************************************//** - @short These values specify special target names which must handled. -*//*-*************************************************************************************************************/ - -#define SPECIALTARGET_BLANK DECLARE_ASCII("_blank" ) -#define SPECIALTARGET_SELF DECLARE_ASCII("_self" ) -#define SPECIALTARGET_PARENT DECLARE_ASCII("_parent" ) -#define SPECIALTARGET_TOP DECLARE_ASCII("_top" ) -#define SPECIALTARGET_BEAMER DECLARE_ASCII("_beamer" ) -/* not supported yet! -#define SPECIALTARGET_DOCUMENT DECLARE_ASCII("_document" ) -#define SPECIALTARGET_EXPLORER DECLARE_ASCII("_explorer" ) -#define SPECIALTARGET_PARTWINDOW DECLARE_ASCII("_partwindow" ) -*/ - -/*-************************************************************************************************************//** @short valid result values to classify targeting *//*-*************************************************************************************************************/ @@ -165,9 +150,8 @@ enum ETargetClass @implements - @base - - @ATTENTION This class is'nt threadsafe! - @devstatus ready to use + @threadsafe not neccessary *//*-*************************************************************************************************************/ class TargetFinder @@ -223,14 +207,14 @@ class TargetFinder @onerror E_UNKNOWN is returned. *//*-*****************************************************************************************************/ - static ETargetClass classify( EFrameType eFrameType , - const OUSTRING& sTargetName , - sal_Int32 nSearchFlags , - sal_Bool& bCreationAllowed , - sal_Bool bChildrenExist , - const OUSTRING& sFrameName = OUSTRING() , - sal_Bool bParentExist = sal_False , - const OUSTRING& sParentName = OUSTRING() ); + static ETargetClass classify( EFrameType eFrameType , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags , + sal_Bool& bCreationAllowed , + sal_Bool bChildrenExist , + const ::rtl::OUString& sFrameName = ::rtl::OUString() , + sal_Bool bParentExist = sal_False , + const ::rtl::OUString& sParentName = ::rtl::OUString() ); //--------------------------------------------------------------------------------------------------------- // private methods @@ -256,28 +240,28 @@ class TargetFinder @onerror A null reference is returned. *//*-*****************************************************************************************************/ - static ETargetClass impl_classifyForDesktop ( sal_Bool bChildrenExist , - const OUSTRING& sTargetName , - sal_Int32 nSearchFlags ); - - static ETargetClass impl_classifyForPlugInFrame ( sal_Bool bParentExist , - sal_Bool bChildrenExist , - const OUSTRING& sFrameName , - const OUSTRING& sTargetName , - sal_Int32 nSearchFlags ); - - static ETargetClass impl_classifyForTask ( sal_Bool bParentExist , - sal_Bool bChildrenExist , - const OUSTRING& sFrameName , - const OUSTRING& sTargetName , - sal_Int32 nSearchFlags ); - - static ETargetClass impl_classifyForFrame ( sal_Bool bParentExist , - sal_Bool bChildrenExist , - const OUSTRING& sFrameName , - const OUSTRING& sParentName , - const OUSTRING& sTargetName , - sal_Int32 nSearchFlags ); + static ETargetClass impl_classifyForDesktop ( sal_Bool bChildrenExist , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags ); + + static ETargetClass impl_classifyForPlugInFrame ( sal_Bool bParentExist , + sal_Bool bChildrenExist , + const ::rtl::OUString& sFrameName , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags ); + + static ETargetClass impl_classifyForTask ( sal_Bool bParentExist , + sal_Bool bChildrenExist , + const ::rtl::OUString& sFrameName , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags ); + + static ETargetClass impl_classifyForFrame ( sal_Bool bParentExist , + sal_Bool bChildrenExist , + const ::rtl::OUString& sFrameName , + const ::rtl::OUString& sParentName , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags ); //--------------------------------------------------------------------------------------------------------- // debug and test methods @@ -306,14 +290,14 @@ class TargetFinder // - check invalid references, misused booleans, wrong flags or for an unknown frame type // - value of bCreationAllowed will set by classify() - existing value isn't important // - empty strings are allowed - static inline sal_Bool implcp_classify( EFrameType eFrameType , - const OUSTRING& sTargetName , - sal_Int32 nSearchFlags , - sal_Bool& bCreationAllowed , - sal_Bool bChildrenExist , - const OUSTRING& sFrameName , - sal_Bool bParentExist , - const OUSTRING& sParentName ) + static inline sal_Bool implcp_classify( EFrameType eFrameType , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags , + sal_Bool& bCreationAllowed , + sal_Bool bChildrenExist , + const ::rtl::OUString& sFrameName , + sal_Bool bParentExist , + const ::rtl::OUString& sParentName ) { return ( ( &sTargetName == NULL ) || diff --git a/framework/inc/classes/taskcreator.hxx b/framework/inc/classes/taskcreator.hxx index 1ddd66c142..bbd622ea0f 100644 --- a/framework/inc/classes/taskcreator.hxx +++ b/framework/inc/classes/taskcreator.hxx @@ -2,9 +2,9 @@ * * $RCSfile: taskcreator.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2001-03-09 14:42:23 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,10 @@ #include <macros/debug.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -108,11 +112,6 @@ namespace framework{ -#define OUSTRING ::rtl::OUString -#define REFERENCE ::com::sun::star::uno::Reference -#define XFRAME ::com::sun::star::frame::XFrame -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -129,7 +128,8 @@ namespace framework{ @implements - @base - - @devstatus deprecated + @devstatus ready to use + @threadsafe no *//*-*************************************************************************************************************/ class TaskCreator @@ -156,7 +156,7 @@ class TaskCreator @onerror - *//*-*****************************************************************************************************/ - TaskCreator( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); + TaskCreator( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); /*-****************************************************************************************************//** @short standard destructor to delete instance @@ -185,8 +185,8 @@ class TaskCreator @onerror We return a null-reference. *//*-*****************************************************************************************************/ - REFERENCE< XFRAME > createNewSystemTask ( const OUSTRING& sName ); - REFERENCE< XFRAME > createNewBrowserTask( const OUSTRING& sName ); + css::uno::Reference< css::frame::XFrame > createNewSystemTask ( const ::rtl::OUString& sName ); + css::uno::Reference< css::frame::XFrame > createNewBrowserTask( const ::rtl::OUString& sName ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -200,7 +200,7 @@ class TaskCreator private: - OUSTRING impl_filterNames( const OUSTRING& sName ); + ::rtl::OUString impl_filterNames( const ::rtl::OUString& sName ); //------------------------------------------------------------------------------------------------------------- // debug methods @@ -225,8 +225,8 @@ class TaskCreator private: - sal_Bool impldbg_checkParameter_createNewSystemTask ( const OUSTRING& sName ); - sal_Bool impldbg_checkParameter_createNewBrowserTask( const OUSTRING& sName ); + static sal_Bool impldbg_checkParameter_createNewSystemTask ( const ::rtl::OUString& sName ); + static sal_Bool impldbg_checkParameter_createNewBrowserTask ( const ::rtl::OUString& sName ); #endif // #ifdef ENABLE_ASSERTIONS @@ -237,7 +237,7 @@ class TaskCreator private: - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; }; // class TaskCreator diff --git a/framework/inc/classes/wildcard.hxx b/framework/inc/classes/wildcard.hxx index 082a69e482..b5327ac834 100644 --- a/framework/inc/classes/wildcard.hxx +++ b/framework/inc/classes/wildcard.hxx @@ -2,9 +2,9 @@ * * $RCSfile: wildcard.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:22 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,8 +92,6 @@ namespace framework{ -#define OUSTRING ::rtl::OUString - //_________________________________________________________________________________________________________________ // declarations //_________________________________________________________________________________________________________________ @@ -169,8 +167,8 @@ class Wildcard @onerror - *//*-*****************************************************************************************************/ - static sal_Bool match( const OUSTRING& sText , - const OUSTRING& sPattern ); + static sal_Bool match( const ::rtl::OUString& sText , + const ::rtl::OUString& sPattern ); //--------------------------------------------------------------------------------------------------------- // debug and test methods @@ -193,8 +191,8 @@ class Wildcard #ifdef ENABLE_ASSERTIONS - static sal_Bool impldbg_checkParameter_match( const OUSTRING& sText , - const OUSTRING& sPattern ); + static sal_Bool impldbg_checkParameter_match( const ::rtl::OUString& sText , + const ::rtl::OUString& sPattern ); #endif // #ifdef ENABLE_ASSERTIONS diff --git a/framework/inc/filterflags.h b/framework/inc/filterflags.h index a078b24800..a3d883fef5 100644 --- a/framework/inc/filterflags.h +++ b/framework/inc/filterflags.h @@ -2,9 +2,9 @@ * * $RCSfile: filterflags.h,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: as $ $Date: 2001-03-20 14:44:45 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,6 +64,12 @@ namespace framework{ +/*-************************************************************************************************************//** + @short These values describe our supported filter flags. + @attention Don't change flag values without reason - we must support old functionality and position + in flag combined values! +*//*-*************************************************************************************************************/ + #define FILTERFLAGNAME_IMPORT DECLARE_ASCII("Import" ) #define FILTERFLAGNAME_EXPORT DECLARE_ASCII("Export" ) #define FILTERFLAGNAME_INTERNAL DECLARE_ASCII("Internal" ) @@ -106,6 +112,27 @@ namespace framework{ #define FILTERFLAG_BROWSERPREFERED 0x00400000L // 4194304 #define FILTERFLAG_PREFERED 0x10000000L // 268435456 +#define DISABLE_FILTERFLAG_IMPORT 0xFFFFFFFEL +#define DISABLE_FILTERFLAG_EXPORT 0xFFFFFFFDL +#define DISABLE_FILTERFLAG_TEMPLATE 0xFFFFFFFBL +#define DISABLE_FILTERFLAG_INTERNAL 0xFFFFFFF7L +#define DISABLE_FILTERFLAG_TEMPLATEPATH 0xFFFFFFEFL +#define DISABLE_FILTERFLAG_OWN 0xFFFFFFDFL +#define DISABLE_FILTERFLAG_ALIEN 0xFFFFFFBFL +#define DISABLE_FILTERFLAG_USESOPTIONS 0xFFFFFF7FL +#define DISABLE_FILTERFLAG_DEFAULT 0xFFFFFEFFL +#define DISABLE_FILTERFLAG_NOTINFILEDIALOG 0xFFFFEFFFL +#define DISABLE_FILTERFLAG_NOTINCHOOSER 0xFFFFDFFFL +#define DISABLE_FILTERFLAG_ASYNCHRON 0xFFFFBFFFL +#define DISABLE_FILTERFLAG_READONLY 0xFFFEFFFFL +#define DISABLE_FILTERFLAG_NOTINSTALLED 0xFFFDFFFFL +#define DISABLE_FILTERFLAG_CONSULTSERVICE 0xFFFBFFFFL +#define DISABLE_FILTERFLAG_3RDPARTYFILTER 0xFFF7FFFFL +#define DISABLE_FILTERFLAG_PACKED 0xFFEFFFFFL +#define DISABLE_FILTERFLAG_SILENTEXPORT 0xFFDFFFFFL +#define DISABLE_FILTERFLAG_BROWSERPREFERED 0xFFBFFFFFL +#define DISABLE_FILTERFLAG_PREFERED 0xEFFFFFFFL + } // namespace framework #endif // #ifndef __FRAMEWORK_FILTERFLAGS_H_ diff --git a/framework/inc/general.h b/framework/inc/general.h new file mode 100644 index 0000000000..33143d61eb --- /dev/null +++ b/framework/inc/general.h @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: general.h,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_GENERAL_H_ +#define __FRAMEWORK_GENERAL_H_ + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ +#include <macros/generic.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// some general defines for whole project +//_________________________________________________________________________________________________________________ + +#define FEATUREDESCRIPTOR_LOADSTATE DECLARE_ASCII("loadFinishedOrCancelled") /// status event mapped from load event of frame loader + +//_________________________________________________________________________________________________________________ +// some general types for whole project +//_________________________________________________________________________________________________________________ + +#define css ::com::sun::star /// used for short namespaces! + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_GENERAL_H_ diff --git a/framework/inc/helper/ocomponentaccess.hxx b/framework/inc/helper/ocomponentaccess.hxx index b0f999624e..12ae989348 100644 --- a/framework/inc/helper/ocomponentaccess.hxx +++ b/framework/inc/helper/ocomponentaccess.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ocomponentaccess.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: as $ $Date: 2000-09-26 13:01:14 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,10 @@ #include <macros/debug.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -132,27 +136,6 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define EVENTOBJECT ::com::sun::star::lang::EventObject -#define MUTEX ::osl::Mutex -#define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException -#define OWEAKOBJECT ::cppu::OWeakObject -#define REFERENCE ::com::sun::star::uno::Reference -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define SEQUENCE ::com::sun::star::uno::Sequence -#define UNOTYPE ::com::sun::star::uno::Type -#define WEAKREFERENCE ::com::sun::star::uno::WeakReference -#define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException -#define XDESKTOP ::com::sun::star::frame::XDesktop -#define XELEMENTACCESS ::com::sun::star::container::XElementAccess -#define XENUMERATION ::com::sun::star::container::XEnumeration -#define XENUMERATIONACCESS ::com::sun::star::container::XEnumerationAccess -#define XFRAMESSUPPLIER ::com::sun::star::frame::XFramesSupplier -#define XFRAME ::com::sun::star::frame::XFrame -#define XTASK ::com::sun::star::frame::XTask -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider -#define XCOMPONENT ::com::sun::star::lang::XComponent - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -178,9 +161,9 @@ namespace framework{ @devstatus ready to use *//*-*************************************************************************************************************/ -class OComponentAccess : public XTYPEPROVIDER , - public XENUMERATIONACCESS , // => XElementAccess - public OWEAKOBJECT +class OComponentAccess : public css::lang::XTypeProvider , + public css::container::XEnumerationAccess , // => XElementAccess + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -208,8 +191,8 @@ class OComponentAccess : public XTYPEPROVIDER , @onerror Do nothing and reset this object to default with an empty list. *//*-*****************************************************************************************************/ - OComponentAccess( const REFERENCE< XDESKTOP >& xOwner , - MUTEX& aMutex ); + OComponentAccess( const css::uno::Reference< css::frame::XDesktop >& xOwner , + ::osl::Mutex& aMutex ); //--------------------------------------------------------------------------------------------------------- // XInterface @@ -237,7 +220,7 @@ class OComponentAccess : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XENUMERATION > SAL_CALL createEnumeration() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XElementAccess @@ -256,7 +239,7 @@ class OComponentAccess : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual UNOTYPE SAL_CALL getElementType() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Type SAL_CALL getElementType() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get state of componentlist of enumeration. @@ -271,7 +254,7 @@ class OComponentAccess : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL hasElements() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL hasElements() throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -316,8 +299,8 @@ class OComponentAccess : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - void impl_collectAllChildComponents( const REFERENCE< XFRAMESSUPPLIER >& xNode , - SEQUENCE< REFERENCE< XCOMPONENT > >& seqComponents ); + void impl_collectAllChildComponents( const css::uno::Reference< css::frame::XFramesSupplier >& xNode , + css::uno::Sequence< css::uno::Reference< css::lang::XComponent > >& seqComponents ); /*-****************************************************************************************************//** @short get the component of a frame @@ -331,7 +314,7 @@ class OComponentAccess : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - REFERENCE< XCOMPONENT > impl_getFrameComponent( const REFERENCE< XFRAME >& xFrame ) const; + css::uno::Reference< css::lang::XComponent > impl_getFrameComponent( const css::uno::Reference< css::frame::XFrame >& xFrame ) const; //------------------------------------------------------------------------------------------------------------- // debug methods @@ -356,8 +339,8 @@ class OComponentAccess : public XTYPEPROVIDER , private: - sal_Bool impldbg_checkParameter_OComponentAccessCtor( const REFERENCE< XDESKTOP >& xOwner , - MUTEX& aMutex ) const; + static sal_Bool impldbg_checkParameter_OComponentAccessCtor( const css::uno::Reference< css::frame::XDesktop >& xOwner , + ::osl::Mutex& aMutex ); #endif // #ifdef ENABLE_ASSERTIONS @@ -368,8 +351,8 @@ class OComponentAccess : public XTYPEPROVIDER , private: - MUTEX& m_aMutex ; /// shared mutex with owner - WEAKREFERENCE< XDESKTOP > m_xOwner ; /// weak reference to the desktop object! + ::osl::Mutex& m_aMutex ; /// shared mutex with owner + css::uno::WeakReference< css::frame::XDesktop > m_xOwner ; /// weak reference to the desktop object! }; // class OComponentAccess diff --git a/framework/inc/helper/ocomponentenumeration.hxx b/framework/inc/helper/ocomponentenumeration.hxx index d31208dd07..7f6affd7a4 100644 --- a/framework/inc/helper/ocomponentenumeration.hxx +++ b/framework/inc/helper/ocomponentenumeration.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ocomponentenumeration.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: as $ $Date: 2000-09-26 13:01:14 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,10 @@ #include <macros/debug.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -120,21 +124,6 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define EVENTOBJECT ::com::sun::star::lang::EventObject -#define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException -#define OWEAKOBJECT ::cppu::OWeakObject -#define REFERENCE ::com::sun::star::uno::Reference -#define SEQUENCE ::com::sun::star::uno::Sequence -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define UNOTYPE ::com::sun::star::uno::Type -#define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException -#define XENUMERATION ::com::sun::star::container::XEnumeration -#define XEVENTLISTENER ::com::sun::star::lang::XEventListener -#define XCOMPONENT ::com::sun::star::lang::XComponent -#define XTASK ::com::sun::star::frame::XTask -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -158,13 +147,14 @@ namespace framework{ OWeakObject @devstatus ready to use + @threadsafe yes *//*-*************************************************************************************************************/ -class OComponentEnumeration : public XTYPEPROVIDER , - public XEVENTLISTENER , - public XENUMERATION , - public OMutexMember , - public OWEAKOBJECT +class OComponentEnumeration : public css::lang::XTypeProvider , + public css::lang::XEventListener , + public css::container::XEnumeration , + public OMutexMember , + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -189,7 +179,7 @@ class OComponentEnumeration : public XTYPEPROVIDER , @onerror Do nothing and reset this object to default with an empty list. *//*-*****************************************************************************************************/ - OComponentEnumeration( const SEQUENCE< REFERENCE< XCOMPONENT > >& seqComponents ); + OComponentEnumeration( const css::uno::Sequence< css::uno::Reference< css::lang::XComponent > >& seqComponents ); //--------------------------------------------------------------------------------------------------------- // XInterface @@ -215,7 +205,7 @@ class OComponentEnumeration : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL disposing( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XEnumeration @@ -236,7 +226,7 @@ class OComponentEnumeration : public XTYPEPROVIDER , (List is emtpy and there no accessible elements ...) *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL hasMoreElements() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL hasMoreElements() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short give the next element, if some exist @@ -250,9 +240,9 @@ class OComponentEnumeration : public XTYPEPROVIDER , @onerror If end of enumeration is arrived or there are no elements in list => a NoSuchElementException is thrown. *//*-*****************************************************************************************************/ - virtual ANY SAL_CALL nextElement() throw( NOSUCHELEMENTEXCEPTION , - WRAPPEDTARGETEXCEPTION , - RUNTIMEEXCEPTION ); + virtual css::uno::Any SAL_CALL nextElement() throw( css::container::NoSuchElementException , + css::lang::WrappedTargetException , + css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -325,8 +315,8 @@ class OComponentEnumeration : public XTYPEPROVIDER , private: - sal_Bool impldbg_checkParameter_OComponentEnumerationCtor ( const SEQUENCE< REFERENCE< XCOMPONENT > >& seqComponents ); - sal_Bool impldbg_checkParameter_disposing ( const EVENTOBJECT& aEvent ); + static sal_Bool impldbg_checkParameter_OComponentEnumerationCtor ( const css::uno::Sequence< css::uno::Reference< css::lang::XComponent > >& seqComponents ); + static sal_Bool impldbg_checkParameter_disposing ( const css::lang::EventObject& aEvent ); #endif // #ifdef ENABLE_ASSERTIONS @@ -337,8 +327,8 @@ class OComponentEnumeration : public XTYPEPROVIDER , private: - sal_uInt32 m_nPosition ; /// current position in enumeration - SEQUENCE< REFERENCE< XCOMPONENT > > m_seqComponents ; /// list of current components + sal_uInt32 m_nPosition ; /// current position in enumeration + css::uno::Sequence< css::uno::Reference< css::lang::XComponent > > m_seqComponents ; /// list of current components }; // class OComponentEnumeration diff --git a/framework/inc/helper/oframes.hxx b/framework/inc/helper/oframes.hxx index 82bb55945c..29c4cc113f 100644 --- a/framework/inc/helper/oframes.hxx +++ b/framework/inc/helper/oframes.hxx @@ -2,9 +2,9 @@ * * $RCSfile: oframes.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2000-10-16 11:54:31 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,10 @@ #include <macros/debug.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -116,18 +120,6 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define INDEXOUTOFBOUNDSEXCEPTION ::com::sun::star::lang::IndexOutOfBoundsException -#define MUTEX ::osl::Mutex -#define OWEAKOBJECT ::cppu::OWeakObject -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define UNOTYPE ::com::sun::star::uno::Type -#define WEAKREFERENCE ::com::sun::star::uno::WeakReference -#define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException -#define XFRAME ::com::sun::star::frame::XFrame -#define XFRAMES ::com::sun::star::frame::XFrames -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -156,8 +148,8 @@ namespace framework{ @devstatus deprecated *//*-*************************************************************************************************************/ -class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess - public OWEAKOBJECT +class OFrames : public css::frame::XFrames , //=> XIndexAccess => XElementAccess + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -185,10 +177,10 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror - *//*-*****************************************************************************************************/ - OFrames( const REFERENCE< XMULTISERVICEFACTORY >& xFactory , - MUTEX& aMutex , - const REFERENCE< XFRAME >& xOwner , - FrameContainer* pFrameContainer ); + OFrames( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , + ::osl::Mutex& aMutex , + const css::uno::Reference< css::frame::XFrame >& xOwner , + FrameContainer* pFrameContainer ); //--------------------------------------------------------------------------------------------------------- // XInterface @@ -213,7 +205,7 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror We do nothing in release or throw an assert in debug version. *//*-*****************************************************************************************************/ - virtual void SAL_CALL append( const REFERENCE< XFRAME >& xFrame ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL append( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short remove frame from container @@ -228,7 +220,7 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror We do nothing in release or throw an assert in debug version. *//*-*****************************************************************************************************/ - virtual void SAL_CALL remove( const REFERENCE< XFRAME >& xFrame ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL remove( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short return list of all applicable frames for given flags @@ -242,7 +234,7 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror An empty list is returned. *//*-*****************************************************************************************************/ - virtual SEQUENCE< REFERENCE< XFRAME > > SAL_CALL queryFrames( sal_Int32 nSearchFlags ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > SAL_CALL queryFrames( sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XIndexAccess @@ -262,7 +254,7 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror If a lock is set, we return 0 for prevent further access! *//*-*****************************************************************************************************/ - virtual sal_Int32 SAL_CALL getCount() throw( RUNTIMEEXCEPTION ); + virtual sal_Int32 SAL_CALL getCount() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get specified container item by index @@ -279,9 +271,9 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror If index out of range, an IndexOutOfBoundsException is thrown. *//*-*****************************************************************************************************/ - virtual ANY SAL_CALL getByIndex( sal_Int32 nIndex ) throw( INDEXOUTOFBOUNDSEXCEPTION , - WRAPPEDTARGETEXCEPTION , - RUNTIMEEXCEPTION ); + virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) throw( css::lang::IndexOutOfBoundsException , + css::lang::WrappedTargetException , + css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XElementAccess @@ -300,7 +292,7 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror - *//*-*****************************************************************************************************/ - virtual UNOTYPE SAL_CALL getElementType() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Type SAL_CALL getElementType() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get fill state of current container @@ -316,7 +308,7 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror We return sal_False. *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL hasElements() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL hasElements() throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -378,8 +370,8 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess @onerror - *//*-*****************************************************************************************************/ - void impl_appendSequence( SEQUENCE< REFERENCE< XFRAME > >& seqDestination , - const SEQUENCE< REFERENCE< XFRAME > >& seqSource ); + void impl_appendSequence( css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqDestination , + const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqSource ); //------------------------------------------------------------------------------------------------------------- // debug methods @@ -404,13 +396,13 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess private: - sal_Bool impldbg_checkParameter_OFramesCtor ( const REFERENCE< XMULTISERVICEFACTORY >& xFactory , - MUTEX& aMutex , - const REFERENCE< XFRAME >& xOwner , - FrameContainer* pFrameContainer ); - sal_Bool impldbg_checkParameter_append ( const REFERENCE< XFRAME >& xFrame ); - sal_Bool impldbg_checkParameter_remove ( const REFERENCE< XFRAME >& xFrame ); - sal_Bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags ); + static sal_Bool impldbg_checkParameter_OFramesCtor ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , + ::osl::Mutex& aMutex , + const css::uno::Reference< css::frame::XFrame >& xOwner , + FrameContainer* pFrameContainer ); + static sal_Bool impldbg_checkParameter_append ( const css::uno::Reference< css::frame::XFrame >& xFrame ); + static sal_Bool impldbg_checkParameter_remove ( const css::uno::Reference< css::frame::XFrame >& xFrame ); + static sal_Bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags ); #endif // #ifdef ENABLE_ASSERTIONS @@ -421,11 +413,11 @@ class OFrames : public XFRAMES , //=> XIndexAccess => XElementAccess private: - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; /// reference to global servicemanager - MUTEX& m_aMutex ; /// shared mutex with owner of an instance of this class - WEAKREFERENCE< XFRAME > m_xOwner ; /// reference to owner of this instance (Hold no hard reference!) - FrameContainer* m_pFrameContainer ; /// with owner shared list to hold all direct childs of an XFramesSupplier - sal_Bool m_bRecursiveSearchProtection ; /// flag to protect against recursive searches of frames at parents + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// reference to global servicemanager + ::osl::Mutex& m_aMutex ; /// shared mutex with owner of an instance of this class + css::uno::WeakReference< css::frame::XFrame > m_xOwner ; /// reference to owner of this instance (Hold no hard reference!) + FrameContainer* m_pFrameContainer ; /// with owner shared list to hold all direct childs of an XFramesSupplier + sal_Bool m_bRecursiveSearchProtection ; /// flag to protect against recursive searches of frames at parents }; // class OFrames diff --git a/framework/inc/helper/opluginframedispatcher.hxx b/framework/inc/helper/opluginframedispatcher.hxx index eb75166969..290324b57e 100644 --- a/framework/inc/helper/opluginframedispatcher.hxx +++ b/framework/inc/helper/opluginframedispatcher.hxx @@ -2,9 +2,9 @@ * * $RCSfile: opluginframedispatcher.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: as $ $Date: 2001-02-15 14:14:16 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,10 @@ #include <macros/debug.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -148,27 +152,6 @@ namespace framework{ -#define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor -#define MUTEX ::osl::Mutex -#define OMULTITYPEINTERFACECONTAINERHELPERVAR ::cppu::OMultiTypeInterfaceContainerHelperVar -#define OUSTRING ::rtl::OUString -#define OWEAKOBJECT ::cppu::OWeakObject -#define PROPERTYVALUE ::com::sun::star::beans::PropertyValue -#define REFERENCE ::com::sun::star::uno::Reference -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define SEQUENCE ::com::sun::star::uno::Sequence -#define UNOURL ::com::sun::star::util::URL -#define WEAKREFERENCE ::com::sun::star::uno::WeakReference -#define XDISPATCH ::com::sun::star::frame::XDispatch -#define XDISPATCHPROVIDER ::com::sun::star::frame::XDispatchProvider -#define XFRAME ::com::sun::star::frame::XFrame -#define XINPUTSTREAM ::com::sun::star::io::XInputStream -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define XPLUGININSTANCE ::com::sun::star::mozilla::XPluginInstance -#define XPLUGININSTANCENOTIFYSINK ::com::sun::star::mozilla::XPluginInstanceNotifySink -#define XPLUGININSTANCEPEER ::com::sun::star::mozilla::XPluginInstancePeer -#define XSTATUSLISTENER ::com::sun::star::frame::XStatusListener - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -177,40 +160,6 @@ namespace framework{ // exported definitions //_________________________________________________________________________________________________________________ -struct tIMPLExtractedArguments -{ - OUSTRING sReferrer ; // Value of extracted referrer argument - REFERENCE< XINPUTSTREAM > xPostDataStream ; // Value of extracted data stream for posting - - sal_Int32 nValidMask ; // state of extracted arguments - - /*ATTENTION - - Bug: #83884# - If no copy-ctor exist - we crash under linux !?? - Why?? ... I HAVE ABSOLUT NO IDEA! - May be its a compiler bug ... or a problem of stack- or memory- handling ... - */ - - tIMPLExtractedArguments() - { - sReferrer = OUSTRING() ; - xPostDataStream = REFERENCE< XINPUTSTREAM >() ; - nValidMask = 0 ; - } - - tIMPLExtractedArguments( const tIMPLExtractedArguments& rCopy ) - : sReferrer ( rCopy.sReferrer ) - , xPostDataStream ( rCopy.xPostDataStream ) - , nValidMask ( rCopy.nValidMask ) - { - } - - ~tIMPLExtractedArguments() - { - } -}; - /*-************************************************************************************************************//** Use OMultiTypeInterfaceContainerHelperVar-template to create new class to get a container to combine string values with listeners. @@ -218,15 +167,15 @@ struct tIMPLExtractedArguments struct IMPL_hashCode { - size_t operator()(const OUSTRING& sString) const + size_t operator()(const ::rtl::OUString& sString) const { return sString.hashCode(); } }; -typedef OMULTITYPEINTERFACECONTAINERHELPERVAR< OUSTRING , - IMPL_hashCode , - std::equal_to< OUSTRING > > IMPL_ListenerContainerHelper ; +typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< ::rtl::OUString , + IMPL_hashCode , + ::std::equal_to< ::rtl::OUString > > IMPL_ListenerContainerHelper ; /*-************************************************************************************************************//** @short - @@ -238,13 +187,13 @@ typedef OMULTITYPEINTERFACECONTAINERHELPERVAR< OUSTRING , XPluginInstanceNotifySink @base OWeakObject - @devstatus deprecated + @devstatus ready to use *//*-*************************************************************************************************************/ -class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , - public XDISPATCH , - public XPLUGININSTANCENOTIFYSINK , - public OWEAKOBJECT +class OPlugInFrameDispatcher : public css::frame::XDispatchProvider , + public css::frame::XDispatch , + public css::mozilla::XPluginInstanceNotifySink , + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -252,9 +201,10 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , public: - static void AddArguments( const SEQUENCE < PROPERTYVALUE > & rArgs, const ::rtl::OUString& rURL ); - static const SEQUENCE < PROPERTYVALUE >* GetArguments( const ::rtl::OUString& rURL ); - static void RemoveArguments( const ::rtl::OUString& rURL ); + static void AddArguments ( const css::uno::Sequence< css::beans::PropertyValue > & rArgs , + const ::rtl::OUString& rURL ); + static const css::uno::Sequence < css::beans::PropertyValue >* GetArguments ( const ::rtl::OUString& rURL ); + static void RemoveArguments ( const ::rtl::OUString& rURL ); //--------------------------------------------------------------------------------------------------------- // constructor / destructor @@ -272,10 +222,10 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , @onerror - *//*-*****************************************************************************************************/ - OPlugInFrameDispatcher( const REFERENCE< XMULTISERVICEFACTORY >& xFactory , - MUTEX& aMutex , - const REFERENCE< XPLUGININSTANCE >& xOwner , - const REFERENCE< XPLUGININSTANCEPEER >& xPlugInDLL ); + OPlugInFrameDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , + ::osl::Mutex& aMutex , + const css::uno::Reference< css::mozilla::XPluginInstance >& xOwner , + const css::uno::Reference< css::mozilla::XPluginInstancePeer >& xPlugInDLL ); //--------------------------------------------------------------------------------------------------------- // XInterface @@ -302,9 +252,9 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , @onerror We return a NULL-reference. *//*-*****************************************************************************************************/ - virtual REFERENCE< XDISPATCH > SAL_CALL queryDispatch( const UNOURL& aURL , - const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL , + const ::rtl::OUString& sTargetFrameName , + sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short search dispatcher for more the one URL @@ -319,7 +269,7 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , @onerror An empty list is returned. *//*-*****************************************************************************************************/ - virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescripts ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescripts ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XDispatch @@ -339,8 +289,8 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL dispatch( const UNOURL& aURL , - const SEQUENCE< PROPERTYVALUE >& seqArguments) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL dispatch( const css::util::URL& aURL , + const css::uno::Sequence< css::beans::PropertyValue >& seqArguments) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short add listener for state events @@ -355,8 +305,8 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL addStatusListener( const REFERENCE< XSTATUSLISTENER >& xControl, - const UNOURL& aURL ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, + const css::util::URL& aURL ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short remove listener @@ -371,8 +321,8 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL removeStatusListener( const REFERENCE< XSTATUSLISTENER >& xControl, - const UNOURL& aURL ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, + const css::util::URL& aURL ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XPluginInstanceNotifySink @@ -391,7 +341,7 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL notifyURL( const OUSTRING& sURL ) throw( RUNTIMEEXCEPTION ); + void SAL_CALL notifyURL( const ::rtl::OUString& sURL ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -433,22 +383,8 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , @onerror - *//*-*****************************************************************************************************/ - tIMPLExtractedArguments impl_extractArguments( const SEQUENCE< PROPERTYVALUE >& seqArguments ); - - /*-****************************************************************************************************//** - @short - - @descr - - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - void impl_sendStatusEvent( const OUSTRING& sURL , - sal_Bool bLoadingSuccessful ); + void impl_sendStatusEvent( const ::rtl::OUString& sURL , + sal_Bool bLoadingSuccessful ); //------------------------------------------------------------------------------------------------------------- // debug methods @@ -473,21 +409,21 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , private: - sal_Bool impldbg_checkParameter_OPlugInFrameDispatcherCtor ( const REFERENCE< XMULTISERVICEFACTORY >& xFactory , - MUTEX& aMutex , - const REFERENCE< XPLUGININSTANCE >& xOwner , - const REFERENCE< XPLUGININSTANCEPEER >& xPlugInDLL ); - sal_Bool impldbg_checkParameter_queryDispatch ( const UNOURL& aURL , - const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags ); - sal_Bool impldbg_checkParameter_queryDispatches ( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ); - sal_Bool impldbg_checkParameter_dispatch ( const UNOURL& aURL , - const SEQUENCE< PROPERTYVALUE >& seqArguments ); - sal_Bool impldbg_checkParameter_addStatusListener ( const REFERENCE< XSTATUSLISTENER >& xControl , - const UNOURL& aURL ); - sal_Bool impldbg_checkParameter_removeStatusListener ( const REFERENCE< XSTATUSLISTENER >& xControl , - const UNOURL& aURL ); - sal_Bool impldbg_checkParameter_notifyURL ( const OUSTRING& sURL ); + static sal_Bool impldbg_checkParameter_OPlugInFrameDispatcherCtor ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , + ::osl::Mutex& aMutex , + const css::uno::Reference< css::mozilla::XPluginInstance >& xOwner , + const css::uno::Reference< css::mozilla::XPluginInstancePeer >& xPlugInDLL ); + static sal_Bool impldbg_checkParameter_queryDispatch ( const css::util::URL& aURL , + const ::rtl::OUString& sTargetFrameName , + sal_Int32 nSearchFlags ); + static sal_Bool impldbg_checkParameter_queryDispatches ( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescriptor ); + static sal_Bool impldbg_checkParameter_dispatch ( const css::util::URL& aURL , + const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ); + static sal_Bool impldbg_checkParameter_addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xControl , + const css::util::URL& aURL ); + static sal_Bool impldbg_checkParameter_removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xControl , + const css::util::URL& aURL ); + static sal_Bool impldbg_checkParameter_notifyURL ( const ::rtl::OUString& sURL ); #endif // #ifdef ENABLE_ASSERTIONS @@ -498,12 +434,12 @@ class OPlugInFrameDispatcher : public XDISPATCHPROVIDER , private: - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; /// servicemanager to create uno services - MUTEX& m_aMutex ; /// shared mutex with owner instance - WEAKREFERENCE< XPLUGININSTANCE > m_xOwnerWeak ; /// weakreference to owner (Don't use a hard reference. Owner can't delete us then!) - REFERENCE< XPLUGININSTANCEPEER > m_xPlugInDLL ; /// Interface for communication with browser. - OUSTRING m_sTargetFrameName ; /// We need it as target for get/postURL. - IMPL_ListenerContainerHelper m_aListenerContainer ; /// Container to combine listeners and URLs. + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// servicemanager to create uno services + ::osl::Mutex& m_aMutex ; /// shared mutex with owner instance + css::uno::WeakReference< css::mozilla::XPluginInstance > m_xOwnerWeak ; /// weakreference to owner (Don't use a hard reference. Owner can't delete us then!) + css::uno::Reference< css::mozilla::XPluginInstancePeer > m_xPlugInDLL ; /// Interface for communication with browser. + ::rtl::OUString m_sTargetFrameName ; /// We need it as target for get/postURL. + IMPL_ListenerContainerHelper m_aListenerContainer ; /// Container to combine listeners and URLs. }; // class OPlugInFrameDispatcher diff --git a/framework/inc/helper/otasksaccess.hxx b/framework/inc/helper/otasksaccess.hxx index 832525e9ef..395b0582b0 100644 --- a/framework/inc/helper/otasksaccess.hxx +++ b/framework/inc/helper/otasksaccess.hxx @@ -2,9 +2,9 @@ * * $RCSfile: otasksaccess.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2000-09-26 06:20:35 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,29 +128,6 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define EVENTOBJECT ::com::sun::star::lang::EventObject -#define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException -#define OWEAKOBJECT ::cppu::OWeakObject -#define REFERENCE ::com::sun::star::uno::Reference -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define UNOTYPE ::com::sun::star::uno::Type -#define WEAKREFERENCE ::com::sun::star::uno::WeakReference -#define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException -#define XDESKTOP ::com::sun::star::frame::XDesktop -#define XELEMENTACCESS ::com::sun::star::container::XElementAccess -#define XENUMERATION ::com::sun::star::container::XEnumeration -#define XENUMERATIONACCESS ::com::sun::star::container::XEnumerationAccess -#define XTASK ::com::sun::star::frame::XTask -#define MUTEX ::osl::Mutex -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider - -//_________________________________________________________________________________________________________________ -// switches -// Use these to de/activate some features of this implementation. -// (for debugging or testing!) -//_________________________________________________________________________________________________________________ - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -169,15 +146,15 @@ namespace framework{ @implements XInterface XEnumerationAccess XElementAccess - [ XDebugging if TEST_TREE is defined! ] + @base OWeakObject @devstatus deprecated *//*-*************************************************************************************************************/ -class OTasksAccess : public XTYPEPROVIDER , - public XENUMERATIONACCESS , // => XElementAccess - public OWEAKOBJECT +class OTasksAccess : public css::lang::XTypeProvider , + public css::container::XEnumerationAccess , // => XElementAccess + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -206,9 +183,9 @@ class OTasksAccess : public XTYPEPROVIDER , @onerror Do nothing and reset this object to default with an empty list. *//*-*****************************************************************************************************/ - OTasksAccess( const REFERENCE< XDESKTOP >& xOwner , - FrameContainer* pTasks , - MUTEX& aMutex ); + OTasksAccess( const css::uno::Reference< css::frame::XDesktop >& xOwner , + FrameContainer* pTasks , + ::osl::Mutex& aMutex ); //--------------------------------------------------------------------------------------------------------- // XInterface @@ -236,7 +213,7 @@ class OTasksAccess : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XENUMERATION > SAL_CALL createEnumeration() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XElementAccess @@ -255,7 +232,7 @@ class OTasksAccess : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual UNOTYPE SAL_CALL getElementType() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Type SAL_CALL getElementType() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get state of tasklist of enumeration. @@ -270,7 +247,7 @@ class OTasksAccess : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL hasElements() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL hasElements() throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -324,9 +301,9 @@ class OTasksAccess : public XTYPEPROVIDER , private: - sal_Bool impldbg_checkParameter_OTasksAccessCtor( const REFERENCE< XDESKTOP >& xOwner , - FrameContainer* pTasks , - MUTEX& aMutex ) const; + static sal_Bool impldbg_checkParameter_OTasksAccessCtor( const css::uno::Reference< css::frame::XDesktop >& xOwner , + FrameContainer* pTasks , + ::osl::Mutex& aMutex ); #endif // #ifdef ENABLE_ASSERTIONS @@ -337,10 +314,10 @@ class OTasksAccess : public XTYPEPROVIDER , private: - MUTEX& m_aMutex ; /// shared mutex with owner - WEAKREFERENCE< XDESKTOP > m_xOwner ; /// weak reference to the desktop object! - FrameContainer* m_pTasks ; /// pointer to list of current tasks on desktop (is a member of class Desktop!) - /// This pointer is valid only, if weakreference can be locked. + ::osl::Mutex& m_aMutex ; /// shared mutex with owner + css::uno::WeakReference< css::frame::XDesktop > m_xOwner ; /// weak reference to the desktop object! + FrameContainer* m_pTasks ; /// pointer to list of current tasks on desktop (is a member of class Desktop!) + /// This pointer is valid only, if weakreference can be locked. }; // class OTasksAccess diff --git a/framework/inc/helper/otasksenumeration.hxx b/framework/inc/helper/otasksenumeration.hxx index b747da0f8f..19219d1a61 100644 --- a/framework/inc/helper/otasksenumeration.hxx +++ b/framework/inc/helper/otasksenumeration.hxx @@ -2,9 +2,9 @@ * * $RCSfile: otasksenumeration.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2000-09-26 06:20:35 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,10 @@ #include <macros/debug.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -120,21 +124,6 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define EVENTOBJECT ::com::sun::star::lang::EventObject -#define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException -#define OWEAKOBJECT ::cppu::OWeakObject -#define REFERENCE ::com::sun::star::uno::Reference -#define SEQUENCE ::com::sun::star::uno::Sequence -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define UNOTYPE ::com::sun::star::uno::Type -#define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException -#define XENUMERATION ::com::sun::star::container::XEnumeration -#define XEVENTLISTENER ::com::sun::star::lang::XEventListener -#define XFRAME ::com::sun::star::frame::XFrame -#define XTASK ::com::sun::star::frame::XTask -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -160,11 +149,11 @@ namespace framework{ @devstatus ready to use *//*-*************************************************************************************************************/ -class OTasksEnumeration : public XTYPEPROVIDER , - public XEVENTLISTENER , - public XENUMERATION , - public OMutexMember , - public OWEAKOBJECT +class OTasksEnumeration : public css::lang::XTypeProvider , + public css::lang::XEventListener , + public css::container::XEnumeration , + public OMutexMember , + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -189,7 +178,7 @@ class OTasksEnumeration : public XTYPEPROVIDER , @onerror Do nothing and reset this object to default with an empty list. *//*-*****************************************************************************************************/ - OTasksEnumeration( const SEQUENCE< REFERENCE< XFRAME > >& seqTasks ); + OTasksEnumeration( const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqTasks ); //--------------------------------------------------------------------------------------------------------- // XInterface @@ -215,7 +204,7 @@ class OTasksEnumeration : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL disposing( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XEnumeration @@ -236,7 +225,7 @@ class OTasksEnumeration : public XTYPEPROVIDER , (List is emtpy and there no accessible elements ...) *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL hasMoreElements() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL hasMoreElements() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short give the next element, if some exist @@ -250,9 +239,9 @@ class OTasksEnumeration : public XTYPEPROVIDER , @onerror If end of enumeration is arrived or there are no elements in list => a NoSuchElementException is thrown. *//*-*****************************************************************************************************/ - virtual ANY SAL_CALL nextElement() throw( NOSUCHELEMENTEXCEPTION , - WRAPPEDTARGETEXCEPTION , - RUNTIMEEXCEPTION ); + virtual css::uno::Any SAL_CALL nextElement() throw( css::container::NoSuchElementException , + css::lang::WrappedTargetException , + css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -325,8 +314,8 @@ class OTasksEnumeration : public XTYPEPROVIDER , private: - sal_Bool impldbg_checkParameter_OTasksEnumerationCtor ( const SEQUENCE< REFERENCE< XFRAME > >& seqTasks ); - sal_Bool impldbg_checkParameter_disposing ( const EVENTOBJECT& aEvent ); + static sal_Bool impldbg_checkParameter_OTasksEnumerationCtor ( const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqTasks ); + static sal_Bool impldbg_checkParameter_disposing ( const css::lang::EventObject& aEvent ); #endif // #ifdef ENABLE_ASSERTIONS @@ -337,8 +326,8 @@ class OTasksEnumeration : public XTYPEPROVIDER , private: - sal_uInt32 m_nPosition ; /// current position in enumeration - SEQUENCE< REFERENCE< XTASK > > m_seqTasks ; /// list of current tasks + sal_uInt32 m_nPosition ; /// current position in enumeration + css::uno::Sequence< css::uno::Reference< css::frame::XTask > > m_seqTasks ; /// list of current tasks }; // class OTasksEnumeration diff --git a/framework/inc/services.h b/framework/inc/services.h new file mode 100644 index 0000000000..5236747294 --- /dev/null +++ b/framework/inc/services.h @@ -0,0 +1,125 @@ +/************************************************************************* + * + * $RCSfile: services.h,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_SERVICES_H_ +#define __FRAMEWORK_SERVICES_H_ + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ +#include <macros/generic.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// used servicenames by framework +//_________________________________________________________________________________________________________________ + +#define SERVICENAME_FRAME DECLARE_ASCII("com.sun.star.frame.Frame" ) +#define SERVICENAME_DESKTOP DECLARE_ASCII("com.sun.star.frame.Desktop" ) +#define SERVICENAME_TASK DECLARE_ASCII("com.sun.star.frame.Task" ) +#define SERVICENAME_FRAMELOADERFACTORY DECLARE_ASCII("com.sun.star.frame.FrameLoaderFactory" ) +#define SERVICENAME_FILTERFACTORY DECLARE_ASCII("com.sun.star.document.FilterFactory" ) +#define SERVICENAME_URLTRANSFORMER DECLARE_ASCII("com.sun.star.util.URLTransformer" ) +#define SERVICENAME_PLUGINFRAME DECLARE_ASCII("com.sun.star.mozilla.Plugin" ) +#define SERVICENAME_BRIDGEFACTORY DECLARE_ASCII("com.sun.star.bridge.BridgeFactory" ) +#define SERVICENAME_INIMANAGER DECLARE_ASCII("com.sun.star.config.INIManager" ) +#define SERVICENAME_MEDIATYPEDETECTIONHELPER DECLARE_ASCII("com.sun.star.frame.MediaTypeDetectionHelper" ) +#define SERVICENAME_LOGINDIALOG DECLARE_ASCII("com.sun.star.framework.LoginDialog" ) +#define SERVICENAME_CONFIGURATION DECLARE_ASCII("com.sun.star.configuration.ConfigurationRegistry" ) +#define SERVICENAME_VCLTOOLKIT DECLARE_ASCII("com.sun.star.awt.Toolkit" ) +#define SERVICENAME_SIMPLEREGISTRY DECLARE_ASCII("com.sun.star.registry.SimpleRegistry" ) +#define SERVICENAME_NESTEDREGISTRY DECLARE_ASCII("com.sun.star.registry.NestedRegistry" ) +#define SERVICENAME_GENERICFRAMELOADER DECLARE_ASCII("com.sun.star.comp.office.FilterDetect" ) +#define SERVICENAME_TYPEDETECTION DECLARE_ASCII("com.sun.star.document.TypeDetection" ) +#define SERVICENAME_DOCUMENTPROPERTIES DECLARE_ASCII("com.sun.star.document.DocumentProperties" ) +#define SERVICENAME_CFGMANAGEMENT DECLARE_ASCII("com.sun.star.configuration.ConfigurationRegistry" ) // describe simple registry service for read access to configuration +#define SERVICENAME_CFGPROVIDER DECLARE_ASCII("com.sun.star.configuration.ConfigurationProvider" ) // describe cfg-provider service for fatoffice, network installation +#define SERVICENAME_ADMINPROVIDER DECLARE_ASCII("com.sun.star.configuration.AdministrationProvider" ) // describe cfg-provider service for sun webtop +#define SERVICENAME_CFGUPDATEACCESS DECLARE_ASCII("com.sun.star.configuration.ConfigurationUpdateAccess") + +//_________________________________________________________________________________________________________________ +// used implementationnames by framework +//_________________________________________________________________________________________________________________ + +#define IMPLEMENTATIONNAME_FRAME DECLARE_ASCII("com.sun.star.comp.framework.Frame" ) +#define IMPLEMENTATIONNAME_DESKTOP DECLARE_ASCII("com.sun.star.comp.framework.Desktop" ) +#define IMPLEMENTATIONNAME_TASK DECLARE_ASCII("com.sun.star.comp.framework.Task" ) +#define IMPLEMENTATIONNAME_FRAMELOADERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.FrameLoaderFactory" ) +#define IMPLEMENTATIONNAME_FILTERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.FilterFactory" ) +#define IMPLEMENTATIONNAME_URLTRANSFORMER DECLARE_ASCII("com.sun.star.comp.framework.URLTransformer" ) +#define IMPLEMENTATIONNAME_PLUGINFRAME DECLARE_ASCII("com.sun.star.comp.framework.PluginFrame" ) +#define IMPLEMENTATIONNAME_GENERICFRAMELOADER DECLARE_ASCII("com.sun.star.comp.office.FrameLoader" ) +#define IMPLEMENTATIONNAME_MEDIATYPEDETECTIONHELPER DECLARE_ASCII("com.sun.star.comp.framework.MediaTypeDetectionHelper") +#define IMPLEMENTATIONNAME_LOGINDIALOG DECLARE_ASCII("com.sun.star.comp.framework.LoginDialog" ) +#define IMPLEMENTATIONNAME_TYPEDETECTION DECLARE_ASCII("com.sun.star.comp.framework.TypeDetection" ) +#define IMPLEMENTATIONNAME_DOCUMENTPROPERTIES DECLARE_ASCII("com.sun.star.comp.framework.DocumentProperties" ) + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_SERVICES_H_ diff --git a/framework/inc/services/desktop.hxx b/framework/inc/services/desktop.hxx index f910ff47bc..aff42edd14 100644 --- a/framework/inc/services/desktop.hxx +++ b/framework/inc/services/desktop.hxx @@ -2,9 +2,9 @@ * * $RCSfile: desktop.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: as $ $Date: 2001-03-15 08:57:27 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -220,52 +220,6 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define EXCEPTION ::com::sun::star::uno::Exception -#define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor -#define EVENTOBJECT ::com::sun::star::lang::EventObject -#define FEATURESTATEEVENT ::com::sun::star::frame::FeatureStateEvent -#define FEATURESTATEEVENT ::com::sun::star::frame::FeatureStateEvent -#define ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException -#define INDEXOUTOFBOUNDSEXCEPTION ::com::sun::star::lang::IndexOutOfBoundsException -#define IOEXCEPTION ::com::sun::star::io::IOException -#define IPROPERTYARRAYHELPER ::cppu::IPropertyArrayHelper -#define LOCALE ::com::sun::star::lang::Locale -#define OBROADCASTHELPER ::cppu::OBroadcastHelper -#define OINTERFACECONTAINERHELPER ::cppu::OInterfaceContainerHelper -#define OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper -#define OPROPERTYSETHELPER ::cppu::OPropertySetHelper -#define OUSTRING ::rtl::OUString -#define OWEAKOBJECT ::cppu::OWeakObject -#define PROPERTY ::com::sun::star::beans::Property -#define PROPERTYVALUE ::com::sun::star::beans::PropertyValue -#define TERMINATIONVETOEXCEPTION ::com::sun::star::frame::TerminationVetoException -#define UNOURL ::com::sun::star::util::URL -#define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException -#define XCOMPONENT ::com::sun::star::lang::XComponent -#define XCOMPONENTLOADER ::com::sun::star::frame::XComponentLoader -#define XCONTROLLER ::com::sun::star::frame::XController -#define XDESKTOP ::com::sun::star::frame::XDesktop -#define XDISPATCH ::com::sun::star::frame::XDispatch -#define XDISPATCHDESCRIPTOR ::com::sun::star::frame::XDispatchDescriptor -#define XDISPATCHPROVIDER ::com::sun::star::frame::XDispatchProvider -#define XENUMERATIONACCESS ::com::sun::star::container::XEnumerationAccess -#define XEVENTLISTENER ::com::sun::star::lang::XEventListener -#define XFRAME ::com::sun::star::frame::XFrame -#define XFRAMEACTIONLISTENER ::com::sun::star::frame::XFrameActionListener -#define XFRAMES ::com::sun::star::frame::XFrames -#define XFRAMESSUPPLIER ::com::sun::star::frame::XFramesSupplier -#define XPROPERTYSETINFO ::com::sun::star::beans::XPropertySetInfo -#define XSERVICEINFO ::com::sun::star::lang::XServiceInfo -#define XSTATUSINDICATOR ::com::sun::star::task::XStatusIndicator -#define XSTATUSINDICATORFACTORY ::com::sun::star::task::XStatusIndicatorFactory -#define XSTATUSLISTENER ::com::sun::star::frame::XStatusListener -#define XTASK ::com::sun::star::frame::XTask -#define XTASKSSUPPLIER ::com::sun::star::frame::XTasksSupplier -#define XTERMINATELISTENER ::com::sun::star::frame::XTerminateListener -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider -#define XWINDOW ::com::sun::star::awt::XWindow - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -302,7 +256,6 @@ enum eIMPL_loadState XMultiPropertySet XStatusListener XEventListener - [ XDebugging, if TEST_TREE is defined! ] @base OMutexMember OBroadcastHelper OPropertySetHelper @@ -311,20 +264,19 @@ enum eIMPL_loadState @devstatus deprecated *//*-*************************************************************************************************************/ -//class Desktop : DERIVE_FROM_XSPECIALDEBUGINTERFACE // => These macro will expand to nothing, if no testmode is set in debug.h! -class Desktop : public XTYPEPROVIDER , - public XSERVICEINFO , - public XDESKTOP , - public XCOMPONENTLOADER , - public XTASKSSUPPLIER , - public XDISPATCHPROVIDER , - public XFRAMESSUPPLIER , // => XFrame => XComponent - public XSTATUSINDICATORFACTORY , - public XSTATUSLISTENER , // => XEventListener - public OMutexMember , // Struct for right initalization of mutex member! Must be the first one of baseclasses! - public OBROADCASTHELPER , - public OPROPERTYSETHELPER , - public OWEAKOBJECT +class Desktop : public css::lang::XTypeProvider , + public css::lang::XServiceInfo , + public css::frame::XDesktop , + public css::frame::XComponentLoader , + public css::frame::XTasksSupplier , + public css::frame::XDispatchProvider , + public css::frame::XFramesSupplier , // => XFrame => XComponent + public css::task::XStatusIndicatorFactory , + public css::frame::XStatusListener , // => XEventListener + public OMutexMember , // Struct for right initalization of mutex member! Must be the first one of baseclasses! + public ::cppu::OBroadcastHelper , + public ::cppu::OPropertySetHelper , + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -350,7 +302,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We throw an ASSERT in debug version or do nothing in relaese version. *//*-*****************************************************************************************************/ - Desktop( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); + Desktop( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); /*-****************************************************************************************************//** @short standard destructor @@ -373,7 +325,6 @@ class Desktop : public XTYPEPROVIDER , DECLARE_XINTERFACE DECLARE_XTYPEPROVIDER DECLARE_XSERVICEINFO -// DECLARE_XSPECIALDEBUGINTERFACE // => These macro will expand to nothing, if no testmode is set in debug.h! //--------------------------------------------------------------------------------------------------------- // XDesktop @@ -393,7 +344,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We return sal_False. *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL terminate() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL terminate() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short add a listener for terminate events @@ -407,7 +358,7 @@ class Desktop : public XTYPEPROVIDER , @onerror No listener is added. *//*-*****************************************************************************************************/ - virtual void SAL_CALL addTerminateListener( const REFERENCE< XTERMINATELISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL addTerminateListener( const css::uno::Reference< css::frame::XTerminateListener >& xListener ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short remove a listener for terminate events @@ -421,7 +372,7 @@ class Desktop : public XTYPEPROVIDER , @onerror No listener is removed. *//*-*****************************************************************************************************/ - virtual void SAL_CALL removeTerminateListener( const REFERENCE< XTERMINATELISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL removeTerminateListener( const css::uno::Reference< css::frame::XTerminateListener >& xListener ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get access to create enumerations of all current components @@ -437,7 +388,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We return a null-reference. *//*-*****************************************************************************************************/ - virtual REFERENCE< XENUMERATIONACCESS > SAL_CALL getComponents() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getComponents() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short return the current active component @@ -452,7 +403,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We return a null-reference. *//*-*****************************************************************************************************/ - virtual REFERENCE< XCOMPONENT > SAL_CALL getCurrentComponent() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::lang::XComponent > SAL_CALL getCurrentComponent() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short return the current active frame in hierarchy @@ -468,7 +419,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We return a null reference. *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAME > SAL_CALL getCurrentFrame() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getCurrentFrame() throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XComponentLoader @@ -486,12 +437,12 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XCOMPONENT > SAL_CALL loadComponentFromURL( const OUSTRING& sURL , - const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags , - const SEQUENCE< PROPERTYVALUE >& seqArguments ) throw( IOEXCEPTION , - ILLEGALARGUMENTEXCEPTION, - RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::lang::XComponent > SAL_CALL loadComponentFromURL( const ::rtl::OUString& sURL , + const ::rtl::OUString& sTargetFrameName , + sal_Int32 nSearchFlags , + const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ) throw( css::io::IOException , + css::lang::IllegalArgumentException , + css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XTasksSupplier //--------------------------------------------------------------------------------------------------------- @@ -512,7 +463,7 @@ class Desktop : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XENUMERATIONACCESS > SAL_CALL getTasks() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getTasks() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short return current active task of ouer direct childs @@ -530,7 +481,7 @@ class Desktop : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XTASK > SAL_CALL getActiveTask() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XTask > SAL_CALL getActiveTask() throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XDispatchProvider @@ -558,9 +509,9 @@ class Desktop : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XDISPATCH > SAL_CALL queryDispatch( const UNOURL& aURL , - const OUSTRING& sTargetFrameName, - sal_Int32 nSearchFlags ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL , + const ::rtl::OUString& sTargetFrameName, + sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not implemented yet @@ -574,7 +525,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescripts ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescripts ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XFramesSupplier @@ -594,7 +545,7 @@ class Desktop : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAMES > SAL_CALL getFrames() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFrames > SAL_CALL getFrames() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get the current active child frame @@ -612,7 +563,7 @@ class Desktop : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAME > SAL_CALL getActiveFrame() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getActiveFrame() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short set the new active direct child frame @@ -629,7 +580,7 @@ class Desktop : public XTYPEPROVIDER , @onerror An assertion is thrown, if given frame is'nt already a child of us. *//*-*****************************************************************************************************/ - virtual void SAL_CALL setActiveFrame( const REFERENCE< XFRAME >& xFrame ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL setActiveFrame( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XFrame @@ -647,7 +598,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL initialize( const REFERENCE< XWINDOW >& xWindow ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL initialize( const css::uno::Reference< css::awt::XWindow >& xWindow ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not supported! @@ -661,7 +612,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XWINDOW > SAL_CALL getContainerWindow() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getContainerWindow() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not supported! @@ -675,7 +626,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL setCreator( const REFERENCE< XFRAMESSUPPLIER >& xCreator ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL setCreator( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not supported! @@ -689,7 +640,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAMESSUPPLIER > SAL_CALL getCreator() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL getCreator() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get the name of the desktop @@ -704,7 +655,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual OUSTRING SAL_CALL getName() throw( RUNTIMEEXCEPTION ); + virtual ::rtl::OUString SAL_CALL getName() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short set the new name of the desktop @@ -719,7 +670,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL setName( const OUSTRING& sName ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL setName( const ::rtl::OUString& sName ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short try to find a frame with special parameters @@ -747,8 +698,8 @@ class Desktop : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAME > SAL_CALL findFrame( const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFrame > SAL_CALL findFrame( const ::rtl::OUString& sTargetFrameName , + sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get state information about desktop @@ -762,7 +713,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL isTop() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL isTop() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not implemented! @@ -776,7 +727,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL activate() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL activate() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not implemented! @@ -790,7 +741,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL deactivate() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL deactivate() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get state information about desktop @@ -804,7 +755,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL isActive() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL isActive() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not supported! @@ -818,8 +769,8 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL setComponent( const REFERENCE< XWINDOW >& xComponentWindow , - const REFERENCE< XCONTROLLER >& xController ) throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL setComponent( const css::uno::Reference< css::awt::XWindow >& xComponentWindow , + const css::uno::Reference< css::frame::XController >& xController ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not supported! @@ -833,7 +784,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XWINDOW > SAL_CALL getComponentWindow() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not supported! @@ -847,7 +798,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XCONTROLLER > SAL_CALL getController() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XController > SAL_CALL getController() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short not implemented yet! @@ -861,7 +812,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL contextChanged() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL contextChanged() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short add listener for frame action events @@ -875,7 +826,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We do nothing or throw an ASSERT in debug version! *//*-*****************************************************************************************************/ - virtual void SAL_CALL addFrameActionListener( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL addFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short remove listener for frame action events @@ -890,7 +841,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We do nothing or throw an ASSERT in debug version! *//*-*****************************************************************************************************/ - virtual void SAL_CALL removeFrameActionListener( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL removeFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XComponent @@ -911,7 +862,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL dispose() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL dispose() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short add listener for dispose events @@ -926,7 +877,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We do nothing or throw an ASSERT in debug version! *//*-*****************************************************************************************************/ - virtual void SAL_CALL addEventListener( const REFERENCE< XEVENTLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short remove listener for dispose events @@ -942,7 +893,7 @@ class Desktop : public XTYPEPROVIDER , @onerror We do nothing or throw an ASSERT in debug version! *//*-*****************************************************************************************************/ - virtual void SAL_CALL removeEventListener( const REFERENCE< XEVENTLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XStatusIndicatorFactory @@ -960,7 +911,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XSTATUSINDICATOR > SAL_CALL createStatusIndicator() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL createStatusIndicator() throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XStatusListener @@ -978,7 +929,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL statusChanged( const FEATURESTATEEVENT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& aEvent ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XEventListener @@ -996,7 +947,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL disposing( const EVENTOBJECT& aSource ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL disposing( const css::lang::EventObject& aSource ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -1045,10 +996,10 @@ class Desktop : public XTYPEPROVIDER , @onerror IllegalArgumentException, if you call this with an invalid argument *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL convertFastPropertyValue( ANY& aConvertedValue , - ANY& aOldValue , - sal_Int32 nHandle , - const ANY& aValue ) throw( ILLEGALARGUMENTEXCEPTION ); + virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& aConvertedValue , + css::uno::Any& aOldValue , + sal_Int32 nHandle , + const css::uno::Any& aValue ) throw( css::lang::IllegalArgumentException ); /*-****************************************************************************************************//** @short set value of a transient property @@ -1066,8 +1017,8 @@ class Desktop : public XTYPEPROVIDER , @onerror An exception is thrown. *//*-*****************************************************************************************************/ - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle , - const ANY& aValue ) throw( EXCEPTION ); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle , + const css::uno::Any& aValue ) throw( css::uno::Exception ); /*-****************************************************************************************************//** @short get value of a transient property @@ -1083,8 +1034,8 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL getFastPropertyValue( ANY& aValue , - sal_Int32 nHandle ) const; + virtual void SAL_CALL getFastPropertyValue( css::uno::Any& aValue , + sal_Int32 nHandle ) const; /*-****************************************************************************************************//** @short return structure and information about transient properties @@ -1099,7 +1050,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual IPROPERTYARRAYHELPER& SAL_CALL getInfoHelper(); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); /*-****************************************************************************************************//** @short return propertysetinfo @@ -1116,7 +1067,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XPROPERTYSETINFO > SAL_CALL getPropertySetInfo(); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(); //------------------------------------------------------------------------------------------------------------- // private methods @@ -1141,7 +1092,7 @@ class Desktop : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - REFERENCE< XCOMPONENT > impl_getFrameComponent( const REFERENCE< XFRAME >& xFrame ) const; + css::uno::Reference< css::lang::XComponent > impl_getFrameComponent( const css::uno::Reference< css::frame::XFrame >& xFrame ) const; /*-****************************************************************************************************//** @short test, if a property will change his value @@ -1161,10 +1112,10 @@ class Desktop : public XTYPEPROVIDER , @onerror IllegalArgumentException, if convert failed. *//*-*****************************************************************************************************/ - sal_Bool impl_tryToChangeProperty( sal_Bool bProperty , - const ANY& aNewValue , - ANY& aOldValue , - ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); + sal_Bool impl_tryToChangeProperty( sal_Bool bProperty , + const css::uno::Any& aNewValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); /*-****************************************************************************************************//** @short create table with information about properties @@ -1180,42 +1131,7 @@ class Desktop : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - static const SEQUENCE< PROPERTY > impl_getStaticPropertyDescriptor(); - - /*-****************************************************************************************************//** - @short create a new task - @descr If findFrame() detect a "_blank" as targetname, he should create a new task. - These helper-method do this. - (Creation of a new task and initializing with an empty window and default values!) - - @seealso method findFrame() - - @param "sFrameName", new name for new taskframe. - @return A reference to the new created task. - - @onerror A null reference is returned. - *//*-*****************************************************************************************************/ - -//OBSOLETE REFERENCE< XFRAME > impl_createNewTask( const OUSTRING& sFrameName ); - - /*-****************************************************************************************************//** - @short search for last destination of load component by means of dispatch(...) - @descr This is a HACK for XDispatch->dispatch(...) calls. You don't get any information about - the destination frame, which has loaded a component in loadComponentFromURL()! - But we will set a flag m_bILoadLastComponent in impl_loadComponent() if loading successfull. - With these impl method you can find this frame and return his component ... - If this method found any frame we must reset ouer special flag! - - @seealso method impl_loadComponent() - @seealso method loadComponentFromURL() - - @param - - @return A reference to frame, which has loaded the last component. - - @onerror A null reference is returned. - *//*-*****************************************************************************************************/ - -//OBSOLETE REFERENCE< XFRAME > impl_searchLastLoadedComponent(); + static const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); /*-****************************************************************************************************//** @short search for last destination of load component by means of dispatch(...) @@ -1234,7 +1150,7 @@ class Desktop : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - void impl_sendQueryTerminationEvent() throw( TERMINATIONVETOEXCEPTION ); + void impl_sendQueryTerminationEvent () throw( css::frame::TerminationVetoException ); void impl_sendNotifyTerminationEvent(); /*-****************************************************************************************************//** @@ -1276,24 +1192,24 @@ class Desktop : public XTYPEPROVIDER , private: - sal_Bool impldbg_checkParameter_DesktopCtor ( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); - sal_Bool impldbg_checkParameter_addTerminateListener ( const REFERENCE< XTERMINATELISTENER >& xListener ); - sal_Bool impldbg_checkParameter_removeTerminateListener ( const REFERENCE< XTERMINATELISTENER >& xListener ); - sal_Bool impldbg_checkParameter_loadComponentFromURL ( const OUSTRING& sURL , - const OUSTRING& sTargetFrameName, - sal_Int32 nSearchFlags , - const SEQUENCE< PROPERTYVALUE >& seqArguments ); - sal_Bool impldbg_checkParameter_queryDispatch ( const UNOURL& aURL , - const OUSTRING& sTargetFrameName, - sal_Int32 nSearchFlags ); - sal_Bool impldbg_checkParameter_findFrame ( const OUSTRING& sTargetFrameName, - sal_Int32 nSearchFlags ); - sal_Bool impldbg_checkParameter_addFrameActionListener ( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ); - sal_Bool impldbg_checkParameter_removeFrameActionListener ( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ); - sal_Bool impldbg_checkParameter_addEventListener ( const REFERENCE< XEVENTLISTENER >& xListener ); - sal_Bool impldbg_checkParameter_removeEventListener ( const REFERENCE< XEVENTLISTENER >& xListener ); - sal_Bool impldbg_checkParameter_statusChanged ( const FEATURESTATEEVENT& aEvent ); - sal_Bool impldbg_checkParameter_disposing ( const EVENTOBJECT& aSource ); + static sal_Bool impldbg_checkParameter_DesktopCtor ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + static sal_Bool impldbg_checkParameter_addTerminateListener ( const css::uno::Reference< css::frame::XTerminateListener >& xListener ); + static sal_Bool impldbg_checkParameter_removeTerminateListener ( const css::uno::Reference< css::frame::XTerminateListener >& xListener ); + static sal_Bool impldbg_checkParameter_loadComponentFromURL ( const ::rtl::OUString& sURL , + const ::rtl::OUString& sTargetFrameName, + sal_Int32 nSearchFlags , + const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ); + static sal_Bool impldbg_checkParameter_queryDispatch ( const css::util::URL& aURL , + const ::rtl::OUString& sTargetFrameName, + sal_Int32 nSearchFlags ); + static sal_Bool impldbg_checkParameter_findFrame ( const ::rtl::OUString& sTargetFrameName, + sal_Int32 nSearchFlags ); + static sal_Bool impldbg_checkParameter_addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ); + static sal_Bool impldbg_checkParameter_removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ); + static sal_Bool impldbg_checkParameter_addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ); + static sal_Bool impldbg_checkParameter_removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ); + static sal_Bool impldbg_checkParameter_statusChanged ( const css::frame::FeatureStateEvent& aEvent ); + static sal_Bool impldbg_checkParameter_disposing ( const css::lang::EventObject& aSource ); sal_Bool m_bIsTerminated ; /// check flag to protect us against dispose before terminate! /// see dispose() for further informations! @@ -1316,7 +1232,7 @@ class Desktop : public XTYPEPROVIDER , #ifdef ENABLE_SERVICEDEBUG // Only active in debug version! - OUSTRING impldbg_getTreeNames(); + ::rtl::OUString impldbg_getTreeNames(); #endif // #ifdef ENABLE_SERVICEDEBUG @@ -1327,34 +1243,32 @@ class Desktop : public XTYPEPROVIDER , private: - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; /// reference to factory, which has create this instance - OUSTRING m_sName ; /// desktop is a topframe and has a name - FrameContainer m_aChildTaskContainer ; /// array of child tasks (childs of desktop are tasks; and tasks are also frames - But pure frames are not accepted!) - OMULTITYPEINTERFACECONTAINERHELPER m_aListenerContainer ; /// container for ALL Listener - REFERENCE< XFRAMES > m_xFramesHelper ; /// helper for XFrames, XIndexAccess, XElementAccess and implementation of a childcontainer! - REFERENCE< XDISPATCH > m_xDispatchHelper ; /// helper to dispatch something for new tasks, created by "_blank"! - eIMPL_loadState m_eLoadState ; /// hold information about state of asynchron loading of component for loadComponentFromURL()! - TaskCreator m_aTaskCreator ; /// Helper to create new tasks or plugin frames! - REFERENCE< XFRAME > m_xLastFrame ; - sal_Bool m_bAlreadyDisposed ; /// protection against multiple dispose calls + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// reference to factory, which has create this instance + ::rtl::OUString m_sName ; /// desktop is a topframe and has a name + FrameContainer m_aChildTaskContainer ; /// array of child tasks (childs of desktop are tasks; and tasks are also frames - But pure frames are not accepted!) + ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer ; /// container for ALL Listener + css::uno::Reference< css::frame::XFrames > m_xFramesHelper ; /// helper for XFrames, XIndexAccess, XElementAccess and implementation of a childcontainer! + css::uno::Reference< css::frame::XDispatch > m_xDispatchHelper ; /// helper to dispatch something for new tasks, created by "_blank"! + eIMPL_loadState m_eLoadState ; /// hold information about state of asynchron loading of component for loadComponentFromURL()! + TaskCreator m_aTaskCreator ; /// Helper to create new tasks or plugin frames! + css::uno::Reference< css::frame::XFrame > m_xLastFrame ; + sal_Bool m_bAlreadyDisposed ; /// protection against multiple dispose calls // Properties -//OLD REFERENCE< XCOMPONENT > m_xActiveComponent ; Durch setActive/getActive am Container zu ersetzen! (+cast nach XComponent!) -//OLD REFERENCE< XCOMPONENT > m_xActiveFrame ; Durch setActive/getActive am Container zu ersetzen! - sal_Bool m_bHasBeamer ; - sal_Bool m_bHasCommonTaskBar ; - sal_Bool m_bHasDesigner ; - sal_Bool m_bHasExplorer ; - sal_Bool m_bHasFunctionBar ; - sal_Bool m_bHasMacroBar ; - sal_Bool m_bHasNavigator ; - sal_Bool m_bHasObjectBar ; - sal_Bool m_bHasOptionBar ; - sal_Bool m_bHasStatusBar ; - sal_Bool m_bHasToolbar ; - -}; // class Desktop - -} // namespace framework + sal_Bool m_bHasBeamer ; + sal_Bool m_bHasCommonTaskBar ; + sal_Bool m_bHasDesigner ; + sal_Bool m_bHasExplorer ; + sal_Bool m_bHasFunctionBar ; + sal_Bool m_bHasMacroBar ; + sal_Bool m_bHasNavigator ; + sal_Bool m_bHasObjectBar ; + sal_Bool m_bHasOptionBar ; + sal_Bool m_bHasStatusBar ; + sal_Bool m_bHasToolbar ; + +}; // class Desktop + +} // namespace framework #endif // #ifndef __FRAMEWORK_SERVICES_DESKTOP_HXX_ diff --git a/framework/inc/services/frame.hxx b/framework/inc/services/frame.hxx index a55fc937f4..2c39e91440 100644 --- a/framework/inc/services/frame.hxx +++ b/framework/inc/services/frame.hxx @@ -2,9 +2,9 @@ * * $RCSfile: frame.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: as $ $Date: 2000-11-23 14:52:05 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,8 +94,8 @@ #include <macros/xserviceinfo.hxx> #endif -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> #endif //_________________________________________________________________________________________________________________ @@ -200,47 +200,18 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor -#define EVENTOBJECT ::com::sun::star::lang::EventObject -#define FOCUSEVENT ::com::sun::star::awt::FocusEvent -#define FRAMEACTION ::com::sun::star::frame::FrameAction -#define INDEXOUTOFBOUNDSEXCEPTION ::com::sun::star::lang::IndexOutOfBoundsException -#define OINTERFACECONTAINERHELPER ::cppu::OInterfaceContainerHelper -#define OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper -#define OSTRING ::rtl::OString -#define OUSTRING ::rtl::OUString -#define OWEAKOBJECT ::cppu::OWeakObject -#define PROPERTYVALUE ::com::sun::star::beans::PropertyValue -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define UNOURL ::com::sun::star::util::URL -#define WINDOWEVENT ::com::sun::star::awt::WindowEvent -#define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException -#define XBROWSEHISTORYREGISTRY ::com::sun::star::frame::XBrowseHistoryRegistry -#define XCONTROLLER ::com::sun::star::frame::XController -#define XDISPATCH ::com::sun::star::frame::XDispatch -#define XDISPATCHPROVIDER ::com::sun::star::frame::XDispatchProvider -#define XDISPATCHPROVIDERINTERCEPTION ::com::sun::star::frame::XDispatchProviderInterception -#define XDISPATCHPROVIDERINTERCEPTOR ::com::sun::star::frame::XDispatchProviderInterceptor -#define XEVENTLISTENER ::com::sun::star::lang::XEventListener -#define XFOCUSLISTENER ::com::sun::star::awt::XFocusListener -#define XFRAME ::com::sun::star::frame::XFrame -#define XFRAMEACTIONLISTENER ::com::sun::star::frame::XFrameActionListener -#define XFRAMES ::com::sun::star::frame::XFrames -#define XFRAMESSUPPLIER ::com::sun::star::frame::XFramesSupplier -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define XSERVICEINFO ::com::sun::star::lang::XServiceInfo -#define XSTATUSINDICATOR ::com::sun::star::task::XStatusIndicator -#define XSTATUSINDICATORFACTORY ::com::sun::star::task::XStatusIndicatorFactory -#define XTOPWINDOWLISTENER ::com::sun::star::awt::XTopWindowListener -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider -#define XWINDOW ::com::sun::star::awt::XWindow -#define XWINDOWLISTENER ::com::sun::star::awt::XWindowListener - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ +// This enum can be used to set differnt active states of frames, tasks. +enum eACTIVESTATE +{ + INACTIVE , // I'am not a member of active path in tree and i don't have the focus. + ACTIVE , // I'am in the middle of an active path in tree and i don't have the focus. + FOCUS // I have the focus now. I must a member of an active path! +}; + //_________________________________________________________________________________________________________________ // exported definitions //_________________________________________________________________________________________________________________ @@ -266,25 +237,24 @@ namespace framework{ XWindowListener XTopWindowListener XFocusListener - [ XDebugging, if TEST_TREE is defined! ] @base OMutexMember OWeakObject @devstatus deprecated *//*-*************************************************************************************************************/ -class Frame : public XTYPEPROVIDER , - public XSERVICEINFO , - public XFRAMESSUPPLIER , // => XFrame , XComponent - public XSTATUSINDICATORFACTORY , - public XDISPATCHPROVIDER , - public XDISPATCHPROVIDERINTERCEPTION , - public XBROWSEHISTORYREGISTRY , - public XWINDOWLISTENER , // => XEventListener - public XTOPWINDOWLISTENER , - public XFOCUSLISTENER , - public OMutexMember , // Struct for right initalization of mutex member! Must be first of baseclasses. - public OWEAKOBJECT +class Frame : public css::lang::XTypeProvider , + public css::lang::XServiceInfo , + public css::frame::XFramesSupplier , // => XFrame , XComponent + public css::task::XStatusIndicatorFactory , + public css::frame::XDispatchProvider , + public css::frame::XDispatchProviderInterception, + public css::frame::XBrowseHistoryRegistry , + public css::awt::XWindowListener , // => XEventListener + public css::awt::XTopWindowListener , + public css::awt::XFocusListener , + public OMutexMember , // Struct for right initalization of mutex member! Must be first of baseclasses. + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -310,7 +280,7 @@ class Frame : public XTYPEPROVIDER , @onerror ASSERT in debug version or nothing in relaese version. *//*-*****************************************************************************************************/ - Frame( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); + Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); /*-****************************************************************************************************//** @short standard destructor @@ -352,7 +322,7 @@ class Frame : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAMES > SAL_CALL getFrames() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFrames > SAL_CALL getFrames() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short get the current active child frame @@ -370,7 +340,7 @@ class Frame : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAME > SAL_CALL getActiveFrame() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getActiveFrame() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short set the new active direct child frame @@ -387,7 +357,7 @@ class Frame : public XTYPEPROVIDER , @onerror An assertion is thrown, if given frame is'nt already a child of us. *//*-*****************************************************************************************************/ - virtual void SAL_CALL setActiveFrame( const REFERENCE< XFRAME >& xFrame ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL setActiveFrame( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XStatusIndicatorFactory @@ -405,7 +375,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XSTATUSINDICATOR > SAL_CALL createStatusIndicator() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL createStatusIndicator() throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XDispatchProvider @@ -427,9 +397,9 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XDISPATCH > SAL_CALL queryDispatch( const UNOURL& aURL , - const OUSTRING& sTargetFrameName, - sal_Int32 nSearchFlags ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL , + const ::rtl::OUString& sTargetFrameName, + sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -445,7 +415,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescriptor ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XDispatchProviderInterception @@ -466,7 +436,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL registerDispatchProviderInterceptor( const REFERENCE< XDISPATCHPROVIDERINTERCEPTOR >& xInterceptor ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL registerDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -483,7 +453,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL releaseDispatchProviderInterceptor( const REFERENCE< XDISPATCHPROVIDERINTERCEPTOR >& xInterceptor ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL releaseDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XBrowseHistoryRegistry @@ -504,7 +474,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL updateViewData( const ANY& aValue ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL updateViewData( const css::uno::Any& aValue ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -521,9 +491,9 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL createNewEntry( const OUSTRING& sURL , - const SEQUENCE< PROPERTYVALUE >& seqArguments, - const OUSTRING& sTitle ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL createNewEntry( const ::rtl::OUString& sURL , + const css::uno::Sequence< css::beans::PropertyValue >& seqArguments, + const ::rtl::OUString& sTitle ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XWindowListener @@ -544,7 +514,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowResized( const WINDOWEVENT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowResized( const css::awt::WindowEvent& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -561,7 +531,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowMoved( const WINDOWEVENT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowMoved( const css::awt::WindowEvent& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -578,7 +548,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowShown( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowShown( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -595,7 +565,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowHidden( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowHidden( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XTopWindowListener @@ -616,7 +586,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowOpened( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowOpened( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -633,7 +603,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowClosing( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowClosing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -650,7 +620,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowClosed( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowClosed( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -667,7 +637,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowMinimized( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowMinimized( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -684,7 +654,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowNormalized( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowNormalized( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -701,7 +671,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowActivated( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowActivated( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -718,7 +688,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowDeactivated( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowDeactivated( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XFrame @@ -739,7 +709,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL initialize( const REFERENCE< XWINDOW >& xWindow ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL initialize( const css::uno::Reference< css::awt::XWindow >& xWindow ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -758,7 +728,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XWINDOW > SAL_CALL getContainerWindow() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getContainerWindow() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -775,7 +745,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL setCreator( const REFERENCE< XFRAMESSUPPLIER >& xCreator ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL setCreator( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -791,7 +761,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAMESSUPPLIER > SAL_CALL getCreator() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL getCreator() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -808,7 +778,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual OUSTRING SAL_CALL getName() throw( RUNTIMEEXCEPTION ); + virtual ::rtl::OUString SAL_CALL getName() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -825,7 +795,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL setName( const OUSTRING& sName ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL setName( const ::rtl::OUString& sName ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -854,8 +824,8 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XFRAME > SAL_CALL findFrame( const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XFrame > SAL_CALL findFrame( const ::rtl::OUString& sTargetFrameName , + sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -875,7 +845,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL isTop() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL isTop() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -892,7 +862,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL activate() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL activate() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -909,7 +879,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL deactivate() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL deactivate() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -926,7 +896,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL isActive() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL isActive() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -943,8 +913,8 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL setComponent( const REFERENCE< XWINDOW >& xComponentWindow , - const REFERENCE< XCONTROLLER >& xController ) throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL setComponent( const css::uno::Reference< css::awt::XWindow >& xComponentWindow , + const css::uno::Reference< css::frame::XController >& xController ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -968,7 +938,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XWINDOW > SAL_CALL getComponentWindow() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -985,7 +955,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XCONTROLLER > SAL_CALL getController() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XController > SAL_CALL getController() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -1002,7 +972,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL contextChanged() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL contextChanged() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -1019,7 +989,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL addFrameActionListener( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL addFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -1036,7 +1006,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL removeFrameActionListener( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL removeFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XComponent @@ -1060,7 +1030,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL dispose() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL dispose() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -1077,7 +1047,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL addEventListener( const REFERENCE< XEVENTLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -1094,7 +1064,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL removeEventListener( const REFERENCE< XEVENTLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XEventListener @@ -1115,7 +1085,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL disposing( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XFocusListener @@ -1133,7 +1103,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL focusGained( const FOCUSEVENT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL focusGained( const css::awt::FocusEvent& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -1147,31 +1117,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL focusLost( const FOCUSEVENT& aEvent ) throw( RUNTIMEEXCEPTION ); - - //--------------------------------------------------------------------------------------------------------- - // public but impl method for direct helper access of class "DispatchProvider". - // Don't use this in another context! - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short search for last destination of load component by means of dispatch(...) - @descr This is a HACK for XDispatch->dispatch(...) calls. You don't get any information about - the destination frame, which has loaded a component in loadComponentFromURL()! - But we will set a flag m_bILoadLastComponent in impl_loadComponent() if loading successfull. - With these impl method you can find this frame and return his component ... - If this method found any frame we must reset ouer special flag! - - @seealso method impl_loadComponent() - @seealso method loadComponentFromURL() - - @param - - @return A reference to frame, which has loaded the last component. - - @onerror A null reference is returned. - *//*-*****************************************************************************************************/ - -//OBSOLETE REFERENCE< XFRAME > impl_searchLastLoadedComponent(); + virtual void SAL_CALL focusLost( const css::awt::FocusEvent& aEvent ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -1199,7 +1145,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - void impl_setContainerWindow( const REFERENCE< XWINDOW >& xWindow ); + void impl_setContainerWindow( const css::uno::Reference< css::awt::XWindow >& xWindow ); /*-****************************************************************************************************//** @short - @@ -1215,7 +1161,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - void impl_setComponentWindow( const REFERENCE< XWINDOW >& xWindow ); + void impl_setComponentWindow( const css::uno::Reference< css::awt::XWindow >& xWindow ); /*-****************************************************************************************************//** @short - @@ -1231,7 +1177,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - void impl_setController( const REFERENCE< XCONTROLLER >& xController ); + void impl_setController( const css::uno::Reference< css::frame::XController >& xController ); /*-****************************************************************************************************//** @short - @@ -1247,7 +1193,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - void impl_sendFrameActionEvent( const FRAMEACTION& aAction ); + void impl_sendFrameActionEvent( const css::frame::FrameAction& aAction ); /*-****************************************************************************************************//** @short - @@ -1277,7 +1223,7 @@ class Frame : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - sal_Bool impl_willFrameTop( const REFERENCE< XFRAMESSUPPLIER >& xParent ); + sal_Bool impl_willFrameTop( const css::uno::Reference< css::frame::XFramesSupplier >& xParent ); /*-****************************************************************************************************//** @short resize ouer componentwindow @@ -1318,39 +1264,31 @@ class Frame : public XTYPEPROVIDER , private: - sal_Bool impldbg_checkParameter_append ( const REFERENCE< XFRAME >& xFrame ); - sal_Bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags ); - sal_Bool impldbg_checkParameter_remove ( const REFERENCE< XFRAME >& xFrame ); - sal_Bool impldbg_checkParameter_setActiveFrame ( const REFERENCE< XFRAME >& xFrame ); -/*OBSOLETE - sal_Bool impldbg_checkParameter_queryDispatch ( const UNOURL& aURL , - const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags ); - sal_Bool impldbg_checkParameter_queryDispatches ( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ); - sal_Bool impldbg_checkParameter_registerDispatchProviderInterceptor ( const REFERENCE< XDISPATCHPROVIDERINTERCEPTOR >& xInterceptor ); - sal_Bool impldbg_checkParameter_releaseDispatchProviderInterceptor ( const REFERENCE< XDISPATCHPROVIDERINTERCEPTOR >& xInterceptor ); -*/ - sal_Bool impldbg_checkParameter_updateViewData ( const ANY& aValue ); - sal_Bool impldbg_checkParameter_createNewEntry ( const OUSTRING& sURL , - const SEQUENCE< PROPERTYVALUE >& seqArguments , - const OUSTRING& sTitle ); - sal_Bool impldbg_checkParameter_windowResized ( const WINDOWEVENT& aEvent ); - sal_Bool impldbg_checkParameter_windowActivated ( const EVENTOBJECT& aEvent ); - sal_Bool impldbg_checkParameter_windowDeactivated ( const EVENTOBJECT& aEvent ); - sal_Bool impldbg_checkParameter_initialize ( const REFERENCE< XWINDOW >& xWindow ); - sal_Bool impldbg_checkParameter_setCreator ( const REFERENCE< XFRAMESSUPPLIER >& xCreator ); - sal_Bool impldbg_checkParameter_setName ( const OUSTRING& sName ); - sal_Bool impldbg_checkParameter_findFrame ( const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags ); - sal_Bool impldbg_checkParameter_setComponent ( const REFERENCE< XWINDOW >& xComponentWindow , - const REFERENCE< XCONTROLLER >& xController ); - sal_Bool impldbg_checkParameter_addFrameActionListener ( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ); - sal_Bool impldbg_checkParameter_removeFrameActionListener ( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ); - sal_Bool impldbg_checkParameter_addEventListener ( const REFERENCE< XEVENTLISTENER >& xListener ); - sal_Bool impldbg_checkParameter_removeEventListener ( const REFERENCE< XEVENTLISTENER >& xListener ); - sal_Bool impldbg_checkParameter_disposing ( const EVENTOBJECT& aEvent ); - sal_Bool impldbg_checkParameter_focusGained ( const FOCUSEVENT& aEvent ); - sal_Bool impldbg_checkParameter_focusLost ( const FOCUSEVENT& aEvent ); + static sal_Bool impldbg_checkParameter_append ( const css::uno::Reference< css::frame::XFrame >& xFrame ); + static sal_Bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags ); + static sal_Bool impldbg_checkParameter_remove ( const css::uno::Reference< css::frame::XFrame >& xFrame ); + static sal_Bool impldbg_checkParameter_setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame ); + static sal_Bool impldbg_checkParameter_updateViewData ( const css::uno::Any& aValue ); + static sal_Bool impldbg_checkParameter_createNewEntry ( const ::rtl::OUString& sURL , + const css::uno::Sequence< css::beans::PropertyValue >& seqArguments , + const ::rtl::OUString& sTitle ); + static sal_Bool impldbg_checkParameter_windowResized ( const css::awt::WindowEvent& aEvent ); + static sal_Bool impldbg_checkParameter_windowActivated ( const css::lang::EventObject& aEvent ); + static sal_Bool impldbg_checkParameter_windowDeactivated ( const css::lang::EventObject& aEvent ); + static sal_Bool impldbg_checkParameter_initialize ( const css::uno::Reference< css::awt::XWindow >& xWindow ); + static sal_Bool impldbg_checkParameter_setCreator ( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ); + static sal_Bool impldbg_checkParameter_setName ( const ::rtl::OUString& sName ); + static sal_Bool impldbg_checkParameter_findFrame ( const ::rtl::OUString& sTargetFrameName , + sal_Int32 nSearchFlags ); + static sal_Bool impldbg_checkParameter_setComponent ( const css::uno::Reference< css::awt::XWindow >& xComponentWindow , + const css::uno::Reference< css::frame::XController >& xController ); + static sal_Bool impldbg_checkParameter_addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ); + static sal_Bool impldbg_checkParameter_removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ); + static sal_Bool impldbg_checkParameter_addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ); + static sal_Bool impldbg_checkParameter_removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ); + static sal_Bool impldbg_checkParameter_disposing ( const css::lang::EventObject& aEvent ); + static sal_Bool impldbg_checkParameter_focusGained ( const css::awt::FocusEvent& aEvent ); + static sal_Bool impldbg_checkParameter_focusLost ( const css::awt::FocusEvent& aEvent ); #endif // #ifdef ENABLE_ASSERTIONS @@ -1369,7 +1307,7 @@ class Frame : public XTYPEPROVIDER , #ifdef ENABLE_SERVICEDEBUG // Only active in debug version. - OUSTRING impldbg_getTreeNames( sal_Int16 nLevel ); + ::rtl::OUString impldbg_getTreeNames( sal_Int16 nLevel ); #endif // #ifdef ENABLE_SERVICEDEBUG @@ -1382,26 +1320,25 @@ class Frame : public XTYPEPROVIDER , // But some variables are used in derived classes! // Make it protected for directly access. - OUSTRING m_sName ; /// name of this frame - REFERENCE< XFRAMESSUPPLIER > m_xParent ; /// parent of this frame - REFERENCE< XDISPATCHPROVIDER > m_xDispatchHelper ; /// helper for XDispatchProvider, XDispatch, XDispatchProviderInterception interfaces - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; /// reference to factory, which has create this instance - REFERENCE< XWINDOW > m_xContainerWindow ; /// containerwindow of this frame for embedded components - sal_Bool m_bRecursiveSearchProtection ; /// protect against recursion while searching in parent frames - FrameContainer m_aChildFrameContainer ; /// array of child frames + ::rtl::OUString m_sName ; /// name of this frame + css::uno::Reference< css::frame::XFramesSupplier > m_xParent ; /// parent of this frame + css::uno::Reference< css::frame::XDispatchProvider > m_xDispatchHelper ; /// helper for XDispatchProvider, XDispatch, XDispatchProviderInterception interfaces + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// reference to factory, which has create this instance + css::uno::Reference< css::awt::XWindow > m_xContainerWindow ; /// containerwindow of this frame for embedded components + sal_Bool m_bRecursiveSearchProtection ; /// protect against recursion while searching in parent frames + FrameContainer m_aChildFrameContainer ; /// array of child frames private: - REFERENCE< XSTATUSINDICATORFACTORY > m_xIndicatorFactoryHelper ; /// reference to factory helper to create status indicator objects - REFERENCE< XWINDOW > m_xComponentWindow ; /// window of the actual component - REFERENCE< XCONTROLLER > m_xController ; /// controller of the actual frame - eACTIVESTATE m_eActiveState ; /// state, if i'am a member of active path in tree or i have the focus or ... - sal_Bool m_bIsFrameTop ; /// frame has no parent or the parent is a taskor the desktop - sal_Bool m_bConnected ; /// due to FrameActionEvent - sal_Bool m_bAlreadyDisposed ; /// protect egainst recursive dispose calls -//OBSOLETE sal_Bool m_bILoadLastComponent ; /// help flag to find last destination of dispatch(...) in tree! see impl_searchLastLoadedComponent() for further informations - OMULTITYPEINTERFACECONTAINERHELPER m_aListenerContainer ; /// container for ALL Listener - REFERENCE< XFRAMES > m_xFramesHelper ; /// helper for XFrames, XIndexAccess and XElementAccess interfaces + css::uno::Reference< css::task::XStatusIndicatorFactory > m_xIndicatorFactoryHelper ; /// reference to factory helper to create status indicator objects + css::uno::Reference< css::awt::XWindow > m_xComponentWindow ; /// window of the actual component + css::uno::Reference< css::frame::XController > m_xController ; /// controller of the actual frame + eACTIVESTATE m_eActiveState ; /// state, if i'am a member of active path in tree or i have the focus or ... + sal_Bool m_bIsFrameTop ; /// frame has no parent or the parent is a taskor the desktop + sal_Bool m_bConnected ; /// due to FrameActionEvent + sal_Bool m_bAlreadyDisposed ; /// protect egainst recursive dispose calls + ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer ; /// container for ALL Listener + css::uno::Reference< css::frame::XFrames > m_xFramesHelper ; /// helper for XFrames, XIndexAccess and XElementAccess interfaces }; // class Frame diff --git a/framework/inc/services/frameloaderfactory.hxx b/framework/inc/services/frameloaderfactory.hxx index 7327613be2..0c093f8b9a 100644 --- a/framework/inc/services/frameloaderfactory.hxx +++ b/framework/inc/services/frameloaderfactory.hxx @@ -2,9 +2,9 @@ * * $RCSfile: frameloaderfactory.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2001-01-26 08:41:06 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,8 +59,6 @@ * ************************************************************************/ -#ifdef TF_FILTER - #ifndef __FRAMEWORK_SERVICES_FRAMELOADERFACTORY_HXX_ #define __FRAMEWORK_SERVICES_FRAMELOADERFACTORY_HXX_ @@ -96,8 +94,8 @@ #include <macros/xserviceinfo.hxx> #endif -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> #endif //_________________________________________________________________________________________________________________ @@ -142,21 +140,6 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define OWEAKOBJECT ::cppu::OWeakObject -#define PROPERTYVALUE ::com::sun::star::beans::PropertyValue -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException -#define WRAPPEDTARGETEXCEPTION ::com::sun::star::lang::WrappedTargetException -#define XINPUTSTREAM ::com::sun::star::io::XInputStream -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define XPROPERTYSET ::com::sun::star::beans::XPropertySet -#define XSERVICEINFO ::com::sun::star::lang::XServiceInfo -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider -#define XINTERFACE ::com::sun::star::uno::XInterface -#define XNAMEACCESS ::com::sun::star::container::XNameAccess -#define UNOTYPE ::com::sun::star::uno::Type - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -167,14 +150,14 @@ namespace framework{ struct tIMPLExtractedArguments { - OUSTRING sMimeType ; - sal_Int32 nFlags ; - OUSTRING sFilterName ; - sal_Int32 nClipboardFormat ; - OUSTRING sDetectService ; - REFERENCE< XINPUTSTREAM > xInputStream ; - - sal_Int32 nValidMask ; + ::rtl::OUString sMimeType ; + sal_Int32 nFlags ; + ::rtl::OUString sFilterName ; + sal_Int32 nClipboardFormat ; + ::rtl::OUString sDetectService ; + css::uno::Reference< css::io::XInputStream > xInputStream ; + + sal_Int32 nValidMask ; }; /*-************************************************************************************************************//** @@ -199,12 +182,12 @@ struct tIMPLExtractedArguments @devstatus deprecated *//*-*************************************************************************************************************/ -class FrameLoaderFactory : public XTYPEPROVIDER , - public XSERVICEINFO , - public XMULTISERVICEFACTORY , - public XNAMEACCESS , // => XElementAccess - public OMutexMember , // Struct for right initalization of mutex member! Mst first of baseclasses - public OWEAKOBJECT +class FrameLoaderFactory : public css::lang::XTypeProvider , + public css::lang::XServiceInfo , + public css::lang::XMultiServiceFactory , + public css::container::XNameAccess , // => XElementAccess + public OMutexMember , // Struct for right initalization of mutex member! Mst first of baseclasses + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -230,7 +213,7 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror An ASSERTION is thrown in debug version, if xFactory is invalid or cache can't filled. *//*-*****************************************************************************************************/ - FrameLoaderFactory( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); + FrameLoaderFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); /*-****************************************************************************************************//** @short standard destructor to delete instance @@ -274,8 +257,8 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XINTERFACE > SAL_CALL createInstance( const OUSTRING& sTypeName ) throw( EXCEPTION , - RUNTIMEEXCEPTION); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& sTypeName ) throw( css::uno::Exception , + css::uno::RuntimeException ); /*-****************************************************************************************************//** @short create a new frameloder @@ -294,9 +277,9 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror A null reference is returned. *//*-*****************************************************************************************************/ - virtual REFERENCE< XINTERFACE > SAL_CALL createInstanceWithArguments( const OUSTRING& sTypeName , - const SEQUENCE< ANY >& seqArguments) throw( EXCEPTION , - RUNTIMEEXCEPTION); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& sTypeName , + const css::uno::Sequence< css::uno::Any >& seqArguments) throw( css::uno::Exception , + css::uno::RuntimeException); /*-****************************************************************************************************//** @short not supported @@ -310,7 +293,7 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual SEQUENCE< OUSTRING > SAL_CALL getAvailableServiceNames() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames() throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XNameAccess @@ -338,9 +321,9 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror If given name not exist a NoSuchElementException is thrown. *//*-*****************************************************************************************************/ - virtual ANY SAL_CALL getByName( const OUSTRING& sName ) throw( NOSUCHELEMENTEXCEPTION , - WRAPPEDTARGETEXCEPTION , - RUNTIMEEXCEPTION ); + virtual css::uno::Any SAL_CALL getByName( const ::rtl::OUString& sName ) throw( css::container::NoSuchElementException , + css::lang::WrappedTargetException , + css::uno::RuntimeException ); /*-****************************************************************************************************//** @short return list of all well known loader names from configuration @@ -356,7 +339,7 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror No error should occure. *//*-*****************************************************************************************************/ - virtual SEQUENCE< OUSTRING > SAL_CALL getElementNames() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short check if searched frame loader exist in configuration @@ -374,7 +357,7 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror No error should occure. *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL hasByName( const OUSTRING& sName ) throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& sName ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XElementAccess @@ -392,7 +375,7 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror No error should occure. *//*-*****************************************************************************************************/ - virtual UNOTYPE SAL_CALL getElementType() throw( RUNTIMEEXCEPTION ); + virtual css::uno::Type SAL_CALL getElementType() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short return state if informations about frame loader available @@ -407,7 +390,7 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror No error should occure. *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL hasElements() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL hasElements() throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -437,7 +420,7 @@ class FrameLoaderFactory : public XTYPEPROVIDER , @onerror No error should occure. *//*-*****************************************************************************************************/ - void impl_initializeLoader( REFERENCE< XINTERFACE >& xLoader, const TLoader* pLoaderInfo ); + void impl_initializeLoader( css::uno::Reference< css::uno::XInterface >& xLoader, const TLoader* pLoaderInfo ); //------------------------------------------------------------------------------------------------------------- // debug methods @@ -463,12 +446,12 @@ class FrameLoaderFactory : public XTYPEPROVIDER , private: - static sal_Bool impldbg_checkParameter_FrameLoaderFactory ( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); - static sal_Bool impldbg_checkParameter_createInstance ( const OUSTRING& sTypeName ); - static sal_Bool impldbg_checkParameter_createInstanceWithArguments ( const OUSTRING& sTypeName , - const SEQUENCE< ANY >& seqArguments); - static sal_Bool impldbg_checkParameter_getByName ( const OUSTRING& sName ); - static sal_Bool impldbg_checkParameter_hasByName ( const OUSTRING& sName ); + static sal_Bool impldbg_checkParameter_FrameLoaderFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + static sal_Bool impldbg_checkParameter_createInstance ( const ::rtl::OUString& sTypeName ); + static sal_Bool impldbg_checkParameter_createInstanceWithArguments ( const ::rtl::OUString& sTypeName , + const css::uno::Sequence< css::uno::Any >& seqArguments); + static sal_Bool impldbg_checkParameter_getByName ( const ::rtl::OUString& sName ); + static sal_Bool impldbg_checkParameter_hasByName ( const ::rtl::OUString& sName ); #endif // #ifdef ENABLE_ASSERTIONS @@ -479,455 +462,11 @@ class FrameLoaderFactory : public XTYPEPROVIDER , private: - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; - FilterCache m_aCache ; + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; + FilterCache m_aCache ; }; // class FrameLoaderFactory } // namespace framework #endif // #ifndef __FRAMEWORK_SERVICES_FRAMELOADERFACTORY_HXX_ - -#else // #ifdef TF_FILTER - -#ifndef __FRAMEWORK_SERVICES_FRAMELOADERFACTORY_HXX_ -#define __FRAMEWORK_SERVICES_FRAMELOADERFACTORY_HXX_ - -//_________________________________________________________________________________________________________________ -// my own includes -//_________________________________________________________________________________________________________________ - -#ifndef __FRAMEWORK_CLASSES_REGISTRYCACHE_HXX_ -#include <classes/registrycache.hxx> -#endif - -#ifndef __FRAMEWORK_HELPER_OMUTEXMEMBER_HXX_ -#include <helper/omutexmember.hxx> -#endif - -#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ -#include <macros/generic.hxx> -#endif - -#ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ -#include <macros/debug.hxx> -#endif - -#ifndef __FRAMEWORK_MACROS_XINTERFACE_HXX_ -#include <macros/xinterface.hxx> -#endif - -#ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_ -#include <macros/xtypeprovider.hxx> -#endif - -#ifndef __FRAMEWORK_MACROS_XSERVICEINFO_HXX_ -#include <macros/xserviceinfo.hxx> -#endif - -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> -#endif - -//_________________________________________________________________________________________________________________ -// interface includes -//_________________________________________________________________________________________________________________ - -#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ -#include <com/sun/star/lang/XServiceInfo.hpp> -#endif - -#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ -#include <com/sun/star/beans/PropertyValue.hpp> -#endif - -#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_ -#include <com/sun/star/io/XInputStream.hpp> -#endif - -#ifndef _COM_SUN_STAR_FRAME_XFRAMELOADERQUERY_HPP_ -#include <com/sun/star/frame/XFrameLoaderQuery.hpp> -#endif - -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ -#include <com/sun/star/beans/XPropertySet.hpp> -#endif - -//_________________________________________________________________________________________________________________ -// other includes -//_________________________________________________________________________________________________________________ - -#ifndef _CPPUHELPER_WEAK_HXX_ -#include <cppuhelper/weak.hxx> -#endif - -//_________________________________________________________________________________________________________________ -// namespace -//_________________________________________________________________________________________________________________ - -namespace framework{ - -#define ANY ::com::sun::star::uno::Any -#define OWEAKOBJECT ::cppu::OWeakObject -#define PROPERTYVALUE ::com::sun::star::beans::PropertyValue -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define XFRAMELOADERQUERY ::com::sun::star::frame::XFrameLoaderQuery -#define XINPUTSTREAM ::com::sun::star::io::XInputStream -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define XPROPERTYSET ::com::sun::star::beans::XPropertySet -#define XSERVICEINFO ::com::sun::star::lang::XServiceInfo -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider -#define XINTERFACE ::com::sun::star::uno::XInterface - -//_________________________________________________________________________________________________________________ -// exported const -//_________________________________________________________________________________________________________________ - -//_________________________________________________________________________________________________________________ -// exported definitions -//_________________________________________________________________________________________________________________ - -struct tIMPLExtractedArguments -{ - OUSTRING sMimeType ; - sal_Int32 nFlags ; - OUSTRING sFilterName ; - sal_Int32 nClipboardFormat ; - OUSTRING sDetectService ; - REFERENCE< XINPUTSTREAM > xInputStream ; - - sal_Int32 nValidMask ; -}; - -/*-************************************************************************************************************//** - @short factory to create frameloader-objects - @descr These class can be used to create new loader for specified contents. - We use cached values of the registry to lay down, wich frameloader match - a given URL or filtername. To do this, we use the XMultiServiceFactory-interface. - - @ATTENTION In a specialmode of these implementation we support a simple filterdetection. - But there is no special interface. You must call some existing methods in another context! - see createInstanceWithArguments() fo rfurther informations! - - @implements XInterface - XTypeProvider - XServiceInfo - XFrameLoaderQuery - XMultiServiceFactory - XDebugging [Exist in debug version only, if ENABLE_SERVICEDEBUG is set!] - @base OMutexMember - OWeakObject - - @devstatus deprecated -*//*-*************************************************************************************************************/ - -//class FrameLoaderFactory : DERIVE_FROM_XSPECIALDEBUGINTERFACE // => These macro will expand to nothing, if no testmode is set in debug.h! -class FrameLoaderFactory : public XTYPEPROVIDER , - public XSERVICEINFO , - public XFRAMELOADERQUERY , - public XMULTISERVICEFACTORY , - public OMutexMember , // Struct for right initalization of mutex member! - public OWEAKOBJECT -{ - //------------------------------------------------------------------------------------------------------------- - // public methods - //------------------------------------------------------------------------------------------------------------- - - public: - - //--------------------------------------------------------------------------------------------------------- - // constructor / destructor - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short standard constructor - @descr Initialize a new instance and fill the registrycache with values. - To do this - xFactory must be valid! - - @seealso class RegistryCache - @seealso member m_aRegistryCache - - @param "xFactory", factory which has created us. - @return - - - @onerror An ASSERTION is thrown in debug version, if xFactory is invalid or cache can't filled. - *//*-*****************************************************************************************************/ - - FrameLoaderFactory( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); - - /*-****************************************************************************************************//** - @short standard destructor to delete instance - @descr We use it to clear ouer cache. - - @seealso class RegistryCache - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual ~FrameLoaderFactory(); - - //--------------------------------------------------------------------------------------------------------- - // XInterface, XTypeProvider, XServiceInfo - //--------------------------------------------------------------------------------------------------------- - - DECLARE_XINTERFACE - DECLARE_XTYPEPROVIDER - DECLARE_XSERVICEINFO -// DECLARE_XSPECIALDEBUGINTERFACE // => These macro will expand to nothing, if no testmode is set in debug.h! - - //--------------------------------------------------------------------------------------------------------- - // XFrameLoaderQuery - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short - - @descr - - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual SEQUENCE< OUSTRING > SAL_CALL getAvailableFilterNames() throw( RUNTIMEEXCEPTION ); - - /*-****************************************************************************************************//** - @short - - @descr - - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual SEQUENCE< PROPERTYVALUE > SAL_CALL getLoaderProperties( const OUSTRING& sFilterName ) throw( RUNTIMEEXCEPTION ); - - /*-****************************************************************************************************//** - @short - - @descr - - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual OUSTRING SAL_CALL searchFilter( const OUSTRING& sURL, const SEQUENCE< PROPERTYVALUE >& seqArguments ) throw( RUNTIMEEXCEPTION ); - - //--------------------------------------------------------------------------------------------------------- - // XMultiServiceFactory - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short create a new frameloder (without arguments!) - @descr We search for an agreement between given servicespecifier and cache-content. - If we found some information, who match the specifier, we create the registered frameloader. - Otherwise - we return NULL. - - @seealso method impl_createFrameLoader() - @seealso method createInstanceWithArguments() - - @param "sServiceSpecifier", specifier/URL or name of searched frameloader. - @return A reference to a new created frameloader. - - @onerror A null reference is returned. - *//*-*****************************************************************************************************/ - - virtual REFERENCE< XINTERFACE > SAL_CALL createInstance( const OUSTRING& sServiceSpecifier ) throw( EXCEPTION , - RUNTIMEEXCEPTION); - - /*-****************************************************************************************************//** - @short create a new frameloder - @descr We search for an agreement between given servicespecifier and cache-content. - If we found some information, who match the specifier, we create the registered frameloader. - Otherwise - we return NULL. - You can give us some optional arguments to initialize the new frameloader. - - @seealso method impl_createFrameLoader() - @seealso method createInstance() - - @param "sServiceSpecifier", specifier/URL or name of searched frameloader. - @param "seqArguments", list of optional arguments for initializing of new frameloader. - @return A reference to a new created frameloader. - - @onerror A null reference is returned. - - @ATTENTION Because of missing filterdetection, we HACK this method and support a SPECIALMODE! - If you call this method with an empty "sServiceSpecifier" and ONE string-argument - a FilterName - - we return a propertyset for access to all informations of these specified filter. - You can get alist of all supported filternames by calling of "getAvailableServiceNames()". - *//*-*****************************************************************************************************/ - - virtual REFERENCE< XINTERFACE > SAL_CALL createInstanceWithArguments( const OUSTRING& sServiceSpecifier , - const SEQUENCE< ANY >& seqArguments ) throw( EXCEPTION , - RUNTIMEEXCEPTION); - - /*-****************************************************************************************************//** - @short not supported yet - @descr - - - @seealso - - - @param - - @return - - - @onerror - - - @ATTENTION Because of missing filterdetection, we HACK this method and support a SPECIALMODE! - You can call these method to get names of all supported filternames for creation of new - frameloader! see "createInstanceWithArguments()" for further informations. - *//*-*****************************************************************************************************/ - - virtual SEQUENCE< OUSTRING > SAL_CALL getAvailableServiceNames() throw( RUNTIMEEXCEPTION ); - - //------------------------------------------------------------------------------------------------------------- - // protected methods - //------------------------------------------------------------------------------------------------------------- - - protected: - - //------------------------------------------------------------------------------------------------------------- - // private methods - //------------------------------------------------------------------------------------------------------------- - - private: - - /*-****************************************************************************************************//** - @short search for a frame loader which match given parameter - @descr These method is a helper for interface methods to search a frame loader. - We search in ouer registrycache for matching of different parameters of a registered loader - with given URL. If someone found - we return the index in ouer cache of founded item! - Caller can use these index for faster access. If we return the name of found loader, caller - must search this name again if he wish to have full access to other properties of it! - - @seealso method searchFilter() - @seealso method createInstanceWithArguments() - @seealso class RegistryCache - - @param "sURL", servicespecifier for new frameloader - @param "seqArguments", list of optional parameter for new frameloader - @return The index of found item in cache or INVALID_CACHE_POSITION if no item was found. - - @onerror INVALID_CACHE_POSITION is returned. - *//*-*****************************************************************************************************/ - - sal_uInt32 impl_searchFrameLoader( const OUSTRING& sURL , - const SEQUENCE< PROPERTYVALUE >& seqArguments ); - - /*-****************************************************************************************************//** - @short extract all arguments from given property-sequence, which are important for us - @descr Ouer methods are called with an optional list of arguments - sometimes. - And we must have informations about existing arguments. - This is the reason for this method. They will extract all neccessary arguments from sequence - and collect informations about his values and his valid-state! (exist, non exist, valid ...) - Unknown arguments are ignored! - - @seealso method impl_createFrameLoader() - - @param "seqArguments", list of optional parameter to extract informations. - @return A structure with all informatons about existing arguments in sequence. - - @onerror State flags of values are set to INVALID! - *//*-*****************************************************************************************************/ - - tIMPLExtractedArguments impl_extractArguments( const SEQUENCE< PROPERTYVALUE >& seqArguments ); - - /*-****************************************************************************************************//** - @short ask special detect service of a frameloader for matching with given document parameter - @descr A frameloader CAN register a detect service [with an interface XExtendedFilterDetection] - to check given URL in a special way. He can parse the URL; look in stream or something else. - If he can handle these document, the return value is a valid filtername; an empty name - otherwise. - - @seealso interface XExtendedFilterDetection - @seealso const group DetectState - - @param "sDetectService", implementationname of detect service of frameloader - @param "sURL", URL for loading. - @param "sFilterName", possible filtername of frameloader - @param "seqArguments", list of optional parameter for given URL. - @return A valid filtername is returned. - - @onerror An empty name is returned. - *//*-*****************************************************************************************************/ - OUSTRING impl_extendedDetect( const OUSTRING& sDetectService , - const OUSTRING& sFilterName , - const OUSTRING& sURL , - const SEQUENCE< PROPERTYVALUE >& seqArguments ); - - /*-****************************************************************************************************//** - @short extract the extension of a given URL - @descr We are a uno service and can't use special parse objects to extract informations from an URL. - We make itself with normal string functions! The extension is all below last "." in string - with no "/" before! - - @seealso class InetURLObject (!) - - @param "sURL", URL to extract extension. - @return A extracted extension. - - @onerror An empty string is returned. - *//*-*****************************************************************************************************/ - - OUSTRING impl_getExtensionFromURL( const OUSTRING& sURL ); - - //------------------------------------------------------------------------------------------------------------- - // debug methods - // (should be private everyway!) - //------------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short debug-method to check incoming parameter of some other mehods of this class - @descr The following methods are used to check parameters for other methods - of this class. The return value is used directly for an ASSERT(...). - - @seealso ASSERTs in implementation! - - @param references to checking variables - @return sal_False ,on invalid parameter - @return sal_True ,otherwise - - @onerror - - *//*-*****************************************************************************************************/ - - - #ifdef ENABLE_ASSERTIONS - - private: - - sal_Bool impldbg_checkParameter_getLoaderProperties ( const OUSTRING& sFilterName ); - sal_Bool impldbg_checkParameter_searchFilter ( const OUSTRING& sURL , - const SEQUENCE< PROPERTYVALUE >& seqArguments ); - sal_Bool impldbg_checkParameter_FrameLoaderFactoryCtor ( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); - sal_Bool impldbg_checkParameter_createInstanceWithArguments ( const OUSTRING& sServiceSpecifier , - const SEQUENCE< ANY >& seqArguments ); - - #endif // #ifdef ENABLE_ASSERTIONS - - //------------------------------------------------------------------------------------------------------------- - // private variables - // (should be private everyway!) - //------------------------------------------------------------------------------------------------------------- - - private: - - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; - RegistryCache m_aRegistryCache ; - -}; // class FrameLoaderFactory - -} // namespace framework - -#endif // #ifndef __FRAMEWORK_SERVICES_FRAMELOADERFACTORY_HXX_ - -#endif // #ifdef ... #else TF_FILTER diff --git a/framework/inc/services/logindialog.hrc b/framework/inc/services/logindialog.hrc new file mode 100644 index 0000000000..b2f795ad69 --- /dev/null +++ b/framework/inc/services/logindialog.hrc @@ -0,0 +1,74 @@ +/************************************************************************* + * + * $RCSfile: logindialog.hrc,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +// windows / dialogs +#define RID_DLG_LOGIN 1000 + +// controls +#define RID_FI_HEADER 1 +#define RID_FT_LOGINTEXT 2 +#define RID_FT_USERNAME 3 +#define RID_FT_PASSWORD 4 +#define RID_FT_SERVER 5 +#define RID_ED_USERNAME 6 +#define RID_ED_PASSWORD 7 +#define RID_CB_SERVER 8 +#define RID_PB_OK 9 +#define RID_PB_CANCEL 10 diff --git a/framework/inc/services/logindialog.hxx b/framework/inc/services/logindialog.hxx new file mode 100644 index 0000000000..488a3aac51 --- /dev/null +++ b/framework/inc/services/logindialog.hxx @@ -0,0 +1,859 @@ +/************************************************************************* + * + * $RCSfile: logindialog.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_SERVICES_LOGINDIALOG_HXX_ +#define __FRAMEWORK_SERVICES_LOGINDIALOG_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_HELPER_OMUTEXMEMBER_HXX_ +#include <helper/omutexmember.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ +#include <macros/generic.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ +#include <macros/debug.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_XINTERFACE_HXX_ +#include <macros/xinterface.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_ +#include <macros/xtypeprovider.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_XSERVICEINFO_HXX_ +#include <macros/xserviceinfo.hxx> +#endif + +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + +#include <services/logindialog.hrc> + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +#ifndef _COM_SUN_STAR_AWT_XDIALOG_HPP_ +#include <com/sun/star/awt/XDialog.hpp> +#endif + +#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_ +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#endif + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_ +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#endif + +#ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_ +#include <com/sun/star/beans/Property.hpp> +#endif + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif + +#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_ +#include <com/sun/star/lang/Locale.hpp> +#endif + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +#ifndef _CONFIG_HXX +#include <tools/config.hxx> +#endif + +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif + +#ifndef _CPPUHELPER_PROPSHLP_HXX +#include <cppuhelper/propshlp.hxx> +#endif + +#ifndef _SV_DIALOG_HXX +#include <vcl/dialog.hxx> +#endif + +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif + +#ifndef _SV_EDIT_HXX +#include <vcl/edit.hxx> +#endif + +#ifndef _SV_COMBOBOX_HXX +#include <vcl/combobox.hxx> +#endif + +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif + +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif + +#ifndef _SV_MOREBTN_HXX +#include <vcl/morebtn.hxx> +#endif + +#ifndef _LANG_HXX +#include <tools/lang.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// exported const +//_________________________________________________________________________________________________________________ + +#ifdef WNT + #define ININAME DECLARE_ASCII("login.ini") +#elif defined UNIX + #define ININAME DECLARE_ASCII("loginrc") +#else + #error "name of login profile unknown!" +#endif + +#define UNCPATHSEPERATOR sal_Unicode(0x002F) +#define MAX_SERVERHISTORY 10 + +// Use follow keys in follow order. +// [Global] +// UserName=as +// ActiveServer=2 +// ConnectionType=compressed_secure +// Language=en-US +// +// [DefaultPorts] +// plain=8081 +// secure=8082 +// compressed_secure=8083 +// compressed=8084 +// +// [ServerHistory] +// Server_1=localhost +// Server_2=munch:7202 +// Server_3=www.xxx.com:8000 + +#define SECTION_GLOBAL "Global" +#define SECTION_DEFAULTPORTS "DefaultPorts" +#define SECTION_SERVERHISTORY "ServerHistory" + +#define SECTION_USERNAME SECTION_GLOBAL +#define SECTION_ACTIVESERVER SECTION_GLOBAL +#define SECTION_CONNECTIONTYPE SECTION_GLOBAL +#define SECTION_LANGUAGE SECTION_GLOBAL +#define SECTION_PLAIN SECTION_DEFAULTPORTS +#define SECTION_SECURE SECTION_DEFAULTPORTS +#define SECTION_COMPRESSEDSECURE SECTION_DEFAULTPORTS +#define SECTION_COMPRESSED SECTION_DEFAULTPORTS +#define SECTION_SERVER_X SECTION_SERVERHISTORY + +#define KEY_USERNAME "UserName" +#define KEY_ACTIVESERVER "ActiveServer" +#define KEY_CONNECTIONTYPE "ConnectionType" +#define KEY_LANGUAGE "Language" +#define KEY_PLAIN "plain" +#define KEY_SECURE "secure" +#define KEY_COMPRESSEDSECURE "compressed_secure" +#define KEY_COMPRESSED "compressed" +#define KEY_SERVER_X "Server_" + +#define PROPERTYNAME_CONNECTIONTYPE DECLARE_ASCII("ConnectionType" ) +#define PROPERTYNAME_LANGUAGE DECLARE_ASCII("Language" ) +#define PROPERTYNAME_PASSWORD DECLARE_ASCII("Password" ) +#define PROPERTYNAME_SERVER DECLARE_ASCII("Server" ) +#define PROPERTYNAME_SERVERHISTORY DECLARE_ASCII("ServerHistory" ) +#define PROPERTYNAME_USERNAME DECLARE_ASCII("UserName" ) +#define PROPERTYNAME_COMPRESSED DECLARE_ASCII("compressed" ) +#define PROPERTYNAME_COMPRESSEDSECURE DECLARE_ASCII("compressed_secure" ) +#define PROPERTYNAME_PLAIN DECLARE_ASCII("plain" ) +#define PROPERTYNAME_SECURE DECLARE_ASCII("secure" ) + +#define PROPERTYHANDLE_CONNECTIONTYPE 1 +#define PROPERTYHANDLE_LANGUAGE 2 +#define PROPERTYHANDLE_PASSWORD 3 +#define PROPERTYHANDLE_SERVER 4 +#define PROPERTYHANDLE_SERVERHISTORY 5 +#define PROPERTYHANDLE_USERNAME 6 +#define PROPERTYHANDLE_COMPRESSED 7 +#define PROPERTYHANDLE_COMPRESSEDSECURE 8 +#define PROPERTYHANDLE_PLAIN 9 +#define PROPERTYHANDLE_SECURE 10 + +#define PROPERTYCOUNT 10 + +//_________________________________________________________________________________________________________________ +// exported definitions +//_________________________________________________________________________________________________________________ + +struct tIMPL_DialogData +{ + ::rtl::OUString sUserName ; + ::rtl::OUString sPassword ; + css::uno::Sequence< ::rtl::OUString > seqServerList ; + sal_Int32 nActiveServer ; + ::rtl::OUString sConnectionType ; + css::lang::Locale aLanguage ; + sal_Int32 nPortPlain ; + sal_Int32 nPortSecure ; + sal_Int32 nPortCompressedSecure ; + sal_Int32 nPortCompressed ; + + // default ctor to initialize empty structure. + tIMPL_DialogData() + : sUserName ( ::rtl::OUString() ) + , sPassword ( ::rtl::OUString() ) + , seqServerList ( css::uno::Sequence< ::rtl::OUString >() ) + , nActiveServer ( 1 ) + , sConnectionType ( ::rtl::OUString() ) + , aLanguage ( ::rtl::OUString(), ::rtl::OUString(), ::rtl::OUString() ) + , nPortPlain ( 0 ) + , nPortSecure ( 0 ) + , nPortCompressedSecure ( 0 ) + , nPortCompressed ( 0 ) + { + } + + // copy ctor to initialize structure with values from another one. + tIMPL_DialogData( const tIMPL_DialogData& aCopyDataSet ) + : sUserName ( aCopyDataSet.sUserName ) + , sPassword ( aCopyDataSet.sPassword ) + , seqServerList ( aCopyDataSet.seqServerList ) + , nActiveServer ( aCopyDataSet.nActiveServer ) + , sConnectionType ( aCopyDataSet.sConnectionType ) + , aLanguage ( aCopyDataSet.aLanguage ) + , nPortPlain ( aCopyDataSet.nPortPlain ) + , nPortSecure ( aCopyDataSet.nPortSecure ) + , nPortCompressedSecure ( aCopyDataSet.nPortCompressedSecure ) + , nPortCompressed ( aCopyDataSet.nPortCompressed ) + { + } + + // assignment operator to cop values from another struct to this one. + tIMPL_DialogData& operator=( const tIMPL_DialogData& aCopyDataSet ) + { + sUserName = aCopyDataSet.sUserName ; + sPassword = aCopyDataSet.sPassword ; + seqServerList = aCopyDataSet.seqServerList ; + nActiveServer = aCopyDataSet.nActiveServer ; + sConnectionType = aCopyDataSet.sConnectionType ; + aLanguage = aCopyDataSet.aLanguage ; + nPortPlain = aCopyDataSet.nPortPlain ; + nPortSecure = aCopyDataSet.nPortSecure ; + nPortCompressedSecure = aCopyDataSet.nPortCompressedSecure ; + nPortCompressed = aCopyDataSet.nPortCompressed ; + return *this; + } +}; + +/*-************************************************************************************************************//** + @short implements an "private inline" dialog class used by follow class LoginDialog to show the dialog + @descr This is a VCL- modal dialog and not threadsafe! We use it as private definition in the context of login dialog only! + + @implements - + + @base ModalDialog +*//*-*************************************************************************************************************/ + +class cIMPL_Dialog : public ModalDialog +{ + //------------------------------------------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------------------------------------------- + + public: + + /*-****************************************************************************************************//** + @short default ctor + @descr This ctor initialize the dialog, load ressources but not set values on edits or check boxes! + These is implemented by setValues() on the same class. + You must give us a language identifier to describe which ressource should be used! + + @seealso method setValues() + + @param "aLanguage", identifier to describe ressource language + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + cIMPL_Dialog( LanguageType aLanguage ); + + /*-****************************************************************************************************//** + @short default dtor + @descr This dtor deinitialize the dialog and free all used ressources. + But you can't get the values of the dialog. Use getValues() to do this. + + @seealso method getValues() + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ~cIMPL_Dialog(); + + /*-****************************************************************************************************//** + @short set new values on dialog to show + @descr Use this to initialize the dialg with new values for showing before execute. + + @seealso method getValues() + + @param "aDataSet"; struct of variables to set it on dialog controls + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void setValues( const tIMPL_DialogData& aDataSet ); + + /*-****************************************************************************************************//** + @short get current values from dialog controls + @descr Use this if you will get all values of dialog after execute. + + @seealso method setValues() + + @param "aDataSet"; struct of variables filled by dialog + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + tIMPL_DialogData getValues(); + + //------------------------------------------------------------------------------------------------------------- + // private methods + //------------------------------------------------------------------------------------------------------------- + + private: + + /*-****************************************************************************************************//** + @short get a ressource for given id from right ressource file + @descr This dialog need his own ressource. We can't use the global ressource manager! + We must use our own. + You must give us the ressource language. If no right ressource could be found - + any existing one is used automaticly! + + @seealso method setValues() + + @param "nId" ; id to convert it in right ressource id + @param "aLanguage" ; type of ressource language + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + static ResId impl_getResId( sal_uInt16 nId , + LanguageType aLanguage ); + + //------------------------------------------------------------------------------------------------------------- + // private member + //------------------------------------------------------------------------------------------------------------- + + private: + + FixedImage m_imageHeader ; + FixedText m_textLoginText ; + FixedText m_textUserName ; + FixedText m_textPassword ; + FixedText m_textServer ; + Edit m_editUserName ; + Edit m_editPassword ; + ComboBox m_comboServer ; + OKButton m_buttonOK ; + CancelButton m_buttonCancel ; + tIMPL_DialogData m_aDataSet ; +}; + +/*-************************************************************************************************************//** + @short + + @descr - + + @implements XInterface + XTypeProvider + XServiceInfo + XDialog + + @base OMutexMember + OWeakObject +*//*-*************************************************************************************************************/ + +class LoginDialog : public css::lang::XTypeProvider , + public css::lang::XServiceInfo , + public css::awt::XDialog , + public OMutexMember , // Order of baseclasses is neccessary for right initialization! + public ::cppu::OBroadcastHelper , + public ::cppu::OPropertySetHelper , + public ::cppu::OWeakObject +{ + //------------------------------------------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------------------------------------------- + + public: + + //--------------------------------------------------------------------------------------------------------- + // constructor / destructor + //--------------------------------------------------------------------------------------------------------- + + /*-****************************************************************************************************//** + @short - + @descr - + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + LoginDialog( const css::uno::Reference< css::lang::XMultiServiceFactory >& sFactory ); + + /*-****************************************************************************************************//** + @short - + @descr - + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual ~LoginDialog(); + + //--------------------------------------------------------------------------------------------------------- + // XInterface, XTypeProvider, XServiceInfo + //--------------------------------------------------------------------------------------------------------- + + DECLARE_XINTERFACE + DECLARE_XTYPEPROVIDER + DECLARE_XSERVICEINFO + + //--------------------------------------------------------------------------------------------------------- + // XDialog + //--------------------------------------------------------------------------------------------------------- + + /*-****************************************************************************************************//** + @short set new title of dialog + @descr - + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle ) throw( css::uno::RuntimeException ); + + /*-****************************************************************************************************//** + @short return the current title of this dialog + @descr - + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual ::rtl::OUString SAL_CALL getTitle() throw( css::uno::RuntimeException ); + + /*-****************************************************************************************************//** + @short show the dialog and return user reaction + @descr If user close dialog with OK we return 1 else + user has cancelled this dialog and we return 0. + You can use this return value directly as boolean. + + @seealso - + + @param - + @return 1; if closed with OK + @return 0; if cancelled + + @onerror We return 0(FALSE). + *//*-*****************************************************************************************************/ + + virtual sal_Int16 SAL_CALL execute() throw( css::uno::RuntimeException ); + + /*-****************************************************************************************************//** + @short not implemented yet! + @descr - + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL endExecute() throw( css::uno::RuntimeException ); + + //------------------------------------------------------------------------------------------------------------- + // protected methods + //------------------------------------------------------------------------------------------------------------- + + protected: + + //--------------------------------------------------------------------------- + // OPropertySetHelper + //--------------------------------------------------------------------------- + + /*-****************************************************************************************************//** + @short try to convert a property value + @descr This method is calling from helperclass "OPropertySetHelper". + Don't use this directly! + You must try to convert the value of given propertyhandle and + return results of this operation. This will be use to ask vetoable + listener. If no listener have a veto, we will change value realy! + ( in method setFastPropertyValue_NoBroadcast(...) ) + + @seealso class OPropertySetHelper + @seealso method setFastPropertyValue_NoBroadcast() + @seealso method impl_tryToChangeProperty() + + @param "aConvertedValue" new converted value of property + @param "aOldValue" old value of property + @param "nHandle" handle of property + @param "aValue" new value of property + @return sal_True if value will be changed, sal_FALSE otherway + + @onerror IllegalArgumentException, if you call this with an invalid argument + *//*-*****************************************************************************************************/ + + virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& aConvertedValue , + css::uno::Any& aOldValue , + sal_Int32 nHandle , + const css::uno::Any& aValue ) throw( css::lang::IllegalArgumentException ); + + /*-****************************************************************************************************//** + @short set value of a transient property + @descr This method is calling from helperclass "OPropertySetHelper". + Don't use this directly! + Handle and value are valid everyway! You must set the new value only. + After this, baseclass send messages to all listener automaticly. + + @seealso OPropertySetHelper + + @param "nHandle" handle of property to change + @param "aValue" new value of property + @return - + + @onerror An exception is thrown. + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle , + const css::uno::Any& aValue ) throw( css::uno::Exception ); + + /*-****************************************************************************************************//** + @short get value of a transient property + @descr This method is calling from helperclass "OPropertySetHelper". + Don't use this directly! + + @seealso OPropertySetHelper + + @param "nHandle" handle of property to change + @param "aValue" current value of property + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL getFastPropertyValue( css::uno::Any& aValue , + sal_Int32 nHandle ) const; + + /*-****************************************************************************************************//** + @short return structure and information about transient properties + @descr This method is calling from helperclass "OPropertySetHelper". + Don't use this directly! + + @seealso OPropertySetHelper + + @param - + @return structure with property-informations + + @onerror - + *//*-*****************************************************************************************************/ + + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + /*-****************************************************************************************************//** + @short return propertysetinfo + @descr You can call this method to get information about transient properties + of this object. + + @seealso OPropertySetHelper + @seealso XPropertySet + @seealso XMultiPropertySet + + @param - + @return reference to object with information [XPropertySetInfo] + + @onerror - + *//*-*****************************************************************************************************/ + + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(); + + //------------------------------------------------------------------------------------------------------------- + // private methods + //------------------------------------------------------------------------------------------------------------- + + private: + + /*-****************************************************************************************************//** + @short return table of all supported properties + @descr We need this table to initialize our helper baseclass OPropertySetHelper + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); + + /*-****************************************************************************************************//** + @short helper method to check if a property will change his value + @descr Is neccessary for vetoable listener mechanism of OPropertySethelper. + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + sal_Bool impl_tryToChangeProperty( const ::rtl::OUString& sProperty , + const css::uno::Any& aValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); + + sal_Bool impl_tryToChangeProperty( const css::uno::Sequence< ::rtl::OUString >& seqProperty , + const css::uno::Any& aValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); + + sal_Bool impl_tryToChangeProperty( const sal_Int32& nProperty , + const css::uno::Any& aValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); + + sal_Bool impl_tryToChangeProperty( const css::lang::Locale& aProperty , + const css::uno::Any& aValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); + + /*-****************************************************************************************************//** + @short search and open profile + @descr This method search and open the ini file. It initialize some member too. + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void impl_openProfile(); + + /*-****************************************************************************************************//** + @short close profile and free some member + @descr This method close current opened ini file and deinitialize some member too. + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void impl_closeProfile(); + + /*-****************************************************************************************************//** + @short check current server history + @descr Our current server history implementation can handle 10 elements as maximum. + If more then 10 elements exist; old ones will be deleted. + + @seealso - + + @param "seqHistory"; current history + @return Sequence< OUString >; checked and repaired history + + @onerror - + *//*-*****************************************************************************************************/ + + void impl_addServerToHistory( css::uno::Sequence< ::rtl::OUString >& seqHistory , + sal_Int32& nActiveServer , + const ::rtl::OUString& sServer ); + + /*-****************************************************************************************************//** + @short helper methods to read/write properties from/to ini file + @descr Using of Config-Class isn't easy everytime :-( + Thats the reason for these helper. State of operation isn't realy important .. + but we assert impossible cases or occured errors! + + @seealso - + + @param - + @return - + + @onerror Assertions are shown. + *//*-*****************************************************************************************************/ + + void impl_writeUserName ( const ::rtl::OUString& sUserName ); + void impl_writeActiveServer ( sal_Int32 nActiveServer ); + void impl_writeServerHistory ( const css::uno::Sequence< ::rtl::OUString >& lHistory ); + void impl_writeConnectionType ( const ::rtl::OUString& sConnectionType ); + void impl_writeLanguage ( const css::lang::Locale& aLanguage ); + void impl_writePortPlain ( sal_Int32 nPort ); + void impl_writePortSecure ( sal_Int32 nPort ); + void impl_writePortCompressedSecure ( sal_Int32 nPort ); + void impl_writePortCompressed ( sal_Int32 nPort ); + + ::rtl::OUString impl_readUserName ( ); + sal_Int32 impl_readActiveServer ( ); + css::uno::Sequence< ::rtl::OUString > impl_readServerHistory ( ); + ::rtl::OUString impl_readConnectionType ( ); + css::lang::Locale impl_readLanguage ( ); + sal_Int32 impl_readPortPlain ( ); + sal_Int32 impl_readPortSecure ( ); + sal_Int32 impl_readPortCompressedSecure ( ); + sal_Int32 impl_readPortCompressed ( ); + + //------------------------------------------------------------------------------------------------------------- + // debug methods + // (should be private everyway!) + //------------------------------------------------------------------------------------------------------------- + + /*-****************************************************************************************************//** + @short debug-method to check incoming parameter of some other mehods of this class + @descr The following methods are used to check parameters for other methods + of this class. The return value is used directly for an ASSERT(...). + + @seealso ASSERTs in implementation! + + @param references to checking variables + @return sal_False on invalid parameter<BR> + sal_True otherway + + @onerror - + *//*-*****************************************************************************************************/ + + #ifdef ENABLE_ASSERTIONS + + private: + + static sal_Bool impldbg_checkParameter_LoginDialog ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + static sal_Bool impldbg_checkParameter_setTitle ( const ::rtl::OUString& sTitle ); + + #endif // #ifdef ENABLE_ASSERTIONS + + //------------------------------------------------------------------------------------------------------------- + // variables + // (should be private everyway!) + //------------------------------------------------------------------------------------------------------------- + + private: + + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// reference to factory, which has created this instance + ::rtl::OUString m_sININame ; /// full qualified path to profile UNC-notation + Config* m_pINIManager ; /// manager for full access to ini file + sal_Bool m_bInExecuteMode ; /// protection against setting of properties during showing of dialog + cIMPL_Dialog* m_pDialog ; /// VCL dialog + tIMPL_DialogData m_aPropertySet ; + +}; // class LoginDialog + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_SERVICES_LOGINDIALOG_HXX_ diff --git a/framework/inc/services/mediatypedetectionhelper.hxx b/framework/inc/services/mediatypedetectionhelper.hxx index 69b3a6b0b9..1791eed9a5 100644 --- a/framework/inc/services/mediatypedetectionhelper.hxx +++ b/framework/inc/services/mediatypedetectionhelper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: mediatypedetectionhelper.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2001-01-26 08:39:19 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,10 @@ #include <macros/xserviceinfo.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -106,18 +110,7 @@ // namespaces //_________________________________________________________________________________________________________________ -namespace framework -{ - -#define OUSTRING ::rtl::OUString -#define OWEAKOBJECT ::cppu::OWeakObject -#define REFERENCE ::com::sun::star::uno::Reference -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define SEQUENCE ::com::sun::star::uno::Sequence -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define XSERVICEINFO ::com::sun::star::lang::XServiceInfo -#define XSTRINGMAPPING ::com::sun::star::util::XStringMapping -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider +namespace framework{ //_________________________________________________________________________________________________________________ // definitions @@ -136,10 +129,10 @@ namespace framework @devstatus deprecated *//*-*************************************************************************************************************/ -class MediaTypeDetectionHelper : public XTYPEPROVIDER - , public XSERVICEINFO - , public XSTRINGMAPPING - , public OWEAKOBJECT +class MediaTypeDetectionHelper : public css::lang::XTypeProvider + , public css::lang::XServiceInfo + , public css::util::XStringMapping + , public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -163,7 +156,7 @@ class MediaTypeDetectionHelper : public XTYPEPROVIDER @onerror - *//*-*****************************************************************************************************/ - MediaTypeDetectionHelper( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); + MediaTypeDetectionHelper( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); /*-****************************************************************************************************//** @short standard destructor @@ -203,7 +196,7 @@ class MediaTypeDetectionHelper : public XTYPEPROVIDER @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL mapStrings( SEQUENCE< OUSTRING >& seqParameter ) throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL mapStrings( css::uno::Sequence< ::rtl::OUString >& seqParameter ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // variables @@ -212,7 +205,7 @@ class MediaTypeDetectionHelper : public XTYPEPROVIDER private: - REFERENCE< XMULTISERVICEFACTORY > m_xFactory; /// reference to global servicemanager + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; /// reference to global servicemanager }; diff --git a/framework/inc/services/pluginframe.hxx b/framework/inc/services/pluginframe.hxx index 6a227a8876..5a041aa5c1 100644 --- a/framework/inc/services/pluginframe.hxx +++ b/framework/inc/services/pluginframe.hxx @@ -2,9 +2,9 @@ * * $RCSfile: pluginframe.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2001-01-26 08:39:19 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,6 +106,10 @@ #include <com/sun/star/frame/FeatureStateEvent.hpp> #endif +#ifndef _COM_SUN_STAR_LANG_EVENTOBJECT_HPP_ +#include <com/sun/star/lang/EventObject.hpp> +#endif + //_________________________________________________________________________________________________________________ // other includes //_________________________________________________________________________________________________________________ @@ -120,17 +124,6 @@ namespace framework{ -#define XPLUGININSTANCE ::com::sun::star::mozilla::XPluginInstance -#define XPLUGININSTANCEPEER ::com::sun::star::mozilla::XPluginInstancePeer -#define XPLUGINWINDOWPEER ::com::sun::star::mozilla::XPluginWindowPeer -#define XINPUTSTREAM ::com::sun::star::io::XInputStream -#define XINITIALIZATION ::com::sun::star::lang::XInitialization -#define XWINDOW ::com::sun::star::awt::XWindow -#define XSTATUSLISTENER ::com::sun::star::frame::XStatusListener -#define FEATURESTATEEVENT ::com::sun::star::frame::FeatureStateEvent -#define ANY ::com::sun::star::uno::Any -#define SOLARTHREADEXECUTOR ::vcl::SolarThreadExecutor - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -149,9 +142,9 @@ namespace framework{ @base Task *//*-*************************************************************************************************************/ -class PlugInFrame : public XINITIALIZATION , - public XPLUGININSTANCE , - public XSTATUSLISTENER , // => XEVENTLISTENER +class PlugInFrame : public css::lang::XInitialization , + public css::mozilla::XPluginInstance, + public css::frame::XStatusListener , // => XEVENTLISTENER public Task // Order of baseclasses is neccessary for right initialization! { //------------------------------------------------------------------------------------------------------------- @@ -177,7 +170,7 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - PlugInFrame( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); + PlugInFrame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); /*-****************************************************************************************************//** @short standard destructor @@ -217,8 +210,8 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL initialize( const SEQUENCE< ANY >& seqArguments ) throw( EXCEPTION , - RUNTIMEEXCEPTION ); + void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& seqArguments ) throw( css::uno::Exception , + css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XPluginInstance @@ -236,8 +229,8 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL start () throw( RUNTIMEEXCEPTION ); - void SAL_CALL implcb_start () throw( RUNTIMEEXCEPTION ); + void SAL_CALL start () throw( css::uno::RuntimeException ); + void SAL_CALL implcb_start () throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -251,8 +244,8 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL stop () throw( RUNTIMEEXCEPTION ); - void SAL_CALL implcb_stop () throw( RUNTIMEEXCEPTION ); + void SAL_CALL stop () throw( css::uno::RuntimeException ); + void SAL_CALL implcb_stop () throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -266,8 +259,8 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL destroy () throw( RUNTIMEEXCEPTION ); - void SAL_CALL implcb_destroy() throw( RUNTIMEEXCEPTION ); + void SAL_CALL destroy () throw( css::uno::RuntimeException ); + void SAL_CALL implcb_destroy() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -281,10 +274,10 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL createWindow ( const ANY& aPlatformWindowHandle , - sal_Bool bEmbedded ) throw( RUNTIMEEXCEPTION ); - void SAL_CALL implcb_createWindow ( const ANY& aPlatformWindowHandle , - sal_Bool bEmbedded ) throw( RUNTIMEEXCEPTION ); + void SAL_CALL createWindow ( const css::uno::Any& aPlatformWindowHandle , + sal_Bool bEmbedded ) throw( css::uno::RuntimeException ); + void SAL_CALL implcb_createWindow ( const css::uno::Any& aPlatformWindowHandle , + sal_Bool bEmbedded ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -298,17 +291,17 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL newStream ( const OUSTRING& sMIMEDescription, - const OUSTRING& sURL , - const OUSTRING& sFilter , - const REFERENCE< XINPUTSTREAM >& xStream , - const ANY& aSessionId ) throw( RUNTIMEEXCEPTION ); + void SAL_CALL newStream ( const ::rtl::OUString& sMIMEDescription, + const ::rtl::OUString& sURL , + const ::rtl::OUString& sFilter , + const css::uno::Reference< css::io::XInputStream >& xStream , + const css::uno::Any& aSessionId ) throw( css::uno::RuntimeException ); void SAL_CALL implcb_newStream - ( const OUSTRING& sMIMEDescription, - const OUSTRING& sURL , - const OUSTRING& sFilter , - const REFERENCE< XINPUTSTREAM >& xStream , - const ANY& aSessionId ) throw( RUNTIMEEXCEPTION ); + ( const ::rtl::OUString& sMIMEDescription, + const ::rtl::OUString& sURL , + const ::rtl::OUString& sFilter , + const css::uno::Reference< css::io::XInputStream >& xStream , + const css::uno::Any& aSessionId ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -322,14 +315,14 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL newURL ( const OUSTRING& sMIMEDescription, - const OUSTRING& sURL , - const OUSTRING& sFilter , - const ANY& aSessionId ) throw( RUNTIMEEXCEPTION ); - void SAL_CALL implcb_newURL ( const OUSTRING& sMIMEDescription, - const OUSTRING& sURL , - const OUSTRING& sFilter , - const ANY& aSessionId ) throw( RUNTIMEEXCEPTION ); + void SAL_CALL newURL ( const ::rtl::OUString& sMIMEDescription, + const ::rtl::OUString& sURL , + const ::rtl::OUString& sFilter , + const css::uno::Any& aSessionId ) throw( css::uno::RuntimeException ); + void SAL_CALL implcb_newURL ( const ::rtl::OUString& sMIMEDescription, + const ::rtl::OUString& sURL , + const ::rtl::OUString& sFilter , + const css::uno::Any& aSessionId ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -343,9 +336,9 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL getHttpServerURL( OUSTRING& sHost , - sal_uInt16& nPort , - OUSTRING& sPrefix ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL getHttpServerURL( ::rtl::OUString& sHost , + sal_uInt16& nPort , + ::rtl::OUString& sPrefix ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XDispatchProvider @@ -363,9 +356,9 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XDISPATCH > SAL_CALL queryDispatch( const UNOURL& aURL , - const OUSTRING& sTargetFrameName, - sal_Int32 nSearchFlags ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL , + const ::rtl::OUString& sTargetFrameName, + sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -379,7 +372,7 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescripts ) throw( RUNTIMEEXCEPTION ); + virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescripts ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XStatusListener @@ -397,7 +390,7 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL statusChanged( const FEATURESTATEEVENT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& aEvent ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XEventListener @@ -415,45 +408,7 @@ class PlugInFrame : public XINITIALIZATION , @onerror - *//*-*****************************************************************************************************/ - void SAL_CALL disposing( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); - - //--------------------------------------------------------------------------------------------------------- - // XDispatchProviderInterception - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short - - - @descr - - - @seealso - - @seealso - - - @param - - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - -//OBSOLETE virtual void SAL_CALL registerDispatchProviderInterceptor( const REFERENCE< XDISPATCHPROVIDERINTERCEPTOR >& xInterceptor ) throw( RUNTIMEEXCEPTION ); - - /*-****************************************************************************************************//** - @short - - - @descr - - - @seealso - - @seealso - - - @param - - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - -//OBSOLETE virtual void SAL_CALL releaseDispatchProviderInterceptor( const REFERENCE< XDISPATCHPROVIDERINTERCEPTOR >& xInterceptor ) throw( RUNTIMEEXCEPTION ); + void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -504,29 +459,25 @@ class PlugInFrame : public XINITIALIZATION , private: - sal_Bool impldbg_checkParameter_initialize ( const SEQUENCE< ANY >& seqArguments ); - sal_Bool impldbg_checkParameter_createWindow ( const ANY& aPlatformWindowHandle , - sal_Bool bEmbedded ); - sal_Bool impldbg_checkParameter_newStream ( const OUSTRING& sMIMEDescription , - const OUSTRING& sURL , - const OUSTRING& sFilter , - const REFERENCE< XINPUTSTREAM >& xStream ); - sal_Bool impldbg_checkParameter_newURL ( const OUSTRING& sMIMEDescription , - const OUSTRING& sURL , - const OUSTRING& sFilter ); - sal_Bool impldbg_checkParameter_getHttpServerURL ( OUSTRING& sHost , - sal_uInt16& nPort , - OUSTRING& sPrefix ); - sal_Bool impldbg_checkParameter_queryDispatch ( const UNOURL& aURL , - const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags ); - sal_Bool impldbg_checkParameter_queryDispatches ( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescripts ); - sal_Bool impldbg_checkParameter_statusChanged ( const FEATURESTATEEVENT& aEvent ); - sal_Bool impldbg_checkParameter_disposing ( const EVENTOBJECT& aEvent ); -/*OBSOLETE - sal_Bool impldbg_checkParameter_registerDispatchProviderInterceptor ( const REFERENCE< XDISPATCHPROVIDERINTERCEPTOR >& xInterceptor ); - sal_Bool impldbg_checkParameter_releaseDispatchProviderInterceptor ( const REFERENCE< XDISPATCHPROVIDERINTERCEPTOR >& xInterceptor ); -*/ + static sal_Bool impldbg_checkParameter_initialize ( const css::uno::Sequence< css::uno::Any >& seqArguments ); + static sal_Bool impldbg_checkParameter_createWindow ( const css::uno::Any& aPlatformWindowHandle , + sal_Bool bEmbedded ); + static sal_Bool impldbg_checkParameter_newStream ( const ::rtl::OUString& sMIMEDescription , + const ::rtl::OUString& sURL , + const ::rtl::OUString& sFilter , + const css::uno::Reference< css::io::XInputStream >& xStream ); + static sal_Bool impldbg_checkParameter_newURL ( const ::rtl::OUString& sMIMEDescription , + const ::rtl::OUString& sURL , + const ::rtl::OUString& sFilter ); + static sal_Bool impldbg_checkParameter_getHttpServerURL ( ::rtl::OUString& sHost , + sal_uInt16& nPort , + ::rtl::OUString& sPrefix ); + static sal_Bool impldbg_checkParameter_queryDispatch ( const css::util::URL& aURL , + const ::rtl::OUString& sTargetFrameName , + sal_Int32 nSearchFlags ); + static sal_Bool impldbg_checkParameter_queryDispatches ( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescripts ); + static sal_Bool impldbg_checkParameter_statusChanged ( const css::frame::FeatureStateEvent& aEvent ); + static sal_Bool impldbg_checkParameter_disposing ( const css::lang::EventObject& aEvent ); #endif // #ifdef ENABLE_ASSERTIONS @@ -537,14 +488,14 @@ class PlugInFrame : public XINITIALIZATION , private: - REFERENCE< XPLUGININSTANCEPEER > m_xPlugInInstancePeer ; /// Reference to UNO interface of PlugIn dll for communication with browser - REFERENCE< XPLUGINWINDOWPEER > m_xPlugInWindowPeer ; /// Reference to set child window at plugin window - SEQUENCE< PROPERTYVALUE > m_seqProperties ; /// Sequence of properties as arguments for load document - UNOURL m_aURL ; /// URL for document to load - sal_Bool m_bILoad ; /// PlugInFrame has a valid loader which load the document and wait for finished/cancelled - sal_Bool m_bIHaveDocument ; /// We have a document loaded successful. - REFERENCE< XDISPATCHPROVIDER > m_xPlugInDispatcher ; /// Dispatcher to forward dispatches to browser - REFERENCE< XMULTISERVICEFACTORY > m_xRemoteServiceManager ; /// reference to the remote uno service manager of our plugin dll! + css::uno::Reference< css::mozilla::XPluginInstancePeer > m_xPlugInInstancePeer ; /// Reference to UNO interface of PlugIn dll for communication with browser + css::uno::Reference< css::mozilla::XPluginWindowPeer > m_xPlugInWindowPeer ; /// Reference to set child window at plugin window + css::uno::Sequence< css::beans::PropertyValue > m_seqProperties ; /// Sequence of properties as arguments for load document + css::util::URL m_aURL ; /// URL for document to load + sal_Bool m_bILoad ; /// PlugInFrame has a valid loader which load the document and wait for finished/cancelled + sal_Bool m_bIHaveDocument ; /// We have a document loaded successful. + css::uno::Reference< css::frame::XDispatchProvider > m_xPlugInDispatcher ; /// Dispatcher to forward dispatches to browser + css::uno::Reference< css::lang::XMultiServiceFactory > m_xRemoteServiceManager ; /// reference to the remote uno service manager of our plugin dll! }; // class PlugInFrame @@ -569,7 +520,7 @@ enum eIMPL_PluginCommand NEWURL }; -class cIMPL_MainThreadExecutor : public SOLARTHREADEXECUTOR +class cIMPL_MainThreadExecutor : public ::vcl::SolarThreadExecutor { //------------------------------------------------------------------------------------------------------------- // public methods @@ -589,21 +540,21 @@ class cIMPL_MainThreadExecutor : public SOLARTHREADEXECUTOR @onerror - *//*-*****************************************************************************************************/ - cIMPL_MainThreadExecutor( eIMPL_PluginCommand eCommand , - PlugInFrame* pPluginInstance ); + cIMPL_MainThreadExecutor( eIMPL_PluginCommand eCommand , + PlugInFrame* pPluginInstance ); - cIMPL_MainThreadExecutor( eIMPL_PluginCommand eCommand , - PlugInFrame* pPluginInstance , - const ANY& aPlatformWindowHandle , - sal_Bool bEmbedded ); + cIMPL_MainThreadExecutor( eIMPL_PluginCommand eCommand , + PlugInFrame* pPluginInstance , + const css::uno::Any& aPlatformWindowHandle , + sal_Bool bEmbedded ); - cIMPL_MainThreadExecutor( eIMPL_PluginCommand eCommand , - PlugInFrame* pPluginInstance , - const OUSTRING& sMIMEDescription , - const OUSTRING& sURL , - const OUSTRING& sFilter , - const REFERENCE< XINPUTSTREAM >& xStream , - const ANY& aSessionId ); + cIMPL_MainThreadExecutor( eIMPL_PluginCommand eCommand , + PlugInFrame* pPluginInstance , + const ::rtl::OUString& sMIMEDescription , + const ::rtl::OUString& sURL , + const ::rtl::OUString& sFilter , + const css::uno::Reference< css::io::XInputStream >& xStream , + const css::uno::Any& aSessionId ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -630,15 +581,15 @@ class cIMPL_MainThreadExecutor : public SOLARTHREADEXECUTOR //------------------------------------------------------------------------------------------------------------- private: - eIMPL_PluginCommand m_eCommand ; /// switch to specify forward function - PlugInFrame* m_pPluginInstance ; /// instance wich has started this swicth mechanism and wish to called back from us - ANY m_aPlatformWindowHandle ; /// parameter for XPluginInstance->createWindow() - sal_Bool m_bEmbedded ; /// parameter for XPluginInstance->createWindow() - OUSTRING m_sMIMEDescription ; /// parameter for XPluginInstance->newStream()/newURL() - OUSTRING m_sURL ; /// parameter for XPluginInstance->newStream()/newURL() - OUSTRING m_sFilter ; /// parameter for XPluginInstance->newStream()/newURL() - REFERENCE< XINPUTSTREAM > m_xStream ; /// parameter for XPluginInstance->newStream()/newURL() - ANY m_aSessionId ; /// parameter for XPluginInstance->newStream()/newURL() + eIMPL_PluginCommand m_eCommand ; /// switch to specify forward function + PlugInFrame* m_pPluginInstance ; /// instance wich has started this swicth mechanism and wish to called back from us + css::uno::Any m_aPlatformWindowHandle ; /// parameter for XPluginInstance->createWindow() + sal_Bool m_bEmbedded ; /// parameter for XPluginInstance->createWindow() + ::rtl::OUString m_sMIMEDescription ; /// parameter for XPluginInstance->newStream()/newURL() + ::rtl::OUString m_sURL ; /// parameter for XPluginInstance->newStream()/newURL() + ::rtl::OUString m_sFilter ; /// parameter for XPluginInstance->newStream()/newURL() + css::uno::Reference< css::io::XInputStream > m_xStream ; /// parameter for XPluginInstance->newStream()/newURL() + css::uno::Any m_aSessionId ; /// parameter for XPluginInstance->newStream()/newURL() }; } // namespace framework diff --git a/framework/inc/services/task.hxx b/framework/inc/services/task.hxx index 7574a40902..6a4df34d7a 100644 --- a/framework/inc/services/task.hxx +++ b/framework/inc/services/task.hxx @@ -2,9 +2,9 @@ * * $RCSfile: task.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: as $ $Date: 2001-03-09 14:42:24 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -127,18 +127,6 @@ namespace framework{ -#define ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException -#define IPROPERTYARRAYHELPER ::cppu::IPropertyArrayHelper -#define OBROADCASTHELPER ::cppu::OBroadcastHelper -#define OPROPERTYSETHELPER ::cppu::OPropertySetHelper -#define PROPERTY ::com::sun::star::beans::Property -#define UNOPOINT ::com::sun::star::awt::Point -#define UNOSIZE ::com::sun::star::awt::Size -#define XPROPERTYSETINFO ::com::sun::star::beans::XPropertySetInfo -#define XTASK ::com::sun::star::frame::XTask -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define EXCEPTION ::com::sun::star::uno::Exception - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -158,10 +146,10 @@ namespace framework{ OPropertySet *//*-*************************************************************************************************************/ -class Task : public XTASK , // => XFrame => XComponent - public Frame , // Order of baseclasses is neccessary for right initialization! - public OBROADCASTHELPER , - public OPROPERTYSETHELPER +class Task : public css::frame::XTask , // => XFrame => XComponent + public Frame , // Order of baseclasses is neccessary for right initialization! + public ::cppu::OBroadcastHelper , + public ::cppu::OPropertySetHelper { //------------------------------------------------------------------------------------------------------------- // public methods @@ -188,7 +176,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - Task( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); + Task( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); /*-****************************************************************************************************//** @short standard destructor @@ -232,7 +220,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL close() throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL close() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -248,7 +236,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL tileWindows() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL tileWindows() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -264,7 +252,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL arrangeWindowsVertical() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL arrangeWindowsVertical() throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -280,7 +268,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL arrangeWindowsHorizontal() throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL arrangeWindowsHorizontal() throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XComponent @@ -301,19 +289,19 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL dispose() throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL dispose() throw( css::uno::RuntimeException ) { Frame::dispose(); } /*-*******************************************************************************************************/ - virtual void SAL_CALL addEventListener( const REFERENCE< XEVENTLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException ) { Frame::addEventListener( xListener ); } /*-*******************************************************************************************************/ - virtual void SAL_CALL removeEventListener( const REFERENCE< XEVENTLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException ) { Frame::removeEventListener( xListener ); } @@ -337,92 +325,89 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL initialize( const REFERENCE< XWINDOW >& xWindow ) throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL initialize( const css::uno::Reference< css::awt::XWindow >& xWindow ) throw( css::uno::RuntimeException ) { Frame::initialize( xWindow ); } - virtual REFERENCE< XWINDOW > SAL_CALL getContainerWindow() throw( RUNTIMEEXCEPTION ) + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getContainerWindow() throw( css::uno::RuntimeException ) { return Frame::getContainerWindow(); } - virtual void SAL_CALL setCreator( const REFERENCE< XFRAMESSUPPLIER >& xCreator ) throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL setCreator( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ) throw( css::uno::RuntimeException ) { Frame::setCreator( xCreator ); } - virtual REFERENCE< XFRAMESSUPPLIER > SAL_CALL getCreator() throw( RUNTIMEEXCEPTION ) + virtual css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL getCreator() throw( css::uno::RuntimeException ) { return Frame::getCreator(); } - virtual OUSTRING SAL_CALL getName() throw( RUNTIMEEXCEPTION ) + virtual ::rtl::OUString SAL_CALL getName() throw( css::uno::RuntimeException ) { return Frame::getName(); } - virtual void SAL_CALL setName( const OUSTRING& sName ) throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL setName( const ::rtl::OUString& sName ) throw( css::uno::RuntimeException ) { Frame::setName( sName ); } - virtual sal_Bool SAL_CALL isTop() throw( RUNTIMEEXCEPTION ) + virtual sal_Bool SAL_CALL isTop() throw( css::uno::RuntimeException ) { return Frame::isTop(); } - virtual void SAL_CALL activate() throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL activate() throw( css::uno::RuntimeException ) { Frame::activate(); } - virtual void SAL_CALL deactivate() throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL deactivate() throw( css::uno::RuntimeException ) { Frame::deactivate(); } - virtual sal_Bool SAL_CALL isActive() throw( RUNTIMEEXCEPTION ) + virtual sal_Bool SAL_CALL isActive() throw( css::uno::RuntimeException ) { return Frame::isActive(); } - virtual sal_Bool SAL_CALL setComponent( const REFERENCE< XWINDOW >& xComponentWindow , - const REFERENCE< XCONTROLLER >& xController ) throw( RUNTIMEEXCEPTION ) + virtual sal_Bool SAL_CALL setComponent( const css::uno::Reference< css::awt::XWindow >& xComponentWindow , + const css::uno::Reference< css::frame::XController >& xController ) throw( css::uno::RuntimeException ) { return Frame::setComponent( xComponentWindow, xController ); } - virtual REFERENCE< XWINDOW > SAL_CALL getComponentWindow() throw( RUNTIMEEXCEPTION ) + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow() throw( css::uno::RuntimeException ) { return Frame::getComponentWindow(); } - virtual REFERENCE< XCONTROLLER > SAL_CALL getController() throw( RUNTIMEEXCEPTION ) + virtual css::uno::Reference< css::frame::XController > SAL_CALL getController() throw( css::uno::RuntimeException ) { return Frame::getController(); } - virtual void SAL_CALL contextChanged() throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL contextChanged() throw( css::uno::RuntimeException ) { Frame::contextChanged(); } - virtual void SAL_CALL addFrameActionListener( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL addFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException ) { Frame::addFrameActionListener( xListener ); } - virtual void SAL_CALL removeFrameActionListener( const REFERENCE< XFRAMEACTIONLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ) + virtual void SAL_CALL removeFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException ) { Frame::removeFrameActionListener( xListener ); } - virtual REFERENCE< XFRAME > SAL_CALL findFrame( const OUSTRING& sTargetFrameName , - sal_Int32 nSearchFlags ) throw( RUNTIMEEXCEPTION ); -// { -// return Frame::findFrame( sTargetFrameName, nSearchFlags ); -// } + virtual css::uno::Reference< css::frame::XFrame > SAL_CALL findFrame( const ::rtl::OUString& sTargetFrameName , + sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XTopWindowListener @@ -443,7 +428,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowClosing( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowClosing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -460,7 +445,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowActivated( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowActivated( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -477,7 +462,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL windowDeactivated( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL windowDeactivated( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); //--------------------------------------------------------------------------------------------------------- // XEventListener @@ -498,7 +483,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL disposing( const EVENTOBJECT& aEvent ) throw( RUNTIMEEXCEPTION ); + virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -532,10 +517,10 @@ class Task : public XTASK , // => XFrame => XComponent @onerror IllegalArgumentException, if you call this with an invalid argument *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL convertFastPropertyValue( ANY& aConvertedValue , - ANY& aOldValue , - sal_Int32 nHandle , - const ANY& aValue ) throw( ILLEGALARGUMENTEXCEPTION ); + virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& aConvertedValue , + css::uno::Any& aOldValue , + sal_Int32 nHandle , + const css::uno::Any& aValue ) throw( css::lang::IllegalArgumentException ); /*-****************************************************************************************************//** @short set value of a transient property @@ -554,8 +539,8 @@ class Task : public XTASK , // => XFrame => XComponent @onerror An exception is thrown. *//*-*****************************************************************************************************/ - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle , - const ANY& aValue ) throw( EXCEPTION ); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle , + const css::uno::Any& aValue ) throw( css::uno::Exception ); /*-****************************************************************************************************//** @short get value of a transient property @@ -572,8 +557,8 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual void SAL_CALL getFastPropertyValue( ANY& aValue , - sal_Int32 nHandle ) const; + virtual void SAL_CALL getFastPropertyValue( css::uno::Any& aValue , + sal_Int32 nHandle ) const; /*-****************************************************************************************************//** @short return structure and information about transient properties @@ -589,7 +574,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual IPROPERTYARRAYHELPER& SAL_CALL getInfoHelper(); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); /*-****************************************************************************************************//** @short return propertysetinfo @@ -607,7 +592,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - virtual REFERENCE< XPROPERTYSETINFO > SAL_CALL getPropertySetInfo(); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(); //------------------------------------------------------------------------------------------------------------- // private methods @@ -615,7 +600,7 @@ class Task : public XTASK , // => XFrame => XComponent private: - DECL_LINK( Close_Impl, void* ); + DECL_LINK( Close_Impl, void* ); /*-****************************************************************************************************//** @short - @@ -630,22 +615,22 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - sal_Bool impl_tryToChangeProperty( sal_Bool bProperty , - const ANY& aValue , - ANY& aOldValue , - ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); - sal_Bool impl_tryToChangeProperty( const OUSTRING& sProperty , - const ANY& aValue , - ANY& aOldValue , - ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); - sal_Bool impl_tryToChangeProperty( const UNOPOINT& aProperty , - const ANY& aValue , - ANY& aOldValue , - ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); - sal_Bool impl_tryToChangeProperty( const UNOSIZE& aProperty , - const ANY& aValue , - ANY& aOldValue , - ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); + sal_Bool impl_tryToChangeProperty( sal_Bool bProperty , + const css::uno::Any& aValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); + sal_Bool impl_tryToChangeProperty( const ::rtl::OUString& sProperty , + const css::uno::Any& aValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); + sal_Bool impl_tryToChangeProperty( const css::awt::Point& aProperty , + const css::uno::Any& aValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); + sal_Bool impl_tryToChangeProperty( const css::awt::Size& aProperty , + const css::uno::Any& aValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException ); /*-****************************************************************************************************//** @short - @@ -660,7 +645,7 @@ class Task : public XTASK , // => XFrame => XComponent @onerror - *//*-*****************************************************************************************************/ - static const SEQUENCE< PROPERTY > impl_getStaticPropertyDescriptor(); + static const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); //------------------------------------------------------------------------------------------------------------- // debug methods @@ -697,17 +682,17 @@ class Task : public XTASK , // => XFrame => XComponent protected: // But some values are neede by derived classes! - sal_Bool m_bIsPlugIn ; /// In objects of these class this member is set to FALSE. - /// But in derived class PlugInFrame it's overwrited with TRUE! + sal_Bool m_bIsPlugIn ; /// In objects of these class this member is set to FALSE. + /// But in derived class PlugInFrame it's overwrited with TRUE! private: // Properties sal_Bool m_bIsAlwaysVisible ; sal_Bool m_bIsFloating ; - UNOPOINT m_aPosition ; - UNOSIZE m_aSize ; - OUSTRING m_sTitle ; + css::awt::Point m_aPosition ; + css::awt::Size m_aSize ; + ::rtl::OUString m_sTitle ; ::vcl::EventPoster m_aPoster ; }; // class Tasks diff --git a/framework/inc/services/urltransformer.hxx b/framework/inc/services/urltransformer.hxx index 2a728ab7f5..76c2af5dbf 100644 --- a/framework/inc/services/urltransformer.hxx +++ b/framework/inc/services/urltransformer.hxx @@ -2,9 +2,9 @@ * * $RCSfile: urltransformer.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2001-01-26 08:39:19 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,6 +90,10 @@ #include <macros/xserviceinfo.hxx> #endif +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -116,18 +120,6 @@ namespace framework{ -#define ANY ::com::sun::star::uno::Any -#define OUSTRING ::rtl::OUString -#define OWEAKOBJECT ::cppu::OWeakObject -#define REFERENCE ::com::sun::star::uno::Reference -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define UNOTYPE ::com::sun::star::uno::Type -#define UNOURL ::com::sun::star::util::URL -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define XSERVICEINFO ::com::sun::star::lang::XServiceInfo -#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider -#define XURLTRANSFORMER ::com::sun::star::util::XURLTransformer - //_________________________________________________________________________________________________________________ // exported const //_________________________________________________________________________________________________________________ @@ -150,12 +142,11 @@ namespace framework{ OWeakObject *//*-*************************************************************************************************************/ -//class URLTransformer : DERIVE_FROM_XSPECIALDEBUGINTERFACE // => These macro will expand to nothing, if no testmode is set in debug.h! -class URLTransformer : public XTYPEPROVIDER , - public XSERVICEINFO , - public XURLTRANSFORMER , +class URLTransformer : public css::lang::XTypeProvider , + public css::lang::XServiceInfo , + public css::util::XURLTransformer , public OMutexMember , - public OWEAKOBJECT + public ::cppu::OWeakObject { //------------------------------------------------------------------------------------------------------------- // public methods @@ -179,7 +170,7 @@ class URLTransformer : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - URLTransformer( const REFERENCE< XMULTISERVICEFACTORY >& sFactory ); + URLTransformer( const css::uno::Reference< css::lang::XMultiServiceFactory >& sFactory ); /*-****************************************************************************************************//** @short - @@ -202,7 +193,6 @@ class URLTransformer : public XTYPEPROVIDER , DECLARE_XINTERFACE DECLARE_XTYPEPROVIDER DECLARE_XSERVICEINFO -// DECLARE_XSPECIALDEBUGINTERFACE // => These macro will expand to nothing, if no testmode is set in debug.h! //--------------------------------------------------------------------------------------------------------- // XURLTransformer @@ -220,7 +210,7 @@ class URLTransformer : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL parseStrict( UNOURL& aURL ) throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL parseStrict( css::util::URL& aURL ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -234,8 +224,8 @@ class URLTransformer : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL parseSmart( UNOURL& aURL , - const OUSTRING& sSmartProtocol ) throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL parseSmart( css::util::URL& aURL , + const ::rtl::OUString& sSmartProtocol ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -249,7 +239,7 @@ class URLTransformer : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual sal_Bool SAL_CALL assemble( UNOURL& aURL ) throw( RUNTIMEEXCEPTION ); + virtual sal_Bool SAL_CALL assemble( css::util::URL& aURL ) throw( css::uno::RuntimeException ); /*-****************************************************************************************************//** @short - @@ -263,8 +253,8 @@ class URLTransformer : public XTYPEPROVIDER , @onerror - *//*-*****************************************************************************************************/ - virtual OUSTRING SAL_CALL getPresentation( const UNOURL& aURL , - sal_Bool bWithPassword ) throw( RUNTIMEEXCEPTION ); + virtual ::rtl::OUString SAL_CALL getPresentation( const css::util::URL& aURL , + sal_Bool bWithPassword ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------------------------------- // protected methods @@ -301,13 +291,13 @@ class URLTransformer : public XTYPEPROVIDER , private: - sal_Bool impldbg_checkParameter_URLTransformer ( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); - sal_Bool impldbg_checkParameter_parseStrict ( UNOURL& aURL ); - sal_Bool impldbg_checkParameter_parseSmart ( UNOURL& aURL , - const OUSTRING& sSmartProtocol ); - sal_Bool impldbg_checkParameter_assemble ( UNOURL& aURL ); - sal_Bool impldbg_checkParameter_getPresentation ( const UNOURL& aURL , - sal_Bool bWithPassword ); + static sal_Bool impldbg_checkParameter_URLTransformer ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + static sal_Bool impldbg_checkParameter_parseStrict ( css::util::URL& aURL ); + static sal_Bool impldbg_checkParameter_parseSmart ( css::util::URL& aURL , + const ::rtl::OUString& sSmartProtocol ); + static sal_Bool impldbg_checkParameter_assemble ( css::util::URL& aURL ); + static sal_Bool impldbg_checkParameter_getPresentation ( const css::util::URL& aURL , + sal_Bool bWithPassword ); #endif // #ifdef ENABLE_ASSERTIONS @@ -318,7 +308,7 @@ class URLTransformer : public XTYPEPROVIDER , private: - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; /// reference to factory, which has created this instance + css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// reference to factory, which has created this instance }; // class URLTransformer diff --git a/framework/inc/targets.h b/framework/inc/targets.h new file mode 100644 index 0000000000..cab0d83512 --- /dev/null +++ b/framework/inc/targets.h @@ -0,0 +1,96 @@ +/************************************************************************* + * + * $RCSfile: targets.h,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_TARGETS_H_ +#define __FRAMEWORK_TARGETS_H_ + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ +#include <macros/generic.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// Values for special frame search ... sTargetFrameName of findFrame() or queryDispatch() or loadComponentFromURL() +//_________________________________________________________________________________________________________________ + +#define SPECIALTARGET_SELF DECLARE_ASCII("_self" ) // The frame himself is searched. +#define SPECIALTARGET_PARENT DECLARE_ASCII("_parent" ) // The direct parent frame is searched. +#define SPECIALTARGET_TOP DECLARE_ASCII("_top" ) // Search at ouer parents for the first task (if any exist) or a frame without a parent. +#define SPECIALTARGET_BLANK DECLARE_ASCII("_blank" ) // Create a new task. +#define SPECIALTARGET_BEAMER DECLARE_ASCII("_beamer" ) // special frame in hierarchy +/* not supported yet! +#define SPECIALTARGET_DOCUMENT DECLARE_ASCII("_document" ) +#define SPECIALTARGET_EXPLORER DECLARE_ASCII("_explorer" ) +#define SPECIALTARGET_PARTWINDOW DECLARE_ASCII("_partwindow" ) +*/ + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_TARGETS_H_ diff --git a/framework/inc/threadhelp/fairrwlock.hxx b/framework/inc/threadhelp/fairrwlock.hxx new file mode 100644 index 0000000000..6b5433ac84 --- /dev/null +++ b/framework/inc/threadhelp/fairrwlock.hxx @@ -0,0 +1,338 @@ +/************************************************************************* + * + * $RCSfile: fairrwlock.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:11 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_THREADHELP_FAIRRWLOCK_HXX_ +#define __FRAMEWORK_THREADHELP_FAIRRWLOCK_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_INONCOPYABLE_H_ +#include <threadhelp/inoncopyable.h> +#endif + +#ifndef __FRAMEWORK_THREADHELP_IRWLOCK_H_ +#include <threadhelp/irwlock.h> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#ifndef _OSL_CONDITN_HXX_ +#include <osl/conditn.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @short implement a read/write lock with fairness between read/write accessors + @descr These implementation never should used as base class! Use it as a member every time. + Use ReadGuard and/or WriteGuard in your methods (which work with these lock) + to make your code threadsafe. + Fair means: All reading or writing threads are synchronized AND serialzed by using one + mutex. For reader this mutex is used to access internal variables of this lock only; + for writer this mutex is used to have an exclusiv access on your class member! + => It's a multi-reader/single-writer lock, which no preferred accessor. + + @implements - + @base IRWLock + + @devstatus ready to use +*//*-*************************************************************************************************************/ + +class FairRWLock : private INonCopyAble + , public IRWLock +{ + //------------------------------------------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------------------------------------------- + public: + + /*-****************************************************************************************************//** + @short standard ctor + @descr Initialize instance with right start values for correct working. + no reader could exist => m_nReadCount = 0 + user initialize himself => m_eWorkingMode = E_INIT + don't block first comming writer => m_aWriteCondition.set() + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + FairRWLock(); + + /*-****************************************************************************************************//** + @short set new working mode for this lock + @descr These lock implementation knows three states of working: E_INIT, E_WORK, E_CLOSE + You can step during this ones only from the left to the right side and start at left side again! + (This is neccessary e.g. for refcounted objects!) + Follow results occure: + E_INIT : All requests on this lock are refused. + It's your decision to react in a right way. + Otherwise this call will block till write access to internal member is available. + + E_WORK : The object work now. The full functionality is available. + This set-call will block till write access to internal member is available. + + E_CLOSE : All further requests on this lock will be refused. + It's your decision to react in a right way. + This set-call will block till write access to internal member is available AND + all current reader or writer are gone! + + @seealso - + + @param "eMode", is the new mode - but we don't accept setting mode in wrong order! + @return - + + @onerror We do nothing. + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL setWorkingMode( EWorkingMode eMode ); + + /*-****************************************************************************************************//** + @short get current working mode + @descr If you stand in your close() or init() method ... but don't know + if you called more then ones(!) ... you can use this function to get + right information. + e.g: You have a method init() which is used to change working mode from + E_INIT to E_WORK and should be used to initialize some member too ... + What should you do: + void init( sal_Int32 nValue ) + { + // Best place to initialize internal member is before you call + // setWorkingMode() ... but if somewhere call this function + // more then ones ... + // => check current mode before! + + if( m_aLock.getWorkingMode() == E_INIT ) + { + // OK - This is the first call of init(). + // Set new value and change mode then. + + m_nMember = nValue; + m_aLock.setWorkingMode( E_WORK ); + + // After that it's not a good idea to work with internal member + // without using the lock! + } + } + + @attention I think it's an easy method - we don't need any mutex here! + + @seealso method setWorkingMode() + + @param - + @return Current set mode. + + @onerror No error should occure. + *//*-*****************************************************************************************************/ + + virtual EWorkingMode SAL_CALL getWorkingMode(); + + /*-****************************************************************************************************//** + @short set lock for reading + @descr A guard should call this method to acquire read access on your member. + Writing isn't allowed then - but nobody could check it for you! + You must look for a possible refused call by check given parameter - eReason! + What you should do then is your problem ... but there is no access to + safed variables allowed! + + @seealso method setWorkingMode() + @seealso method releaseReadAccess() + + @param "eRejectReason", is the reason for rejected calls. + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL acquireReadAccess( ERefusalReason& eReason ); + + /*-****************************************************************************************************//** + @short reset lock for reading + @descr A guard should call this method to release read access on your member. + + @seealso method acquireReadAccess() + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL releaseReadAccess(); + + /*-****************************************************************************************************//** + @short set lock for writing + @descr A guard should call this method to acquire write access on your member. + Reading is allowed too - of course. + You must look for a possible refused call by check given parameter - eReason! + What you should do then is your problem ... but there is no access to + safed variables allowed! + After successfully calling of this method you are the only writer. + + @seealso method setWorkingMode() + @seealso method releaseWriteAccess() + + @param "eRejectReason", is the reason for rejected calls. + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL acquireWriteAccess( ERefusalReason& eReason ); + + /*-****************************************************************************************************//** + @short reset lock for writing + @descr A guard should call this method to release write access on your member. + + @seealso method acquireWriteAccess() + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL releaseWriteAccess(); + + /*-****************************************************************************************************//** + @short downgrade a write access to a read access + @descr A guard should call this method to change a write to a read access. + New readers can work too - new writer are blocked! + + @attention Don't call this method if you are not a writer! + Results are not defined then ... + An upgrade can't be implemented realy ... because acquiring new access + will be the same - there no differences! + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL downgradeWriteAccess(); + + //------------------------------------------------------------------------------------------------------------- + // private methods + //------------------------------------------------------------------------------------------------------------- + private: + + /*-****************************************************************************************************//** + @short used to check if calls must be refused + @descr If our internal state isn't E_WORK we must refuse all requests! + + @seealso acquire methods + + @param "eReason", is used to give you the reason for refused calls + @return true , if call must refused + false, otherwise + + @onerror No error can occure. + *//*-*****************************************************************************************************/ + + sal_Bool impl_isCallRefused( ERefusalReason& eReason ); + + //------------------------------------------------------------------------------------------------------------- + // private member + //------------------------------------------------------------------------------------------------------------- + private: + + ::osl::Mutex m_aAccessLock ; /// regulate access on internal member of this instance + EWorkingMode m_eWorkingMode ; /// current working mode of object which use this lock (used to reject calls at wrong time) + ::osl::Mutex m_aSerializer ; /// serialze incoming read/write access threads + ::osl::Condition m_aWriteCondition ; /// a writer must wait till current working reader are gone + sal_Int32 m_nReadCount ; /// every reader is registered - the last one open the door for waiting writer + +}; // class FairRWLock + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_THREADHELP_FAIRRWLOCK_HXX_ diff --git a/framework/inc/threadhelp/gate.hxx b/framework/inc/threadhelp/gate.hxx new file mode 100644 index 0000000000..fc43e80015 --- /dev/null +++ b/framework/inc/threadhelp/gate.hxx @@ -0,0 +1,247 @@ +/************************************************************************* + * + * $RCSfile: gate.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:11 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_THREADHELP_GATE_HXX_ +#define __FRAMEWORK_THREADHELP_GATE_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_INONCOPYABLE_H_ +#include <threadhelp/inoncopyable.h> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#ifndef _OSL_CONDITN_HXX_ +#include <osl/conditn.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @short implement a gate to block multiple threads at same time or unblock all + @descr A gate can be used as a negative-condition! You can open a "door" - wait() will not block ... + or you can close it - wait() blocks till open() is called again. + As a special feature you can open the gate a little bit by sing openGap(). + Then all currently waiting threads are running immediately - but new ones are blocked! + + @attention To prevent us against wrong using, the default ctor, copy ctor and the =operator are maked private! + + @implements - + @base - + + @devstatus ready to use +*//*-*************************************************************************************************************/ + +class Gate : private INonCopyAble +{ + //------------------------------------------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------------------------------------------- + public: + + /*-****************************************************************************************************//** + @short ctor + @descr These initialize the object right as an open gate. + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + Gate(); + + /*-****************************************************************************************************//** + @short dtor + @descr Is user forget it - we open the gate ... + blocked threads can running ... but I don't know + if it's right - we are destroyed yet!? + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ~Gate(); + + /*-****************************************************************************************************//** + @short open the gate + @descr A wait() call will not block then. + + @seealso method close() + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void open(); + + /*-****************************************************************************************************//** + @short close the gate + @descr A wait() call will block then. + + @seealso method open() + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void close(); + + /*-****************************************************************************************************//** + @short open gate for current waiting threads + @descr All current waiting threads stand in wait() at line "m_aPassage.wait()" ... + With this call you can open the passage for these waiting ones. + The "gap" is closed by any new thread which call wait() automaticly! + + @seealso method wait() + @seealso method open() + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void openGap(); + + /*-****************************************************************************************************//** + @short must be called to pass the gate + @descr If gate "open" => wait() will not block. + If gate "closed" => wait() will block till somewhere open it again. + If gap "open" => currently waiting threads unblocked, new ones blocked + + @seealso method wait() + @seealso method open() + + @param "pTimeOut", optional parameter to wait a certain time + @return true, if wait was successful (gate was opened) + false, if condition has an error or timeout was reached! + + @onerror We return false. + *//*-*****************************************************************************************************/ + + sal_Bool wait( const TimeValue* pTimeOut = NULL ); + + /*-****************************************************************************************************//** + @short get information about current opening state + @descr Use it if you not shure what going on ... but I think this never should realy neccessary! + + @seealso - + + @param - + @return true, if gate is open + false, otherwise + + @onerror No error could occure! + *//*-*****************************************************************************************************/ + + sal_Bool isOpen() const; + + //------------------------------------------------------------------------------------------------------------- + // private member + //------------------------------------------------------------------------------------------------------------- + private: + + ::osl::Mutex m_aAccessLock ; + ::osl::Condition m_aPassage ; + sal_Bool m_bClosed ; + sal_Bool m_bGapOpen ; + +}; // class Gate + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_THREADHELP_GATE_HXX_ diff --git a/framework/inc/threadhelp/inoncopyable.h b/framework/inc/threadhelp/inoncopyable.h new file mode 100644 index 0000000000..4b448d323e --- /dev/null +++ b/framework/inc/threadhelp/inoncopyable.h @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: inoncopyable.h,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:11 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_THREADHELP_INONCOPYABLE_H_ +#define __FRAMEWORK_THREADHELP_INONCOPYABLE_H_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @descr Use this as one of your base classes to disable + all possiblities to copy or assign one object to another one! + We declare neccessary functions private to do so. +*//*-*************************************************************************************************************/ + +class INonCopyAble +{ + public: + + INonCopyAble() {} + + private: + + INonCopyAble ( const INonCopyAble& rCopy ); + INonCopyAble& operator= ( const INonCopyAble& rCopy ); + +}; // class INonCopyAble + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_THREADHELP_INONCOPYABLE_H_ diff --git a/framework/inc/threadhelp/irwlock.h b/framework/inc/threadhelp/irwlock.h new file mode 100644 index 0000000000..f7c7880a04 --- /dev/null +++ b/framework/inc/threadhelp/irwlock.h @@ -0,0 +1,162 @@ +/************************************************************************* + * + * $RCSfile: irwlock.h,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:11 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_THREADHELP_IRWLOCK_H_ +#define __FRAMEWORK_THREADHELP_IRWLOCK_H_ + +//_________________________________________________________________________________________________________________ +// includes +//_________________________________________________________________________________________________________________ + +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @descr A guard (specialy a write guard) support different internal working states. + His lock can set for reading or writing/reading! Or he was unlocked by user ... +*//*-*************************************************************************************************************/ + +enum ELockMode +{ + E_NOLOCK , + E_READLOCK , + E_WRITELOCK +}; + +/*-************************************************************************************************************//** + @descr Describe different states of a feature of following implementation. + During live time of an object different working states occure: + initialization - working - closing/disposing + If you whish to implement thread safe classes you should use these feature to protect + your code against calls at wrong time. e.g. you are not full initialized but somewhere + call an interface method (initialize phase means startup time from creating object till + calling specified first method e.g. XInitialization::initialze()!) then you should refuse + this call. The same for closing/disposing object! +*//*-*************************************************************************************************************/ + +enum EWorkingMode +{ + E_INIT , + E_WORK , + E_CLOSE +}; + +/*-************************************************************************************************************//** + @descr If a request was refused by a lock implementation (internal state different E_WORK) + use can check the reason. +*//*-*************************************************************************************************************/ + +enum ERefusalReason +{ + E_NOREASON , + E_UNINITIALIZED , + E_CLOSED +}; + +/*-************************************************************************************************************//** + @descr We implement two guards for using an rw-lock. But if you wish to implement + different rw-locks to you will have problems by using with same guard implementation! + Thats why we define this "pure virtual base class" ... + All rw-locks must support this base interface for working and all guard must use this one too! +*//*-*************************************************************************************************************/ + +class IRWLock +{ + //------------------------------------------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------------------------------------------- + public: + + /*-****************************************************************************************************//** + @descr The dtor isn't realy important ... but if you whish to use derived classes + with any pointer ... you must have it! + *//*-*****************************************************************************************************/ + + virtual ~IRWLock() {} + + /*-****************************************************************************************************//** + @descr These function must be supported by a derived class! + *//*-*****************************************************************************************************/ + + virtual void SAL_CALL setWorkingMode ( EWorkingMode eMode ) = 0; + virtual EWorkingMode SAL_CALL getWorkingMode ( ) = 0; + virtual void SAL_CALL acquireReadAccess ( ERefusalReason& eReason ) = 0; + virtual void SAL_CALL releaseReadAccess ( ) = 0; + virtual void SAL_CALL acquireWriteAccess ( ERefusalReason& eReason ) = 0; + virtual void SAL_CALL releaseWriteAccess ( ) = 0; + virtual void SAL_CALL downgradeWriteAccess ( ) = 0; + +}; // class IRWLock + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_THREADHELP_IRWLOCK_H_ diff --git a/framework/inc/threadhelp/readguard.hxx b/framework/inc/threadhelp/readguard.hxx new file mode 100644 index 0000000000..e6fac3d91e --- /dev/null +++ b/framework/inc/threadhelp/readguard.hxx @@ -0,0 +1,236 @@ +/************************************************************************* + * + * $RCSfile: readguard.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:11 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_THREADHELP_READGUARD_HXX_ +#define __FRAMEWORK_THREADHELP_READGUARD_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_INONCOPYABLE_H_ +#include <threadhelp/inoncopyable.h> +#endif + +#ifndef __FRAMEWORK_THREADHELP_IRWLOCK_H_ +#include <threadhelp/irwlock.h> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @short implement a guard to set read locks + @descr This guard should be used to set a lock for reading object internal member. + Nobody can control it but don't use member after successfuly locking for writing! + We never need a own mutex to safe our internal member access - because + a guard is used as function-local member only. There exist no multithreaded access to it realy ... + + @attention 1) To prevent us against wrong using, the default ctor, copy ctor and the =operator are maked private! + 2) Every method support a return value "eReason". Use this value to react for refused lock-calls! + This means: You can't work with this object! We are not ready for working yet ... + React for that in a right way. + (see "irwlock.h" for further informations) + + @implements - + @base INonCopyAble + + @devstatus ready to use +*//*-*************************************************************************************************************/ + +class ReadGuard : private INonCopyAble +{ + //------------------------------------------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------------------------------------------- + public: + + /*-****************************************************************************************************//** + @short ctor + @descr These ctors initialize the guard with a reference to used lock member of object to protect. + Null isn't allowed as value! + + @seealso - + + @param "pLock", reference to used lock member of object to protect + @param "rLock", reference to used lock member of object to protect + @param "eReason", return value if call was refused + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ReadGuard( IRWLock* pLock , + ERefusalReason& eReason ); + ReadGuard( IRWLock& rLock , + ERefusalReason& eReason ); + + /*-****************************************************************************************************//** + @short dtor + @descr We unlock the used lock member automaticly if user forget it. + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ~ReadGuard(); + + /*-****************************************************************************************************//** + @short set read lock + @descr Call this method to set the read lock. The call will block till all current threads are synchronized! + If the return value right you can work ... If return value is different from E_NONE you have no permission! + May be the lock call was refused and must be handled in another way! + + @seealso method unlock() + + @param "eReason", return the reason for rejected calls + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void lock( ERefusalReason& eReason ); + + /*-****************************************************************************************************//** + @short unset read lock + @descr Call this method to unlock the rw-lock temp.! + Normaly we do it at dtor automaticly for you ... + + @seealso method lock() + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void unlock(); + + /*-****************************************************************************************************//** + @short return internal lock state + @descr For user they dont know what they are doing there ... + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + sal_Bool isLocked() const; + + //------------------------------------------------------------------------------------------------------------- + // private methods + //------------------------------------------------------------------------------------------------------------- + private: + + /*-****************************************************************************************************//** + @short disable using of these functions! + @descr It's not allowed to use this methods. Different problem can occure otherwise. + Thats why we disable it by make it private. + + @seealso other ctor + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ReadGuard(); + + //------------------------------------------------------------------------------------------------------------- + // private member + //------------------------------------------------------------------------------------------------------------- + private: + + IRWLock* m_pLock ; /// refrence to lock-member of protected object + sal_Bool m_bLocked ; /// protection against multiple lock calls without unlock! + +}; // class ReadGuard + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_THREADHELP_READGUARD_HXX_ diff --git a/framework/inc/threadhelp/resetableguard.hxx b/framework/inc/threadhelp/resetableguard.hxx new file mode 100644 index 0000000000..0f0f67276a --- /dev/null +++ b/framework/inc/threadhelp/resetableguard.hxx @@ -0,0 +1,236 @@ +/************************************************************************* + * + * $RCSfile: resetableguard.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:11 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_ +#define __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_INONCOPYABLE_H_ +#include <threadhelp/inoncopyable.h> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @short implement a guard for implementing save thread access + @descr These guard has an additional feature to well known one ::osl::Guard. + You can lock() and unlock() it very often! + A set bool flag inside protect this implementation against multiple lock() calls + without any unlock()! So the increasing of guarded mutex couldn't be greater then 1 ... + + @attention To prevent us against wrong using, the default ctor, copy ctor and the =operator are maked private! + + @implements - + @base INonCopyAble + + @devstatus ready to use +*//*-*************************************************************************************************************/ + +class ResetableGuard : private INonCopyAble +{ + //------------------------------------------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------------------------------------------- + public: + + /*-****************************************************************************************************//** + @short ctors + @descr Use these ctor methods to initialize the guard right. + Given mutex reference must be valid - otherwise crashes could occure! + + @seealso - + + @param "pMutex" pointer to mutex for using as lock + @param "rMutex" reference to mutex for using as lock + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ResetableGuard( ::osl::Mutex* pMutex ); + ResetableGuard( ::osl::Mutex& rMutex ); + + /*-****************************************************************************************************//** + @short dtor + @descr We must release set mutex if programmer forget it ... + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ~ResetableGuard(); + + /*-****************************************************************************************************//** + @short enable/disable the lock + @descr Use this methods to lock or unlock the mutex. + You can do it so often you wish to do that ... + + @attention We use another member to prevent us against multiple acquire calls of the same guard + without suitable release calls! + You don't must protect access at these bool member by using an own mutex .... + because nobody use the same guard instance from different threads! + It will be a function-local object every time. + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void lock(); + void unlock(); + + /*-****************************************************************************************************//** + @short try to lock the mutex + @descr Try to acquire the mutex without blocking. + + @seealso - + + @param - + @return true, if lock already set or could new acquired + false, otherwise + + @onerror No error could occure. + *//*-*****************************************************************************************************/ + + sal_Bool tryToLock(); + + /*-****************************************************************************************************//** + @short get information about current lock state + @descr Use it if you not shure what going on ... but I think this never should realy neccessary! + + @seealso - + + @param - + @return true, if lock is set + false, otherwise + + @onerror No error could occure! + *//*-*****************************************************************************************************/ + + sal_Bool isLocked() const; + + //------------------------------------------------------------------------------------------------------------- + // private methods + //------------------------------------------------------------------------------------------------------------- + private: + + /*-****************************************************************************************************//** + @short disable using of these functions! + @descr It's not allowed to use this methods. Different problem can occure otherwise. + Thats why we disable it by make it private. + + @seealso other ctor + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ResetableGuard(); + + //------------------------------------------------------------------------------------------------------------- + // private member + //------------------------------------------------------------------------------------------------------------- + private: + + ::osl::Mutex* m_pMutex ; /// pointer to safed mutex + sal_Bool m_bLocked ; /// protection against multiple lock() calls without unlock() + +}; // class ResetableGuard + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_ diff --git a/framework/inc/threadhelp/writeguard.hxx b/framework/inc/threadhelp/writeguard.hxx new file mode 100644 index 0000000000..82e1b232ff --- /dev/null +++ b/framework/inc/threadhelp/writeguard.hxx @@ -0,0 +1,253 @@ +/************************************************************************* + * + * $RCSfile: writeguard.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:11 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_THREADHELP_WRITEGUARD_HXX_ +#define __FRAMEWORK_THREADHELP_WRITEGUARD_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_INONCOPYABLE_H_ +#include <threadhelp/inoncopyable.h> +#endif + +#ifndef __FRAMEWORK_THREADHELP_IRWLOCK_H_ +#include <threadhelp/irwlock.h> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @short implement a guard to set write locks + @descr This guard should be used to set a lock for reading AND writing object internal member. + We never need a own mutex to safe our internal member access - because + a guard is used as function-local member only. There exist no multithreaded access to it realy ... + + @attention 1) To prevent us against wrong using, the default ctor, copy ctor and the =operator are maked private! + 2) Every method support a return value "eReason". Use this value to react for refused lock-calls! + this means: You can't work with this object! We are not ready for working yet ... + React for that in a right way. + (see irwlock.h for further informations) + + @implements - + @base INonCopyAble + + @devstatus ready to use +*//*-*************************************************************************************************************/ + +class WriteGuard : private INonCopyAble +{ + //------------------------------------------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------------------------------------------- + public: + + /*-****************************************************************************************************//** + @short ctor + @descr These ctors initialize the guard with a reference to used lock member of object to protect. + Null isn't allowed as value! + + @attention If eRefusalReason is different from E_WORK + + @seealso - + + @param "pLock", reference to used lock member of object to protect + @param "rLock", reference to used lock member of object to protect + @param "eReason", return value for working mode + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + WriteGuard( IRWLock* pLock , + ERefusalReason& eReason ); + + WriteGuard( IRWLock& rLock , + ERefusalReason& eReason ); + + /*-****************************************************************************************************//** + @short dtor + @descr We unlock the used lock member automaticly if user forget it. + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + ~WriteGuard(); + + /*-****************************************************************************************************//** + @short set write lock + @descr Call this method to set the write lock. The call will block till all current threads are synchronized! + + @attention You have to check "eReason". If is different from E_NONE your access to our member was refused! + + @seealso method unlock() + + @param "eReason", return the reason for refused calls + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void lock( ERefusalReason& eReason ); + + /*-****************************************************************************************************//** + @short unset write lock + @descr Call this method to unlock the rw-lock temp.! + Normaly we do it at dtor automaticly for you ... + + @seealso method lock() + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void unlock(); + + /*-****************************************************************************************************//** + @short downgrade write access to read access without new blocking! + @descr If this write lock is set you can change it to a "read lock". + An "upgrade" is the same like new calling "lock()"! + + @seealso - + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + void downgrade(); + + /*-****************************************************************************************************//** + @short return internal lock state + @descr For user they dont know what they are doing there ... + + @seealso - + + @param - + @return Current set lock mode. + + @onerror No error should occure. + *//*-*****************************************************************************************************/ + + ELockMode getMode() const; + + //------------------------------------------------------------------------------------------------------------- + // private methods + //------------------------------------------------------------------------------------------------------------- + private: + + /*-****************************************************************************************************//** + @short disable using of these functions! + @descr It's not allowed to use this methods. Different problem can occure otherwise. + Thats why we disable it by make it private. + + @seealso other ctor + + @param - + @return - + + @onerror - + *//*-*****************************************************************************************************/ + + WriteGuard(); + + //------------------------------------------------------------------------------------------------------------- + // private member + //------------------------------------------------------------------------------------------------------------- + private: + + IRWLock* m_pLock ; /// refrence to lock-member of protected object + ELockMode m_eMode ; /// protection against multiple lock calls without unlock and difference between supported lock modi + +}; // class WriteGuard + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_THREADHELP_WRITEGUARD_HXX_ diff --git a/framework/prj/build.lst b/framework/prj/build.lst index 8e0f15e75d..6306f7e6c3 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -1,10 +1,10 @@ fr framework : svtools NULL fr framework usr1 - all fr_mkout NULL fr framework\source\unotypes nmake - all fr_unotypes NULL -fr framework\source\classes nmake - all fr_classes fr_unotypes NULL -fr framework\source\helper nmake - all fr_helper fr_unotypes NULL -fr framework\source\services nmake - all fr_services fr_unotypes NULL -fr framework\source\logindialog nmake - all fr_logindialog fr_unotypes NULL -fr framework\source\application nmake - all fr_application fr_unotypes NULL -fr framework\source\register nmake - all fr_register fr_unotypes NULL -fr framework\util nmake - all fr_util fr_application fr_classes fr_helper fr_register fr_services NULL +fr framework\source\threadhelp nmake - all fr_threadhelp NULL +fr framework\source\classes nmake - all fr_classes fr_unotypes fr_threadhelp NULL +fr framework\source\helper nmake - all fr_helper fr_unotypes fr_threadhelp NULL +fr framework\source\services nmake - all fr_services fr_unotypes fr_threadhelp NULL +fr framework\source\application nmake - all fr_application fr_unotypes fr_threadhelp NULL +fr framework\source\register nmake - all fr_register fr_unotypes fr_threadhelp NULL +fr framework\util nmake - all fr_util fr_threadhelp fr_application fr_classes fr_helper fr_register fr_services NULL diff --git a/framework/source/application/login.cxx b/framework/source/application/login.cxx new file mode 100644 index 0000000000..da152450d3 --- /dev/null +++ b/framework/source/application/login.cxx @@ -0,0 +1,382 @@ +/************************************************************************* + * + * $RCSfile: login.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:12 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_SERVICES_LOGINDIALOG_HXX_ +#include <services/logindialog.hxx> +#endif + +#ifndef __FRAMEWORK_CLASSES_SERVICEMANAGER_HXX_ +#include <classes/servicemanager.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ +#include <macros/generic.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ +#include <macros/debug.hxx> +#endif + +#ifndef __FRAMEWORK_SERVICES_H_ +#include <services.h> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#endif + +#ifndef _COM_SUN_STAR_AWT_XDIALOG_HPP_ +#include <com/sun/star/awt/XDialog.hpp> +#endif + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +#ifndef _COMPHELPER_PROCESSFACTORY_HXX_ +#include <comphelper/processfactory.hxx> +#endif + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ +#include <com/sun/star/uno/Reference.h> +#endif + +#ifndef _VOS_PROCESS_HXX_ +#include <vos/process.hxx> +#endif + +#ifndef _RTL_USTRING_ +#include <rtl/ustring> +#endif + +#ifndef _RTL_USTRBUF_HXX_ +#include <rtl/ustrbuf.hxx> +#endif + +#ifndef _SV_EVENT_HXX +#include <vcl/event.hxx> +#endif + +#ifndef _SV_SVAPP_HXX +#include <vcl/svapp.hxx> +#endif + +#ifndef _SV_WRKWIN_HXX +#include <vcl/wrkwin.hxx> +#endif + +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif + +#include <stdio.h> + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +#define TEMPFILE_ENCODING RTL_TEXTENCODING_UTF8 // encoding of written temp. ascii file +#define ARGUMENTFOUND 0 // OUString::compareTo returns 0 if searched string match given one +#define SEPERATOR (sal_Unicode)';' // seperator for temp. file values +#define ENCODESIGN (sal_Unicode)'\\' // special character to encode SEPERATOR. These sign must be encoded too!!! + +#define ARGUMENT_TEMPFILE DECLARE_ASCII("-f=") // we support "-f=c:\temp\test.txt" as argument +#define ARGUMENTLENGTH_TEMPFILE 3 // length of ARGUMENT_TEMPFILE to find it in argumentlist + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +using namespace ::rtl ; +using namespace ::vos ; +using namespace ::comphelper ; +using namespace ::framework ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::awt ; +using namespace ::com::sun::star::beans ; + +//_________________________________________________________________________________________________________________ +// defines +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @short implement command application to show login dialog and save his information in temp. file! + @descr We need this temp. file to share informations between our dialog and different processes, which + can't use vcl directly. Caller of this executable give us the file name as an argument - we save + all informations in it - caller can read it and MUST delete temp. file. + This is neccessary for example; to hide the password! + + @implements - + + @base Application +*//*-*************************************************************************************************************/ +class LoginApplication : public Application +{ + //************************************************************************************************************* + // public methods + //************************************************************************************************************* + public: + void Main(); + + //************************************************************************************************************* + // private methods + //************************************************************************************************************* + private: + void impl_parseCommandline ( ); // search supported arguments on command line + OUString impl_encodeString ( const OUString& sValue ); // encode SEPERATOR and "\" with an additional "\"! zB "\" => "\\" + + //************************************************************************************************************* + // private variables + //************************************************************************************************************* + private: + OString m_sTempFile ; // name of temp. file in system notation + +}; // class LoginApplication + +//_________________________________________________________________________________________________________________ +// global variables +//_________________________________________________________________________________________________________________ + +LoginApplication gLoginApplication; + +//_________________________________________________________________________________________________________________ +// main +//_________________________________________________________________________________________________________________ + +void LoginApplication::Main() +{ + // Init global uno servicemanager. + ServiceManager aManager; + Reference< XMultiServiceFactory > xServiceManager = aManager.getSharedUNOServiceManager( DECLARE_ASCII("login.rdb") ); + LOG_ASSERT( !(xServiceManager.is()==sal_False), "LoginApplication::Main()\nCould not create uno service manager!\n" ) + + // Parse command line and set found arguments on application member. + impl_parseCommandline(); + LOG_ASSERT( !(m_sTempFile.getLength()<1), "LoginApplication::Main()\nWrong or missing argument for temp. file detected!\n" ) + + // Try to get neccessary dialog service. + // By the way - cast it to interface XPropertySet too - we need it later. + // (define SERVICENAME... comes from defines.hxx!) + Reference< XDialog > xLoginDialog( xServiceManager->createInstance( SERVICENAME_LOGINDIALOG ), UNO_QUERY ); + Reference< XPropertySet > xPropertySet( xLoginDialog , UNO_QUERY ); + + // Work with valid ressources only! + // Otherwise do nothing ... + if ( + ( xLoginDialog.is() == sal_True ) && + ( xPropertySet.is() == sal_True ) && + ( m_sTempFile.getLength() > 0 ) + ) + { + // User can't set used connection type in dialog directly! + // And if our setup has written wrong value for it ... + // we must set right type before to get right value after showing dialog!!! + Any aConnectionType; + aConnectionType <<= PROPERTYNAME_COMPRESSEDSECURE; + xPropertySet->setPropertyValue( PROPERTYNAME_CONNECTIONTYPE, aConnectionType ); + + // Show login dialog and get decision of user. + sal_Bool bDecision = (sal_Bool)(xLoginDialog->execute()); + + OUString sUserName ; + OUString sPassword ; + OUString sServer ; + OUString sConnectionType ; + sal_Int32 nPort=0 ; // We need this default if follow "if"-statement "failed"! + // Strings before has "" as default. + + // If user say "OK" ... get values from dialog. + // If user say "NO" ... leave it. Then we save empty informations later ... + if( bDecision == sal_True ) + { + // defines PROPERTYNAME... comes from logindialog.hxx! + xPropertySet->getPropertyValue( PROPERTYNAME_USERNAME ) >>= sUserName ; + xPropertySet->getPropertyValue( PROPERTYNAME_PASSWORD ) >>= sPassword ; + xPropertySet->getPropertyValue( PROPERTYNAME_SERVER ) >>= sServer ; + xPropertySet->getPropertyValue( PROPERTYNAME_CONNECTIONTYPE ) >>= sConnectionType ; + if( sConnectionType.getLength() > 0 ) + { + xPropertySet->getPropertyValue( sConnectionType ) >>= nPort; + } + } + + // Build string for output. + // At this point it doesnt matter if information exist or not! + // Format of output: "<decision[0|1]>;<username[string]>;<password[string]>;<servername[string]>;<port[int]>" + OUStringBuffer sBuffer( 1000 ); + + if( bDecision == sal_True ) + { + sBuffer.appendAscii( "1" ); + } + else + { + sBuffer.appendAscii( "0" ); + } + sBuffer.append ( SEPERATOR ); + sBuffer.append ( impl_encodeString(sUserName) ); + sBuffer.append ( SEPERATOR ); + sBuffer.append ( impl_encodeString(sPassword) ); + sBuffer.append ( SEPERATOR ); + sBuffer.append ( impl_encodeString(sServer) ); + sBuffer.append ( SEPERATOR ); + sBuffer.append ( impl_encodeString(sConnectionType)); + sBuffer.append ( SEPERATOR ); + sBuffer.append ( nPort ); + sBuffer.append ( SEPERATOR ); + sBuffer.appendAscii ( "\n" ); + + // Write informations in temp. file. + // If given file name isnt valid ... caller will have a problem!!! + // If fil already exist (That's out of specification!!!) we overwrite it everytime. + FILE* pFile = fopen( m_sTempFile.getStr(), "w" ); + LOG_ASSERT( !(pFile==NULL), "LoginApplication::Main()\nCould not open file!\n" ); + if( pFile != NULL ) + { + OString sEncodedOut = U2B_ENC( sBuffer.makeStringAndClear(), TEMPFILE_ENCODING ); + fprintf( pFile, sEncodedOut.getStr() ); + fclose ( pFile ); + } + } +} + +//***************************************************************************************************************** +// private method +//***************************************************************************************************************** +void LoginApplication::impl_parseCommandline() +{ + // Use vos::OStartupInfo for access to command line. + // Step over all arguments, search for supported ones and try to get his values. + // Set it on our member. Caller of this method must control setted values. + OStartupInfo aInfo; + + sal_uInt32 nCount = aInfo.getCommandArgCount() ; + sal_uInt32 nArgument = 0 ; + OUString sArgument ; + + // Warn programmer if argument count isnt ok! + LOG_ASSERT( !(nCount!=1), "LoginApplication::impl_parseCommandline()\nWrong argument count detected!\n" ) + + // Step over all arguments ... + for( nArgument=0; nArgument<nCount; ++nArgument ) + { + // .. but work with valid ones only! + // Don't check values here. Caller of this method must decide between wrong and allowed values! + aInfo.getCommandArg( nArgument, sArgument ); + + //_____________________________________________________________________________________________________ + // Look for "-f<temp. file name> + if( sArgument.compareTo( ARGUMENT_TEMPFILE, ARGUMENTLENGTH_TEMPFILE ) == ARGUMENTFOUND ) + { + m_sTempFile = U2B(sArgument.copy( ARGUMENTLENGTH_TEMPFILE )); + } + } +} + +//***************************************************************************************************************** +// private method +//***************************************************************************************************************** +OUString LoginApplication::impl_encodeString( const OUString& sValue ) +{ + // Read all signs from source buffer into destination buffer + // and change all ";" and "\" to "\;" and "\\"! + + sal_Int32 nCount = sValue.getLength(); + OUStringBuffer sSource ( sValue ) ; + OUStringBuffer sDestination( nCount*2 ) ; // Reserve destination buffer with enough free space for changes! Sometimes we must add signs ... + sal_Unicode cLetter ; + + for( sal_Int32 nLetter=0; nLetter<nCount; ++nLetter ) + { + cLetter = sSource.charAt(nLetter); + // If sign a special one ... + // add escape letter before ... + // and special one then! + // Otherwise letter will copied normaly. + if ( + ( cLetter == SEPERATOR ) || + ( cLetter == ENCODESIGN ) + ) + { + sDestination.append( ENCODESIGN ); + } + sDestination.append( cLetter ); + } + + return sDestination.makeStringAndClear(); +} diff --git a/framework/source/application/makefile.mk b/framework/source/application/makefile.mk index b5b460ce86..3a38db8080 100644 --- a/framework/source/application/makefile.mk +++ b/framework/source/application/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.1.1.1 $ +# $Revision: 1.2 $ # -# last change: $Author: hr $ $Date: 2000-09-18 16:29:23 $ +# last change: $Author: as $ $Date: 2001-03-29 13:17:12 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -74,50 +74,9 @@ ENABLE_EXCEPTIONS= TRUE # --- Files -------------------------------------------------------- -SLOFILES= $(SLO)$/framework.obj +SLOFILES= $(SLO)$/login.obj # --- Targets ------------------------------------------------------ .INCLUDE : target.mk -# ------------------------------------------------------------------ -# Windows -# ------------------------------------------------------------------ - -.IF "$(GUI)" == "WIN" - -$(MISC)$/$(TARGET).def: makefile - echo NAME $(TARGET) >$@ - echo DESCRIPTION 'Framework - Testprogramm' >>$@ - echo EXETYPE WINDOWS >>$@ - echo STUB 'winSTUB.EXE' >>$@ - echo PROTMODE >>$@ - echo CODE PRELOAD MOVEABLE DISCARDABLE >>$@ - echo DATA PRELOAD MOVEABLE MULTIPLE >>$@ - echo HEAPSIZE 8192 >>$@ - echo STACKSIZE 32768 >>$@ - -.ENDIF -# -## ------------------------------------------------------------------ -## OS2 -## ------------------------------------------------------------------ -# -#.IF "$(GUI)" == "OS2" -# -#$(MISC)$/$(TARGET).def: makefile -# echo NAME $(TARGET) WINDOWAPI >$@ -# echo DESCRIPTION 'Framework - Testprogramm' >>$@ -#.IF "$(COM)" != "BLC" -# echo STUB 'os2STUB.EXE' >>$@ -#.ENDIF -#.IF "$(COM)"!="MTW" -# echo EXETYPE OS2 >>$@ -#.ENDIF -# echo PROTMODE >>$@ -# echo CODE LOADONCALL >>$@ -# echo DATA PRELOAD MULTIPLE >>$@ -# echo HEAPSIZE 16384 >>$@ -# echo STACKSIZE 32768 >>$@ -# -#.ENDIF diff --git a/framework/source/classes/framecontainer.cxx b/framework/source/classes/framecontainer.cxx index ccc99e366e..21ab2c7f2c 100644 --- a/framework/source/classes/framecontainer.cxx +++ b/framework/source/classes/framecontainer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: framecontainer.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: as $ $Date: 2001-03-09 14:42:25 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,11 +63,18 @@ // my own includes //_________________________________________________________________________________________________________________ - #ifndef __FRAMEWORK_FRAMECONTAINER_HXX_ #include <classes/framecontainer.hxx> #endif +#ifndef __FRAMEWORK_THREADHELP_WRITEGUARD_HXX_ +#include <threadhelp/writeguard.hxx> +#endif + +#ifndef __FRAMEWORK_THREADHELP_READGUARD_HXX_ +#include <threadhelp/readguard.hxx> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -95,9 +102,6 @@ using namespace ::com::sun::star::frame ; // non exported const //_________________________________________________________________________________________________________________ -#define LOCK_OFF sal_False -#define LOCK_ON sal_True - //_________________________________________________________________________________________________________________ // non exported definitions //_________________________________________________________________________________________________________________ @@ -110,8 +114,14 @@ using namespace ::com::sun::star::frame ; // constructor //***************************************************************************************************************** FrameContainer::FrameContainer() - : m_bLock( LOCK_OFF ) + // initialize RWLock-member at first! + : FairRWLockBase() { + // Make object ready for working. + // change working mode from E_INIT to E_WORK + // We don't must look for current set modi - a ctor + // couldn't be called more then ones ... I think so :-) + m_aLock.setWorkingMode( E_WORK ); } //***************************************************************************************************************** @@ -119,9 +129,18 @@ FrameContainer::FrameContainer() //***************************************************************************************************************** FrameContainer::~FrameContainer() { + // Disable object for working! + // All further requests will be refused ... + // but I think it's alittle bit superflous by using in dtor ... + // May be - it's neccessary? + // So we wait for current working reader/writer till they finish her work. + m_aLock.setWorkingMode( E_CLOSE ); + + // Disable possible active quit timer! + // He can be active for owner=desktop only. + impl_disableQuitTimer(); // Don't forget to free memory! - disableQuitTimer(); - clear(); + impl_clear(); } //***************************************************************************************************************** @@ -130,22 +149,22 @@ FrameContainer::~FrameContainer() void FrameContainer::append( const Reference< XFrame >& xFrame ) { // Safe impossible cases - // This method is not defined for ALL incoming parameters! - LOG_ASSERT2( implcp_append( xFrame ), "FrameContainer::append()", "Invalid parameter detected!" ) - // Warn programmer at already existing elements in container. - LOG_ASSERT2( exist(xFrame)==sal_True, "FrameContainer::append()", "New frame already exist in container!" ) - // Warn programmer if an already existing frame has no component inside! - // These frames are created (e.g. by dispatch()) but not used ... - LOG_ASSERT2( impldbg_existZombie(), "FrameContainer::append()", "Zombie frame detected!" ) - - // Work only, if container not locked! - if ( m_bLock == LOCK_OFF ) + // a) This method is not defined for ALL incoming parameters! + // b) Warn programmer at already existing elements in container. + // c) Warn programmer if an already existing frame has no component inside! + // These frames are created (e.g. by dispatch()) but not used ... + LOG_ASSERT2( implcp_append( xFrame ), "FrameContainer::append()", "Invalid parameter detected!" ) + LOG_ASSERT2( exist(xFrame)==sal_True, "FrameContainer::append()", "New frame already exist in container!" ) + // LOG_ASSERT2( impldbg_existZombie(), "FrameContainer::append()", "Zombie frame detected!" ) + + // Append new frame to container. + // Make it threadsafe by using write lock - Look for refused calls => Do nothing then. + ERefusalReason eReason ; + WriteGuard aWriteLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) { - // Append new frame to container. m_aContainer.push_back( xFrame ); } - // Else; Warn programmer. - LOG_ASSERT( !(m_bLock==LOCK_ON), "FrameContainer::append()\nContainer is locked! You can't append frame.\n" ) } //***************************************************************************************************************** @@ -154,29 +173,35 @@ void FrameContainer::append( const Reference< XFrame >& xFrame ) void FrameContainer::remove( const Reference< XFrame >& xFrame ) { // Safe impossible cases - // This method is not defined for ALL incoming parameters! - LOG_ASSERT2( implcp_remove( xFrame ), "FrameContainer::remove()", "Invalid parameter detected!" ) - // Warn programmer at non existing elements in container. - LOG_ASSERT2( exist(xFrame)==sal_False, "FrameContainer::remove()", "Frame to remove not exist in container!" ) - - // Work only, if container not locked! - if ( m_bLock == LOCK_OFF ) + // a) This method is not defined for ALL incoming parameters! + // b) Warn programmer at non existing elements in container. + LOG_ASSERT2( implcp_remove( xFrame ) , "FrameContainer::remove()", "Invalid parameter detected!" ) + LOG_ASSERT2( exist(xFrame)==sal_False , "FrameContainer::remove()", "Frame to remove not exist in container!" ) + + // Search frame and remove it from container if he exist. + // Make it threadsafe. I think removing container elements must be "atomar". + // We shouldn't make a copy of current container items to work on it. + // Use write lock for whole method. + ERefusalReason eReason ; + WriteGuard aWriteLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) { - // Search frame and remove it from container ... TFrameIterator aSearchedItem = find( m_aContainer.begin(), m_aContainer.end(), xFrame ); - // ... if it exist. - if ( aSearchedItem != m_aContainer.end() ) + if( aSearchedItem != m_aContainer.end() ) { m_aContainer.erase( aSearchedItem ); - // And if removed frame the current active frame - reset state variable. - if ( m_xActiveFrame == xFrame ) + // If removed frame the current active frame - reset state variable. + if( m_xActiveFrame == xFrame ) { m_xActiveFrame = Reference< XFrame >(); } + // We don't need the write lock any longer ... + // downgrade to read access. + aWriteLock.downgrade(); // If last frame was removed and special quit timer is enabled by the desktop // we must terminate the desktop by using this timer! if ( - ( getCount() < 1 ) && + ( m_aContainer.size() < 1 ) && ( m_rQuitTimer.isValid() == sal_True ) ) { @@ -184,32 +209,30 @@ void FrameContainer::remove( const Reference< XFrame >& xFrame ) } } } - // Else; Warn programmer. - LOG_ASSERT2( m_bLock==LOCK_ON, "FrameContainer::remove()", "Container is locked! You can't remove frame." ) } //***************************************************************************************************************** // public method //***************************************************************************************************************** -sal_Bool FrameContainer::exist( const REFERENCE< XFRAME >& xFrame ) const +sal_Bool FrameContainer::exist( const Reference< XFrame >& xFrame ) const { // Safe impossible cases - // This method is not defined for ALL incoming parameters! + // a) This method is not defined for ALL incoming parameters! LOG_ASSERT2( implcp_exist( xFrame ), "FrameContainer::exist()", "Invalid parameter detected!" ) - // Set default return value. - sal_Bool bExist = sal_False; - - // We ignore the lock, because we do not change the content of container! - // Search frame. - TConstFrameIterator aSearchedItem = find( m_aContainer.begin(), m_aContainer.end(), xFrame ); - // If it exist ... - if ( aSearchedItem != m_aContainer.end() ) + // Search for frame. + // Make it threadsafe by using readlock. Declare default return value for refused calls! + sal_Bool bExist = sal_False ; + ERefusalReason eReason ; + ReadGuard aReadLock ( m_aLock, eReason ); + if( eReason == E_NOREASON ) { - // Set new return value. - bExist = sal_True; + bExist = ( find( m_aContainer.begin() , + m_aContainer.end() , + xFrame ) != m_aContainer.end() + ); } - // Return result of this operation. + return bExist; } @@ -218,54 +241,30 @@ sal_Bool FrameContainer::exist( const REFERENCE< XFRAME >& xFrame ) const //***************************************************************************************************************** void FrameContainer::clear() { - // This method is only allowed, if no lock is set! - // Warn programmer, if its not true. - LOG_ASSERT2( m_bLock==LOCK_ON, "FrameContainer::clear()", "Container is locked! You can't clear it." ) - if ( m_bLock == LOCK_OFF ) + // We need write access to our member. + ERefusalReason eReason ; + WriteGuard aWriteLock ( m_aLock, eReason ); + if( eReason == E_NOREASON ) { - // Clear the container ... - m_aContainer.erase( m_aContainer.begin(), m_aContainer.end() ); - m_aContainer.clear(); - // ... and don't forget to reset the active frame. - // Its an reference to a valid container-item. - // But no container item => no active frame! - m_xActiveFrame = Reference< XFrame >(); - // If special quit timer is used - we must terminate the desktop. - // He is the owner of this container and can't work without any visible tasks/frames! - if( m_rQuitTimer.isValid() == sal_True ) - { - m_rQuitTimer->start(); - } + impl_clear(); } } //***************************************************************************************************************** // public method //***************************************************************************************************************** -void FrameContainer::lock() -{ - // Lock the container and block all append(), remove() and clear() calls. - m_bLock = LOCK_ON; -} - -//***************************************************************************************************************** -// public method -//***************************************************************************************************************** -void FrameContainer::unlock() -{ - // Unlock the container and block all getCount() and operator[] calls. - m_bLock = LOCK_OFF; -} - -//***************************************************************************************************************** -// public method -//***************************************************************************************************************** sal_uInt32 FrameContainer::getCount() const { - // Return size of current container. - // We ignore the lock, because you can ask for count of container elements ... - // but if you will have full index access you must lock it! - return (sal_uInt32)m_aContainer.size(); + // We need read access to our member. + // Declare default return value for refused calls. + sal_uInt32 nCount = 0 ; + ERefusalReason eReason ; + ReadGuard aReadLock ( m_aLock, eReason ); + if( eReason == E_NOREASON ) + { + nCount = (sal_uInt32)m_aContainer.size(); + } + return nCount; } //***************************************************************************************************************** @@ -274,17 +273,14 @@ sal_uInt32 FrameContainer::getCount() const Reference< XFrame > FrameContainer::operator[]( sal_uInt32 nIndex ) const { // Safe impossible cases - // This method is not defined for ALL incoming parameters! + // a) This method is not defined for ALL incoming parameters! LOG_ASSERT2( implcp_IndexOperator( nIndex, getCount() ), "FrameContainer::operator[]()", "Invalid parameter detected!" ) - // Set default return value. - Reference< XFrame > xFrame; - - // This operation is allowed only, if lock is set. - // Warn programmer, if this not true. - LOG_ASSERT2( m_bLock==LOCK_OFF, "FrameContainer::operator[]()", "Container is not locked! You can't do this." ) - - if ( m_bLock == LOCK_ON ) + // Use read lock to make it threadsafe. Declare default return value for refused calls! + Reference< XFrame > xFrame ; + ERefusalReason eReason ; + ReadGuard aReadLock ( m_aLock, eReason ); + if( eReason == E_NOREASON ) { try { @@ -294,43 +290,34 @@ Reference< XFrame > FrameContainer::operator[]( sal_uInt32 nIndex ) const } catch( std::out_of_range& ) { - // The index is not valid for current container-content ... - // ... but we must handle this case! - // We return a NULL reference. - xFrame = Reference< XFrame >(); + // The index is not valid for current container-content - we must handle this case! + // We can return the default value ... + LOG_EXCEPTION( "FrameContainer::operator[]", "Exception catched ...", DECLARE_ASCII("::std::out_of_range") ) } } - - // Return result of this operation. return xFrame; } //***************************************************************************************************************** // public method //***************************************************************************************************************** -Sequence< Reference< XFrame > > FrameContainer::getAllElements() +Sequence< Reference< XFrame > > FrameContainer::getAllElements() const { - // Lock the container for this method. - // Nobody should append or remove anything between creation of snapshot. - // But - don't forget to unlock the container. - m_bLock = LOCK_ON; - - // Get memory for return sequence. - sal_uInt32 nCount = (sal_uInt32)m_aContainer.size(); - Sequence< Reference< XFrame > > seqReturn( nCount ); - - // Copy from container to return list. - Reference< XFrame >* pArray = seqReturn.getArray(); - for ( sal_uInt32 nPosition=0; nPosition<nCount; ++nPosition ) + // Use read lock. Declare default return value if call is refused. + Sequence< Reference< XFrame > > lElements ; + ERefusalReason eReason ; + ReadGuard aReadLock ( m_aLock, eReason ); + if( eReason == E_NOREASON ) { - pArray[nPosition] = m_aContainer[nPosition]; - } - - // Don't forget this! - m_bLock = LOCK_OFF; + sal_uInt32 nCount = (sal_uInt32)m_aContainer.size(); + lElements.realloc( nCount ); - // Return result of this operation. - return seqReturn; + for( sal_uInt32 nPosition=0; nPosition<nCount; ++nPosition ) + { + lElements[nPosition] = m_aContainer[nPosition]; + } + } + return lElements; } //***************************************************************************************************************** @@ -338,8 +325,15 @@ Sequence< Reference< XFrame > > FrameContainer::getAllElements() //***************************************************************************************************************** sal_Bool FrameContainer::hasElements() const { - // Has container some elements? - return ( m_aContainer.size() > 0 ); + // Use read lock. Declare default return value if call is refused. + sal_Bool bHasElements= sal_False ; + ERefusalReason eReason ; + ReadGuard aReadLock ( m_aLock, eReason ); + if( eReason == E_NOREASON ) + { + bHasElements = ( m_aContainer.size() > 0 ); + } + return bHasElements; } //***************************************************************************************************************** @@ -348,17 +342,17 @@ sal_Bool FrameContainer::hasElements() const void FrameContainer::setActive( const Reference< XFrame >& xFrame ) { // Safe impossible cases - // This method is not defined for ALL incoming parameters! - // BUT we accept null refrences for reset active state. => No frame is active then. - LOG_ASSERT2( implcp_setActive( xFrame ), "FrameContainer::setActive()", "Invalid parameter detected!" ) - // The new active frame MUST exist in container. - // Control this. - LOG_ASSERT2( xFrame.is()==sal_True && exist(xFrame)==sal_False, "FrameContainer::setActive()", "The new active frame is not a member of current container!You cant activate it." ) - - // All incoming parameters are controlled. - // We have a new active frame or a null reference to reset this state. - // Actualize member. - m_xActiveFrame = xFrame; + // a) This method is not defined for ALL incoming parameters! + // b) The new active frame MUST exist in container. + LOG_ASSERT2( implcp_setActive( xFrame ) , "FrameContainer::setActive()", "Invalid parameter detected!" ) + LOG_ASSERT2( xFrame.is()==sal_True && exist(xFrame)==sal_False , "FrameContainer::setActive()", "The new active frame is not a member of current container!You cant activate it." ) + + ERefusalReason eReason ; + WriteGuard aWriteLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) + { + m_xActiveFrame = xFrame; + } } //***************************************************************************************************************** @@ -366,10 +360,15 @@ void FrameContainer::setActive( const Reference< XFrame >& xFrame ) //***************************************************************************************************************** Reference< XFrame > FrameContainer::getActive() const { - // Return member. - // The correct state of this variable we have controlled in setActive()! - // But we accept null reference for these variable. => There is no active frame in the moment. - return m_xActiveFrame; + // Use read lock. Declare default return value if call is refused. + Reference< XFrame > xActive ; + ERefusalReason eReason ; + ReadGuard aReadLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) + { + xActive = m_xActiveFrame; + } + return xActive; } //***************************************************************************************************************** @@ -378,9 +377,14 @@ Reference< XFrame > FrameContainer::getActive() const void FrameContainer::enableQuitTimer( const Reference< XDesktop >& xDesktop ) { // If no current timer exist - create a new one. - if( m_rQuitTimer.isEmpty() == sal_True ) + ERefusalReason eReason ; + WriteGuard aWriteLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) { - m_rQuitTimer.bind( new AsyncQuit( xDesktop ) ); + if( m_rQuitTimer.isEmpty() == sal_True ) + { + m_rQuitTimer.bind( new AsyncQuit( xDesktop ) ); + } } } @@ -391,130 +395,149 @@ void FrameContainer::disableQuitTimer() { // Delete current quit timer. // If user wish to create it again he must do it with "enableQuitTimer()". - if( m_rQuitTimer.isValid() == sal_True ) + ERefusalReason eReason ; + WriteGuard aWriteLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) { - m_rQuitTimer.unbind(); + impl_disableQuitTimer(); } } //***************************************************************************************************************** // public method //***************************************************************************************************************** -Reference< XFrame > FrameContainer::searchDeepDown( const OUString& sName ) +Reference< XFrame > FrameContainer::searchDeepDown( const OUString& sName ) const { // Check incoming parameter. LOG_ASSERT2( implcp_searchDeepDown( sName ), "FrameContainer::searchDeepDown()", "Invalid parameter detected!" ) - // Set default return value if search failed. - Reference< XFrame > xSearchedFrame; - - // Use snapshot for search ... - // because these search could be a longer process. - // We must protect us against deleting references. - // In our multithreaded environment it could be that some new frames are appended or other are removed - // during this operation - but we hold valid references to it! - - // Step over all child frames. But if direct child isnt the right one search on his children first - before - // you go to next direct child of this container! - Sequence< Reference< XFrame > > lFrames = getAllElements(); - sal_Int32 nCount = lFrames.getLength(); - for( sal_Int32 nFrame=0; nFrame<nCount; ++nFrame ) + // Use read lock to make it threadsafe. + // Declare default return value for refused calls. + Reference< XFrame > xSearchedFrame ; + ERefusalReason eReason ; + ReadGuard aReadLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) { - if( lFrames[nFrame]->getName() == sName ) + // Step over all child frames. But if direct child isn't the right one search on his children first - before + // you go to next direct child of this container! + for( TConstFrameIterator pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator ) { - xSearchedFrame = lFrames[nFrame]; - break; - } - else - { - xSearchedFrame = lFrames[nFrame]->findFrame( sName, FrameSearchFlag::CHILDREN ); - if( xSearchedFrame.is() == sal_True ) + if( (*pIterator)->getName() == sName ) { + xSearchedFrame = *pIterator; break; } + else + { + xSearchedFrame = (*pIterator)->findFrame( sName, FrameSearchFlag::CHILDREN ); + if( xSearchedFrame.is() == sal_True ) + { + break; + } + } } } - return xSearchedFrame; } //***************************************************************************************************************** // public method //***************************************************************************************************************** -Reference< XFrame > FrameContainer::searchFlatDown( const OUString& sName ) +Reference< XFrame > FrameContainer::searchFlatDown( const OUString& sName ) const { // Check incoming parameter. LOG_ASSERT2( implcp_searchFlatDown( sName ), "FrameContainer::searchFlatDown()", "Invalid parameter detected!" ) - // Set default return value if search failed. - Reference< XFrame > xSearchedFrame; - - // Use snapshot for search ... - // because these search could be a longer process. - // We must protect us against deleting references. - // In our multithreaded environment it could be that some new frames are appended or other are removed - // during this operation - but we hold valid references to it! - - // Step over all direct child frames first. - // Even right frame wasn't found start search at children of direct children. - Sequence< Reference< XFrame > > lFrames = getAllElements(); - sal_Int32 nCount = lFrames.getLength(); - sal_Int32 nFrame = 0; - for( nFrame=0; nFrame<nCount; ++nFrame ) + // Use read lock to make it threadsafe. + // Declare default return value for refused calls. + Reference< XFrame > xSearchedFrame ; + ERefusalReason eReason ; + ReadGuard aReadLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) { - if( lFrames[nFrame]->getName() == sName ) + // Step over all direct child frames first. + // Even right frame wasn't found, start search at children of direct children. + for( TConstFrameIterator pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator ) { - xSearchedFrame = lFrames[nFrame]; - break; + if( (*pIterator)->getName() == sName ) + { + xSearchedFrame = *pIterator; + break; + } } - } - if( xSearchedFrame.is() == sal_False ) - { - nCount = lFrames.getLength(); - for( sal_Int32 nFrame=0; nFrame<nCount; ++nFrame ) + if( xSearchedFrame.is() == sal_False ) { - xSearchedFrame = lFrames[nFrame]->findFrame( sName, FrameSearchFlag::CHILDREN | FrameSearchFlag::SIBLINGS ); - if( xSearchedFrame.is() == sal_True ) + for( pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator ) { - break; + xSearchedFrame = (*pIterator)->findFrame( sName, FrameSearchFlag::CHILDREN | FrameSearchFlag::SIBLINGS ); + if( xSearchedFrame.is() == sal_True ) + { + break; + } } } } - return xSearchedFrame; } //***************************************************************************************************************** // public method //***************************************************************************************************************** -Reference< XFrame > FrameContainer::searchDirectChildren( const OUString& sName ) +Reference< XFrame > FrameContainer::searchDirectChildren( const OUString& sName ) const { // Check incoming parameter. LOG_ASSERT2( implcp_searchDirectChildren( sName ), "FrameContainer::searchDirectChildren()", "Invalid parameter detected!" ) - // Set default return value if search failed. - Reference< XFrame > xSearchedFrame; - - // Use snapshot for search ... - // because these search could be a longer process. - // We must protect us against deleting references. - // In our multithreaded environment it could be that some new frames are appended or other are removed - // during this operation - but we hold valid references to it! - - // Step over all current container items and search for right target. - Sequence< Reference< XFrame > > lFrames = getAllElements(); - sal_Int32 nCount = lFrames.getLength(); - for( sal_Int32 nFrame=0; nFrame<nCount; ++nFrame ) + // Use read lock to make it threadsafe. + // Declare default return value for refused calls. + Reference< XFrame > xSearchedFrame ; + ERefusalReason eReason ; + ReadGuard aReadLock( m_aLock, eReason ) ; + if( eReason == E_NOREASON ) { - if( lFrames[nFrame]->getName() == sName ) + // Step over all current container items and search for right target. + for( TConstFrameIterator pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator ) { - xSearchedFrame = lFrames[nFrame]; - break; + if( (*pIterator)->getName() == sName ) + { + xSearchedFrame = *pIterator; + break; + } } } - return xSearchedFrame; } +//***************************************************************************************************************** +// private method +//***************************************************************************************************************** +void FrameContainer::impl_clear() +{ + // Clear the container ... + m_aContainer.erase( m_aContainer.begin(), m_aContainer.end() ); + m_aContainer.clear(); + // ... and don't forget to reset the active frame. + // Its an reference to a valid container-item. + // But no container item => no active frame! + m_xActiveFrame = Reference< XFrame >(); + // If special quit timer is used - we must terminate the desktop. + // He is the owner of this container and can't work without any visible tasks/frames! + if( m_rQuitTimer.isValid() == sal_True ) + { + m_rQuitTimer->start(); + } +} + +//***************************************************************************************************************** +// private method +//***************************************************************************************************************** +void FrameContainer::impl_disableQuitTimer() +{ + if( m_rQuitTimer.isValid() == sal_True ) + { + m_rQuitTimer.unbind(); + } +} + } // namespace framework diff --git a/framework/source/classes/makefile.mk b/framework/source/classes/makefile.mk index 7380743277..511a672cb6 100644 --- a/framework/source/classes/makefile.mk +++ b/framework/source/classes/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.4 $ +# $Revision: 1.5 $ # -# last change: $Author: as $ $Date: 2000-11-23 14:52:07 $ +# last change: $Author: as $ $Date: 2001-03-29 13:17:12 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -78,7 +78,6 @@ BOOTSTRAP_SERVICE= FALSE SLOFILES= $(SLO)$/servicemanager.obj \ $(SLO)$/filtercache.obj \ - $(SLO)$/registrycache.obj \ $(SLO)$/wildcard.obj \ $(SLO)$/framecontainer.obj \ $(SLO)$/taskcreator.obj \ diff --git a/framework/source/classes/targetfinder.cxx b/framework/source/classes/targetfinder.cxx index a4256d67d3..ccb0be06db 100644 --- a/framework/source/classes/targetfinder.cxx +++ b/framework/source/classes/targetfinder.cxx @@ -2,9 +2,9 @@ * * $RCSfile: targetfinder.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2001-03-09 14:42:25 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -172,7 +172,7 @@ ETargetClass TargetFinder::classify( EFrameType eFrameType , // private method //***************************************************************************************************************** ETargetClass TargetFinder::impl_classifyForDesktop( sal_Bool bChildrenExist , - const OUSTRING& sTargetName , + const OUString& sTargetName , sal_Int32 nSearchFlags ) { ETargetClass eResult = E_UNKNOWN; diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx index dabcb6624c..bb5d769278 100644 --- a/framework/source/classes/taskcreator.cxx +++ b/framework/source/classes/taskcreator.cxx @@ -2,9 +2,9 @@ * * $RCSfile: taskcreator.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: as $ $Date: 2001-03-09 14:42:25 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,8 +67,8 @@ #include <classes/taskcreator.hxx> #endif -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> +#ifndef __FRAMEWORK_SERVICES_H_ +#include <services.h> #endif //_________________________________________________________________________________________________________________ diff --git a/framework/source/helper/makefile.mk b/framework/source/helper/makefile.mk index 5b053fadfc..8272486f64 100644 --- a/framework/source/helper/makefile.mk +++ b/framework/source/helper/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.5 $ +# $Revision: 1.6 $ # -# last change: $Author: obr $ $Date: 2000-11-01 08:39:52 $ +# last change: $Author: as $ $Date: 2001-03-29 13:17:13 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -84,8 +84,6 @@ SLOFILES= $(SLO)$/otasksaccess.obj \ $(SLO)$/odesktopdispatcher.obj \ $(SLO)$/oframes.obj \ $(SLO)$/opluginframedispatcher.obj \ - $(SLO)$/oinstanceprovider.obj \ - $(SLO)$/opluginframefactory.obj \ $(SLO)$/ostatusindicatorfactory.obj \ $(SLO)$/ostatusindicator.obj \ $(SLO)$/ointerceptionhelper.obj diff --git a/framework/source/helper/ocomponentaccess.cxx b/framework/source/helper/ocomponentaccess.cxx index 47fff2de0c..c673e386d2 100644 --- a/framework/source/helper/ocomponentaccess.cxx +++ b/framework/source/helper/ocomponentaccess.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ocomponentaccess.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2000-10-06 11:34:43 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -295,7 +295,7 @@ Reference< XComponent > OComponentAccess::impl_getFrameComponent( const Referenc //***************************************************************************************************************** sal_Bool OComponentAccess::impldbg_checkParameter_OComponentAccessCtor( const Reference< XDesktop >& xOwner , - Mutex& aMutex ) const + Mutex& aMutex ) { // Set default return value. sal_Bool bOK = sal_True; diff --git a/framework/source/helper/ocomponentenumeration.cxx b/framework/source/helper/ocomponentenumeration.cxx index a6d9382852..f5c1e68fbf 100644 --- a/framework/source/helper/ocomponentenumeration.cxx +++ b/framework/source/helper/ocomponentenumeration.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ocomponentenumeration.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: as $ $Date: 2000-09-26 13:01:15 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -175,7 +175,7 @@ sal_Bool SAL_CALL OComponentEnumeration::hasMoreElements() throw( RuntimeExcepti // => The last one is getLength() - 1! // m_nPosition's current value is the position for the next element, which will be return, if user call "nextElement()" // => We have more elements if current position less then the length of the list! - return ( m_nPosition < m_seqComponents.getLength() ); + return ( m_nPosition < (sal_uInt32)(m_seqComponents.getLength()) ); } //***************************************************************************************************************** diff --git a/framework/source/helper/oframes.cxx b/framework/source/helper/oframes.cxx index d928703b96..e88823ae55 100644 --- a/framework/source/helper/oframes.cxx +++ b/framework/source/helper/oframes.cxx @@ -2,9 +2,9 @@ * * $RCSfile: oframes.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: as $ $Date: 2000-10-16 11:54:42 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,10 +67,6 @@ #include <helper/oframes.hxx> #endif -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> -#endif - //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -129,7 +125,7 @@ OFrames::OFrames( const Reference< XMultiServiceFactory >& xFactory , , m_aMutex ( aMutex ) , m_xOwner ( xOwner ) , m_pFrameContainer ( pFrameContainer ) - , m_bRecursiveSearchProtection( PROTECTION_OFF ) + , m_bRecursiveSearchProtection( sal_False ) { // Safe impossible cases // Method is not defined for ALL incoming parameters! @@ -229,7 +225,7 @@ Sequence< Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int32 nSearch if ( xOwner.is() == sal_True ) { // Work only, if search was not started here ...! - if( m_bRecursiveSearchProtection == PROTECTION_OFF ) + if( m_bRecursiveSearchProtection == sal_False ) { // This class is a helper for services, which must implement XFrames. // His parent and childs are MY parent and childs to. @@ -278,7 +274,7 @@ Sequence< Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int32 nSearch { // Else; start a new search. // Protect this instance against recursive calls from parents. - m_bRecursiveSearchProtection = PROTECTION_ON; + m_bRecursiveSearchProtection = sal_True; // Ask parent of my owner for frames and append results to return list. Reference< XFramesSupplier > xParent( xOwner->getCreator(), UNO_QUERY ); // If a parent exist ... @@ -289,7 +285,7 @@ Sequence< Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int32 nSearch } // We have all searched informations. // Reset protection-mode. - m_bRecursiveSearchProtection = PROTECTION_OFF; + m_bRecursiveSearchProtection = sal_False; } //_____________________________________________________________________________________________________________ @@ -300,8 +296,6 @@ Sequence< Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int32 nSearch // These things are supported by this instance himself. sal_Int32 nChildSearchFlags = FrameSearchFlag::SELF | FrameSearchFlag::CHILDREN; // Step over all items of container and ask childrens for frames. - // But first lock the container! see class FrameContainer for further informations. - m_pFrameContainer->lock(); sal_uInt32 nCount = m_pFrameContainer->getCount(); for ( sal_uInt32 nIndex=0; nIndex<nCount; ++nIndex ) { @@ -310,8 +304,6 @@ Sequence< Reference< XFrame > > SAL_CALL OFrames::queryFrames( sal_Int32 nSearch Reference< XFramesSupplier > xItem( (*m_pFrameContainer)[nIndex], UNO_QUERY ); impl_appendSequence( seqFrames, xItem->getFrames()->queryFrames( nChildSearchFlags ) ); } - // Don't forget to unlock the container. - m_pFrameContainer->unlock(); } } } @@ -366,9 +358,7 @@ Any SAL_CALL OFrames::getByIndex( sal_Int32 nIndex ) throw( IndexOutOfBoundsExce { // Get element form container. // (If index not valid, FrameContainer return NULL!) - m_pFrameContainer->lock(); aReturnValue <<= (*m_pFrameContainer)[nIndex]; - m_pFrameContainer->unlock(); } // Return result of this operation. @@ -500,7 +490,7 @@ sal_Bool OFrames::impldbg_checkParameter_OFramesCtor( const Reference< XMultiSer ( &xOwner == NULL ) || ( xFactory.is() == sal_False ) || ( xOwner.is() == sal_False ) || - ( m_pFrameContainer == NULL ) + ( pFrameContainer == NULL ) ) { bOK = sal_False ; diff --git a/framework/source/register/makefile.mk b/framework/source/register/makefile.mk index 42faa6a2e1..a3744be193 100644 --- a/framework/source/register/makefile.mk +++ b/framework/source/register/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.3 $ +# $Revision: 1.4 $ # -# last change: $Author: as $ $Date: 2000-12-13 09:23:06 $ +# last change: $Author: as $ $Date: 2001-03-29 13:17:14 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -79,7 +79,8 @@ LIBTARGET= NO SLOFILES= \ $(SLO)$/registerservices.obj \ - $(SLO)$/registertemp.obj + $(SLO)$/registertemp.obj \ + $(SLO)$/registerlogindialog.obj # --- Targets ------------------------------------------------------ diff --git a/framework/source/register/registerlogindialog.cxx b/framework/source/register/registerlogindialog.cxx new file mode 100644 index 0000000000..786ade2548 --- /dev/null +++ b/framework/source/register/registerlogindialog.cxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * $RCSfile: registerlogindialog.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//_________________________________________________________________________________________________________________ +// includes of my own project +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_MACROS_REGISTRATION_HXX_ +#include <macros/registration.hxx> +#endif + +/*================================================================================================================= + Add new include and new register info to for new services. + + Example: + + #ifndef __YOUR_SERVICE_1_HXX_ + #include <service1.hxx> + #endif + + #ifndef __YOUR_SERVICE_2_HXX_ + #include <service2.hxx> + #endif + + COMPONENTGETIMPLEMENTATIONENVIRONMENT + + COMPONENTWRITEINFO ( COMPONENTINFO( Service1 ) + COMPONENTINFO( Service2 ) + ) + + COMPONENTGETFACTORY ( IFFACTORIE( Service1 ) + else + IFFACTORIE( Service2 ) + ) +=================================================================================================================*/ + +#ifndef __FRAMEWORK_SERVICES_LOGINDIALOG_HXX_ +#include <services/logindialog.hxx> +#endif + +COMPONENTGETIMPLEMENTATIONENVIRONMENT + +COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::LoginDialog ) + ) + +COMPONENTGETFACTORY ( IFFACTORY( ::framework::LoginDialog ) + ) diff --git a/framework/source/register/registertemp.cxx b/framework/source/register/registertemp.cxx index 9f22a4a144..a9240909a0 100644 --- a/framework/source/register/registertemp.cxx +++ b/framework/source/register/registertemp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: registertemp.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: as $ $Date: 2001-02-16 12:20:19 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,7 +99,6 @@ #include <services/frameloaderfactory.hxx> #endif -#ifdef TF_FILTER #ifndef __FRAMEWORK_SERVICES_FILTERFACTORY_HXX_ #include <services/filterfactory.hxx> #endif @@ -107,11 +106,9 @@ #ifndef __FRAMEWORK_SERVICES_TYPEDETECTION_HXX_ #include <services/typedetection.hxx> #endif -#endif // TF_FILTER COMPONENTGETIMPLEMENTATIONENVIRONMENT -#ifdef TF_FILTER COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::MediaTypeDetectionHelper ) COMPONENTINFO( ::framework::FrameLoaderFactory ) COMPONENTINFO( ::framework::FilterFactory ) @@ -123,12 +120,3 @@ COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper ) else IFFACTORY( ::framework::FilterFactory ) else IFFACTORY( ::framework::TypeDetection ) ) -#else // TF_FILTER -COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::MediaTypeDetectionHelper ) - COMPONENTINFO( ::framework::FrameLoaderFactory ) - ) - -COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper ) else - IFFACTORY( ::framework::FrameLoaderFactory ) - ) -#endif // TF_FILTER diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index f17dea5bab..cb9915a7db 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -2,9 +2,9 @@ * * $RCSfile: desktop.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: as $ $Date: 2001-03-15 08:57:28 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,14 +83,18 @@ #include <helper/odesktopdispatcher.hxx> #endif -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> -#endif - #ifndef __FRAMEWORK_CLASSES_TARGETFINDER_HXX_ #include <classes/targetfinder.hxx> #endif +#ifndef __FRAMEWORK_SERVICES_H_ +#include <services.h> +#endif + +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -1614,24 +1618,20 @@ sal_Bool Desktop::impl_checkPlugInState() // set default return value if search failed or no plugin could be detected. sal_Bool bReturn = sal_False; - // We must search at ouer childs. We make a deep search. - // Lock the container. Nobody should append or remove elements during next time. - // But don't forget to unlock it again! - m_aChildTaskContainer.lock(); + // We must search at ouer childs. We make a flat search at our direct children only. // Break loop, if something was found or all container items was compared. - sal_uInt32 nCount = m_aChildTaskContainer.getCount(); - sal_uInt32 nPosition = 0; + Sequence< Reference< XFrame > > lTasks = m_aChildTaskContainer.getAllElements(); + sal_uInt32 nCount = lTasks.getLength(); + sal_uInt32 nPosition = 0; while ( ( bReturn == sal_False ) && ( nPosition < nCount ) ) { - Reference< XPluginInstance > xPlugInFrame( m_aChildTaskContainer[nPosition], UNO_QUERY ); + Reference< XPluginInstance > xPlugInFrame( lTasks[nPosition], UNO_QUERY ); bReturn = xPlugInFrame.is(); ++nPosition; } - // Don't forget to unlock the container! - m_aChildTaskContainer.unlock(); return bReturn; } diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 243880296c..67747d8f72 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -2,9 +2,9 @@ * * $RCSfile: frame.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: mba $ $Date: 2001-03-15 10:35:49 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,6 +87,10 @@ #include <classes/targetfinder.hxx> #endif +#ifndef __FRAMEWORK_SERVICES_H_ +#include <services.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -1386,7 +1390,7 @@ void Frame::impl_sendDisposeEvent() //***************************************************************************************************************** // private method //***************************************************************************************************************** -sal_Bool Frame::impl_willFrameTop( const REFERENCE< XFRAMESSUPPLIER >& xParent ) +sal_Bool Frame::impl_willFrameTop( const Reference< XFramesSupplier >& xParent ) { // Set default return value. sal_Bool bWillFrameTop = sal_False; diff --git a/framework/source/services/makefile.mk b/framework/source/services/makefile.mk index 202069ec95..ca02f3092a 100644 --- a/framework/source/services/makefile.mk +++ b/framework/source/services/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.4 $ +# $Revision: 1.5 $ # -# last change: $Author: as $ $Date: 2000-12-20 14:01:47 $ +# last change: $Author: as $ $Date: 2001-03-29 13:17:15 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -86,7 +86,15 @@ SLOFILES= \ $(SLO)$/typedetection.obj \ $(SLO)$/urltransformer.obj \ $(SLO)$/mediatypedetectionhelper.obj \ - $(SLO)$/documentproperties.obj + $(SLO)$/documentproperties.obj \ + $(SLO)$/logindialog.obj + +SRCFILES= logindialog.src + +RESLIB1NAME= lgd +RESLIB1SRSFILES= $(SRS)$/$(TARGET).srs +RESLIB1DEPN= logindialog.src \ + logindialog.hrc # --- Targets ------------------------------------------------------ diff --git a/framework/source/services/mediatypedetectionhelper.cxx b/framework/source/services/mediatypedetectionhelper.cxx index ac2cc361c4..c8a4cbaae9 100644 --- a/framework/source/services/mediatypedetectionhelper.cxx +++ b/framework/source/services/mediatypedetectionhelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: mediatypedetectionhelper.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: as $ $Date: 2001-01-26 06:42:14 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,8 +67,8 @@ #include <services/mediatypedetectionhelper.hxx> #endif -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> +#ifndef __FRAMEWORK_SERVICES_H_ +#include <services.h> #endif #ifndef _INETTYPE_HXX @@ -82,11 +82,7 @@ //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ -#ifndef TF_FILTER//MUSTFILTER -#ifndef _COM_SUN_STAR_FRAME_XFRAMELOADERQUERY_HPP_ -#include <com/sun/star/frame/XFrameLoaderQuery.hpp> -#endif -#endif//MUSTFILTER + //_________________________________________________________________________________________________________________ // namespace //_________________________________________________________________________________________________________________ @@ -94,9 +90,6 @@ namespace framework { -#ifndef TF_FILTER//MUSTFILTER -using namespace ::com::sun::star::frame ; -#endif//MUSTFILTER using namespace ::com::sun::star ; using namespace ::rtl ; @@ -150,30 +143,7 @@ sal_Bool SAL_CALL MediaTypeDetectionHelper::mapStrings( uno::Sequence< OUString >& rSeq ) throw(uno::RuntimeException) { - //osl::Guard aGuard( m_aMutex ); - //uno::Reference< lang::XMultiServiceFactory > xFactory - - if( !m_xFactory.is() ) - { - LOG_ASSERT( !(m_xFactory.is()==sal_False), "MediaTypeDetectionHelper::mapStrings()\n member m_xFactory( XMultiServiceFactory ) not set\n" ) - return sal_False; - } - -#ifndef TF_FILTER//MUSTFILTER - uno::Reference< frame::XFrameLoaderQuery > xQ( - m_xFactory->createInstance( SERVICENAME_FRAMELOADERFACTORY ),uno::UNO_QUERY ); - //IMPLEMENTATIONNAME_FRAMELOADERFACTORY - - if( !xQ.is() ) - { - LOG_ASSERT( !(xQ.is()==sal_False), "MediaTypeDetectionHelper::mapStrings()\n could not get Service FrameLoaderQuery\n" ) - return sal_False; - } -#endif//MUSTFILTER - sal_Bool bModified = sal_False; - //uno::Sequence< beans::PropertyValue > aTmpSeq(1); - //aTmpSeq[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")); for( sal_Int32 i = rSeq.getLength(); i--; ) { @@ -186,22 +156,6 @@ sal_Bool SAL_CALL MediaTypeDetectionHelper::mapStrings( rUrl = aType; bModified = sal_True; } - /* - OUString aFilter( xQ->searchFilter( rUrl, aTmpSeq ) ); - if( !aFilter.getLength() ) - continue; - uno::Sequence< beans::PropertyValue > aProps = xQ->getLoaderProperties( aFilter ); - for( sal_Int32 nN = aProps.getLength(); nN--; ) - { - const beans::PropertyValue& rProp = aProps[nN]; - if( rProp.Name.compareToAscii("ContentType") == 0 ) - { - rProp.Value >>= rUrl; - bModified = sal_True; - break; - } - } - */ } return bModified; } @@ -210,6 +164,9 @@ sal_Bool SAL_CALL MediaTypeDetectionHelper::mapStrings( /*------------------------------------------------------------------------- $Log: not supported by cvs2svn $ + Revision 1.3 2001/01/26 06:42:14 as + change baeh_services/BAEHSERVICES to services/SERVICES + Revision 1.2 2000/11/28 14:45:30 as #79040# new version of new type detection diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx index a07b1f8166..57ef7a37e3 100644 --- a/framework/source/services/urltransformer.cxx +++ b/framework/source/services/urltransformer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: urltransformer.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: as $ $Date: 2001-01-26 06:42:14 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,14 +67,14 @@ #include <services/urltransformer.hxx> #endif -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> -#endif - #ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ #include <macros/debug.hxx> #endif +#ifndef __FRAMEWORK_SERVICES_H_ +#include <services.h> +#endif + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -389,7 +389,7 @@ sal_Bool URLTransformer::impldbg_checkParameter_assemble( URL& aURL ) } //***************************************************************************************************************** -sal_Bool URLTransformer::impldbg_checkParameter_getPresentation ( const UNOURL& aURL , +sal_Bool URLTransformer::impldbg_checkParameter_getPresentation ( const URL& aURL , sal_Bool bWithPassword ) { // Set default return value. diff --git a/framework/source/threadhelp/fairrwlock.cxx b/framework/source/threadhelp/fairrwlock.cxx new file mode 100644 index 0000000000..96cc2922df --- /dev/null +++ b/framework/source/threadhelp/fairrwlock.cxx @@ -0,0 +1,282 @@ +/************************************************************************* + * + * $RCSfile: fairrwlock.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_FAIRRWLOCK_HXX_ +#include <threadhelp/fairrwlock.hxx> +#endif + +#ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_ +#include <threadhelp/resetableguard.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// non exported const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// non exported declarations +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// definitions +//_________________________________________________________________________________________________________________ + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +FairRWLock::FairRWLock() + : m_nReadCount ( 0 ) + , m_eWorkingMode ( E_INIT ) +{ + m_aWriteCondition.set(); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void SAL_CALL FairRWLock::setWorkingMode( EWorkingMode eMode ) +{ + // We need the access lock only here - because + // new calls are influenced by this call. + // Current working reader or writer has already checked this value! + // It's to late to refuse her requests ... + ResetableGuard aAccessGuard( m_aAccessLock ); + + if ( + ( m_eWorkingMode == E_INIT ) && + ( eMode == E_WORK ) + ) + { + m_eWorkingMode = E_WORK; + } + else + if ( + ( m_eWorkingMode == E_WORK ) && + ( eMode == E_CLOSE ) + ) + { + m_eWorkingMode = E_CLOSE; + } + else + if ( + ( m_eWorkingMode == E_CLOSE ) && + ( eMode == E_INIT ) + ) + { + m_eWorkingMode = E_INIT; + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +EWorkingMode SAL_CALL FairRWLock::getWorkingMode() +{ + // We don't must stand in serializer-queue! + // But synchronize access to internal member. + ResetableGuard aAccessLock( m_aAccessLock ); + + return m_eWorkingMode; +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void SAL_CALL FairRWLock::acquireReadAccess( ERefusalReason& eReason ) +{ + // impl-call is threadsafe himself! + if( impl_isCallRefused( eReason ) == sal_False ) + { + // Put call in "SERIALIZE"-queue! + // After successful acquiring this mutex we are alone ... + ResetableGuard aSerializeGuard( m_aSerializer ); + + // ... but we should synchronize us with other reader! + // May be - they will unregister himself by using releaseReadAccess()! + ResetableGuard aAccessGuard( m_aAccessLock ); + + // Now we must register us as reader by increasing counter. + // If this the first writer we must close door for possible writer. + // Other reader don't look for this barrier - they work parallel to us! + if( m_nReadCount == 0 ) + { + m_aWriteCondition.reset(); + } + ++m_nReadCount; + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void SAL_CALL FairRWLock::releaseReadAccess() +{ + // The access lock is enough at this point + // because it's not allowed to wait for all reader or writer here! + // That will cause a deadlock! + ResetableGuard aAccessGuard( m_aAccessLock ); + + // Unregister as reader first! + // Open writer barrier then if it was the last reader. + --m_nReadCount; + if( m_nReadCount == 0 ) + { + m_aWriteCondition.set(); + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void SAL_CALL FairRWLock::acquireWriteAccess( ERefusalReason& eReason ) +{ + // impl-call is threadsafe himself! + if( impl_isCallRefused( eReason ) == sal_False ) + { + // You have to stand in our serialize-queue till all reader + // are registered (not for releasing them!) or writer finished their work! + // Don't use a guard to do so - because you must hold the mutex till + // you call releaseWriteAccess()! + // After succesfull acquire you have to wait for current working reader. + // Used condition will open by last gone reader object. + m_aSerializer.acquire(); + m_aWriteCondition.wait(); + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void SAL_CALL FairRWLock::releaseWriteAccess() +{ + // The only one you have to do here is to release + // hold seriliaze-mutex. All other user of these instance are blocked + // by these mutex! + // You don't need any other mutex here - you are the only one in the moment! + m_aSerializer.release(); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void SAL_CALL FairRWLock::downgradeWriteAccess() +{ + // You must be a writer to call this method! + // We can't check it - but otherwise it's your problem ... + // Thats why you don't need any mutex here. + + // Register himself as "new" reader. + // This value must be 0 before - because we support single writer access only! + ++m_nReadCount; + // Close barrier for other writer! + // Why? + // You hold the serializer mutex - next one can be a reader OR a writer. + // They must blocked then - because you will be a reader after this call + // and writer use this condition to wait for current reader! + m_aWriteCondition.reset(); + // Open door for next waiting thread in serialize queue! + m_aSerializer.release(); +} + +//***************************************************************************************************************** +// private method +//***************************************************************************************************************** +sal_Bool FairRWLock::impl_isCallRefused( ERefusalReason& eReason ) +{ + // This call must safe access to internal member only. + // Set "possible reason" for return and check reject-state then! + // User should look ro return value first - reason then ... + ResetableGuard aAccessGuard( m_aAccessLock ); + switch( m_eWorkingMode ) + { + case E_INIT : eReason = E_UNINITIALIZED ; + break; + case E_WORK : eReason = E_NOREASON ; + break; + case E_CLOSE : eReason = E_CLOSED ; + break; + } + return( eReason!=E_NOREASON ); +} + +} // namespace framework diff --git a/framework/source/threadhelp/gate.cxx b/framework/source/threadhelp/gate.cxx new file mode 100644 index 0000000000..c7c7289b4e --- /dev/null +++ b/framework/source/threadhelp/gate.cxx @@ -0,0 +1,201 @@ +/************************************************************************* + * + * $RCSfile: gate.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_GATE_HXX_ +#include <threadhelp/gate.hxx> +#endif + +#ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_ +#include <threadhelp/resetableguard.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// non exported const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// non exported declarations +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// definitions +//_________________________________________________________________________________________________________________ + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +Gate::Gate() + : m_bClosed ( sal_False ) + , m_bGapOpen ( sal_False ) +{ + open(); +} + +//***************************************************************************************************************** +// destructor +//***************************************************************************************************************** +Gate::~Gate() +{ + open(); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void Gate::open() +{ + // We must safe access to our internal member! + ResetableGuard aLock( m_aAccessLock ); + // Set condition -> wait don't block any longer -> gate is open + m_aPassage.set(); + // Check if operation was successful! + // Check returns false if condition isn't set => m_bClosed will be true then => we must return false; opening failed + m_bClosed = ( m_aPassage.check() == sal_False ); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void Gate::close() +{ + // We must safe access to our internal member! + ResetableGuard aLock( m_aAccessLock ); + // Reset condition -> wait blocks now -> gate is closed + m_aPassage.reset(); + // Check if operation was successful! + // Check returns false if condition was reseted => m_bClosed will be true then => we can return true; closing ok + m_bClosed = ( m_aPassage.check() == sal_False ); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void Gate::openGap() +{ + // We must safe access to our internal member! + ResetableGuard aLock( m_aAccessLock ); + // Open passage for current waiting threads. + m_aPassage.set(); + // Check state of condition. + // If condition is set check() returns true => m_bGapOpen will be true too => we can use it as return value. + m_bGapOpen = ( m_aPassage.check() == sal_True ); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +sal_Bool Gate::wait( const TimeValue* pTimeOut ) +{ + // We must safe access to our internal member! + ResetableGuard aLock( m_aAccessLock ); + // If gate not closed - caller can pass it. + sal_Bool bSuccessful = sal_True; + if( m_bClosed == sal_True ) + { + // Otherwise first new thread must close an open gap! + if( m_bGapOpen == sal_True ) + { + m_bGapOpen = sal_False; + m_aPassage.reset(); + } + // Then we must release used access lock - + // because next call will block ... + // and if we hold the access lock nobody else can use this object without a dadlock! + aLock.unlock(); + // Wait for opening gate ... + bSuccessful = ( m_aPassage.wait( pTimeOut ) == osl_cond_result_ok ); + } + + return bSuccessful; +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +sal_Bool Gate::isOpen() const +{ + // I think we never need the access lock for pure reading of this bool member ... + return !m_bClosed; +} + +} // namespace framework diff --git a/framework/source/threadhelp/makefile.mk b/framework/source/threadhelp/makefile.mk new file mode 100644 index 0000000000..fae6cb3d31 --- /dev/null +++ b/framework/source/threadhelp/makefile.mk @@ -0,0 +1,87 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1 $ +# +# last change: $Author: as $ $Date: 2001-03-29 13:17:16 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 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 +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* +PRJ=..$/.. + +PRJNAME= framework +TARGET= fwk_threadhelp +USE_DEFFILE= TRUE +NO_BSYMBOLIC= TRUE +ENABLE_EXCEPTIONS= TRUE +BOOTSTRAP_SERVICE= FALSE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +# --- Generate ----------------------------------------------------- + +SLOFILES= $(SLO)$/resetableguard.obj \ + $(SLO)$/fairrwlock.obj \ + $(SLO)$/gate.obj \ + $(SLO)$/readguard.obj \ + $(SLO)$/writeguard.obj + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/framework/source/threadhelp/readguard.cxx b/framework/source/threadhelp/readguard.cxx new file mode 100644 index 0000000000..b97175fbd2 --- /dev/null +++ b/framework/source/threadhelp/readguard.cxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * $RCSfile: readguard.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_READGUARD_HXX_ +#include <threadhelp/readguard.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// non exported const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// non exported declarations +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// definitions +//_________________________________________________________________________________________________________________ + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +ReadGuard::ReadGuard( IRWLock* pLock , + ERefusalReason& eReason ) + : m_pLock ( pLock ) + , m_bLocked ( sal_False ) +{ + lock( eReason ); +} + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +ReadGuard::ReadGuard( IRWLock& rLock , + ERefusalReason& eReason ) + : m_pLock ( &rLock ) + , m_bLocked ( sal_False ) +{ + lock( eReason ); +} + +//***************************************************************************************************************** +// destructor +//***************************************************************************************************************** +ReadGuard::~ReadGuard() +{ + unlock(); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void ReadGuard::lock( ERefusalReason& eReason ) +{ + if( m_bLocked == sal_False ) + { + m_pLock->acquireReadAccess( eReason ); + if( eReason == E_NOREASON ) + { + m_bLocked = sal_True; + } + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void ReadGuard::unlock() +{ + if( m_bLocked == sal_True ) + { + m_pLock->releaseReadAccess(); + m_bLocked = sal_False; + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +sal_Bool ReadGuard::isLocked() const +{ + return m_bLocked; +} + +} // namespace framework diff --git a/framework/source/threadhelp/resetableguard.cxx b/framework/source/threadhelp/resetableguard.cxx new file mode 100644 index 0000000000..39508c2547 --- /dev/null +++ b/framework/source/threadhelp/resetableguard.cxx @@ -0,0 +1,172 @@ +/************************************************************************* + * + * $RCSfile: resetableguard.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_ +#include <threadhelp/resetableguard.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +using namespace ::osl ; + +//_________________________________________________________________________________________________________________ +// non exported const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// non exported declarations +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// definitions +//_________________________________________________________________________________________________________________ + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +ResetableGuard::ResetableGuard( Mutex* pMutex ) + : m_pMutex ( pMutex ) + , m_bLocked ( sal_False ) +{ + lock(); +} + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +ResetableGuard::ResetableGuard( Mutex& rMutex ) + : m_pMutex ( &rMutex ) + , m_bLocked ( sal_False ) +{ + lock(); +} + +//***************************************************************************************************************** +// destructor +//***************************************************************************************************************** +ResetableGuard::~ResetableGuard() +{ + unlock(); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void ResetableGuard::lock() +{ + if( m_bLocked == sal_False ) + { + m_bLocked = m_pMutex->acquire(); + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void ResetableGuard::unlock() +{ + if( m_bLocked == sal_True ) + { + m_bLocked = !(m_pMutex->release()); + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +sal_Bool ResetableGuard::tryToLock() +{ + if( m_bLocked == sal_False ) + { + m_bLocked = m_pMutex->tryToAcquire(); + } + return m_bLocked; +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +sal_Bool ResetableGuard::isLocked() const +{ + return m_bLocked; +} + +} // namespace framework diff --git a/framework/source/threadhelp/writeguard.cxx b/framework/source/threadhelp/writeguard.cxx new file mode 100644 index 0000000000..61cc9cec0b --- /dev/null +++ b/framework/source/threadhelp/writeguard.cxx @@ -0,0 +1,206 @@ +/************************************************************************* + * + * $RCSfile: writeguard.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:16 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_WRITEGUARD_HXX_ +#include <threadhelp/writeguard.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ +#include <macros/debug.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// non exported const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// non exported declarations +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// definitions +//_________________________________________________________________________________________________________________ + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +WriteGuard::WriteGuard( IRWLock* pLock , + ERefusalReason& eReason ) + : m_pLock ( pLock ) + , m_eMode ( E_NOLOCK ) +{ + lock( eReason ); +} + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +WriteGuard::WriteGuard( IRWLock& rLock , + ERefusalReason& eReason ) + : m_pLock ( &rLock ) + , m_eMode ( E_NOLOCK ) +{ + lock( eReason ); +} + +//***************************************************************************************************************** +// destructor +//***************************************************************************************************************** +WriteGuard::~WriteGuard() +{ + unlock(); +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void WriteGuard::lock( ERefusalReason& eReason ) +{ + switch( m_eMode ) + { + case E_NOLOCK : { + // Acquire write access and set return state. + // Mode is set later if it was successful! + m_pLock->acquireWriteAccess( eReason ); + if( eReason == E_NOREASON ) + { + m_eMode = E_WRITELOCK; + } + } + break; + case E_READLOCK : { + // User has downgrade to read access before! + // We must release it before we can set a new write access! + m_pLock->releaseReadAccess(); + m_pLock->acquireWriteAccess( eReason ); + if( eReason == E_NOREASON ) + { + m_eMode = E_WRITELOCK; + } + } + break; + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void WriteGuard::unlock() +{ + switch( m_eMode ) + { + case E_READLOCK : { + // Use has downgraded to a read lock! + m_pLock->releaseReadAccess(); + m_eMode = E_NOLOCK; + } + break; + case E_WRITELOCK : { + m_pLock->releaseWriteAccess(); + m_eMode = E_NOLOCK; + } + break; + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +void WriteGuard::downgrade() +{ + if( m_eMode == E_WRITELOCK ) + { + m_pLock->downgradeWriteAccess(); + m_eMode = E_READLOCK; + } +} + +//***************************************************************************************************************** +// public method +//***************************************************************************************************************** +ELockMode WriteGuard::getMode() const +{ + return m_eMode; +} + +} // namespace framework diff --git a/framework/source/unotypes/fwl.xml b/framework/source/unotypes/fwl.xml index 9f684cd419..6a23159d2a 100644 --- a/framework/source/unotypes/fwl.xml +++ b/framework/source/unotypes/fwl.xml @@ -1,7 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd"> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> + <module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name> fwl </module-name> + <component-description> <author> Andreas Schluens </author> <name> com.sun.star.comp.framework.TypeDetection </name> @@ -12,7 +15,9 @@ <language> c++ </language> <status value="final"/> <supported-service> com.sun.star.document.TypeDetection </supported-service> + <type> com.</type> </component-description> + <component-description> <author> Andreas Schluens </author> <name> com.sun.star.comp.framework.FilterFactory </name> @@ -24,6 +29,7 @@ <status value="final"/> <supported-service> com.sun.star.document.FilterFactory </supported-service> </component-description> + <component-description> <author> Andreas Schluens </author> <name> com.sun.star.comp.frame.FrameLoaderFactory </name> @@ -36,6 +42,7 @@ <status value="final"/> <supported-service> com.sun.star.frame.FrameLoaderFactory </supported-service> </component-description> + <component-description> <author> Ingrid Halama </author> <name> com.sun.star.comp.framework.MediaTypeDetectionHelper </name> @@ -48,6 +55,7 @@ <status value="final"/> <supported-service> com.sun.star.frame.MediaTypeDetectionHelper </supported-service> </component-description> + <project-build-dependency> cppu </project-build-dependency> <project-build-dependency> cppuhelper </project-build-dependency> <project-build-dependency> comphelper </project-build-dependency> @@ -55,6 +63,7 @@ <project-build-dependency> vos </project-build-dependency> <project-build-dependency> sal </project-build-dependency> <project-build-dependency> svl </project-build-dependency> + <runtime-module-dependency> cppu2 </runtime-module-dependency> <runtime-module-dependency> cppuhelper </runtime-module-dependency> <runtime-module-dependency> comphelp2 </runtime-module-dependency> @@ -62,4 +71,5 @@ <runtime-module-dependency> vos2$(COM) </runtime-module-dependency> <runtime-module-dependency> sal2 </runtime-module-dependency> <runtime-module-dependency> svl </runtime-module-dependency> + </module-description> diff --git a/framework/source/unotypes/lgd.xml b/framework/source/unotypes/lgd.xml index 22016c9dfe..d62a77c6c0 100644 --- a/framework/source/unotypes/lgd.xml +++ b/framework/source/unotypes/lgd.xml @@ -1,5 +1,5 @@ -<?xml version='1.0' encoding="UTF-8"?> -<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd"> +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> <module-description xmlns:xlink="http://www.w3.org/1999/xlink"> diff --git a/framework/test/makefile.mk b/framework/test/makefile.mk index 7cd6cc6971..3122a0650d 100644 --- a/framework/test/makefile.mk +++ b/framework/test/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.3 $ +# $Revision: 1.4 $ # -# last change: $Author: as $ $Date: 2001-02-26 08:45:23 $ +# last change: $Author: as $ $Date: 2001-03-29 13:17:17 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -78,17 +78,16 @@ NO_BSYMBOLIC= TRUE LINKFLAGS+=/SEGMENTS:1024 /PACKD:32768 .ENDIF -# --- Test Applikation -------------------------------------------------- +# --- applikation: "test" -------------------------------------------------- -APP1TARGET= $(TARGET) +APP1TARGET= test APP1OBJS= $(SLO)$/test.obj APP1LIBS= $(SLB)$/fwk_classes.lib \ $(SLB)$/fwk_helper.lib -APP1STDLIBS= \ - $(CPPULIB) \ +APP1STDLIBS= $(CPPULIB) \ $(CPPUHELPERLIB) \ $(OSLLIB) \ $(SALLIB) \ @@ -106,16 +105,44 @@ APP1DEPN= $(SLB)$/fwk_helper.lib \ APP1DEF= $(MISC)$/test.def .ENDIF -# --- TypeCFG Applikation -------------------------------------------------- +# --- application: "threadtest" -------------------------------------------------- -APP2TARGET= typecfg +APP2TARGET= threadtest -APP2OBJS= $(SLO)$/typecfg.obj \ +APP2OBJS= $(SLO)$/threadtest.obj \ + $(SLO)$/fairrwlock.obj \ + $(SLO)$/resetableguard.obj \ + $(SLO)$/gate.obj \ + $(SLO)$/readguard.obj \ + $(SLO)$/writeguard.obj + +APP2STDLIBS= $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(OSLLIB) \ + $(SALLIB) \ + $(VOSLIB) \ + $(SVLIB) + +APP2DEPN= $(SLO)$/fairrwlock.obj \ + $(SLO)$/resetableguard.obj \ + $(SLO)$/gate.obj \ + $(SLO)$/readguard.obj \ + $(SLO)$/writeguard.obj + +.IF "$(GUI)"=="WIN" || "$(GUI)"=="OS2" +APP2DEF= $(MISC)$/threadtest.def +.ENDIF + +# --- applikation: "typecfg" -------------------------------------------------- + +APP3TARGET= typecfg + +APP3OBJS= $(SLO)$/typecfg.obj \ $(SLO)$/servicemanager.obj \ $(SLO)$/filtercache.obj \ $(SLO)$/wildcard.obj -APP2STDLIBS= $(CPPULIB) \ +APP3STDLIBS= $(CPPULIB) \ $(CPPUHELPERLIB) \ $(OSLLIB) \ $(SALLIB) \ @@ -126,11 +153,11 @@ APP2STDLIBS= $(CPPULIB) \ $(COMPHELPERLIB) \ $(SVLIB) -APP2DEPN= $(SLO)$/servicemanager.obj \ +APP3DEPN= $(SLO)$/servicemanager.obj \ $(SLO)$/filtercache.obj .IF "$(GUI)"=="WIN" || "$(GUI)"=="OS2" -APP2DEF= $(MISC)$/typecfg.def +APP3DEF= $(MISC)$/typecfg.def .ENDIF # --- Targets ------------------------------------------------------ diff --git a/framework/test/test.cxx b/framework/test/test.cxx index afeb98dfe3..c604af4590 100644 --- a/framework/test/test.cxx +++ b/framework/test/test.cxx @@ -2,9 +2,9 @@ * * $RCSfile: test.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: as $ $Date: 2001-03-09 14:42:26 $ + * last change: $Author: as $ $Date: 2001-03-29 13:17:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,10 +63,6 @@ // my own includes //_________________________________________________________________________________________________________________ -#ifndef __FRAMEWORK_HELPER_OINSTANCEPROVIDER_HXX_ -#include <helper/oinstanceprovider.hxx> -#endif - #ifndef __FRAMEWORK_CLASSES_SERVICEMANAGER_HXX_ #include <classes/servicemanager.hxx> #endif @@ -83,8 +79,8 @@ #include <macros/debug.hxx> #endif -#ifndef __FRAMEWORK_DEFINES_HXX_ -#include <defines.hxx> +#ifndef __FRAMEWORK_SERVICES_H_ +#include <services.h> #endif //_________________________________________________________________________________________________________________ @@ -163,10 +159,8 @@ #include <com/sun/star/bridge/XInstanceProvider.hpp> #endif -#ifdef TF_FILTER//MUSTFILTER - #ifndef _COM_SUN_STAR_DOCUMENT_XTYPEDETECTION_HPP_ - #include <com/sun/star/document/XTypeDetection.hpp> - #endif +#ifndef _COM_SUN_STAR_DOCUMENT_XTYPEDETECTION_HPP_ +#include <com/sun/star/document/XTypeDetection.hpp> #endif #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ @@ -246,9 +240,7 @@ using namespace ::com::sun::star::util ; using namespace ::com::sun::star::task ; using namespace ::com::sun::star::mozilla ; using namespace ::com::sun::star::bridge ; -#ifdef TF_FILTER//MUSTFILTER using namespace ::com::sun::star::document ; -#endif using namespace ::com::sun::star::container ; //_________________________________________________________________________________________________________________ @@ -285,7 +277,6 @@ class TestApplication : public Application void impl_testLoginDialog(); #endif -#ifdef TF_FILTER #ifdef TEST_FILTERCACHE void impl_testFilterCache(); #endif @@ -297,7 +288,6 @@ class TestApplication : public Application #ifdef TEST_FILTERREGISTRATION void impl_testFilterRegistration(); #endif -#endif #ifdef TEST_TREESEARCH sal_Bool impl_testTreeSearch(); @@ -355,11 +345,9 @@ void TestApplication::Main() #endif //------------------------------------------------------------------------------------------------------------- -#ifdef TF_FILTER #ifdef TEST_TYPEDETECTION impl_testTypeDetection(); #endif -#endif //------------------------------------------------------------------------------------------------------------- #ifdef TEST_LOGINDIALOG @@ -405,7 +393,6 @@ void TestApplication::Main() //_________________________________________________________________________________________________________________ // test method //_________________________________________________________________________________________________________________ -#ifdef TF_FILTER #ifdef TEST_TYPEDETECTION void TestApplication::impl_testTypeDetection() { @@ -504,12 +491,10 @@ void TestApplication::impl_testTypeDetection() WRITE_LOGFILE( "testTypeDetection.log", U2B(sBuffer.makeStringAndClear()).getStr() ) } #endif -#endif //_________________________________________________________________________________________________________________ // test method //_________________________________________________________________________________________________________________ -#ifdef TF_FILTER #ifdef TEST_FILTERCACHE void TestApplication::impl_testFilterCache() { @@ -585,7 +570,6 @@ void TestApplication::impl_testFilterCache() WRITE_LOGFILE( "test_FilterCache.log", U2B(sBuffer.makeStringAndClear()).getStr() ) } #endif -#endif //_________________________________________________________________________________________________________________ // test method diff --git a/framework/test/threadtest.cxx b/framework/test/threadtest.cxx new file mode 100644 index 0000000000..bd0af348c9 --- /dev/null +++ b/framework/test/threadtest.cxx @@ -0,0 +1,828 @@ +/************************************************************************* + * + * $RCSfile: threadtest.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: as $ $Date: 2001-03-29 13:17:17 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ +#include <macros/generic.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ +#include <macros/debug.hxx> +#endif + +#ifndef __FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_ +#include <threadhelp/resetableguard.hxx> +#endif + +#ifndef __FRAMEWORK_THREADHELP_RWLOCKBASE_HXX_ +#include <threadhelp/rwlockbase.hxx> +#endif + +#ifndef __FRAMEWORK_THREADHELP_READGUARD_HXX_ +#include <threadhelp/readguard.hxx> +#endif + +#ifndef __FRAMEWORK_THREADHELP_WRITEGUARD_HXX_ +#include <threadhelp/writeguard.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +#ifndef _RTL_RANDOM_H_ +#include <rtl/random.h> +#endif + +#ifndef _VOS_PROCESS_HXX_ +#include <vos/process.hxx> +#endif + +#ifndef _VOS_THREAD_HXX_ +#include <vos/thread.hxx> +#endif + +#ifndef _RTL_USTRING_ +#include <rtl/ustring> +#endif + +#ifndef _RTL_USTRBUF_HXX_ +#include <rtl/ustrbuf.hxx> +#endif + +#ifndef _OSL_TIME_H_ +#include <osl/time.h> +#endif + +#ifndef _OSL_INTERLOCK_H_ +#include <osl/interlock.h> +#endif + +#include <vcl/event.hxx> +#include <vcl/svapp.hxx> +#include <vcl/wrkwin.hxx> +#include <vcl/msgbox.hxx> +#include <stdio.h> + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +#define LOGFILE "threadtest.log" +#define STATISTICS_FILE "threadtest_statistic.csv" + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +using namespace ::rtl ; +using namespace ::osl ; +using namespace ::vos ; +using namespace ::framework ; + +//_________________________________________________________________________________________________________________ +// defines +//_________________________________________________________________________________________________________________ + +/*---------------- Use follow defines to enable/disable some special features of this little test program! -------*/ + +//#define ENABLE_LOG +//#define ENABLE_THREADDELAY +//#define ENABLE_REQUESTCOUNT + +/*----------------------------------------------------------------------------------------------------------------*/ + +#ifdef ENABLE_LOG + #define LOG_SETA_START( NA, NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + sLog.append( " ] call setA( " ); \ + sLog.append( NA ); \ + sLog.append( " )\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_SETA_END( NA, EREASON, NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + if( EREASON == E_NOREASON ) \ + sLog.append( " ] finish setA( " ); \ + else \ + sLog.append( " ] was refused at setA( "); \ + sLog.append( NA ); \ + sLog.append( " )\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_GETA_START( NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + sLog.append( " ] call getA()\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_GETA_END( NRETURN, EREASON, NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + if( EREASON == E_NOREASON ) \ + sLog.append( " ] finish getA() with " ); \ + else \ + sLog.append( " ] was refused at getA() with " ); \ + sLog.append( NRETURN ); \ + sLog.append( "\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_WORKA_START( NA, NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + sLog.append( " ] call workA( " ); \ + sLog.append( NA ); \ + sLog.append( " )\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_WORKA_END( NRETURN, EREASON, NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + if( EREASON == E_NOREASON ) \ + sLog.append( " ] finish workA() with " ); \ + else \ + sLog.append( " ] was refused at workA() with " ); \ + sLog.append( NRETURN ); \ + sLog.append( "\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_INITEXCEPTION( SMETHOD, NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + sLog.append( " ] get EInitException from \"" ); \ + sLog.append( SMETHOD ); \ + sLog.append( "\"\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_CLOSEEXCEPTION( SMETHOD, NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + sLog.append( " ] get ECloseException from \"" ); \ + sLog.append( SMETHOD ); \ + sLog.append( "\"\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_INIT( NA, NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + sLog.append( " ] initialize me with " ); \ + sLog.append( NA ); \ + sLog.append( "\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } + + #define LOG_CLOSE( NID ) \ + { \ + sal_uInt32 nTimeStamp = osl_getGlobalTimer(); \ + ResetableGuard aLogGuard( m_aLogMutex ); \ + OStringBuffer sLog(256); \ + sLog.append( (sal_Int32)nTimeStamp ); \ + sLog.append( ": Thread[ " ); \ + sLog.append( NID ); \ + sLog.append( " ] close me\n" ); \ + WRITE_LOGFILE( LOGFILE, sLog.makeStringAndClear().getStr() ) \ + } +#else + #define LOG_SETA_START( NA, NID ) + #define LOG_SETA_END( NA, EREASON, NID ) + #define LOG_GETA_START( NID ) + #define LOG_GETA_END( NRETURN, EREASON, NID ) + #define LOG_WORKA_START( NA, NID ) + #define LOG_WORKA_END( NRETURN, EREASON, NID ) + #define LOG_INITEXCEPTION( SMETHOD, NID ) + #define LOG_CLOSEEXCEPTION( SMETHOD, NID ) + #define LOG_INIT( NA, NID ) + #define LOG_CLOSE( NID ) +#endif + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +sal_uInt16 getRandomValue() +{ + // Get new random value for thread-sleep! + // See run() for further informations. + // Always calculate a new random number. + sal_uInt16 nValue; + rtlRandomPool aPool = rtl_random_createPool(); + rtl_random_getBytes ( aPool, &nValue, 2 ); + rtl_random_destroyPool ( aPool ); + return nValue; +} + +/*-************************************************************************************************************//** + @descr This class is used from different threads at the same time. + We start working after calling init() first(!) ... + and finish it by calling close(). It exist two methods for reading/writing an + internal variable "A". Another function workA() do both things at the same time. + All public methods log information in a file if DO_LOG is defined. + + @attention Our public base class FaiRWLockBase is a struct with a RWLock as member. + This member can be used by guards to safe access at internal variables + in interface methods. +*//*-*************************************************************************************************************/ + +class ThreadSafeClass : private FairRWLockBase +{ + public: + + ThreadSafeClass (); + ~ThreadSafeClass(); + + // This methods are used from differnt threads + // to test this class. + void init ( sal_Int32 nA , + sal_Int32 nThreadID ); + void close ( sal_Int32 nThreadID ); + void setA ( sal_Int32 nA , + sal_Int32 nThreadID ); + sal_Int32 getA ( sal_Int32 nThreadID ); + sal_Int32 workA ( sal_Int32 nA , + sal_Int32 nThreadID ); + + #ifdef ENABLE_REQUESTCOUNT + // This methods are used for statistics only! + sal_Int32 getReadCount () { return m_nReadCount; } + sal_Int32 getWriteCount() { return m_nWriteCount; } + #endif + + private: + + sal_Int32 m_nA ; /// test member fro reading/writing + + #ifdef ENABLE_LOG + ::osl::Mutex m_aLogMutex ; /// mutex to serialize writing log file! + #endif + + #ifdef ENABLE_REQUESTCOUNT + oslInterlockedCount m_nReadCount ; /// statistic variables to count read/write requests + oslInterlockedCount m_nWriteCount ; + #endif +}; + +//_________________________________________________________________________________________________________________ +ThreadSafeClass::ThreadSafeClass() + : FairRWLockBase ( ) /// This struct "export" a public lock member, which can be used by our methods! + , m_nA ( 0 ) + #ifdef ENABLE_REQUESTCOUNT + , m_nReadCount ( 0 ) + , m_nWriteCount ( 0 ) + #endif +{ +} + +//_________________________________________________________________________________________________________________ +ThreadSafeClass::~ThreadSafeClass() +{ +} + +//_________________________________________________________________________________________________________________ +void ThreadSafeClass::init( sal_Int32 nA, sal_Int32 nThreadID ) +{ + LOG_INIT( nA, nThreadID ) + // Best place to initialize internal member is before you call + // setWorkingMode() ... but if somewhere call this function + // more then ones ... + // => check current mode before! + switch( m_aLock.getWorkingMode() ) + { + case E_INIT : { + // OK - This is the first call of init(). + // Set new value and change mode then. + m_nA = nA; + m_aLock.setWorkingMode( E_WORK ); + // After that it's not a good idea to work with internal member + // iwthout using the lock! + } + break; + case E_WORK : { + LOG_ERROR( "ThreadSafeClass::init()", "Don't call this method more then ones!" ) + } + break; + case E_CLOSE : LOG_CLOSEEXCEPTION( "init()", nThreadID ) + break; + } +} + +//_________________________________________________________________________________________________________________ +void ThreadSafeClass::close( sal_Int32 nThreadID ) +{ + LOG_CLOSE( nThreadID ) + // First get current working mode to prevent us against + // multiple calls of this method or calls at wrong time! + switch( m_aLock.getWorkingMode() ) + { + case E_INIT : LOG_INITEXCEPTION( "close()", nThreadID ) + //throw Exception(); + break; + case E_CLOSE : LOG_CLOSEEXCEPTION( "close()", nThreadID ) + //throw Exception(); + break; + case E_WORK : { + // This is the only accepted mode for this method. + // Now we should change it to E_CLOSE before we do something + // with our internal member!!! + // This call will block till all current reader and writer are gone! + m_aLock.setWorkingMode( E_CLOSE ); + // Now we are alone ... + // All further calls to this object are rejected. + m_nA = 0; + } + break; + } +} + +//_________________________________________________________________________________________________________________ +void ThreadSafeClass::setA( sal_Int32 nA, sal_Int32 nThreadID ) +{ + LOG_SETA_START( nA, nThreadID ) + + // Try to set a write lock ... but look for + // rejected calls. We must react for. + ERefusalReason eReason; + WriteGuard aGuard( m_aLock, eReason ); + switch( eReason ) + { + case E_UNINITIALIZED : { + // This object isn't initialized => not ready for working! + // We should throw an exception or do nothing. + LOG_INITEXCEPTION( "setA()", nThreadID ) + //throw Exception(); + } + break; + case E_CLOSED : { + // This object is closed => not ready for working! + // We should throw an exception or do nothing. + LOG_CLOSEEXCEPTION( "setA()", nThreadID ) + //throw Exception(); + } + break; + case E_NOREASON : { + // This object is ready for working and we have full write access. + // We can work with our member. + m_nA = nA; + #ifdef ENABLE_REQUESTCOUNT + osl_incrementInterlockedCount( &m_nWriteCount ); + #endif + } + break; + } + + LOG_SETA_END( nA, eReason, nThreadID ) +} + +//_________________________________________________________________________________________________________________ +sal_Int32 ThreadSafeClass::getA( sal_Int32 nThreadID ) +{ + LOG_GETA_START( nThreadID ) + + // Try to set a read lock ... but look for + // rejected calls. We must react for. + // Define a default return value for this case. + sal_Int32 nReturn = 0; + ERefusalReason eReason; + ReadGuard aGuard( m_aLock, eReason ); + switch( eReason ) + { + case E_UNINITIALIZED : { + LOG_INITEXCEPTION( "getA()", nThreadID ) + //throw Exception(); + } + break; + case E_CLOSED : { + LOG_CLOSEEXCEPTION( "getA()", nThreadID ) + //throw Exception(); + } + break; + case E_NOREASON : { + nReturn = m_nA; + #ifdef ENABLE_REQUESTCOUNT + osl_incrementInterlockedCount( &m_nReadCount ); + #endif + } + break; + } + + LOG_GETA_END( nReturn, eReason, nThreadID ) + + return nReturn; +} + +//_________________________________________________________________________________________________________________ +sal_Int32 ThreadSafeClass::workA( sal_Int32 nA , + sal_Int32 nThreadID ) +{ + LOG_WORKA_START( nA, nThreadID ) + // This method test the downgrade-mechanism of used lock implementation! + + // Try to set a write lock first ... but look for + // rejected calls. We must react for. + // Define a default return value for this case. + sal_Int32 nReturn = 0; + ERefusalReason eReason; + WriteGuard aGuard( m_aLock, eReason ); + switch( eReason ) + { + case E_UNINITIALIZED : { + LOG_INITEXCEPTION( "workA()", nThreadID ) + //throw Exception(); + } + break; + case E_CLOSED : { + LOG_CLOSEEXCEPTION( "workA()", nThreadID ) + //throw Exception(); + } + break; + case E_NOREASON : { + // We have write access to our member. + // Set new value. + m_nA = nA; + #ifdef ENABLE_REQUESTCOUNT + osl_incrementInterlockedCount( &m_nWriteCount ); + #endif + + // Downgrade write access to read access and read the set value again. + // This call can't be rejected - but it can fail! + aGuard.downgrade(); + nReturn = m_nA; + #ifdef ENABLE_REQUESTCOUNT + osl_incrementInterlockedCount( &m_nReadCount ); + #endif + } + break; + } + + LOG_WORKA_END( nReturn, eReason, nThreadID ) + return nReturn; +} + +/*-****************************************************************************************************//** + @descr Every thread instance of these class lopp from 0 up to "nLoops". + He sleep for a random time and work with given test class "pClass" then. + We use random values for waiting for better results! + Otherwise all threads are sychron after first 2,3...5 calls - I think! +*//*-*****************************************************************************************************/ + +class TestThread : public OThread +{ + public: + + TestThread( ThreadSafeClass* pClass , + sal_Int32 nLoops , + Condition* pListener , + sal_Bool bOwner = sal_False ); + + private: + + virtual void SAL_CALL run (); + virtual void SAL_CALL onTerminated (); + + private: + + ThreadSafeClass* m_pClass ; + sal_Int32 m_nLoops ; + sal_Int32 m_nThreadID ; + Condition* m_pListener ; + sal_Bool m_bOwner ; +}; + +//_________________________________________________________________________________________________________________ +TestThread::TestThread( ThreadSafeClass* pClass , + sal_Int32 nLoops , + Condition* pListener , + sal_Bool bOwner ) + : m_pClass ( pClass ) + , m_nLoops ( nLoops ) + , m_pListener ( pListener ) + , m_bOwner ( bOwner ) +{ +} + +//_________________________________________________________________________________________________________________ +void SAL_CALL TestThread::run() +{ + // Get ID of this thread. + // Is used for logging information ... + m_nThreadID = getCurrentIdentifier(); + + // If we are the owner of given pClass + // we must initialize ... and close + // it. See at the end of this method too. + if( m_bOwner == sal_True ) + { + m_pClass->init( 0, m_nThreadID ); + } + + #ifdef ENABLE_THREADDELAY + TimeValue nDelay ; + #endif + + sal_Int32 nA ; + + for( sal_Int32 nCount=0; nCount<m_nLoops; ++nCount ) + { + // Work with class. + // Use random to select called method. + nA = (sal_Int32)getRandomValue(); + if( nA % 5 == 0 ) + { + nA = m_pClass->workA( nA, m_nThreadID ); + } + else + if( nA % 3 == 0 ) + { + m_pClass->setA( nA, m_nThreadID ); + } + else + { + nA = m_pClass->getA( m_nThreadID ); + } + #ifdef ENABLE_THREADDELAY + // Sleep - use random value to do that too! + nDelay.Seconds = 0; + nDelay.Nanosec = getRandomValue(); + sleep( nDelay ); + #endif + } + + // Don't forget to "close" teset object if you are the owner! + if( m_bOwner == sal_True ) + { + m_pClass->close( m_nThreadID ); + } +} + +//_________________________________________________________________________________________________________________ +void SAL_CALL TestThread::onTerminated() +{ + // Destroy yourself if you finished. + // But don't forget to call listener before. + m_pListener->set(); + + m_pClass = NULL; + m_pListener = NULL; + + delete this; +} + +/*-****************************************************************************************************//** + @descr This is our test application. + We create one ThreadSafeClass object and a lot of threads + which use it at different times. +*//*-*****************************************************************************************************/ + +struct ThreadInfo +{ + Condition* pCondition ; + TestThread* pThread ; +}; + +class TestApplication : public Application +{ + public: + void Main ( ); + sal_Int32 measureTime ( sal_Int32 nThreadCount , + sal_Int32 nOwner , + sal_Int32 nLoops=0 ); +}; + +//_________________________________________________________________________________________________________________ +// definition +//_________________________________________________________________________________________________________________ + +TestApplication aApplication; + +//_________________________________________________________________________________________________________________ +// This function start "nThreadCount" threads to use same test class. +// You can specify the owner thread of this test class which start/stop it by using "nOwner". [1..nThreadcount]! +// If you specify "nLoops" different from 0 we use it as loop count for every started thread. +// Otherwise we work with random values. +sal_Int32 TestApplication::measureTime( sal_Int32 nThreadCount , + sal_Int32 nOwner , + sal_Int32 nLoops ) +{ + // This is the class which should be tested. + ThreadSafeClass aClass; + + // Create list of threads. + ThreadInfo* pThreads = new ThreadInfo[nThreadCount]; + sal_Int32 nLoopCount = nLoops ; + sal_Bool bOwner = sal_False ; + for( sal_Int32 nI=1; nI<=nThreadCount; ++nI ) + { + // If nLoops==0 => we must use random value; otherwise we must use given count ... + if( nLoops == 0 ) + { + nLoopCount = getRandomValue(); + } + // Search owner of class. + bOwner = sal_False; + if( nOwner == nI ) + { + bOwner = sal_True; + } + // initialize condition. + pThreads[nI].pCondition = new Condition; + // Initialize thread. + pThreads[nI].pThread = new TestThread( &aClass, nLoopCount, pThreads[nI].pCondition, bOwner ); + } + + // Start clock to get information about used time. + sal_uInt32 nStartTime ; + sal_uInt32 nEndTime ; + + nStartTime = osl_getGlobalTimer(); + + // Start threads ... + for( nI=1; nI<=nThreadCount; ++nI ) + { + pThreads[nI].pThread->create(); + } + + // Wait for threads ... + for( nI=1; nI<=nThreadCount; ++nI ) + { + pThreads[nI].pCondition->wait(); + delete pThreads[nI].pCondition; + pThreads[nI].pCondition = NULL; + } + + delete[] pThreads; + pThreads = NULL; + + nEndTime = osl_getGlobalTimer(); + + // Calc used time and return it. [ms] + return( nEndTime-nStartTime ); +} + +//_________________________________________________________________________________________________________________ +void TestApplication::Main() +{ + sal_Int32 nTestCount = 0; /// count of calling "measureTime()" + sal_Int32 nThreadCount = 0; /// count of used threads by "measure..." + sal_Int32 nLoops = 0; /// loop count for every thread + sal_Int32 nOwner = 0; /// number of owner thread + + // Parse command line. + // Attention: All parameter are required and must exist! + // syntax: "threadtest.exe <testcount> <threadcount> <loops> <owner>" + OStartupInfo aInfo ; + OUString sArgument ; + sal_Int32 nArgument ; + sal_Int32 nCount = aInfo.getCommandArgCount(); + + LOG_ASSERT2( nCount!=4 ,"TestApplication::Main()" , "Wrong argument line detected!") + + for( nArgument=0; nArgument<nCount; ++nArgument ) + { + aInfo.getCommandArg( nArgument, sArgument ); + if( nArgument== 0 ) nTestCount =sArgument.toInt32(); + if( nArgument== 1 ) nThreadCount=sArgument.toInt32(); + if( nArgument== 2 ) nLoops =sArgument.toInt32(); + if( nArgument== 3 ) nOwner =sArgument.toInt32(); + } + + // Start test. + OStringBuffer sBuf(256); + sal_Int32 nTime=0; + sBuf.append( "Nr.\tTime\tThreadCount\tLoops\tOwner\n" ); + for( sal_Int32 nI=1; nI<=nTestCount; ++nI ) + { + nTime = measureTime( nThreadCount, nOwner, nLoops ); + sBuf.append( nI ); + sBuf.append( "\t" ); + sBuf.append( nTime ); + sBuf.append( "\t" ); + sBuf.append( nThreadCount ); + sBuf.append( "\t" ); + sBuf.append( nLoops ); + sBuf.append( "\t" ); + sBuf.append( nOwner ); + sBuf.append( "\n" ); + } + + WRITE_LOGFILE( STATISTICS_FILE, sBuf.makeStringAndClear().getStr() ); + LOG_ERROR( "TApplication::Main()", "Test finish successful!" ) +} diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk index 39d0609955..36f517e7ff 100644 --- a/framework/util/makefile.mk +++ b/framework/util/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.15 $ +# $Revision: 1.16 $ # -# last change: $Author: avy $ $Date: 2001-03-22 08:46:24 $ +# last change: $Author: as $ $Date: 2001-03-29 13:17:17 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -62,35 +62,58 @@ PRJ=.. PRJNAME= framework -TARGET= fwk +TARGET= framework USE_DEFFILE= TRUE ENABLE_EXCEPTIONS= TRUE NO_BSYMBOLIC= TRUE -#COMP1TYPELIST= fwk -#COMP2TYPELIST= fwl -#COMP3TYPELIST= lgd +COMP1TYPELIST= fwk +COMP2TYPELIST= fwl +COMP3TYPELIST= lgd # --- Settings ----------------------------------------------------- .INCLUDE : svpre.mk .INCLUDE : settings.mk .INCLUDE : sv.mk -.INCLUDE : version.mk .IF "$(COM)"=="ICC" LINKFLAGS+=/SEGMENTS:1024 /PACKD:32768 .ENDIF -# --- DLL Services ---------------------------------------------------- +# --- services library ---------------------------------------------------- -SHL1TARGET= $(FRAMEWORK_TARGET)$(UPD)$(DLLPOSTFIX) -SHL1IMPLIB= i$(TARGET)$(UPD)$(DLLPOSTFIX) +SHL1TARGET= fwk$(UPD)$(DLLPOSTFIX) -SHL1OBJS= $(SLO)$/registerservices.obj +SHL1IMPLIB= ifwk$(UPD)$(DLLPOSTFIX) -SHL1LIBS= $(SLB)$/fwk_services.lib \ - $(SLB)$/fwk_helper.lib \ - $(SLB)$/fwk_classes.lib +SHL1OBJS= $(SLO)$/registerservices.obj \ + $(SLO)$/frame.obj \ + $(SLO)$/task.obj \ + $(SLO)$/pluginframe.obj \ + $(SLO)$/desktop.obj \ + $(SLO)$/documentproperties.obj \ + $(SLO)$/urltransformer.obj \ + $(SLO)$/framecontainer.obj \ + $(SLO)$/taskcreator.obj \ + $(SLO)$/targetfinder.obj \ + $(SLO)$/argumentanalyzer.obj \ + $(SLO)$/wildcard.obj \ + $(SLO)$/asyncquit.obj \ + $(SLO)$/odesktopdispatcher.obj \ + $(SLO)$/ointerceptionhelper.obj \ + $(SLO)$/oframes.obj \ + $(SLO)$/opluginframedispatcher.obj \ + $(SLO)$/ostatusindicatorfactory.obj \ + $(SLO)$/ocomponentaccess.obj \ + $(SLO)$/otasksaccess.obj \ + $(SLO)$/ostatusindicator.obj \ + $(SLO)$/otasksenumeration.obj \ + $(SLO)$/ocomponentenumeration.obj \ + $(SLO)$/odispatchprovider.obj \ + $(SLO)$/fairrwlock.obj \ + $(SLO)$/writeguard.obj \ + $(SLO)$/readguard.obj \ + $(SLO)$/resetableguard.obj SHL1STDLIBS= $(CPPULIB) \ $(CPPUHELPERLIB) \ @@ -110,9 +133,10 @@ DEF1NAME= $(SHL1TARGET) DEF1EXPORTFILE= exports.dxp -# --- DLL temp. light Services ---------------------------------------------------- +# --- light services library ---------------------------------------------------- SHL2TARGET= fwl$(UPD)$(DLLPOSTFIX) + SHL2IMPLIB= ifwl$(UPD)$(DLLPOSTFIX) SHL2OBJS= $(SLO)$/registertemp.obj \ @@ -121,7 +145,6 @@ SHL2OBJS= $(SLO)$/registertemp.obj \ $(SLO)$/filterfactory.obj \ $(SLO)$/typedetection.obj \ $(SLO)$/filtercache.obj \ - $(SLO)$/registrycache.obj \ $(SLO)$/argumentanalyzer.obj \ $(SLO)$/wildcard.obj @@ -139,37 +162,83 @@ DEF2NAME= $(SHL2TARGET) DEF2EXPORTFILE= exports.dxp -# --- Applikation -------------------------------------------------------- +# --- login service library ---------------------------------------------------- + +SHL3TARGET= lgd$(UPD)$(DLLPOSTFIX) + +SHL3IMPLIB= ilgd$(UPD)$(DLLPOSTFIX) + +SHL3OBJS= $(SLO)$/registerlogindialog.obj \ + $(SLO)$/logindialog.obj + +SHL3STDLIBS= $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(VOSLIB) \ + $(SALLIB) \ + $(SVLIB) \ + $(TOOLSLIB) + +SHL3DEF= $(MISC)$/$(SHL3TARGET).def + +DEF3NAME= $(SHL3TARGET) + +DEF3EXPORTFILE= exports.dxp -APP1TARGET= framework +# --- login applikation -------------------------------------------------------- -APP1OBJS= $(SLO)$/framework.obj +APP1TARGET= login -APP1LIBS= $(SLB)$/fwk_classes.lib \ - $(SLB)$/fwk_helper.lib \ - $(SLB)$/fwk_services.lib +APP1OBJS= $(SLO)$/login.obj \ + $(SLO)$/servicemanager.obj -APP1STDLIBS= \ - $(CPPULIB) \ +APP1STDLIBS= $(CPPULIB) \ $(CPPUHELPERLIB) \ $(OSLLIB) \ $(SALLIB) \ $(VOSLIB) \ $(TOOLSLIB) \ $(SVTOOLLIB) \ - $(SVLLIB) \ $(TKLIB) \ $(COMPHELPERLIB) \ - $(SOTLIB) \ $(SVLIB) -APP1DEPN= $(SLB)$/fwk_helper.lib \ - $(SLB)$/fwk_classes.lib +APP1DEPN= $(SLO)$/servicemanager.obj .IF "$(GUI)"=="WIN" || "$(GUI)"=="OS2" -APP1DEF= $(MISC)$/framework.def +APP1DEF= $(MISC)$/login.def .ENDIF +# --- framework applikation -------------------------------------------------------- +# --- not build yet! -------------------------------------------------------- + +#APP2TARGET= framework +# +#APP2OBJS= $(SLO)$/framework.obj +# +#APP2LIBS= $(SLB)$/fwk_classes.lib \ +# $(SLB)$/fwk_helper.lib \ +# $(SLB)$/fwk_services.lib +# +#APP2STDLIBS= $(CPPULIB) \ +# $(CPPUHELPERLIB) \ +# $(OSLLIB) \ +# $(SALLIB) \ +# $(VOSLIB) \ +# $(TOOLSLIB) \ +# $(SVTOOLLIB) \ +# $(SVLLIB) \ +# $(TKLIB) \ +# $(COMPHELPERLIB) \ +# $(SOTLIB) \ +# $(SVLIB) +# +#APP2DEPN= $(SLB)$/fwk_helper.lib \ +# $(SLB)$/fwk_classes.lib +# +#.IF "$(GUI)"=="WIN" || "$(GUI)"=="OS2" +#APP2DEF= $(MISC)$/framework.def +#.ENDIF + # --- Targets ------------------------------------------------------ .INCLUDE : target.mk |