diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-10-14 05:23:43 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-10-14 05:23:43 +0000 |
commit | 7bf29c44efa5985f59c160ba5a75dc212f955d42 (patch) | |
tree | 8cd9404e8ac9ba3268061278dc1ef215f631b4c9 /desktop | |
parent | a3458db24dc4688fcca14242917ec3bd62a6adcb (diff) |
CWS-TOOLING: integrate CWS mba30fixes02
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/inc/app.hxx | 3 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 3 | ||||
-rw-r--r-- | desktop/source/app/intro.cxx | 119 | ||||
-rw-r--r-- | desktop/source/app/intro.hxx | 63 | ||||
-rw-r--r-- | desktop/source/app/makefile.mk | 5 | ||||
-rw-r--r-- | desktop/source/app/oinstanceprovider.cxx | 200 | ||||
-rw-r--r-- | desktop/source/app/oinstanceprovider.hxx | 212 | ||||
-rw-r--r-- | desktop/source/app/opluginframefactory.cxx | 203 | ||||
-rw-r--r-- | desktop/source/app/opluginframefactory.hxx | 229 |
9 files changed, 3 insertions, 1034 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 00f0e91d4875..df875df23ad6 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: app.hxx,v $ - * $Revision: 1.37 $ + * $Revision: 1.37.14.1 $ * * This file is part of OpenOffice.org. * @@ -60,7 +60,6 @@ namespace desktop /*-------------------------------------------------------------------- Description: Application-class --------------------------------------------------------------------*/ -class IntroWindow_Impl; class CommandLineArgs; class Lockfile; class AcceptorMap : public std::map< OUString, Reference<XInitialization> > {}; diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cb2a32ee0d4c..a27a7d67b92c 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: app.cxx,v $ - * $Revision: 1.224 $ + * $Revision: 1.224.14.1 $ * * This file is part of OpenOffice.org. * @@ -36,7 +36,6 @@ #include "app.hxx" #include "desktop.hrc" #include "appinit.hxx" -#include "intro.hxx" #include "officeipcthread.hxx" #include "cmdlineargs.hxx" #include "desktopresid.hxx" diff --git a/desktop/source/app/intro.cxx b/desktop/source/app/intro.cxx index 9b52f1101c42..e69de29bb2d1 100644 --- a/desktop/source/app/intro.cxx +++ b/desktop/source/app/intro.cxx @@ -1,119 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: intro.cxx,v $ - * $Revision: 1.10 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_desktop.hxx" - - -#include "intro.hxx" - -#include <tools/stream.hxx> -#include <tools/urlobj.hxx> -#include <vos/process.hxx> -#include <rtl/logfile.hxx> -#include <vcl/svapp.hxx> - -namespace desktop -{ - -// ----------------------------------------------------------------------- - -void IntroWindow_Impl::Init() -{ - RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::IntroWindow_Impl::Init" ); - - Size aSize = m_aIntroBmp.GetSizePixel(); - SetOutputSizePixel( aSize ); - - if ( GetColorCount() >= 16 ) - { - Show(); - Update(); - } -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( IntroWindow_Impl, AppEventListenerHdl, VclWindowEvent *, inEvent ) -{ - if ( inEvent != 0 ) - { - switch ( inEvent->GetId() ) - { - case VCLEVENT_WINDOW_HIDE: - Paint( Rectangle() ); - break; - - default: - break; - } - } - return 0; -} - -// ----------------------------------------------------------------------- - -IntroWindow_Impl::IntroWindow_Impl( const Bitmap& aIntroBitmap ) : - IntroWindow(), - m_aIntroBmp( aIntroBitmap ) -{ - RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::IntroWindow_Impl::IntroWindowImpl" ); - - Hide(); - - Init(); - Application::AddEventListener( - LINK( this, IntroWindow_Impl, AppEventListenerHdl ) ); -} - -// ----------------------------------------------------------------------- - -IntroWindow_Impl::~IntroWindow_Impl() -{ - Application::RemoveEventListener( - LINK( this, IntroWindow_Impl, AppEventListenerHdl ) ); - Hide(); -} - -// ----------------------------------------------------------------------- - -void IntroWindow_Impl::Paint( const Rectangle& ) -{ - DrawBitmap( Point(), m_aIntroBmp ); - Flush(); -} - -// ----------------------------------------------------------------------- - -void IntroWindow_Impl::Slide() -{ -} - -} diff --git a/desktop/source/app/intro.hxx b/desktop/source/app/intro.hxx index 793c85c983b1..e69de29bb2d1 100644 --- a/desktop/source/app/intro.hxx +++ b/desktop/source/app/intro.hxx @@ -1,63 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: intro.hxx,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _DESKTOP_INTRO_HXX -#define _DESKTOP_INTRO_HXX - -// include --------------------------------------------------------------- - -#ifndef _SV_WRKWIN_HXX -#include <vcl/introwin.hxx> -#endif -#include <vcl/bitmap.hxx> - -// class IntroWindow_Impl ------------------------------------------------ -namespace desktop -{ - -class IntroWindow_Impl : public IntroWindow -{ -private: - Bitmap m_aIntroBmp; - - void Init(); - DECL_LINK( AppEventListenerHdl, VclWindowEvent * ); - -public: - IntroWindow_Impl( const Bitmap& aInfoBitmap ); - ~IntroWindow_Impl(); - - virtual void Paint( const Rectangle& ); - - void Slide(); -}; - -} - -#endif // #ifndef _DESKTOP_INTRO_HXX diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk index d9923dff0a8f..7ae735148e5c 100644 --- a/desktop/source/app/makefile.mk +++ b/desktop/source/app/makefile.mk @@ -8,7 +8,7 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.42 $ +# $Revision: 1.42.40.1 $ # # This file is part of OpenOffice.org. # @@ -54,14 +54,11 @@ SHL1OBJS = \ $(SLO)$/desktopcontext.obj \ $(SLO)$/desktopresid.obj \ $(SLO)$/dispatchwatcher.obj \ - $(SLO)$/intro.obj \ $(SLO)$/langselect.obj \ $(SLO)$/lockfile.obj \ $(SLO)$/lockfile2.obj \ $(SLO)$/migration.obj \ $(SLO)$/officeipcthread.obj \ - $(SLO)$/oinstanceprovider.obj \ - $(SLO)$/opluginframefactory.obj \ $(SLO)$/pages.obj \ $(SLO)$/sofficemain.obj \ $(SLO)$/userinstall.obj \ diff --git a/desktop/source/app/oinstanceprovider.cxx b/desktop/source/app/oinstanceprovider.cxx index 96c72bb62a40..e69de29bb2d1 100644 --- a/desktop/source/app/oinstanceprovider.cxx +++ b/desktop/source/app/oinstanceprovider.cxx @@ -1,200 +0,0 @@ - /************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: oinstanceprovider.cxx,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_desktop.hxx" - -//_________________________________________________________________________________________________________________ -// my own includes -//_________________________________________________________________________________________________________________ - -#include "oinstanceprovider.hxx" -#include "opluginframefactory.hxx" - -//_________________________________________________________________________________________________________________ -// interface includes -//_________________________________________________________________________________________________________________ -#include <comphelper/processfactory.hxx> - -//_________________________________________________________________________________________________________________ -// includes of other projects -//_________________________________________________________________________________________________________________ -#include <osl/diagnose.h> - -//_________________________________________________________________________________________________________________ -// namespace -//_________________________________________________________________________________________________________________ - -using namespace ::osl ; -using namespace ::rtl ; -using namespace ::cppu ; -using namespace ::com::sun::star::uno ; -using namespace ::com::sun::star::lang ; -using namespace ::com::sun::star::bridge ; -using namespace ::com::sun::star::container ; - -//_________________________________________________________________________________________________________________ -// non exported const -//_________________________________________________________________________________________________________________ -#define INSTANCENAME_PLUGINFACTORY OUString(RTL_CONSTASCII_USTRINGPARAM("PluginFactory")) -#define INSTANCENAME_PLUGINFACTORY_SERVICEMANAGER OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager")) - -//_________________________________________________________________________________________________________________ -// non exported definitions -//_________________________________________________________________________________________________________________ - -//_________________________________________________________________________________________________________________ -// declarations -//_________________________________________________________________________________________________________________ - -//***************************************************************************************************************** -// constructor -//***************************************************************************************************************** -OInstanceProvider::OInstanceProvider( const Reference< XMultiServiceFactory >& xFactory ) - // Init baseclasses first - // Attention: - // Don't change order of initialization! - // OMutexMember is a struct with a mutex as member. We can't use a mutex as member directly, while - // we must garant right initialization and a valid value of this! First initialize - // baseclasses and then members. And we need the mutex for other baseclasses !!! - : OMutexMember( ) - , OWeakObject ( ) - // Init member - , m_xFactory ( xFactory ) -{ -} - -//***************************************************************************************************************** -// destructor (protected!) -//***************************************************************************************************************** -OInstanceProvider::~OInstanceProvider() -{ -} - -//***************************************************************************************************************** -// XInterface -//***************************************************************************************************************** - -void SAL_CALL OInstanceProvider::acquire() throw() -{ OWeakObject::acquire(); } - -void SAL_CALL OInstanceProvider::release() throw() -{ OWeakObject::release(); } - -Any SAL_CALL OInstanceProvider::queryInterface( const Type& aType ) throw( RuntimeException ) -{ - Any aReturn ( ::cppu::queryInterface( aType, static_cast< XInstanceProvider* >( this ) ) ); - if ( aReturn.hasValue() == sal_False ) - { - aReturn = OWeakObject::queryInterface( aType ); - } - return aReturn; -} - -//***************************************************************************************************************** -// XInstanceProvider -//***************************************************************************************************************** -Reference< XInterface > SAL_CALL OInstanceProvider::getInstance( const OUString& sInstanceName ) throw( NoSuchElementException , - RuntimeException ) -{ - // Ready for multithreading - MutexGuard aGuard( m_aMutex ); - - // Safe impossible cases - // This method is not defined for all incoming parameter. - OSL_ENSURE( impldbg_checkParameter_getInstance( sInstanceName ), "OInstanceProvider::getInstance()\nInvalid parameter detected.\n" ); - - // Set default return value - Reference< XInterface > xReturn; - - // Attention: The created factories are helper services and not registered in registry! - // We cant' instanciate it as service; we must do it dynamicly. - - // If a correct name for factory was given ... - if ( sInstanceName == INSTANCENAME_PLUGINFACTORY ) - { - // ... create this searched factory and set it for return. - OPlugInFrameFactory* pPlugInFactory = new OPlugInFrameFactory( m_xFactory ); - xReturn = Reference< XInterface >( (OWeakObject*)pPlugInFactory, UNO_QUERY ); - // Safe impossible cases! - // This operation can't failed. - OSL_ENSURE( !(xReturn.is()==sal_False), "OInstanceProvider::getInstance()\nCreation of PlugInFactory failed!\n" ); - } - else if (sInstanceName == INSTANCENAME_PLUGINFACTORY_SERVICEMANAGER) - { - xReturn = Reference< XInterface >( ::comphelper::getProcessServiceFactory(), UNO_QUERY ); - } - else - { - // If an unknown name was given, we throw an exception! - NoSuchElementException aTmpException; - throw( aTmpException ); - } - - // Return result of this operation. - return xReturn; -} - -//_________________________________________________________________________________________________________________ -// debug methods -//_________________________________________________________________________________________________________________ - -/*----------------------------------------------------------------------------------------------------------------- - The follow methods checks the parameter for other functions. If a parameter or his value is non valid, - we return "sal_False". (else sal_True) This mechanism is used to throw an ASSERT! - - ATTENTION - - If you miss a test for one of this parameters, contact the autor or add it himself !(?) - But ... look for right testing! See using of this methods! ------------------------------------------------------------------------------------------------------------------*/ - -#if OSL_DEBUG_LEVEL > 0 - -//***************************************************************************************************************** -sal_Bool OInstanceProvider::impldbg_checkParameter_getInstance( const OUString& sInstanceName ) -{ - // Set default return value. - sal_Bool bOK = sal_True; - // Check parameter. - if ( - ( &sInstanceName == NULL ) || - ( - ( sInstanceName != INSTANCENAME_PLUGINFACTORY && sInstanceName != INSTANCENAME_PLUGINFACTORY_SERVICEMANAGER ) - ) - ) - { - bOK = sal_False ; - } - // Return result of check. - return bOK ; -} - -#endif // #ifdef OSL_DEBUG_LEVEL diff --git a/desktop/source/app/oinstanceprovider.hxx b/desktop/source/app/oinstanceprovider.hxx index 4d2358f5ef18..e69de29bb2d1 100644 --- a/desktop/source/app/oinstanceprovider.hxx +++ b/desktop/source/app/oinstanceprovider.hxx @@ -1,212 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: oinstanceprovider.hxx,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __SFX_OINSTANCEPROVIDER_HXX_ -#define __SFX_OINSTANCEPROVIDER_HXX_ - -//_________________________________________________________________________________________________________________ -// my own includes -//_________________________________________________________________________________________________________________ - -#include "omutexmember.hxx" - -//_________________________________________________________________________________________________________________ -// interface includes -//_________________________________________________________________________________________________________________ -#include <com/sun/star/bridge/XInstanceProvider.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/container/NoSuchElementException.hpp> - -//_________________________________________________________________________________________________________________ -// other includes -//_________________________________________________________________________________________________________________ -#include <cppuhelper/weak.hxx> - -//_________________________________________________________________________________________________________________ -// namespace -//_________________________________________________________________________________________________________________ - -#define XINSTANCEPROVIDER ::com::sun::star::bridge::XInstanceProvider -#define OWEAKOBJECT ::cppu::OWeakObject -#define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define REFERENCE ::com::sun::star::uno::Reference -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define ANY ::com::sun::star::uno::Any -#define UNOTYPE ::com::sun::star::uno::Type -#define XINTERFACE ::com::sun::star::uno::XInterface -#define OUSTRING ::rtl::OUString - -//_________________________________________________________________________________________________________________ -// exported const -//_________________________________________________________________________________________________________________ - -//_________________________________________________________________________________________________________________ -// exported definitions -//_________________________________________________________________________________________________________________ - -/*-************************************************************************************************************//** - @short create factories corresponding to special name - @descr If you need a factory for creation of other factories (zB. neccessary for bridges) you can use - these implementation. You will give us a factory name and we will give you these factory (if it exist). - - @implements XInterface - XInstanceProvider - [ XDebugging if ENABLE_SERVICEDEBUG is defined! ] - @base OMutexMember - OWeakObject - - @devstatus deprecated -*//*-*************************************************************************************************************/ - -class OInstanceProvider : public XINSTANCEPROVIDER , - public OMutexMember , // Order of baseclasses is important for right initialization! - public OWEAKOBJECT -{ - //------------------------------------------------------------------------------------------------------------- - // public methods - //------------------------------------------------------------------------------------------------------------- - - public: - - //--------------------------------------------------------------------------------------------------------- - // constructor / destructor - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short standard ctor - @descr These initialize a new instance of ths class with needed informations for work. - - @seealso using at owner - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - OInstanceProvider( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); - - //--------------------------------------------------------------------------------------------------------- - // XInterface - //--------------------------------------------------------------------------------------------------------- - - virtual void SAL_CALL acquire() throw(); - virtual void SAL_CALL release() throw(); - virtual ANY SAL_CALL queryInterface( const UNOTYPE& aType ) throw( RUNTIMEEXCEPTION ); - - //--------------------------------------------------------------------------------------------------------- - // XInstanceProvider - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short return reference to a factory for specified instance - @descr These object is a selector for different factories. You will give me a factory name - - and I will give you a reference to the right factory object (if any exist!). - - @seealso - - - @param "sInstanceName", name of searched factory. - @return A reference to corresponding factory. - - @onerror A null reference is returned. - *//*-*****************************************************************************************************/ - - virtual REFERENCE< XINTERFACE > SAL_CALL getInstance( const OUSTRING& sInstanceName ) throw( NOSUCHELEMENTEXCEPTION , - RUNTIMEEXCEPTION ); - - //------------------------------------------------------------------------------------------------------------- - // protected methods - //------------------------------------------------------------------------------------------------------------- - - protected: - - /*-****************************************************************************************************//** - @short standard destructor - @descr This method destruct an instance of this class and clear some member. - This method is protected, because its not allowed to use an instance of this class as a member! - You MUST use a pointer. - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual ~OInstanceProvider(); - - //------------------------------------------------------------------------------------------------------------- - // private methods - //------------------------------------------------------------------------------------------------------------- - - private: - - //------------------------------------------------------------------------------------------------------------- - // 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 - - *//*-*****************************************************************************************************/ - - #if OSL_DEBUG_LEVEL > 0 - - private: - - sal_Bool impldbg_checkParameter_getInstance( const OUSTRING& sInstanceName ); - - #endif // #ifdef OSL_DEBUG_LEVEL - - //------------------------------------------------------------------------------------------------------------- - // variables - // (should be private everyway!) - //------------------------------------------------------------------------------------------------------------- - - private: - - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; - -}; // class OInstanceProvider - -#endif // #ifndef __SFX_OINSTANCEPROVIDER_HXX_ diff --git a/desktop/source/app/opluginframefactory.cxx b/desktop/source/app/opluginframefactory.cxx index 49c2382e2e08..e69de29bb2d1 100644 --- a/desktop/source/app/opluginframefactory.cxx +++ b/desktop/source/app/opluginframefactory.cxx @@ -1,203 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: opluginframefactory.cxx,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_desktop.hxx" - -//_________________________________________________________________________________________________________________ -// my own includes -//_________________________________________________________________________________________________________________ - -#include "opluginframefactory.hxx" - -//_________________________________________________________________________________________________________________ -// interface includes -//_________________________________________________________________________________________________________________ -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/frame/XFrame.hpp> - -//_________________________________________________________________________________________________________________ -// includes of other projects -//_________________________________________________________________________________________________________________ -#include <osl/diagnose.h> - -//_________________________________________________________________________________________________________________ -// namespace -//_________________________________________________________________________________________________________________ - -using namespace ::osl ; -using namespace ::rtl ; -using namespace ::cppu ; -using namespace ::com::sun::star::uno ; -using namespace ::com::sun::star::lang ; -using namespace ::com::sun::star::frame ; - -//_________________________________________________________________________________________________________________ -// non exported const -//_________________________________________________________________________________________________________________ -#define SERVICENAME_DESKTOP OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" )) -#define SERVICENAME_PLUGINFRAME OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.Plugin" )) - -//_________________________________________________________________________________________________________________ -// non exported definitions -//_________________________________________________________________________________________________________________ - -//_________________________________________________________________________________________________________________ -// declarations -//_________________________________________________________________________________________________________________ - -//***************************************************************************************************************** -// constructor -//***************************************************************************************************************** -OPlugInFrameFactory::OPlugInFrameFactory( const Reference< XMultiServiceFactory >& xFactory ) - // Init baseclasses first - // Attention: - // Don't change order of initialization! - // OMutexMember is a struct with a mutex as member. We can't use a mutex as member directly, while - // we must garant right initialization and a valid value of this! First initialize - // baseclasses and then members. And we need the mutex for other baseclasses !!! - : OMutexMember( ) - , OWeakObject ( ) - // Init member - , m_xFactory ( xFactory ) -{ -} - -//***************************************************************************************************************** -// destructor (protected!) -//***************************************************************************************************************** -OPlugInFrameFactory::~OPlugInFrameFactory() -{ -} - -//***************************************************************************************************************** -// XInterface -//***************************************************************************************************************** - -void SAL_CALL OPlugInFrameFactory::acquire() throw() -{ OWeakObject::acquire(); } - -void SAL_CALL OPlugInFrameFactory::release() throw() -{ OWeakObject::release(); } - -Any SAL_CALL OPlugInFrameFactory::queryInterface( const Type& aType ) throw( RuntimeException ) -{ - Any aReturn ( ::cppu::queryInterface( aType, static_cast< XSingleServiceFactory* >( this ) ) ); - if ( aReturn.hasValue() == sal_False ) - { - aReturn = OWeakObject::queryInterface( aType ); - } - return aReturn; -} -//***************************************************************************************************************** -// XSingleServiceFactory -//***************************************************************************************************************** -Reference< XInterface > SAL_CALL OPlugInFrameFactory::createInstance() throw( Exception , - RuntimeException) -{ - // Ready for multithreading - MutexGuard aGuard( m_aMutex ); - - // Create new plugin. - Reference< XInterface > xPlugIn( m_xFactory->createInstance( SERVICENAME_PLUGINFRAME ), UNO_QUERY ); - // Safe impossible cases - OSL_ENSURE( !(xPlugIn.is()==sal_False), "OPlugInFrameFactory::createInstance()\nServicename of PlugIn is unknown!\n" ); - - // Ouer plugin need information about his parent! - // If someone dispatch anything to this plugin instance, he will create a new window and load the content. - // Then he must append himself to ouer frame tree !!! => Thats why he need a valid reference to the desktop - // as parent to do this. - // Return result. - return xPlugIn; -} - -//***************************************************************************************************************** -// XSingleServiceFactory -//***************************************************************************************************************** -Reference< XInterface > SAL_CALL OPlugInFrameFactory::createInstanceWithArguments( const Sequence< Any >& seqArguments ) throw( Exception , - RuntimeException) -{ - // Ready for multithreading - MutexGuard aGuard( m_aMutex ); - - // Safe impossible cases - // This method is not defined for all incoming parameter. - OSL_ENSURE( impldbg_checkParameter_createInstanceWithArguments( seqArguments ), "OPlugInFrameFactory::createInstanceWithArguments()\nInvalid parameter detected.\n" ); - - // Create new PlugIn. - Reference< XInterface > xPlugIn = createInstance(); - // Initialize it with given arguments. - if ( xPlugIn.is()==sal_True ) - { - // Before we must cast to right interface. - Reference< XInitialization > xInit( xPlugIn, UNO_QUERY ); - // Safe impossible cases - OSL_ENSURE( !(xInit.is()==sal_False), "OPlugInFrameFactory::createInstanceWithArguments()\nPlugIn don't support XInitialization ?!...\n" ); - xInit->initialize( seqArguments ); - } - - // Return result. - return xPlugIn; -} - -//_________________________________________________________________________________________________________________ -// debug methods -//_________________________________________________________________________________________________________________ - -/*----------------------------------------------------------------------------------------------------------------- - The follow methods checks the parameter for other functions. If a parameter or his value is non valid, - we return "sal_False". (else sal_True) This mechanism is used to throw an ASSERT! - - ATTENTION - - If you miss a test for one of this parameters, contact the autor or add it himself !(?) - But ... look for right testing! See using of this methods! ------------------------------------------------------------------------------------------------------------------*/ - -#if OSL_DEBUG_LEVEL > 0 - -//***************************************************************************************************************** -sal_Bool OPlugInFrameFactory::impldbg_checkParameter_createInstanceWithArguments( const Sequence< Any >& seqArguments ) -{ - // Set default return value. - sal_Bool bOK = sal_True; - // Check parameter. - if ( - ( &seqArguments == NULL ) || - ( seqArguments.getLength() < 1 ) - ) - { - bOK = sal_False ; - } - // Return result of check. - return bOK ; -} - -#endif // #ifdef OSL_DEBUG_LEVEL diff --git a/desktop/source/app/opluginframefactory.hxx b/desktop/source/app/opluginframefactory.hxx index 39c6361bed84..e69de29bb2d1 100644 --- a/desktop/source/app/opluginframefactory.hxx +++ b/desktop/source/app/opluginframefactory.hxx @@ -1,229 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: opluginframefactory.hxx,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __SFX_OPLUGINFRAMEFACTORY_HXX_ -#define __SFX_OPLUGINFRAMEFACTORY_HXX_ - -//_________________________________________________________________________________________________________________ -// my own includes -//_________________________________________________________________________________________________________________ - -#include "omutexmember.hxx" - -//_________________________________________________________________________________________________________________ -// interface includes -//_________________________________________________________________________________________________________________ -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> - -//_________________________________________________________________________________________________________________ -// other includes -//_________________________________________________________________________________________________________________ -#include <cppuhelper/weak.hxx> - -//_________________________________________________________________________________________________________________ -// namespace -//_________________________________________________________________________________________________________________ - -#define XSINGLESERVICEFACTORY ::com::sun::star::lang::XSingleServiceFactory -#define OWEAKOBJECT ::cppu::OWeakObject -#define EXCEPTION ::com::sun::star::uno::Exception -#define SEQUENCE ::com::sun::star::uno::Sequence -#define XCONNECTION ::com::sun::star::connection::XConnection -#define IOEXCEPTION ::com::sun::star::io::IOException -#define XINSTANCEPROVIDER ::com::sun::star::bridge::XInstanceProvider -#define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException -#define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory -#define REFERENCE ::com::sun::star::uno::Reference -#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define ANY ::com::sun::star::uno::Any -#define UNOTYPE ::com::sun::star::uno::Type -#define XINTERFACE ::com::sun::star::uno::XInterface -#define OUSTRING ::rtl::OUString -#define MUTEX ::osl::Mutex - -//_________________________________________________________________________________________________________________ -// exported const -//_________________________________________________________________________________________________________________ - -//_________________________________________________________________________________________________________________ -// exported definitions -//_________________________________________________________________________________________________________________ - -/*-************************************************************************************************************//** - @short - - @descr - - - @implements XInterface - XSingleServiceFactory - [ XDebugging if ENABLE_SERVICEDEBUG is defined! ] - @base OMutexMember - OWeakObject - - @devstatus deprecated -*//*-*************************************************************************************************************/ - -class OPlugInFrameFactory : public XSINGLESERVICEFACTORY , - public OMutexMember , // Order of baseclasses is important for right initialization! - public OWEAKOBJECT -{ - //------------------------------------------------------------------------------------------------------------- - // public methods - //------------------------------------------------------------------------------------------------------------- - - public: - - //--------------------------------------------------------------------------------------------------------- - // constructor / destructor - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short standard ctor - @descr These initialize a new instance of ths class with needed informations for work. - - @seealso using at owner - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - OPlugInFrameFactory( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); - - //--------------------------------------------------------------------------------------------------------- - // XInterface - //--------------------------------------------------------------------------------------------------------- - - virtual void SAL_CALL acquire() throw(); - virtual void SAL_CALL release() throw(); - virtual ANY SAL_CALL queryInterface( const UNOTYPE& aType ) throw( RUNTIMEEXCEPTION ); - - //--------------------------------------------------------------------------------------------------------- - // XSingleServiceFactory - //--------------------------------------------------------------------------------------------------------- - - /*-****************************************************************************************************//** - @short - - @descr - - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual REFERENCE< XINTERFACE > SAL_CALL createInstance() throw( EXCEPTION , - RUNTIMEEXCEPTION ); - - /*-****************************************************************************************************//** - @short - - @descr - - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual REFERENCE< XINTERFACE > SAL_CALL createInstanceWithArguments( const SEQUENCE< ANY >& seqArguments ) throw( EXCEPTION , - RUNTIMEEXCEPTION ); - - //------------------------------------------------------------------------------------------------------------- - // protected methods - //------------------------------------------------------------------------------------------------------------- - - protected: - - /*-****************************************************************************************************//** - @short standard destructor - @descr This method destruct an instance of this class and clear some member. - This method is protected, because its not allowed to use an instance of this class as a member! - You MUST use a pointer. - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - - virtual ~OPlugInFrameFactory(); - - //------------------------------------------------------------------------------------------------------------- - // private methods - //------------------------------------------------------------------------------------------------------------- - - private: - - //------------------------------------------------------------------------------------------------------------- - // 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 - - *//*-*****************************************************************************************************/ - - #if OSL_DEBUG_LEVEL > 0 - - private: - - sal_Bool impldbg_checkParameter_createInstanceWithArguments( const SEQUENCE< ANY >& seqArguments ); - - #endif // #ifdef OSL_DEBUG_LEVEL - - //------------------------------------------------------------------------------------------------------------- - // variables - // (should be private everyway!) - //------------------------------------------------------------------------------------------------------------- - - private: - - REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; - -}; // class OPlugInFrameFactory - -#endif // #ifndef __FRAMEWORK_OPLUGINFRAMEFACTORY_HXX_ |