INTEGRATION: CWS scriptingf7 (1.8.4); FILE MERGED

2004/07/15 09:52:34 npower 1.8.4.3: #i25269# Fix crash/hang on exit, release in InvocationCtxProperties not using osl  osl_decrementInterlockedCount/osl_incrementInterlockedCount in fact we don't use this class anymore, have deleted from MasterScriptProvider.[ch]xx
2004/07/09 18:11:58 npower 1.8.4.2: #i25260# Changed exception handling as per new exception specification for Xscript::inovke and XScriptProvider::getScript.
2004/06/12 08:42:35 npower 1.8.4.1: #i25269# Add support for pkgchk.
This commit is contained in:
Jens-Heiner Rechtien
2004-07-23 13:10:31 +00:00
parent 2098b84c4f
commit d9536ce8d6

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: MasterScriptProvider.hxx,v $
*
* $Revision: 1.8 $
* $Revision: 1.9 $
*
* last change: $Author: rt $ $Date: 2004-05-19 08:28:24 $
* last change: $Author: hr $ $Date: 2004-07-23 14:10:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,9 +63,13 @@
#define _FRAMEWORK_SCRIPT_PROVIDER_XFUNCTIONPROVIDER_HXX_
#include <rtl/ustring>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/implbase5.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <drafts/com/sun/star/script/provider/XScriptProvider.hpp>
@@ -73,17 +77,21 @@
#include "InvocationCtxProperties.hxx"
#include "ProviderCache.hxx"
namespace func_provider
{
// for simplification
#define css ::com::sun::star
#define dcsss ::drafts::com::sun::star::script
typedef ::cppu::WeakImplHelper4<
typedef ::cppu::WeakImplHelper5<
dcsss::provider::XScriptProvider,
dcsss::browse::XBrowseNode, css::lang::XServiceInfo,
css::lang::XInitialization > t_helper;
class MasterScriptProvider : public t_helper
css::lang::XInitialization,
css::container::XNameContainer > t_helper;
class MasterScriptProvider :
public t_helper
{
public:
MasterScriptProvider(
@@ -104,8 +112,20 @@ public:
throw ( css::uno::RuntimeException );
virtual sal_Int16 SAL_CALL getType()
throw ( css::uno::RuntimeException );
// XNameContainer
virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const css::uno::Any& aElement ) throw ( css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, css::uno::RuntimeException);
virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw ( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
// XNameReplace
virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const css::uno::Any& aElement ) throw ( css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
// XNameAccess
virtual css::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw ( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw ( css::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
// XElementAccess
virtual css::uno::Type SAL_CALL getElementType( ) throw ( css::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements( ) throw ( css::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
throw( css::uno::RuntimeException );
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
@@ -114,7 +134,8 @@ public:
// XScriptProvider implementation
virtual css::uno::Reference < dcsss::provider::XScript > SAL_CALL
getScript( const ::rtl::OUString& scriptURI )
throw( css::lang::IllegalArgumentException, css::uno::RuntimeException );
throw( dcsss::provider::ScriptFrameworkErrorException,
css::uno::RuntimeException );
/**
* XInitialise implementation
@@ -129,10 +150,17 @@ public:
// context.
css::uno::Sequence< css::uno::Reference< dcsss::provider::XScriptProvider > > SAL_CALL
getAllProviders() throw ( css::uno::RuntimeException );
bool isPkgProvider() { return m_bIsPkgMSP; }
css::uno::Reference< dcsss::provider::XScriptProvider > getPkgProvider() { return m_xMSPPkg; }
// returns context string for this provider, eg
::rtl::OUString getContextString() { return m_sCtxString; }
css::uno::Reference< css::frame::XModel > getModel() { return m_xModel; }
private:
::rtl::OUString parseLocationName( const ::rtl::OUString& location );
void createPkgProvider();
bool isValid();
::rtl::OUString getURLForModel();
const css::uno::Sequence< ::rtl::OUString >& getProviderNames();
ProviderCache* providerCache();
@@ -149,11 +177,11 @@ private:
// for the object, so m_bIsValid indicates that the object is valid is set in ctor
// in case of createInstanceWithArgumentsXXX() called m_bIsValid is set to reset
// and then set to true when initialisation is complete
bool m_bIsValid;
// m_bInitialised ensure initialisation only takes place once.
bool m_bInitialised;
css::uno::Reference< css::beans::XPropertySet > m_XScriptingContext;
bool m_bIsPkgMSP;
css::uno::Reference< dcsss::provider::XScriptProvider > m_xMSPPkg;
ProviderCache* m_pPCache;
osl::Mutex m_mutex;
::rtl::OUString m_sCtxString;