*** empty log message ***
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptingContext.hxx,v $
|
* $RCSfile: ScriptingContext.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.3 $
|
* $Revision: 1.4 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:25 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:10 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -73,78 +73,72 @@
|
|||||||
|
|
||||||
namespace func_provider
|
namespace func_provider
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
//Typedefs
|
//Typedefs
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
typedef ::std::hash_map < ::rtl::OUString, ::com::sun::star::uno::Any,
|
typedef ::std::hash_map < ::rtl::OUString, css::uno::Any, ::rtl::OUStringHash,
|
||||||
::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ScriptingConext_hash;
|
::std::equal_to< ::rtl::OUString > > ScriptingConext_hash;
|
||||||
typedef ::std::vector< ::rtl::OUString > OUString_vec;
|
typedef ::std::vector< ::rtl::OUString > OUString_vec;
|
||||||
|
|
||||||
class ScriptingContext :
|
class ScriptingContext : public ::cppu::WeakImplHelper1< css::beans::XPropertySet >
|
||||||
public ::cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertySet >
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
ScriptingContext( const css::uno::Reference< css::uno::XComponentContext > & xContext );
|
||||||
|
~ScriptingContext();
|
||||||
|
|
||||||
|
// XPropertySet implementation
|
||||||
|
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
|
||||||
|
getPropertySetInfo( )
|
||||||
|
throw ( css::uno::RuntimeException );
|
||||||
|
virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
|
||||||
|
const css::uno::Any& aValue )
|
||||||
|
throw ( css::beans::UnknownPropertyException,
|
||||||
|
css::beans::PropertyVetoException,
|
||||||
|
css::lang::IllegalArgumentException,
|
||||||
|
css::lang::WrappedTargetException,
|
||||||
|
css::uno::RuntimeException );
|
||||||
|
virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
|
||||||
|
throw ( css::beans::UnknownPropertyException,
|
||||||
|
css::lang::WrappedTargetException,
|
||||||
|
css::uno::RuntimeException );
|
||||||
|
virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
|
||||||
|
const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener )
|
||||||
|
throw ( css::beans::UnknownPropertyException,
|
||||||
|
css::lang::WrappedTargetException,
|
||||||
|
css::uno::RuntimeException );
|
||||||
|
virtual void SAL_CALL removePropertyChangeListener(
|
||||||
|
const ::rtl::OUString& aPropertyName,
|
||||||
|
const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener )
|
||||||
|
throw ( css::beans::UnknownPropertyException,
|
||||||
|
css::lang::WrappedTargetException,
|
||||||
|
css::uno::RuntimeException );
|
||||||
|
virtual void SAL_CALL addVetoableChangeListener(
|
||||||
|
const ::rtl::OUString& PropertyName,
|
||||||
|
const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener )
|
||||||
|
throw ( css::beans::UnknownPropertyException,
|
||||||
|
css::lang::WrappedTargetException,
|
||||||
|
css::uno::RuntimeException );
|
||||||
|
virtual void SAL_CALL removeVetoableChangeListener(
|
||||||
|
const ::rtl::OUString& PropertyName,
|
||||||
|
const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener )
|
||||||
|
throw ( css::beans::UnknownPropertyException,
|
||||||
|
css::lang::WrappedTargetException,
|
||||||
|
css::uno::RuntimeException );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// to obtain other services if needed
|
// to obtain other services if needed
|
||||||
ScriptingConext_hash m_propertyMap;
|
ScriptingConext_hash m_propertyMap;
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
m_xContext;
|
|
||||||
|
|
||||||
osl::Mutex m_mutex;
|
osl::Mutex m_mutex;
|
||||||
|
|
||||||
// Private helper methods
|
// Private helper methods
|
||||||
bool validateKey( const ::rtl::OUString& key );
|
bool validateKey( const ::rtl::OUString& key );
|
||||||
|
|
||||||
public:
|
|
||||||
ScriptingContext( const ::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::uno::XComponentContext > & xContext );
|
|
||||||
~ScriptingContext();
|
|
||||||
|
|
||||||
// XPropertySet implementation
|
|
||||||
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
|
|
||||||
SAL_CALL getPropertySetInfo( )
|
|
||||||
throw ( ::com::sun::star::uno::RuntimeException );
|
|
||||||
virtual void SAL_CALL setPropertyValue(
|
|
||||||
const ::rtl::OUString& aPropertyName,
|
|
||||||
const ::com::sun::star::uno::Any& aValue )
|
|
||||||
throw ( ::com::sun::star::beans::UnknownPropertyException,
|
|
||||||
::com::sun::star::beans::PropertyVetoException,
|
|
||||||
::com::sun::star::lang::IllegalArgumentException,
|
|
||||||
::com::sun::star::lang::WrappedTargetException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
|
|
||||||
const ::rtl::OUString& PropertyName )
|
|
||||||
throw ( ::com::sun::star::beans::UnknownPropertyException,
|
|
||||||
::com::sun::star::lang::WrappedTargetException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
virtual void SAL_CALL addPropertyChangeListener(
|
|
||||||
const ::rtl::OUString& aPropertyName,
|
|
||||||
const ::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::beans::XPropertyChangeListener >& xListener )
|
|
||||||
throw ( ::com::sun::star::beans::UnknownPropertyException,
|
|
||||||
::com::sun::star::lang::WrappedTargetException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
virtual void SAL_CALL removePropertyChangeListener(
|
|
||||||
const ::rtl::OUString& aPropertyName,
|
|
||||||
const ::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::beans::XPropertyChangeListener >& aListener )
|
|
||||||
throw ( ::com::sun::star::beans::UnknownPropertyException,
|
|
||||||
::com::sun::star::lang::WrappedTargetException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
virtual void SAL_CALL addVetoableChangeListener(
|
|
||||||
const ::rtl::OUString& PropertyName,
|
|
||||||
const ::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::beans::XVetoableChangeListener >& aListener )
|
|
||||||
throw ( ::com::sun::star::beans::UnknownPropertyException,
|
|
||||||
::com::sun::star::lang::WrappedTargetException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
virtual void SAL_CALL removeVetoableChangeListener(
|
|
||||||
const ::rtl::OUString& PropertyName,
|
|
||||||
const ::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::beans::XVetoableChangeListener >& aListener )
|
|
||||||
throw ( ::com::sun::star::beans::UnknownPropertyException,
|
|
||||||
::com::sun::star::lang::WrappedTargetException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
};
|
};
|
||||||
} // func_provider
|
} // func_provider
|
||||||
#endif //_FRAMEWORK_SCRIPT_PROVIDER_XFUNCTIONPROVIDER_HXX_
|
#endif //_FRAMEWORK_SCRIPT_PROVIDER_XFUNCTIONPROVIDER_HXX_
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptNameResolverImpl.hxx,v $
|
* $RCSfile: ScriptNameResolverImpl.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.3 $
|
* $Revision: 1.4 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-30 12:56:40 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:11 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -77,10 +77,12 @@
|
|||||||
|
|
||||||
namespace scripting_runtimemgr
|
namespace scripting_runtimemgr
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
class ScriptNameResolverImpl :
|
class ScriptNameResolverImpl : public
|
||||||
public ::cppu::WeakImplHelper1 <
|
::cppu::WeakImplHelper1 < dcsssf::XScriptNameResolver >
|
||||||
::drafts::com::sun::star::script::framework::XScriptNameResolver >
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**********************************************
|
/**********************************************
|
||||||
@@ -88,18 +90,16 @@ public:
|
|||||||
@param the current context
|
@param the current context
|
||||||
*/
|
*/
|
||||||
ScriptNameResolverImpl(
|
ScriptNameResolverImpl(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&
|
const css::uno::Reference< css::uno::XComponentContext > & xContext );
|
||||||
xContext );
|
|
||||||
~ScriptNameResolverImpl();
|
~ScriptNameResolverImpl();
|
||||||
|
|
||||||
// XServiceInfo implementation
|
// XServiceInfo implementation
|
||||||
virtual ::rtl::OUString SAL_CALL getImplementationName( )
|
virtual ::rtl::OUString SAL_CALL getImplementationName()
|
||||||
throw( ::com::sun::star::uno::RuntimeException );
|
throw( css::uno::RuntimeException );
|
||||||
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
|
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
|
||||||
throw( ::com::sun::star::uno::RuntimeException );
|
throw( css::uno::RuntimeException );
|
||||||
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
|
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
|
||||||
getSupportedServiceNames( )
|
throw( css::uno::RuntimeException );
|
||||||
throw( ::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**********************************************
|
/**********************************************
|
||||||
resolve method
|
resolve method
|
||||||
@@ -114,30 +114,21 @@ public:
|
|||||||
@exception NullPointerException
|
@exception NullPointerException
|
||||||
@return the resolved XScriptURI
|
@return the resolved XScriptURI
|
||||||
*/
|
*/
|
||||||
::com::sun::star::uno::Reference <
|
css::uno::Reference < dcsssf::scripturi::XScriptURI > SAL_CALL resolve(
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > SAL_CALL
|
const css::uno::Reference < dcsssf::scripturi::XScriptURI > & scriptURI,
|
||||||
resolve( const ::com::sun::star::uno::Reference <
|
css::uno::Any& invocationCtx )
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > &
|
throw( css::script::CannotConvertException, css::lang::IllegalArgumentException,
|
||||||
scriptURI,
|
css::uno::RuntimeException );
|
||||||
::com::sun::star::uno::Any& invocationCtx )
|
|
||||||
throw( ::com::sun::star::script::CannotConvertException,
|
|
||||||
::com::sun::star::lang::IllegalArgumentException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
private:
|
private:
|
||||||
::com::sun::star::uno::Reference <
|
css::uno::Reference < dcsssf::scripturi::XScriptURI >
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI >
|
resolveURIFromStorageID( sal_uInt16 sid, const css::uno::Reference <
|
||||||
resolveURIFromStorageID( sal_uInt16 sid,
|
dcsssf::scripturi::XScriptURI > & nameToResolve )
|
||||||
const ::com::sun::star::uno::Reference <
|
SAL_THROW ( ( css::lang::IllegalArgumentException, css::uno::RuntimeException ) );
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > &
|
|
||||||
nameToResolve )
|
|
||||||
SAL_THROW ( ( ::com::sun::star::lang::IllegalArgumentException,
|
|
||||||
::com::sun::star::uno::RuntimeException ) );
|
|
||||||
/**********************************************
|
/**********************************************
|
||||||
Reference< XComponentContext > m_xContext
|
Reference< XComponentContext > m_xContext
|
||||||
to obtain other services if needed
|
to obtain other services if needed
|
||||||
*/
|
*/
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
m_xContext;
|
|
||||||
StorageBridgeFactory m_StorageFactory;
|
StorageBridgeFactory m_StorageFactory;
|
||||||
::osl::Mutex m_mutex;
|
::osl::Mutex m_mutex;
|
||||||
|
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptRuntimeManager.hxx,v $
|
* $RCSfile: ScriptRuntimeManager.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:26 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:11 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -79,29 +79,30 @@
|
|||||||
|
|
||||||
namespace scripting_runtimemgr
|
namespace scripting_runtimemgr
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class responsible for managing the various ScriptRuntime implementations.
|
* Class responsible for managing the various ScriptRuntime implementations.
|
||||||
*/
|
*/
|
||||||
class ScriptRuntimeManager :
|
class ScriptRuntimeManager : public
|
||||||
public ::cppu::WeakImplHelper3<
|
::cppu::WeakImplHelper3< dcsssf::XScriptInvocation, css::lang::XServiceInfo,
|
||||||
::drafts::com::sun::star::script::framework::XScriptInvocation,
|
dcsssf::XScriptNameResolver >
|
||||||
::com::sun::star::lang::XServiceInfo,
|
|
||||||
::drafts::com::sun::star::script::framework::XScriptNameResolver >
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ScriptRuntimeManager( const ::com::sun::star::uno::Reference<
|
explicit ScriptRuntimeManager(
|
||||||
::com::sun::star::uno::XComponentContext > & xContext );
|
const css::uno::Reference< css::uno::XComponentContext > & xContext );
|
||||||
~ScriptRuntimeManager();
|
~ScriptRuntimeManager();
|
||||||
|
|
||||||
|
|
||||||
// XServiceInfo implementation
|
// XServiceInfo implementation
|
||||||
virtual ::rtl::OUString SAL_CALL getImplementationName( )
|
virtual ::rtl::OUString SAL_CALL getImplementationName()
|
||||||
throw( ::com::sun::star::uno::RuntimeException );
|
throw( css::uno::RuntimeException );
|
||||||
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
|
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
|
||||||
throw( ::com::sun::star::uno::RuntimeException );
|
throw( css::uno::RuntimeException );
|
||||||
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
|
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
|
||||||
getSupportedServiceNames( )
|
throw( css::uno::RuntimeException );
|
||||||
throw( ::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* implements XScriptInvocation, invokes the script named in scriptURI
|
* implements XScriptInvocation, invokes the script named in scriptURI
|
||||||
@@ -137,17 +138,16 @@ public:
|
|||||||
rethrown as this exception type.
|
rethrown as this exception type.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
virtual ::com::sun::star::uno::Any SAL_CALL invoke(
|
virtual css::uno::Any SAL_CALL invoke(
|
||||||
const ::com::sun::star::uno::Reference<
|
const css::uno::Reference< dcsssf::scripturi::XScriptURI > & scriptUri,
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > & scriptUri,
|
const css::uno::Any& invocationCtx,
|
||||||
const ::com::sun::star::uno::Any& invocationCtx,
|
const css::uno::Sequence< css::uno::Any >& aParams,
|
||||||
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
|
css::uno::Sequence< sal_Int16 >& aOutParamIndex,
|
||||||
::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
|
css::uno::Sequence< css::uno::Any >& aOutParam )
|
||||||
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam )
|
throw ( css::lang::IllegalArgumentException,
|
||||||
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
css::script::CannotConvertException,
|
||||||
::com::sun::star::script::CannotConvertException,
|
css::reflection::InvocationTargetException,
|
||||||
::com::sun::star::reflection::InvocationTargetException,
|
css::uno::RuntimeException );
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* implements XScriptNameResolver, attempts to resolve the script URI
|
* implements XScriptNameResolver, attempts to resolve the script URI
|
||||||
@@ -161,28 +161,20 @@ public:
|
|||||||
same as the documentStorageID.
|
same as the documentStorageID.
|
||||||
* @return the resolved URI
|
* @return the resolved URI
|
||||||
*/
|
*/
|
||||||
virtual ::com::sun::star::uno::Reference<
|
virtual css::uno::Reference< dcsssf::scripturi::XScriptURI > SAL_CALL resolve(
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > SAL_CALL
|
const css::uno::Reference< dcsssf::scripturi::XScriptURI >& scriptUri,
|
||||||
resolve(
|
css::uno::Any& invocationCtx )
|
||||||
const ::com::sun::star::uno::Reference<
|
throw( css::lang::IllegalArgumentException, css::script::CannotConvertException,
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI >& scriptUri ,
|
css::uno::RuntimeException );
|
||||||
::com::sun::star::uno::Any& invocationCtx )
|
|
||||||
throw( ::com::sun::star::lang::IllegalArgumentException,
|
|
||||||
::com::sun::star::script::CannotConvertException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
::com::sun::star::uno::Reference<
|
css::uno::Reference< dcsssf::XScriptInvocation > SAL_CALL getScriptRuntime(
|
||||||
::drafts::com::sun::star::script::framework::XScriptInvocation > SAL_CALL
|
const css::uno::Reference< dcsssf::scripturi::XScriptURI > & scriptUri )
|
||||||
getScriptRuntime( const ::com::sun::star::uno::Reference<
|
throw( css::uno::RuntimeException );
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > & scriptUri )
|
css::uno::Reference< dcsssf::XScriptNameResolver > SAL_CALL getScriptNameResolver()
|
||||||
throw( ::com::sun::star::uno::RuntimeException );
|
throw( css::uno::RuntimeException );
|
||||||
::com::sun::star::uno::Reference<
|
|
||||||
::drafts::com::sun::star::script::framework::XScriptNameResolver > SAL_CALL
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
getScriptNameResolver() throw( ::com::sun::star::uno::RuntimeException );
|
|
||||||
// to obtain other services if needed
|
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
|
|
||||||
m_xContext;
|
|
||||||
::osl::Mutex m_mutex;
|
::osl::Mutex m_mutex;
|
||||||
};
|
};
|
||||||
} // scripting_runtimemgr
|
} // scripting_runtimemgr
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: StorageBridge.hxx,v $
|
* $RCSfile: StorageBridge.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:26 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:11 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -71,9 +71,11 @@
|
|||||||
|
|
||||||
namespace scripting_runtimemgr
|
namespace scripting_runtimemgr
|
||||||
{
|
{
|
||||||
class StorageBridge :
|
// for simplification
|
||||||
public ::cppu::WeakImplHelper1<
|
#define css ::com::sun::star
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptImplAccess >
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
|
class StorageBridge : public ::cppu::WeakImplHelper1< dcsssf::storage::XScriptImplAccess >
|
||||||
{
|
{
|
||||||
friend class StorageBridgeFactory;
|
friend class StorageBridgeFactory;
|
||||||
public:
|
public:
|
||||||
@@ -88,23 +90,18 @@ public:
|
|||||||
* @return XScriptURI
|
* @return XScriptURI
|
||||||
* The URIs of the implementations
|
* The URIs of the implementations
|
||||||
*/
|
*/
|
||||||
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
|
virtual css::uno::Sequence< css::uno::Reference< dcsssf::scripturi::XScriptURI > >
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > > SAL_CALL
|
SAL_CALL getImplementations(
|
||||||
getImplementations(
|
const css::uno::Reference< dcsssf::scripturi::XScriptURI >& queryURI )
|
||||||
const ::com::sun::star::uno::Reference<
|
throw ( css::lang::IllegalArgumentException,
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI >& queryURI )
|
css::uno::RuntimeException );
|
||||||
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
private:
|
private:
|
||||||
StorageBridge( const ::com::sun::star::uno::Reference<
|
StorageBridge( const css::uno::Reference< css::uno::XComponentContext >& xContext,
|
||||||
::com::sun::star::uno::XComponentContext >& xContext, sal_uInt16 sid );
|
sal_uInt16 sid );
|
||||||
|
|
||||||
void initStorage() throw ( ::com::sun::star::uno::RuntimeException );
|
void initStorage() throw ( css::uno::RuntimeException );
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
m_xContext;
|
css::uno::Reference< dcsssf::storage::XScriptImplAccess > m_xScriptImplAccess;
|
||||||
::com::sun::star::uno::Reference<
|
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptImplAccess >
|
|
||||||
m_xScriptImplAccess;
|
|
||||||
sal_uInt16 m_sid;
|
sal_uInt16 m_sid;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: StorageBridgeFactory.hxx,v $
|
* $RCSfile: StorageBridgeFactory.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.3 $
|
* $Revision: 1.4 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-30 12:56:40 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:12 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -72,20 +72,21 @@
|
|||||||
|
|
||||||
namespace scripting_runtimemgr
|
namespace scripting_runtimemgr
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
class StorageBridgeFactory
|
class StorageBridgeFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit StorageBridgeFactory( const ::com::sun::star::uno::Reference <
|
explicit StorageBridgeFactory(
|
||||||
::com::sun::star::uno::XComponentContext > & xContext
|
const css::uno::Reference < css::uno::XComponentContext > & xContext );
|
||||||
);
|
css::uno::Reference < dcsssf::storage::XScriptImplAccess >
|
||||||
::com::sun::star::uno::Reference <
|
getStorageInstance( sal_uInt16 sid );
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptImplAccess >
|
|
||||||
getStorageInstance( sal_uInt16 sid );
|
|
||||||
private:
|
private:
|
||||||
StorageBridgeFactory(); // No definition for default ctor
|
StorageBridgeFactory(); // No definition for default ctor
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
m_xContext;
|
|
||||||
};
|
};
|
||||||
} // scripting_runtimemgr
|
} // scripting_runtimemgr
|
||||||
#endif //_FRAMEWORK_SCRIPT_NAMERESOLVER_HXX_
|
#endif //_FRAMEWORK_SCRIPT_NAMERESOLVER_HXX_
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptElement.hxx,v $
|
* $RCSfile: ScriptElement.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*
|
*
|
||||||
* last change: $Author: lkovacs $ $Date: 2002-09-23 14:08:29 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:13 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -63,20 +63,18 @@
|
|||||||
|
|
||||||
#include <osl/mutex.hxx>
|
#include <osl/mutex.hxx>
|
||||||
|
|
||||||
#ifndef _DRAFTS_COM_SUN_STAR_SCRIPT_FRAMEWORK_STORAGE_SCRIPTIMPLINFO_HPP_
|
|
||||||
#include <drafts/com/sun/star/script/framework/storage/ScriptImplInfo.hpp>
|
#include <drafts/com/sun/star/script/framework/storage/ScriptImplInfo.hpp>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "XMLElement.hxx"
|
#include "XMLElement.hxx"
|
||||||
|
|
||||||
namespace scripting_impl
|
namespace scripting_impl
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
class ScriptElement : public ::scripting_impl::XMLElement
|
class ScriptElement : public ::scripting_impl::XMLElement
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
drafts::com::sun::star::script::framework::storage::ScriptImplInfo m_sII;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
Construct a ScriptElement from a ScriptImplInfo object
|
Construct a ScriptElement from a ScriptImplInfo object
|
||||||
@@ -84,8 +82,12 @@ public:
|
|||||||
@param sII
|
@param sII
|
||||||
the ScriptImplInfoObject
|
the ScriptImplInfoObject
|
||||||
*/
|
*/
|
||||||
explicit ScriptElement(drafts::com::sun::star::script::framework::storage::ScriptImplInfo & sII);
|
explicit ScriptElement(dcsssf::storage::ScriptImplInfo & sII);
|
||||||
~ScriptElement() SAL_THROW (());
|
~ScriptElement() SAL_THROW (());
|
||||||
|
|
||||||
|
private:
|
||||||
|
dcsssf::storage::ScriptImplInfo m_sII;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptInfo.hxx,v $
|
* $RCSfile: ScriptInfo.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.3 $
|
* $Revision: 1.4 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:29 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:13 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -73,39 +73,53 @@
|
|||||||
#include <drafts/com/sun/star/script/framework/storage/XScriptInvocationPrep.hpp>
|
#include <drafts/com/sun/star/script/framework/storage/XScriptInvocationPrep.hpp>
|
||||||
|
|
||||||
namespace scripting_impl {
|
namespace scripting_impl {
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
class ScriptInfo :
|
class ScriptInfo : public ::cppu::WeakImplHelper4< css::lang::XServiceInfo,
|
||||||
public ::cppu::WeakImplHelper4<
|
css::lang::XInitialization, dcsssf::storage::XScriptInfo,
|
||||||
::com::sun::star::lang::XServiceInfo,
|
dcsssf::storage::XScriptInvocationPrep >
|
||||||
::com::sun::star::lang::XInitialization,
|
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptInfo,
|
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptInvocationPrep >
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ScriptInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext);
|
explicit ScriptInfo(
|
||||||
|
const css::uno::Reference< css::uno::XComponentContext >& xContext);
|
||||||
virtual ~ScriptInfo();
|
virtual ~ScriptInfo();
|
||||||
|
|
||||||
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
|
virtual ::rtl::OUString SAL_CALL getImplementationName()
|
||||||
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
|
throw(css::uno::RuntimeException);
|
||||||
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::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( )
|
||||||
|
throw(css::uno::RuntimeException);
|
||||||
|
|
||||||
virtual void SAL_CALL initialize(::com::sun::star::uno::Sequence < ::com::sun::star::uno::Any > const & args) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception);
|
virtual void SAL_CALL initialize(css::uno::Sequence < css::uno::Any > const & args)
|
||||||
|
throw (css::uno::RuntimeException, css::uno::Exception);
|
||||||
|
|
||||||
// XScriptInfo
|
// XScriptInfo
|
||||||
virtual ::rtl::OUString SAL_CALL getLogicalName( ) throw (::com::sun::star::uno::RuntimeException);
|
virtual ::rtl::OUString SAL_CALL getLogicalName() throw (css::uno::RuntimeException);
|
||||||
virtual void SAL_CALL setLogicalName( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL setLogicalName( const ::rtl::OUString& name )
|
||||||
virtual ::rtl::OUString SAL_CALL getDescription( ) throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual void SAL_CALL setDescription( const ::rtl::OUString& desc ) throw (::com::sun::star::uno::RuntimeException);
|
virtual ::rtl::OUString SAL_CALL getDescription()
|
||||||
virtual ::rtl::OUString SAL_CALL getLanguage( ) throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getScriptLocation( ) throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL setDescription( const ::rtl::OUString& desc )
|
||||||
virtual void SAL_CALL setLanguage( const ::rtl::OUString& language ) throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual sal_Bool SAL_CALL hasSource( ) throw (::com::sun::star::uno::RuntimeException);
|
virtual ::rtl::OUString SAL_CALL getLanguage() throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getLanguageSpecificName( ) throw (::com::sun::star::uno::RuntimeException);
|
virtual ::rtl::OUString SAL_CALL getScriptLocation()
|
||||||
virtual void SAL_CALL setLanguageSpecificName( const ::rtl::OUString& langName ) throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getRoot( ) throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL setLanguage( const ::rtl::OUString& language )
|
||||||
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getDependencies( ) throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException);
|
virtual sal_Bool SAL_CALL hasSource( ) throw (css::uno::RuntimeException);
|
||||||
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL extraProperties( ) throw (::com::sun::star::uno::RuntimeException);
|
virtual ::rtl::OUString SAL_CALL getLanguageSpecificName()
|
||||||
|
throw (css::uno::RuntimeException);
|
||||||
|
virtual void SAL_CALL setLanguageSpecificName( const ::rtl::OUString& langName )
|
||||||
|
throw (css::uno::RuntimeException);
|
||||||
|
virtual ::rtl::OUString SAL_CALL getRoot() throw (css::uno::RuntimeException);
|
||||||
|
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getDependencies()
|
||||||
|
throw (css::uno::RuntimeException);
|
||||||
|
virtual ::rtl::OUString SAL_CALL getLocation() throw (css::uno::RuntimeException);
|
||||||
|
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL extraProperties()
|
||||||
|
throw (css::uno::RuntimeException);
|
||||||
/**
|
/**
|
||||||
This function prepares the script for invocation and returns the full path
|
This function prepares the script for invocation and returns the full path
|
||||||
to the prepared parcel folder
|
to the prepared parcel folder
|
||||||
@@ -114,14 +128,15 @@ public:
|
|||||||
<type>::rtl::OUString</type> file URI to the prepared parcel
|
<type>::rtl::OUString</type> file URI to the prepared parcel
|
||||||
|
|
||||||
*/
|
*/
|
||||||
virtual ::rtl::OUString SAL_CALL prepareForInvocation() throw (::com::sun::star::uno::RuntimeException);
|
virtual ::rtl::OUString SAL_CALL prepareForInvocation()
|
||||||
|
throw (css::uno::RuntimeException);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext;
|
css::uno::Reference< css::uno::XComponentContext> m_xContext;
|
||||||
|
|
||||||
::osl::Mutex m_mutex;
|
::osl::Mutex m_mutex;
|
||||||
|
|
||||||
::drafts::com::sun::star::script::framework::storage::ScriptImplInfo m_scriptImplInfo;
|
dcsssf::storage::ScriptImplInfo m_scriptImplInfo;
|
||||||
sal_uInt16 m_storageID;
|
sal_uInt16 m_storageID;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptMetadataImporter.hxx,v $
|
* $RCSfile: ScriptMetadataImporter.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*
|
*
|
||||||
* last change: $Author: dsherwin $ $Date: 2002-09-24 13:20:47 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:13 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -77,19 +77,156 @@
|
|||||||
|
|
||||||
namespace scripting_impl
|
namespace scripting_impl
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
typedef ::std::vector< ::drafts::com::sun::star::script::framework::storage::ScriptImplInfo > Impls_vec;
|
typedef ::std::vector< dcsssf::storage::ScriptImplInfo > Impls_vec;
|
||||||
typedef ::std::vector< ::rtl::OUString > Deps_vec;
|
typedef ::std::vector< ::rtl::OUString > Deps_vec;
|
||||||
typedef ::std::vector< bool > Bool_vec;
|
typedef ::std::vector< bool > Bool_vec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Script Meta Data Importer
|
* Script Meta Data Importer
|
||||||
*/
|
*/
|
||||||
class ScriptMetadataImporter
|
class ScriptMetadataImporter : public
|
||||||
: public ::cppu::WeakImplHelper1<
|
::cppu::WeakImplHelper1< css::xml::sax::XExtendedDocumentHandler >
|
||||||
::com::sun::star::xml::sax::XExtendedDocumentHandler >
|
|
||||||
{
|
{
|
||||||
// private member
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function will begin the parser and parse the meta data
|
||||||
|
*
|
||||||
|
* @param xInput The XInputStream for the parser which contains the XML
|
||||||
|
* @param parcelURI The parcel's URI in the document or the application
|
||||||
|
*
|
||||||
|
* @see css::io::XInputStream
|
||||||
|
*/
|
||||||
|
Impls_vec parseMetaData( css::uno::Reference< css::io::XInputStream > const & xInput,
|
||||||
|
const ::rtl::OUString & parcelURI )
|
||||||
|
throw ( css::xml::sax::SAXException, css::io::IOException,
|
||||||
|
css::uno::RuntimeException);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for the meta-data parser
|
||||||
|
*
|
||||||
|
* @param XComponentContext
|
||||||
|
*/
|
||||||
|
explicit ScriptMetadataImporter(
|
||||||
|
const css::uno::Reference< css::uno::XComponentContext >& );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destructor for the parser
|
||||||
|
*/
|
||||||
|
virtual ~ScriptMetadataImporter() SAL_THROW( () );
|
||||||
|
|
||||||
|
// XExtendedDocumentHandler impl
|
||||||
|
/**
|
||||||
|
* Function to handle the start of CDATA in XML
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL startCDATA()
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle the end of CDATA in XML
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL endCDATA() throw ( css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle comments in XML
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL comment( const ::rtl::OUString & sComment )
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle line breaks in XML
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL allowLineBreak()
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle unknowns in XML
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL unknown( const ::rtl::OUString & sString )
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle the start of XML document
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
||||||
|
*/
|
||||||
|
// XDocumentHandler impl
|
||||||
|
virtual void SAL_CALL startDocument()
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle the end of the XML document
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL endDocument()
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle the start of an element
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL startElement( const ::rtl::OUString& aName,
|
||||||
|
const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs )
|
||||||
|
throw ( css::xml::sax::SAXException,
|
||||||
|
css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle the end of an element
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL endElement( const ::rtl::OUString & aName )
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle characters in elements
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL characters( const ::rtl::OUString & aChars )
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle whitespace
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString & aWhitespaces )
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to handle XML processing instructions
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL processingInstruction(
|
||||||
|
const ::rtl::OUString & aTarget, const ::rtl::OUString & aData )
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to set the document locator
|
||||||
|
*
|
||||||
|
* @see com::sun::star::xml::sax::XDocumentHandler
|
||||||
|
*/
|
||||||
|
virtual void SAL_CALL setDocumentLocator(
|
||||||
|
const css::uno::Reference< css::xml::sax::XLocator >& xLocator )
|
||||||
|
throw ( css::xml::sax::SAXException, css::uno::RuntimeException );
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/** Vector contains the ScriptImplInfo structs */
|
/** Vector contains the ScriptImplInfo structs */
|
||||||
@@ -111,8 +248,7 @@ private:
|
|||||||
osl::Mutex m_mutex;
|
osl::Mutex m_mutex;
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
m_xContext;
|
|
||||||
|
|
||||||
/** Placeholder for the parcel URI */
|
/** Placeholder for the parcel URI */
|
||||||
::rtl::OUString ms_parcelURI;
|
::rtl::OUString ms_parcelURI;
|
||||||
@@ -121,11 +257,10 @@ private:
|
|||||||
enum { PARCEL, SCRIPT, LANGUAGE_NAME, LOGICALNAME, LANGUAGENAME,
|
enum { PARCEL, SCRIPT, LANGUAGE_NAME, LOGICALNAME, LANGUAGENAME,
|
||||||
DEPENDENCIES, DESCRIPTION, DELIVERY, DELIVERFILE, DEPENDFILE } m_state;
|
DEPENDENCIES, DESCRIPTION, DELIVERY, DELIVERFILE, DEPENDFILE } m_state;
|
||||||
|
|
||||||
::com::sun::star::uno::Sequence< ::rtl::OUString > ms_dependFiles;
|
css::uno::Sequence< ::rtl::OUString > ms_dependFiles;
|
||||||
|
|
||||||
/** Build up the struct during parsing the meta data */
|
/** Build up the struct during parsing the meta data */
|
||||||
::drafts::com::sun::star::script::framework::storage::ScriptImplInfo
|
dcsssf::storage::ScriptImplInfo m_scriptImplInfo;
|
||||||
m_scriptImplInfo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to set the state
|
* Helper function to set the state
|
||||||
@@ -134,162 +269,6 @@ private:
|
|||||||
* The current tag being processed
|
* The current tag being processed
|
||||||
*/
|
*/
|
||||||
void setState(const ::rtl::OUString & tagName);
|
void setState(const ::rtl::OUString & tagName);
|
||||||
|
|
||||||
// public interface
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function will begin the parser and parse the meta data
|
|
||||||
*
|
|
||||||
* @param xInput The XInputStream for the parser which contains the XML
|
|
||||||
* @param parcelURI The parcel's URI in the document or the application
|
|
||||||
*
|
|
||||||
* @see ::com::sun::star::io::XInputStream
|
|
||||||
*/
|
|
||||||
Impls_vec parseMetaData(
|
|
||||||
::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::io::XInputStream >
|
|
||||||
const & xInput, const ::rtl::OUString & parcelURI )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::io::IOException,
|
|
||||||
::com::sun::star::uno::RuntimeException);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor for the meta-data parser
|
|
||||||
*
|
|
||||||
* @param XComponentContext
|
|
||||||
*/
|
|
||||||
explicit ScriptMetadataImporter(
|
|
||||||
const ::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::uno::XComponentContext >& );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor for the parser
|
|
||||||
*/
|
|
||||||
virtual ~ScriptMetadataImporter() SAL_THROW( () );
|
|
||||||
|
|
||||||
// XExtendedDocumentHandler impl
|
|
||||||
/**
|
|
||||||
* Function to handle the start of CDATA in XML
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL startCDATA()
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle the end of CDATA in XML
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL endCDATA()
|
|
||||||
throw ( ::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle comments in XML
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL comment( const ::rtl::OUString & sComment )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle line breaks in XML
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL allowLineBreak()
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle unknowns in XML
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL unknown( const ::rtl::OUString & sString )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle the start of XML document
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XExtendedDocumentHandler
|
|
||||||
*/
|
|
||||||
// XDocumentHandler impl
|
|
||||||
virtual void SAL_CALL startDocument()
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle the end of the XML document
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL endDocument()
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle the start of an element
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL startElement(
|
|
||||||
const ::rtl::OUString& aName,
|
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle the end of an element
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL endElement( const ::rtl::OUString & aName )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle characters in elements
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL characters( const ::rtl::OUString & aChars )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle whitespace
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL ignorableWhitespace(
|
|
||||||
const ::rtl::OUString & aWhitespaces )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to handle XML processing instructions
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL processingInstruction(
|
|
||||||
const ::rtl::OUString & aTarget, const ::rtl::OUString & aData )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to set the document locator
|
|
||||||
*
|
|
||||||
* @see com::sun::star::xml::sax::XDocumentHandler
|
|
||||||
*/
|
|
||||||
virtual void SAL_CALL setDocumentLocator(
|
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator )
|
|
||||||
throw ( ::com::sun::star::xml::sax::SAXException,
|
|
||||||
::com::sun::star::uno::RuntimeException );
|
|
||||||
}
|
}
|
||||||
; // class ScriptMetadataImporter
|
; // class ScriptMetadataImporter
|
||||||
|
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptStorage.hxx,v $
|
* $RCSfile: ScriptStorage.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.3 $
|
* $Revision: 1.4 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:29 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:13 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -86,64 +86,62 @@
|
|||||||
|
|
||||||
namespace scripting_impl
|
namespace scripting_impl
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
//Typedefs
|
//Typedefs
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
typedef ::std::vector<
|
typedef ::std::vector< dcsssf::storage::ScriptImplInfo > Impls_vec;
|
||||||
::drafts::com::sun::star::script::framework::storage::ScriptImplInfo > Impls_vec;
|
//-----------------------------------------------------------------------------
|
||||||
|
typedef ::std::hash_map < ::rtl::OUString, Impls_vec, ::rtl::OUStringHash,
|
||||||
|
::std::equal_to< ::rtl::OUString > > ScriptInfo_hash;
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
typedef ::std::hash_map < ::rtl::OUString,
|
typedef ::std::hash_map < ::rtl::OUString,
|
||||||
Impls_vec, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ScriptInfo_hash;
|
css::uno::Reference< css::xml::sax::XExtendedDocumentHandler >,
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
typedef ::std::hash_map < ::rtl::OUString,
|
|
||||||
::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::xml::sax::XExtendedDocumentHandler >,
|
|
||||||
::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > >
|
::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > >
|
||||||
ScriptOutput_hash;
|
ScriptOutput_hash;
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
class ScriptStorage
|
class ScriptStorage : public
|
||||||
: public ::cppu::WeakImplHelper6<
|
::cppu::WeakImplHelper6<
|
||||||
::com::sun::star::lang::XServiceInfo,
|
css::lang::XServiceInfo,
|
||||||
::com::sun::star::lang::XInitialization,
|
css::lang::XInitialization,
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptImplAccess,
|
dcsssf::storage::XScriptImplAccess,
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptStorageExport,
|
dcsssf::storage::XScriptStorageExport,
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptAccessManager,
|
dcsssf::storage::XScriptAccessManager,
|
||||||
::drafts::com::sun::star::script::framework::storage::XParcelInvocationPrep >
|
dcsssf::storage::XParcelInvocationPrep >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//Constructors and Destructors
|
//Constructors and Destructors
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
explicit ScriptStorage( const ::com::sun::star::uno::Reference<
|
explicit ScriptStorage(
|
||||||
::com::sun::star::uno::XComponentContext >& );
|
const css::uno::Reference< css::uno::XComponentContext > & xContext);
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual ~ScriptStorage() SAL_THROW( () );
|
virtual ~ScriptStorage() SAL_THROW( () );
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
|
||||||
// XServiceInfo impl
|
// XServiceInfo impl
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
virtual ::rtl::OUString SAL_CALL
|
virtual ::rtl::OUString SAL_CALL getImplementationName()
|
||||||
getImplementationName()
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual sal_Bool SAL_CALL
|
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString & ServiceName )
|
||||||
supportsService( const ::rtl::OUString & ServiceName )
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
|
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
|
||||||
getSupportedServiceNames()
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
|
static css::uno::Sequence< ::rtl::OUString > SAL_CALL
|
||||||
getSupportedServiceNames_Static();
|
getSupportedServiceNames_Static();
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
|
||||||
// XInitialization impl
|
// XInitialization impl
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
virtual void SAL_CALL
|
virtual void SAL_CALL
|
||||||
initialize( ::com::sun::star::uno::Sequence<
|
initialize( css::uno::Sequence< css::uno::Any > const & args )
|
||||||
::com::sun::star::uno::Any > const & args )
|
throw (css::uno::RuntimeException, css::uno::Exception);
|
||||||
throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception);
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
|
||||||
// XScriptAccessManager impl
|
// XScriptAccessManager impl
|
||||||
@@ -159,10 +157,9 @@ public:
|
|||||||
* A sequence of XScriptInfos which represent the implementations
|
* A sequence of XScriptInfos which represent the implementations
|
||||||
* of the passed in logical name
|
* of the passed in logical name
|
||||||
*/
|
*/
|
||||||
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
|
virtual css::uno::Sequence< css::uno::Reference< dcsssf::storage::XScriptInfo > >
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptInfo > > SAL_CALL
|
SAL_CALL getScriptInfoService( const ::rtl::OUString & name )
|
||||||
getScriptInfoService( const ::rtl::OUString & name )
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
|
||||||
//XScriptImplAccess
|
//XScriptImplAccess
|
||||||
@@ -176,14 +173,10 @@ public:
|
|||||||
* @return XScriptURI
|
* @return XScriptURI
|
||||||
* The URIs of the implementations
|
* The URIs of the implementations
|
||||||
*/
|
*/
|
||||||
virtual ::com::sun::star::uno::Sequence<
|
virtual css::uno::Sequence< css::uno::Reference< dcsssf::scripturi::XScriptURI > >
|
||||||
::com::sun::star::uno::Reference<
|
SAL_CALL getImplementations(
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > > SAL_CALL
|
const css::uno::Reference< dcsssf::scripturi::XScriptURI >& queryURI )
|
||||||
getImplementations( const ::com::sun::star::uno::Reference<
|
throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
|
||||||
::drafts::com::sun::star::script::framework::scripturi::XScriptURI >&
|
|
||||||
queryURI )
|
|
||||||
throw (::com::sun::star::lang::IllegalArgumentException,
|
|
||||||
::com::sun::star::uno::RuntimeException);
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
|
||||||
|
|
||||||
@@ -198,16 +191,13 @@ public:
|
|||||||
* @return XInterface
|
* @return XInterface
|
||||||
* The view of the hierarchy
|
* The view of the hierarchy
|
||||||
*/
|
*/
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
|
css::uno::Reference< css::uno::XInterface > getView( const ::rtl::OUString& viewName )
|
||||||
getView( const ::rtl::OUString& viewName )
|
throw (dcsssf::storage::NoSuchView, css::uno::RuntimeException);
|
||||||
throw (::drafts::com::sun::star::script::framework::storage::NoSuchView,
|
|
||||||
::com::sun::star::uno::RuntimeException);
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
|
||||||
// XScriptStorageExport
|
// XScriptStorageExport
|
||||||
void SAL_CALL
|
void SAL_CALL save()
|
||||||
save()
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
|
||||||
//XParcelInvocationPrep
|
//XParcelInvocationPrep
|
||||||
@@ -221,31 +211,26 @@ public:
|
|||||||
@return
|
@return
|
||||||
<type>::rtl::OUString</type> the new location of the parcel (file URI)
|
<type>::rtl::OUString</type> the new location of the parcel (file URI)
|
||||||
*/
|
*/
|
||||||
::rtl::OUString SAL_CALL
|
::rtl::OUString SAL_CALL prepareForInvocation( const ::rtl::OUString& parcelURI )
|
||||||
prepareForInvocation( const ::rtl::OUString& parcelURI )
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
private:
|
private:
|
||||||
|
|
||||||
::com::sun::star::uno::Reference<
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
::com::sun::star::uno::XComponentContext > m_xContext;
|
css::uno::Reference< css::ucb::XSimpleFileAccess > m_xSimpleFileAccess;
|
||||||
::com::sun::star::uno::Reference<
|
css::uno::Reference< css::lang::XMultiComponentFactory > m_xMgr;
|
||||||
::com::sun::star::ucb::XSimpleFileAccess > m_xSimpleFileAccess;
|
|
||||||
::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::lang::XMultiComponentFactory > m_xMgr;
|
|
||||||
|
|
||||||
::std::vector < ::rtl::OUString > mv_logicalNames;
|
::std::vector < ::rtl::OUString > mv_logicalNames;
|
||||||
ScriptInfo_hash mh_implementations;
|
ScriptInfo_hash mh_implementations;
|
||||||
ScriptOutput_hash mh_parcels;
|
ScriptOutput_hash mh_parcels;
|
||||||
sal_uInt16 m_scriptStorageID;
|
sal_uInt16 m_scriptStorageID;
|
||||||
|
|
||||||
osl::Mutex m_mutex;
|
osl::Mutex m_mutex;
|
||||||
bool m_bInitialised;
|
bool m_bInitialised;
|
||||||
|
|
||||||
void updateMaps(const Impls_vec & vScriptImplInfos);
|
void updateMaps(const Impls_vec & vScriptImplInfos);
|
||||||
void writeMetadataHeader(
|
void writeMetadataHeader(
|
||||||
::com::sun::star::uno::Reference <
|
css::uno::Reference < css::xml::sax::XExtendedDocumentHandler > & xExDocHandler);
|
||||||
::com::sun::star::xml::sax::XExtendedDocumentHandler > & );
|
|
||||||
/**
|
/**
|
||||||
This function copies the contents of the source folder into the
|
This function copies the contents of the source folder into the
|
||||||
destination folder. If the destination folder does not exist, it
|
destination folder. If the destination folder does not exist, it
|
||||||
@@ -259,9 +244,8 @@ private:
|
|||||||
@params dest
|
@params dest
|
||||||
the destination folder (file URI)
|
the destination folder (file URI)
|
||||||
*/
|
*/
|
||||||
void
|
void copyFolder(const ::rtl::OUString & src, const ::rtl::OUString & dest)
|
||||||
copyFolder(const ::rtl::OUString & src, const ::rtl::OUString & dest)
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
; // class ScriptingStorage
|
; // class ScriptingStorage
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptStorageManager.cxx,v $
|
* $RCSfile: ScriptStorageManager.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.5 $
|
* $Revision: 1.6 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-30 10:59:39 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:14 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -87,8 +87,6 @@ static OUString s_serviceName =
|
|||||||
::rtl::OUString::createFromAscii(
|
::rtl::OUString::createFromAscii(
|
||||||
"drafts.com.sun.star.script.framework.storage.ScriptStorageManager" );
|
"drafts.com.sun.star.script.framework.storage.ScriptStorageManager" );
|
||||||
static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceName, 1 );
|
static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceName, 1 );
|
||||||
const sal_uInt16 ScriptStorageManager::APP_SHARE_STORAGE_ID = 0;
|
|
||||||
const sal_uInt16 ScriptStorageManager::APP_USER_STORAGE_ID = 1;
|
|
||||||
extern ::rtl_StandardModuleCount s_moduleCount = MODULE_COUNT_INIT;
|
extern ::rtl_StandardModuleCount s_moduleCount = MODULE_COUNT_INIT;
|
||||||
|
|
||||||
//*************************************************************************
|
//*************************************************************************
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ScriptStorageManager.hxx,v $
|
* $RCSfile: ScriptStorageManager.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
*
|
*
|
||||||
* last change: $Author: jmrice $ $Date: 2002-09-30 12:57:03 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:14 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -77,41 +77,36 @@
|
|||||||
|
|
||||||
namespace scripting_impl
|
namespace scripting_impl
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
// Define a hash_map used to store the ScriptingStorages key;d by ID
|
// Define a hash_map used to store the ScriptingStorages key;d by ID
|
||||||
typedef ::std::hash_map <
|
typedef ::std::hash_map < sal_uInt16, css::uno::Reference < css::uno::XInterface > >
|
||||||
sal_uInt16,
|
|
||||||
::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > >
|
|
||||||
ScriptStorage_hash;
|
ScriptStorage_hash;
|
||||||
|
|
||||||
class ScriptStorageManager :
|
class ScriptStorageManager : public
|
||||||
public ::cppu::WeakImplHelper3 <
|
::cppu::WeakImplHelper3 < dcsssf::storage::XScriptStorageManager,
|
||||||
::drafts::com::sun::star::script::framework::storage::XScriptStorageManager,
|
css::lang::XServiceInfo, css::lang::XEventListener >
|
||||||
::com::sun::star::lang::XServiceInfo, ::com::sun::star::lang::XEventListener >
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ScriptStorageManager(
|
explicit ScriptStorageManager(
|
||||||
const ::com::sun::star::uno::Reference<
|
const css::uno::Reference< css::uno::XComponentContext > & xContext )
|
||||||
::com::sun::star::uno::XComponentContext > & xContext )
|
SAL_THROW ( ( css::uno::RuntimeException ) );
|
||||||
SAL_THROW ( ( ::com::sun::star::uno::RuntimeException ) );
|
|
||||||
|
|
||||||
|
|
||||||
~ScriptStorageManager() SAL_THROW ( () );
|
~ScriptStorageManager() SAL_THROW ( () );
|
||||||
|
|
||||||
// XServiceInfo implementation
|
// XServiceInfo implementation
|
||||||
//======================================================================
|
//======================================================================
|
||||||
virtual ::rtl::OUString SAL_CALL
|
virtual ::rtl::OUString SAL_CALL getImplementationName()
|
||||||
getImplementationName()
|
throw(css::uno::RuntimeException);
|
||||||
throw(::com::sun::star::uno::RuntimeException);
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
virtual sal_Bool SAL_CALL
|
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
|
||||||
supportsService(
|
throw(css::uno::RuntimeException);
|
||||||
const ::rtl::OUString& ServiceName )
|
|
||||||
throw(::com::sun::star::uno::RuntimeException);
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
|
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
|
||||||
getSupportedServiceNames()
|
throw(css::uno::RuntimeException);
|
||||||
throw(::com::sun::star::uno::RuntimeException);
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
//XScriptStorageManager
|
//XScriptStorageManager
|
||||||
@@ -127,11 +122,9 @@ public:
|
|||||||
@returns an unsigned short ScriptStorage ID, which can be used in the
|
@returns an unsigned short ScriptStorage ID, which can be used in the
|
||||||
getScriptStorage method
|
getScriptStorage method
|
||||||
*/
|
*/
|
||||||
virtual sal_uInt16 SAL_CALL
|
virtual sal_uInt16 SAL_CALL createScriptStorage(
|
||||||
createScriptStorage(
|
const css::uno::Reference< css::ucb::XSimpleFileAccess > & xSFA )
|
||||||
const ::com::sun::star::uno::Reference<
|
throw (css::uno::RuntimeException);
|
||||||
::com::sun::star::ucb::XSimpleFileAccess > & xSFA )
|
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
create a ScriptStorage using the XSimpleFileAccess, and a string URL
|
create a ScriptStorage using the XSimpleFileAccess, and a string URL
|
||||||
@@ -148,10 +141,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual sal_uInt16 SAL_CALL
|
virtual sal_uInt16 SAL_CALL
|
||||||
createScriptStorageWithURI(
|
createScriptStorageWithURI(
|
||||||
const ::com::sun::star::uno::Reference<
|
const css::uno::Reference< css::ucb::XSimpleFileAccess >& xSFA,
|
||||||
::com::sun::star::ucb::XSimpleFileAccess >& xSFA,
|
|
||||||
const ::rtl::OUString& stringURI )
|
const ::rtl::OUString& stringURI )
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
get a ScriptStorage component using its scriptStorageID
|
get a ScriptStorage component using its scriptStorageID
|
||||||
@@ -164,46 +156,36 @@ public:
|
|||||||
@returns an XInterface to a component that implements the ScriptStorage
|
@returns an XInterface to a component that implements the ScriptStorage
|
||||||
service
|
service
|
||||||
*/
|
*/
|
||||||
virtual ::com::sun::star::uno::Reference<
|
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getScriptStorage(
|
||||||
::com::sun::star::uno::XInterface > SAL_CALL
|
sal_uInt16 scriptStorageID )
|
||||||
getScriptStorage( sal_uInt16 scriptStorageID )
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
|
||||||
//XEventListener
|
//XEventListener
|
||||||
//======================================================================
|
//======================================================================
|
||||||
virtual void SAL_CALL
|
virtual void SAL_CALL disposing( const css::lang::EventObject& Source )
|
||||||
disposing( const ::com::sun::star::lang::EventObject& Source )
|
throw (css::uno::RuntimeException);
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
|
|
||||||
static const sal_uInt16 APP_SHARE_STORAGE_ID;
|
|
||||||
static const sal_uInt16 APP_USER_STORAGE_ID;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScriptStorageManager(const ScriptStorageManager & );
|
ScriptStorageManager(const ScriptStorageManager & );
|
||||||
ScriptStorageManager& operator= (const ScriptStorageManager &);
|
ScriptStorageManager& operator= (const ScriptStorageManager &);
|
||||||
|
|
||||||
// to obtain other services if needed
|
// to obtain other services if needed
|
||||||
::com::sun::star::uno::Reference<
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
::com::sun::star::uno::XComponentContext > m_xContext;
|
css::uno::Reference< css::lang::XMultiComponentFactory > m_xMgr;
|
||||||
::com::sun::star::uno::Reference<
|
::osl::Mutex m_mutex;
|
||||||
::com::sun::star::lang::XMultiComponentFactory > m_xMgr;
|
|
||||||
::osl::Mutex m_mutex;
|
|
||||||
ScriptStorage_hash m_ScriptStorageHash;
|
ScriptStorage_hash m_ScriptStorageHash;
|
||||||
sal_uInt16 m_count;
|
sal_uInt16 m_count;
|
||||||
|
|
||||||
void setupAppStorage(
|
void setupAppStorage( const css::uno::Reference< css::util::XMacroExpander > & xME,
|
||||||
const ::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::util::XMacroExpander > & xME,
|
|
||||||
const ::rtl::OUString & storageStr )
|
const ::rtl::OUString & storageStr )
|
||||||
SAL_THROW ( ( ::com::sun::star::uno::RuntimeException ) );
|
SAL_THROW ( ( css::uno::RuntimeException ) );
|
||||||
|
|
||||||
sal_uInt16 setupAnyStorage(
|
sal_uInt16 setupAnyStorage(
|
||||||
const ::com::sun::star::uno::Reference<
|
const css::uno::Reference< css::ucb::XSimpleFileAccess> & xSFA,
|
||||||
::com::sun::star::ucb::XSimpleFileAccess> & xSFA,
|
|
||||||
const ::rtl::OUString & storageStr )
|
const ::rtl::OUString & storageStr )
|
||||||
SAL_THROW ( ( ::com::sun::star::uno::RuntimeException ) );
|
SAL_THROW ( ( css::uno::RuntimeException ) );
|
||||||
|
|
||||||
};
|
};
|
||||||
} // scripting_impl
|
} // scripting_impl
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: XMLElement.hxx,v $
|
* $RCSfile: XMLElement.hxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.1 $
|
* $Revision: 1.2 $
|
||||||
*
|
*
|
||||||
* last change: $Author: dfoster $ $Date: 2002-09-20 14:33:55 $
|
* last change: $Author: npower $ $Date: 2002-10-01 10:45:14 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -69,6 +69,9 @@
|
|||||||
|
|
||||||
namespace scripting_impl
|
namespace scripting_impl
|
||||||
{
|
{
|
||||||
|
// for simplification
|
||||||
|
#define css ::com::sun::star
|
||||||
|
#define dcsssf ::drafts::com::sun::star::script::framework
|
||||||
|
|
||||||
/*##################################################################################################
|
/*##################################################################################################
|
||||||
|
|
||||||
@@ -77,8 +80,7 @@ namespace scripting_impl
|
|||||||
##################################################################################################*/
|
##################################################################################################*/
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class XMLElement
|
class XMLElement : public ::cppu::WeakImplHelper1< css::xml::sax::XAttributeList >
|
||||||
: public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XAttributeList >
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline XMLElement( ::rtl::OUString const & name, ::rtl::OUString const & chars )
|
inline XMLElement( ::rtl::OUString const & name, ::rtl::OUString const & chars )
|
||||||
@@ -98,23 +100,25 @@ public:
|
|||||||
@param xElem element reference
|
@param xElem element reference
|
||||||
*/
|
*/
|
||||||
void SAL_CALL addSubElement(
|
void SAL_CALL addSubElement(
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > const & xElem )
|
css::uno::Reference< css::xml::sax::XAttributeList > const & xElem )
|
||||||
SAL_THROW( () );
|
SAL_THROW( () );
|
||||||
|
|
||||||
/** Gets sub element of given index. The index follows order in which sub elements were added.
|
/** Gets sub element of given index. The index follows order in which sub elements were added.
|
||||||
|
|
||||||
@param nIndex index of sub element
|
@param nIndex index of sub element
|
||||||
*/
|
*/
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > SAL_CALL getSubElement( sal_Int32 nIndex )
|
css::uno::Reference< css::xml::sax::XAttributeList > SAL_CALL getSubElement(
|
||||||
SAL_THROW( () );
|
sal_Int32 nIndex )
|
||||||
|
SAL_THROW( () );
|
||||||
|
|
||||||
/** Adds an attribute to elements.
|
/** Adds an attribute to elements.
|
||||||
|
|
||||||
@param rAttrName qname of attribute
|
@param rAttrName qname of attribute
|
||||||
@param rValue value string of element
|
@param rValue value string of element
|
||||||
*/
|
*/
|
||||||
void SAL_CALL addAttribute( ::rtl::OUString const & rAttrName, ::rtl::OUString const & rValue )
|
void SAL_CALL addAttribute( ::rtl::OUString const & rAttrName,
|
||||||
SAL_THROW( () );
|
::rtl::OUString const & rValue )
|
||||||
|
SAL_THROW( () );
|
||||||
|
|
||||||
/** Gets the tag name (qname) of element.
|
/** Gets the tag name (qname) of element.
|
||||||
|
|
||||||
@@ -131,27 +135,27 @@ public:
|
|||||||
@param xOut document handler to be written to
|
@param xOut document handler to be written to
|
||||||
*/
|
*/
|
||||||
void SAL_CALL dump(
|
void SAL_CALL dump(
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut );
|
css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > const & xOut );
|
||||||
/** Dumps out sub elements (and all further sub elements).
|
/** Dumps out sub elements (and all further sub elements).
|
||||||
|
|
||||||
@param xOut document handler to be written to
|
@param xOut document handler to be written to
|
||||||
*/
|
*/
|
||||||
void SAL_CALL dumpSubElements(
|
void SAL_CALL dumpSubElements(
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut );
|
css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > const & xOut );
|
||||||
|
|
||||||
// XAttributeList
|
// XAttributeList
|
||||||
virtual sal_Int16 SAL_CALL getLength()
|
virtual sal_Int16 SAL_CALL getLength()
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getNameByIndex( sal_Int16 nPos )
|
virtual ::rtl::OUString SAL_CALL getNameByIndex( sal_Int16 nPos )
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getTypeByIndex( sal_Int16 nPos )
|
virtual ::rtl::OUString SAL_CALL getTypeByIndex( sal_Int16 nPos )
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getTypeByName( ::rtl::OUString const & rName )
|
virtual ::rtl::OUString SAL_CALL getTypeByName( ::rtl::OUString const & rName )
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getValueByIndex( sal_Int16 nPos )
|
virtual ::rtl::OUString SAL_CALL getValueByIndex( sal_Int16 nPos )
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
virtual ::rtl::OUString SAL_CALL getValueByName( ::rtl::OUString const & rName )
|
virtual ::rtl::OUString SAL_CALL getValueByName( ::rtl::OUString const & rName )
|
||||||
throw (::com::sun::star::uno::RuntimeException);
|
throw (css::uno::RuntimeException);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
::rtl::OUString _name;
|
::rtl::OUString _name;
|
||||||
@@ -161,8 +165,8 @@ protected:
|
|||||||
::std::vector< ::rtl::OUString > _attrNames;
|
::std::vector< ::rtl::OUString > _attrNames;
|
||||||
::std::vector< ::rtl::OUString > _attrValues;
|
::std::vector< ::rtl::OUString > _attrValues;
|
||||||
|
|
||||||
::std::vector< ::com::sun::star::uno::Reference<
|
::std::vector< css::uno::Reference<
|
||||||
::com::sun::star::xml::sax::XAttributeList > > _subElems;
|
css::xml::sax::XAttributeList > > _subElems;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user