*** empty log message ***

This commit is contained in:
Noel Power
2002-10-01 09:45:14 +00:00
parent 8ac18c6b80
commit 19dc7dbb80
12 changed files with 455 additions and 516 deletions

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -63,20 +63,18 @@
#include <osl/mutex.hxx>
#ifndef _DRAFTS_COM_SUN_STAR_SCRIPT_FRAMEWORK_STORAGE_SCRIPTIMPLINFO_HPP_
#include <drafts/com/sun/star/script/framework/storage/ScriptImplInfo.hpp>
#endif
#include "XMLElement.hxx"
namespace scripting_impl
{
// for simplification
#define css ::com::sun::star
#define dcsssf ::drafts::com::sun::star::script::framework
class ScriptElement : public ::scripting_impl::XMLElement
{
private:
drafts::com::sun::star::script::framework::storage::ScriptImplInfo m_sII;
public:
/**
Construct a ScriptElement from a ScriptImplInfo object
@@ -84,8 +82,12 @@ public:
@param sII
the ScriptImplInfoObject
*/
explicit ScriptElement(drafts::com::sun::star::script::framework::storage::ScriptImplInfo & sII);
explicit ScriptElement(dcsssf::storage::ScriptImplInfo & sII);
~ScriptElement() SAL_THROW (());
private:
dcsssf::storage::ScriptImplInfo m_sII;
};
}

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -73,39 +73,53 @@
#include <drafts/com/sun/star/script/framework/storage/XScriptInvocationPrep.hpp>
namespace scripting_impl {
// for simplification
#define css ::com::sun::star
#define dcsssf ::drafts::com::sun::star::script::framework
class ScriptInfo :
public ::cppu::WeakImplHelper4<
::com::sun::star::lang::XServiceInfo,
::com::sun::star::lang::XInitialization,
::drafts::com::sun::star::script::framework::storage::XScriptInfo,
::drafts::com::sun::star::script::framework::storage::XScriptInvocationPrep >
class ScriptInfo : public ::cppu::WeakImplHelper4< css::lang::XServiceInfo,
css::lang::XInitialization, dcsssf::storage::XScriptInfo,
dcsssf::storage::XScriptInvocationPrep >
{
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 ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getImplementationName()
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( )
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
virtual ::rtl::OUString SAL_CALL getLogicalName( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setLogicalName( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getDescription( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setDescription( const ::rtl::OUString& desc ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getLanguage( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getScriptLocation( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setLanguage( const ::rtl::OUString& language ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasSource( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getLanguageSpecificName( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setLanguageSpecificName( const ::rtl::OUString& langName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getRoot( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getDependencies( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getLocation( ) throw (::com::sun::star::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 getLogicalName() throw (css::uno::RuntimeException);
virtual void SAL_CALL setLogicalName( const ::rtl::OUString& name )
throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getDescription()
throw (css::uno::RuntimeException);
virtual void SAL_CALL setDescription( const ::rtl::OUString& desc )
throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getLanguage() throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getScriptLocation()
throw (css::uno::RuntimeException);
virtual void SAL_CALL setLanguage( const ::rtl::OUString& language )
throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasSource( ) throw (css::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
to the prepared parcel folder
@@ -114,14 +128,15 @@ public:
<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:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext;
css::uno::Reference< css::uno::XComponentContext> m_xContext;
::osl::Mutex m_mutex;
::drafts::com::sun::star::script::framework::storage::ScriptImplInfo m_scriptImplInfo;
dcsssf::storage::ScriptImplInfo m_scriptImplInfo;
sal_uInt16 m_storageID;
};

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -77,19 +77,156 @@
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< bool > Bool_vec;
/**
* Script Meta Data Importer
*/
class ScriptMetadataImporter
: public ::cppu::WeakImplHelper1<
::com::sun::star::xml::sax::XExtendedDocumentHandler >
class ScriptMetadataImporter : public
::cppu::WeakImplHelper1< css::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:
/** Vector contains the ScriptImplInfo structs */
@@ -111,8 +248,7 @@ private:
osl::Mutex m_mutex;
/** @internal */
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
m_xContext;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
/** Placeholder for the parcel URI */
::rtl::OUString ms_parcelURI;
@@ -121,11 +257,10 @@ private:
enum { PARCEL, SCRIPT, LANGUAGE_NAME, LOGICALNAME, LANGUAGENAME,
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 */
::drafts::com::sun::star::script::framework::storage::ScriptImplInfo
m_scriptImplInfo;
dcsssf::storage::ScriptImplInfo m_scriptImplInfo;
/**
* Helper function to set the state
@@ -134,162 +269,6 @@ private:
* The current tag being processed
*/
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

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -86,64 +86,62 @@
namespace scripting_impl
{
// for simplification
#define css ::com::sun::star
#define dcsssf ::drafts::com::sun::star::script::framework
//Typedefs
//=============================================================================
typedef ::std::vector<
::drafts::com::sun::star::script::framework::storage::ScriptImplInfo > Impls_vec;
typedef ::std::vector< dcsssf::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,
Impls_vec, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ScriptInfo_hash;
//-----------------------------------------------------------------------------
typedef ::std::hash_map < ::rtl::OUString,
::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XExtendedDocumentHandler >,
css::uno::Reference< css::xml::sax::XExtendedDocumentHandler >,
::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > >
ScriptOutput_hash;
//=============================================================================
class ScriptStorage
: public ::cppu::WeakImplHelper6<
::com::sun::star::lang::XServiceInfo,
::com::sun::star::lang::XInitialization,
::drafts::com::sun::star::script::framework::storage::XScriptImplAccess,
::drafts::com::sun::star::script::framework::storage::XScriptStorageExport,
::drafts::com::sun::star::script::framework::storage::XScriptAccessManager,
::drafts::com::sun::star::script::framework::storage::XParcelInvocationPrep >
class ScriptStorage : public
::cppu::WeakImplHelper6<
css::lang::XServiceInfo,
css::lang::XInitialization,
dcsssf::storage::XScriptImplAccess,
dcsssf::storage::XScriptStorageExport,
dcsssf::storage::XScriptAccessManager,
dcsssf::storage::XParcelInvocationPrep >
{
public:
//Constructors and Destructors
//=========================================================================
explicit ScriptStorage( const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& );
explicit ScriptStorage(
const css::uno::Reference< css::uno::XComponentContext > & xContext);
//-------------------------------------------------------------------------
virtual ~ScriptStorage() SAL_THROW( () );
//=========================================================================
// XServiceInfo impl
//=========================================================================
virtual ::rtl::OUString SAL_CALL
getImplementationName()
throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getImplementationName()
throw (css::uno::RuntimeException);
//-------------------------------------------------------------------------
virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString & ServiceName )
throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString & ServiceName )
throw (css::uno::RuntimeException);
//-------------------------------------------------------------------------
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames()
throw (::com::sun::star::uno::RuntimeException);
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw (css::uno::RuntimeException);
//-------------------------------------------------------------------------
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
static css::uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames_Static();
//=========================================================================
// XInitialization impl
//=========================================================================
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);
initialize( css::uno::Sequence< css::uno::Any > const & args )
throw (css::uno::RuntimeException, css::uno::Exception);
//=========================================================================
// XScriptAccessManager impl
@@ -159,10 +157,9 @@ public:
* A sequence of XScriptInfos which represent the implementations
* of the passed in logical name
*/
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
::drafts::com::sun::star::script::framework::storage::XScriptInfo > > SAL_CALL
getScriptInfoService( const ::rtl::OUString & name )
throw (::com::sun::star::uno::RuntimeException);
virtual css::uno::Sequence< css::uno::Reference< dcsssf::storage::XScriptInfo > >
SAL_CALL getScriptInfoService( const ::rtl::OUString & name )
throw (css::uno::RuntimeException);
//=========================================================================
//XScriptImplAccess
@@ -176,14 +173,10 @@ public:
* @return XScriptURI
* The URIs of the implementations
*/
virtual ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Reference<
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > > SAL_CALL
getImplementations( const ::com::sun::star::uno::Reference<
::drafts::com::sun::star::script::framework::scripturi::XScriptURI >&
queryURI )
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
virtual css::uno::Sequence< css::uno::Reference< dcsssf::scripturi::XScriptURI > >
SAL_CALL getImplementations(
const css::uno::Reference< dcsssf::scripturi::XScriptURI >& queryURI )
throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
//=========================================================================
@@ -198,16 +191,13 @@ public:
* @return XInterface
* The view of the hierarchy
*/
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
getView( const ::rtl::OUString& viewName )
throw (::drafts::com::sun::star::script::framework::storage::NoSuchView,
::com::sun::star::uno::RuntimeException);
css::uno::Reference< css::uno::XInterface > getView( const ::rtl::OUString& viewName )
throw (dcsssf::storage::NoSuchView, css::uno::RuntimeException);
//=========================================================================
// XScriptStorageExport
void SAL_CALL
save()
throw (::com::sun::star::uno::RuntimeException);
void SAL_CALL save()
throw (css::uno::RuntimeException);
//=========================================================================
//XParcelInvocationPrep
@@ -221,31 +211,26 @@ public:
@return
<type>::rtl::OUString</type> the new location of the parcel (file URI)
*/
::rtl::OUString SAL_CALL
prepareForInvocation( const ::rtl::OUString& parcelURI )
throw (::com::sun::star::uno::RuntimeException);
::rtl::OUString SAL_CALL prepareForInvocation( const ::rtl::OUString& parcelURI )
throw (css::uno::RuntimeException);
//=========================================================================
private:
::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference<
::com::sun::star::ucb::XSimpleFileAccess > m_xSimpleFileAccess;
::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiComponentFactory > m_xMgr;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Reference< css::ucb::XSimpleFileAccess > m_xSimpleFileAccess;
css::uno::Reference< css::lang::XMultiComponentFactory > m_xMgr;
::std::vector < ::rtl::OUString > mv_logicalNames;
ScriptInfo_hash mh_implementations;
ScriptOutput_hash mh_parcels;
sal_uInt16 m_scriptStorageID;
osl::Mutex m_mutex;
osl::Mutex m_mutex;
bool m_bInitialised;
void updateMaps(const Impls_vec & vScriptImplInfos);
void writeMetadataHeader(
::com::sun::star::uno::Reference <
::com::sun::star::xml::sax::XExtendedDocumentHandler > & );
css::uno::Reference < css::xml::sax::XExtendedDocumentHandler > & xExDocHandler);
/**
This function copies the contents of the source folder into the
destination folder. If the destination folder does not exist, it
@@ -259,9 +244,8 @@ private:
@params dest
the destination folder (file URI)
*/
void
copyFolder(const ::rtl::OUString & src, const ::rtl::OUString & dest)
throw (::com::sun::star::uno::RuntimeException);
void copyFolder(const ::rtl::OUString & src, const ::rtl::OUString & dest)
throw (css::uno::RuntimeException);
}
; // class ScriptingStorage

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -87,8 +87,6 @@ static OUString s_serviceName =
::rtl::OUString::createFromAscii(
"drafts.com.sun.star.script.framework.storage.ScriptStorageManager" );
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;
//*************************************************************************

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -77,41 +77,36 @@
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
typedef ::std::hash_map <
sal_uInt16,
::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > >
typedef ::std::hash_map < sal_uInt16, css::uno::Reference < css::uno::XInterface > >
ScriptStorage_hash;
class ScriptStorageManager :
public ::cppu::WeakImplHelper3 <
::drafts::com::sun::star::script::framework::storage::XScriptStorageManager,
::com::sun::star::lang::XServiceInfo, ::com::sun::star::lang::XEventListener >
class ScriptStorageManager : public
::cppu::WeakImplHelper3 < dcsssf::storage::XScriptStorageManager,
css::lang::XServiceInfo, css::lang::XEventListener >
{
public:
explicit ScriptStorageManager(
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > & xContext )
SAL_THROW ( ( ::com::sun::star::uno::RuntimeException ) );
const css::uno::Reference< css::uno::XComponentContext > & xContext )
SAL_THROW ( ( css::uno::RuntimeException ) );
~ScriptStorageManager() SAL_THROW ( () );
// XServiceInfo implementation
//======================================================================
virtual ::rtl::OUString SAL_CALL
getImplementationName()
throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getImplementationName()
throw(css::uno::RuntimeException);
//----------------------------------------------------------------------
virtual sal_Bool SAL_CALL
supportsService(
const ::rtl::OUString& ServiceName )
throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
throw(css::uno::RuntimeException);
//----------------------------------------------------------------------
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames()
throw(::com::sun::star::uno::RuntimeException);
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw(css::uno::RuntimeException);
//======================================================================
//XScriptStorageManager
@@ -127,11 +122,9 @@ public:
@returns an unsigned short ScriptStorage ID, which can be used in the
getScriptStorage method
*/
virtual sal_uInt16 SAL_CALL
createScriptStorage(
const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XSimpleFileAccess > & xSFA )
throw (::com::sun::star::uno::RuntimeException);
virtual sal_uInt16 SAL_CALL createScriptStorage(
const css::uno::Reference< css::ucb::XSimpleFileAccess > & xSFA )
throw (css::uno::RuntimeException);
//----------------------------------------------------------------------
/**
create a ScriptStorage using the XSimpleFileAccess, and a string URL
@@ -148,10 +141,9 @@ public:
*/
virtual sal_uInt16 SAL_CALL
createScriptStorageWithURI(
const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XSimpleFileAccess >& xSFA,
const css::uno::Reference< css::ucb::XSimpleFileAccess >& xSFA,
const ::rtl::OUString& stringURI )
throw (::com::sun::star::uno::RuntimeException);
throw (css::uno::RuntimeException);
//----------------------------------------------------------------------
/**
get a ScriptStorage component using its scriptStorageID
@@ -164,46 +156,36 @@ public:
@returns an XInterface to a component that implements the ScriptStorage
service
*/
virtual ::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface > SAL_CALL
getScriptStorage( sal_uInt16 scriptStorageID )
throw (::com::sun::star::uno::RuntimeException);
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getScriptStorage(
sal_uInt16 scriptStorageID )
throw (css::uno::RuntimeException);
//======================================================================
//XEventListener
//======================================================================
virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject& Source )
throw (::com::sun::star::uno::RuntimeException);
static const sal_uInt16 APP_SHARE_STORAGE_ID;
static const sal_uInt16 APP_USER_STORAGE_ID;
virtual void SAL_CALL disposing( const css::lang::EventObject& Source )
throw (css::uno::RuntimeException);
private:
ScriptStorageManager(const ScriptStorageManager & );
ScriptStorageManager& operator= (const ScriptStorageManager &);
// to obtain other services if needed
::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiComponentFactory > m_xMgr;
::osl::Mutex m_mutex;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Reference< css::lang::XMultiComponentFactory > m_xMgr;
::osl::Mutex m_mutex;
ScriptStorage_hash m_ScriptStorageHash;
sal_uInt16 m_count;
sal_uInt16 m_count;
void setupAppStorage(
const ::com::sun::star::uno::Reference<
::com::sun::star::util::XMacroExpander > & xME,
void setupAppStorage( const css::uno::Reference< css::util::XMacroExpander > & xME,
const ::rtl::OUString & storageStr )
SAL_THROW ( ( ::com::sun::star::uno::RuntimeException ) );
SAL_THROW ( ( css::uno::RuntimeException ) );
sal_uInt16 setupAnyStorage(
const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XSimpleFileAccess> & xSFA,
const css::uno::Reference< css::ucb::XSimpleFileAccess> & xSFA,
const ::rtl::OUString & storageStr )
SAL_THROW ( ( ::com::sun::star::uno::RuntimeException ) );
SAL_THROW ( ( css::uno::RuntimeException ) );
};
} // scripting_impl

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -69,6 +69,9 @@
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
: public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XAttributeList >
class XMLElement : public ::cppu::WeakImplHelper1< css::xml::sax::XAttributeList >
{
public:
inline XMLElement( ::rtl::OUString const & name, ::rtl::OUString const & chars )
@@ -98,23 +100,25 @@ public:
@param xElem element reference
*/
void SAL_CALL addSubElement(
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > const & xElem )
SAL_THROW( () );
css::uno::Reference< css::xml::sax::XAttributeList > const & xElem )
SAL_THROW( () );
/** Gets sub element of given index. The index follows order in which sub elements were added.
@param nIndex index of sub element
*/
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > SAL_CALL getSubElement( sal_Int32 nIndex )
SAL_THROW( () );
css::uno::Reference< css::xml::sax::XAttributeList > SAL_CALL getSubElement(
sal_Int32 nIndex )
SAL_THROW( () );
/** Adds an attribute to elements.
@param rAttrName qname of attribute
@param rValue value string of element
*/
void SAL_CALL addAttribute( ::rtl::OUString const & rAttrName, ::rtl::OUString const & rValue )
SAL_THROW( () );
void SAL_CALL addAttribute( ::rtl::OUString const & rAttrName,
::rtl::OUString const & rValue )
SAL_THROW( () );
/** Gets the tag name (qname) of element.
@@ -131,27 +135,27 @@ public:
@param xOut document handler to be written to
*/
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).
@param xOut document handler to be written to
*/
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
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 )
throw (::com::sun::star::uno::RuntimeException);
throw (css::uno::RuntimeException);
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 )
throw (::com::sun::star::uno::RuntimeException);
throw (css::uno::RuntimeException);
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 )
throw (::com::sun::star::uno::RuntimeException);
throw (css::uno::RuntimeException);
protected:
::rtl::OUString _name;
@@ -161,8 +165,8 @@ protected:
::std::vector< ::rtl::OUString > _attrNames;
::std::vector< ::rtl::OUString > _attrValues;
::std::vector< ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList > > _subElems;
::std::vector< css::uno::Reference<
css::xml::sax::XAttributeList > > _subElems;
};
}