Kaydet (Commit) 74916b2d authored tarafından Daniel Boelzle's avatar Daniel Boelzle

#90513# event revision

üst 23427dd5
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Id: dialog.dtd,v 1.15 2001-07-30 17:18:41 dbo Exp $
$Id: dialog.dtd,v 1.16 2001-08-07 10:55:46 dbo Exp $
The Contents of this file are made available subject to the terms of
either of the following licenses
......@@ -72,6 +72,11 @@
dlg:help-url CDATA #IMPLIED
">
<!ENTITY % event "(script:event|
script:listener-event|
dlg:event
)">
<!ENTITY % control "(dlg:bulletinboard|
dlg:button|
dlg:checkbox|
......@@ -93,7 +98,7 @@
dlg:scrollbar
)">
<!ELEMENT dlg:window (dlg:styles*, dlg:event*, dlg:bulletinboard*)>
<!ELEMENT dlg:window (dlg:styles*, (%event;)*, dlg:bulletinboard*)>
<!ATTLIST dlg:window dlg:id CDATA #REQUIRED
dlg:left %numeric; #IMPLIED
dlg:top %numeric; #IMPLIED
......@@ -106,6 +111,7 @@
dlg:help-text CDATA #IMPLIED
dlg:help-url CDATA #IMPLIED
xmlns:dlg CDATA #FIXED "http://openoffice.org/2000/dialog"
xmlns:script CDATA #FIXED "http://openoffice.org/2000/script"
>
<!ELEMENT dlg:styles (dlg:style+)>
......@@ -134,6 +140,21 @@
dlg:font-type (raster|device|scalable) #IMPLIED
>
<!ELEMENT script:event EMPTY>
<!ATTLIST script:event script:location CDATA #IMPLIED
script:language CDATA #REQUIRED
script:macro-name CDATA #REQUIRED
script:event-name CDATA #REQUIRED
>
<!ELEMENT script:listener-event EMPTY>
<!ATTLIST script:listener-event script:location CDATA #IMPLIED
script:language CDATA #REQUIRED
script:macro-name CDATA #REQUIRED
script:listener-type CDATA #REQUIRED
script:listener-method CDATA #REQUIRED
script:listener-param CDATA #IMPLIED
>
<!-- deprecated -->
<!ELEMENT dlg:event EMPTY>
<!ATTLIST dlg:event dlg:listener-type CDATA #REQUIRED
dlg:event-method CDATA #REQUIRED
......@@ -141,20 +162,21 @@
dlg:script-code CDATA #IMPLIED
dlg:param CDATA #IMPLIED
>
<!-- /deprecated -->
<!ELEMENT dlg:bulletinboard ((%control;)*)>
<!ATTLIST dlg:bulletinboard dlg:left %numeric; #IMPLIED
dlg:top %numeric; #IMPLIED
>
<!ELEMENT dlg:button (dlg:event*)>
<!ELEMENT dlg:button ((%event;)*)>
<!ATTLIST dlg:button %default-attributes;
dlg:value CDATA #IMPLIED
dlg:default %boolean; #IMPLIED
dlg:tabstop %boolean; #IMPLIED
>
<!ELEMENT dlg:checkbox (dlg:event*)>
<!ELEMENT dlg:checkbox ((%event;)*)>
<!ATTLIST dlg:checkbox %default-attributes;
dlg:value CDATA #IMPLIED
dlg:checked %boolean; #IMPLIED
......@@ -162,7 +184,7 @@
dlg:tabstop %boolean; #IMPLIED
>
<!ELEMENT dlg:combobox (dlg:menupopup?, dlg:event*)>
<!ELEMENT dlg:combobox (dlg:menupopup?, (%event;)*)>
<!ATTLIST dlg:combobox %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:readonly %boolean; #IMPLIED
......@@ -173,7 +195,7 @@
dlg:value CDATA #IMPLIED
>
<!ELEMENT dlg:menulist (dlg:menupopup?, dlg:event*)>
<!ELEMENT dlg:menulist (dlg:menupopup?, (%event;)*)>
<!ATTLIST dlg:menulist %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:spin %boolean; #IMPLIED
......@@ -188,7 +210,7 @@
>
<!ELEMENT dlg:radiogroup (dlg:radio+)>
<!ELEMENT dlg:radio (dlg:event*)>
<!ELEMENT dlg:radio ((%event;)*)>
<!ATTLIST dlg:radio %default-attributes;
dlg:value CDATA #IMPLIED
dlg:checked %boolean; #IMPLIED
......@@ -210,7 +232,7 @@
dlg:value CDATA #IMPLIED
>
<!ELEMENT dlg:textfield (dlg:event*)>
<!ELEMENT dlg:textfield ((%event;)*)>
<!ATTLIST dlg:textfield %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:align (left|center|right|none) #IMPLIED
......@@ -224,18 +246,18 @@
dlg:value CDATA #IMPLIED
>
<!ELEMENT dlg:img (dlg:event*)>
<!ELEMENT dlg:img ((%event;)*)>
<!ATTLIST dlg:img %default-attributes;
dlg:src CDATA #IMPLIED
>
<!ELEMENT dlg:filecontrol (dlg:event*)>
<!ELEMENT dlg:filecontrol ((%event;)*)>
<!ATTLIST dlg:filecontrol %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:value CDATA #IMPLIED
>
<!ELEMENT dlg:currencyfield (dlg:event*)>
<!ELEMENT dlg:currencyfield ((%event;)*)>
<!ATTLIST dlg:currencyfield %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:readonly %boolean; #IMPLIED
......@@ -250,7 +272,7 @@
dlg:spin %boolean; #IMPLIED
>
<!ELEMENT dlg:datefield (dlg:event*)>
<!ELEMENT dlg:datefield ((%event;)*)>
<!ATTLIST dlg:datefield %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:readonly %boolean; #IMPLIED
......@@ -262,7 +284,7 @@
dlg:spin %boolean; #IMPLIED
>
<!ELEMENT dlg:numericfield (dlg:event*)>
<!ELEMENT dlg:numericfield ((%event;)*)>
<!ATTLIST dlg:numericfield %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:readonly %boolean; #IMPLIED
......@@ -276,7 +298,7 @@
dlg:spin %boolean; #IMPLIED
>
<!ELEMENT dlg:timefield (dlg:event*)>
<!ELEMENT dlg:timefield ((%event;)*)>
<!ATTLIST dlg:timefield %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:readonly %boolean; #IMPLIED
......@@ -288,7 +310,7 @@
dlg:spin %boolean; #IMPLIED
>
<!ELEMENT dlg:patternfield (dlg:event*)>
<!ELEMENT dlg:patternfield ((%event;)*)>
<!ATTLIST dlg:patternfield %default-attributes;
dlg:tabstop %boolean; #IMPLIED
dlg:readonly %boolean; #IMPLIED
......@@ -298,13 +320,13 @@
dlg:literal-mask CDATA #IMPLIED
>
<!ELEMENT dlg:fixedline (dlg:event*)>
<!ELEMENT dlg:fixedline ((%event;)*)>
<!ATTLIST dlg:fixedline %default-attributes;
dlg:align (horizontal|vertical) #IMPLIED
dlg:value CDATA #IMPLIED
>
<!ELEMENT dlg:scrollbar (dlg:event*)>
<!ELEMENT dlg:scrollbar ((%event;)*)>
<!ATTLIST dlg:scrollbar %default-attributes;
dlg:align (horizontal|vertical) #IMPLIED
dlg:curpos %numeric; #IMPLIED
......@@ -314,7 +336,7 @@
dlg:visible-size %numeric; #IMPLIED
>
<!ELEMENT dlg:progressmeter (dlg:event*)>
<!ELEMENT dlg:progressmeter ((%event;)*)>
<!ATTLIST dlg:progressmeter %default-attributes;
dlg:value %numeric; #IMPLIED
dlg:value-min %numeric; #IMPLIED
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_imexp.hxx,v $
*
* $Revision: 1.8 $
* $Revision: 1.9 $
*
* last change: $Author: dbo $ $Date: 2001-03-28 10:50:35 $
* last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -71,15 +71,14 @@
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
#endif
#ifndef _XMLSCRIPT_XMLNS_H_
#include <xmlscript/xmlns.h>
#endif
namespace xmlscript
{
#define XMLNS_DIALOGS_URI "http://openoffice.org/2000/dialog"
#define XMLNS_DIALOGS_UID 1
#define XMLNS_DIALOGS_PREFIX "dlg"
//==================================================================================================
void SAL_CALL exportDialogModel(
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut,
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmllib_imexp.hxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: ab $ $Date: 2001-07-02 12:00:13 $
* last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -68,18 +68,14 @@
#include <com/sun/star/uno/Sequence.hxx>
#endif
#ifndef _XMLSCRIPT_XMLNS_H_
#include <xmlscript/xmlns.h>
#endif
namespace xmlscript
{
#define XMLNS_LIBRARY_URI "http://openoffice.org/2000/library"
#define XMLNS_LIBRARY_UID 1
#define XMLNS_LIBRARY_PREFIX "library"
#define XMLNS_XLINK_URI "http://www.w3.org/1999/xlink"
#define XMLNS_XLINK_UID 2
#define XMLNS_XLINK_PREFIX "xlink"
//==================================================================================================
// Library container export
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmlmod_imexp.hxx,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: dbo $ $Date: 2001-04-04 14:35:07 $
* last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -68,14 +68,14 @@
#include <com/sun/star/uno/Sequence.hxx>
#endif
#ifndef _XMLSCRIPT_XMLNS_H_
#include <xmlscript/xmlns.h>
#endif
namespace xmlscript
{
#define XMLNS_SCRIPT_URI "http://openoffice.org/2000/script"
#define XMLNS_SCRIPT_UID 1
#define XMLNS_SCRIPT_PREFIX "script"
//==================================================================================================
// Script module import/export
......
/*************************************************************************
*
* $RCSfile: xmlns.h,v $
*
* $Revision: 1.1 $
*
* last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
#ifndef _XMLSCRIPT_XMLNS_H_
#define _XMLSCRIPT_XMLNS_H_
#define XMLNS_DIALOGS_URI "http://openoffice.org/2000/dialog"
#define XMLNS_DIALOGS_UID 1
#define XMLNS_DIALOGS_PREFIX "dlg"
#define XMLNS_SCRIPT_URI "http://openoffice.org/2000/script"
#define XMLNS_SCRIPT_UID 2
#define XMLNS_SCRIPT_PREFIX "script"
#define XMLNS_LIBRARY_URI "http://openoffice.org/2000/library"
#define XMLNS_LIBRARY_UID 3
#define XMLNS_LIBRARY_PREFIX "library"
#define XMLNS_XLINK_URI "http://www.w3.org/1999/xlink"
#define XMLNS_XLINK_UID 4
#define XMLNS_XLINK_PREFIX "xlink"
#endif
......@@ -8,6 +8,7 @@ mkdir: %_DEST%\inc\xmlscript
..\inc\xmlscript\xmldlg_imexp.hxx %_DEST%\inc%_EXT%\xmlscript\xmldlg_imexp.hxx
..\inc\xmlscript\xmllib_imexp.hxx %_DEST%\inc%_EXT%\xmlscript\xmllib_imexp.hxx
..\inc\xmlscript\xmlmod_imexp.hxx %_DEST%\inc%_EXT%\xmlscript\xmlmod_imexp.hxx
..\inc\xmlscript\xmlns.h %_DEST%\inc%_EXT%\xmlscript\xmlns.h
..\dtd\*.dtd %_DEST%\bin%_EXT%\*.dtd
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: imp_share.hxx,v $
*
* $Revision: 1.11 $
* $Revision: 1.12 $
*
* last change: $Author: dbo $ $Date: 2001-05-04 13:17:40 $
* last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -101,9 +101,10 @@ inline sal_Int32 toInt32( OUString const & rStr ) SAL_THROW( () )
}
inline bool getBoolAttr(
sal_Bool * pRet, OUString const & rAttrName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes )
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
sal_Int32 nUid = XMLNS_DIALOGS_UID )
{
OUString aValue( xAttributes->getValueByUidName( XMLNS_DIALOGS_UID, rAttrName ) );
OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
if (aValue.getLength())
{
if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("true") ))
......@@ -127,16 +128,18 @@ inline bool getBoolAttr(
}
inline bool getStringAttr(
OUString * pRet, OUString const & rAttrName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes )
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
sal_Int32 nUid = XMLNS_DIALOGS_UID )
{
*pRet = xAttributes->getValueByUidName( XMLNS_DIALOGS_UID, rAttrName );
*pRet = xAttributes->getValueByUidName( nUid, rAttrName );
return (pRet->getLength() > 0);
}
inline bool getLongAttr(
sal_Int32 * pRet, OUString const & rAttrName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes )
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
sal_Int32 nUid = XMLNS_DIALOGS_UID )
{
OUString aValue( xAttributes->getValueByUidName( XMLNS_DIALOGS_UID, rAttrName ) );
OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
if (aValue.getLength())
{
*pRet = toInt32( aValue );
......@@ -201,12 +204,13 @@ protected:
DialogImport * _pImport;
ElementBase * _pParent;
sal_Int32 _nUid;
OUString _aLocalName;
Reference< xml::sax2::XExtendedAttributes > _xAttributes;
public:
ElementBase(
OUString const & rLocalName,
sal_Int32 nUid, OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
SAL_THROW( () );
......@@ -250,7 +254,7 @@ public:
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
: ElementBase( XMLNS_DIALOGS_UID, rLocalName, xAttributes, pParent, pImport )
{}
};
//==================================================================================================
......@@ -289,7 +293,7 @@ public:
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
: ElementBase( XMLNS_DIALOGS_UID, rLocalName, xAttributes, pParent, pImport )
, _inited( 0 )
, _hasValue( 0 )
{}
......@@ -314,7 +318,7 @@ public:
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
: ElementBase( XMLNS_DIALOGS_UID, rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -327,14 +331,14 @@ class ControlElement
protected:
sal_Int32 _nBasePosX, _nBasePosY;
vector< Reference< xml::sax2::XExtendedAttributes > > _events;
vector< Reference< xml::XImportContext > > _events;
OUString getControlId(
Reference< xml::sax2::XExtendedAttributes > const & xAttributes );
Reference< xml::XImportContext > getStyle(
Reference< xml::sax2::XExtendedAttributes > const & xAttributes );
public:
vector< Reference< xml::sax2::XExtendedAttributes > > const * getEvents() SAL_THROW( () )
vector< Reference< xml::XImportContext > > const * getEvents() SAL_THROW( () )
{ return &_events; }
ControlElement(
......@@ -358,7 +362,7 @@ public:
{ return _xControlModel; }
void importEvents(
vector< Reference< xml::sax2::XExtendedAttributes > > const & rEvents );
vector< Reference< xml::XImportContext > > const & rEvents );
bool importStringProperty(
OUString const & rPropName, OUString const & rAttrName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes );
......@@ -441,11 +445,11 @@ public:
throw (xml::sax::SAXException, RuntimeException);
inline EventElement(
OUString const & rLocalName,
sal_Int32 nUid, OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
: ElementBase( nUid, rLocalName, xAttributes, pParent, pImport )
{}
};
//==================================================================================================
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_expmodels.cxx,v $
*
* $Revision: 1.11 $
* $Revision: 1.12 $
*
* last change: $Author: tbe $ $Date: 2001-05-08 11:48:13 $
* last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -769,6 +769,8 @@ void ElementDescriptor::readDialogModel( StyleBag * all_styles )
// collect elements
addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_DIALOGS_PREFIX) ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_URI) ) );
addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_SCRIPT_PREFIX) ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_URI) ) );
readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":id") ) );
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_export.cxx,v $
*
* $Revision: 1.22 $
* $Revision: 1.23 $
*
* last change: $Author: ab $ $Date: 2001-05-22 14:04:41 $
* last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -722,6 +722,15 @@ void ElementDescriptor::readDefaults()
readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("HelpURL") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":help-url") ) );
}
struct StringTriple
{
char const * first;
char const * second;
char const * third;
};
extern StringTriple const * const g_pEventTranslations;
//__________________________________________________________________________________________________
void ElementDescriptor::readEvents()
SAL_THROW( (Exception) )
......@@ -739,37 +748,88 @@ void ElementDescriptor::readEvents()
script::ScriptEventDescriptor descr;
if (xEvents->getByName( pNames[ nPos ] ) >>= descr)
{
ElementDescriptor * pElem = new ElementDescriptor(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":event") ) );
Reference< xml::sax::XAttributeList > xElem( pElem );
OSL_ENSURE( descr.ListenerType.getLength() > 0 &&
descr.EventMethod.getLength() > 0,
"### invalid listener/ event method descr!" );
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":listener-type") ),
descr.ListenerType );
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":event-method") ),
descr.EventMethod );
if (descr.ScriptType.getLength())
descr.EventMethod.getLength() > 0 &&
descr.ScriptCode.getLength() > 0 &&
descr.ScriptType.getLength() > 0,
"### invalid event descr!" );
OUString aEventName;
if (! descr.AddListenerParam.getLength())
{
// detection of event-name
OString listenerType( OUStringToOString( descr.ListenerType, RTL_TEXTENCODING_ASCII_US ) );
OString eventMethod( OUStringToOString( descr.EventMethod, RTL_TEXTENCODING_ASCII_US ) );
StringTriple const * p = g_pEventTranslations;
while (p->first)
{
if (0 == ::rtl_str_compare( p->second, eventMethod.getStr() ) &&
0 == ::rtl_str_compare( p->first, listenerType.getStr() ))
{
aEventName = OUString( p->third, ::rtl_str_getLength( p->third ), RTL_TEXTENCODING_ASCII_US );
break;
}
++p;
}
}
ElementDescriptor * pElem;
Reference< xml::sax::XAttributeList > xElem;
if (aEventName.getLength()) // script:event
{
pElem = new ElementDescriptor(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":event") ) );
xElem = pElem;
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":script-type") ),
descr.ScriptType );
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":event-name") ),
aEventName );
}
if (descr.ScriptCode.getLength())
else // script:listener-event
{
pElem = new ElementDescriptor(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":listener-event") ) );
xElem = pElem;
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":script-code") ),
descr.ScriptCode );
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":listener-type") ),
descr.ListenerType );
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":listener-method") ),
descr.EventMethod );
if (descr.AddListenerParam.getLength())
{
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":listener-param") ),
descr.AddListenerParam );
}
}
if (descr.AddListenerParam.getLength())
// separate optional location
sal_Int32 nIndex = descr.ScriptCode.indexOf( (sal_Unicode)':' );
if (nIndex >= 0)
{
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":param") ),
descr.AddListenerParam );
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":location") ),
descr.ScriptCode.copy( 0, nIndex ) );
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":macro-name") ),
descr.ScriptCode.copy( nIndex +1 ) );
}
else
{
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":macro-name") ),
descr.ScriptCode );
}
// language
pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_PREFIX ":language") ),
descr.ScriptType );
addSubElement( xElem );
}
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: imexp.cxx,v $
*
* $Revision: 1.12 $
* $Revision: 1.13 $
*
* last change: $Author: dbo $ $Date: 2001-05-11 13:53:34 $
* last change: $Author: dbo $ $Date: 2001-08-07 10:55:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -86,9 +86,6 @@
#include <com/sun/star/registry/XImplementationRegistration.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
......@@ -108,7 +105,7 @@ Reference< lang::XMultiServiceFactory > createApplicationServiceManager()
try
{
::rtl::OUString localRegistry = ::comphelper::getPathToUserRegistry();
::rtl::OUString localRegistry = OUString::createFromAscii( "xmlscript.rdb" ); //"::comphelper::getPathToUserRegistry();
::rtl::OUString systemRegistry = ::comphelper::getPathToSystemRegistry();
Reference< registry::XSimpleRegistry > xLocalRegistry( ::cppu::createSimpleRegistry() );
......@@ -149,55 +146,59 @@ Reference< lang::XMultiServiceFactory > createApplicationServiceManager()
Reference< XInterface >() );
}
Reference < registry::XImplementationRegistration > xReg(
xContext->getServiceManager()->createInstanceWithContext(
OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ), xContext ), UNO_QUERY );
Reference< XInterface > x( xContext->getServiceManager()->createInstanceWithContext(
OUString::createFromAscii( "com.sun.star.xml.sax.Parser" ), xContext ) );
if (! x.is()) // register only once
{
Reference < registry::XImplementationRegistration > xReg(
xContext->getServiceManager()->createInstanceWithContext(
OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ), xContext ), UNO_QUERY );
#ifdef SAL_W32
OUString aDllName = OUString::createFromAscii( "sax.dll" );
OUString aDllName = OUString::createFromAscii( "sax.dll" );
#else
OUString aDllName = OUString::createFromAscii( "libsax.so" );
OUString aDllName = OUString::createFromAscii( "libsax.so" );
#endif
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
#ifdef SAL_W32
aDllName = OUString::createFromAscii( "tk" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( "mi.dll" );
aDllName = OUString::createFromAscii( "tk" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( "mi.dll" );
#else
aDllName = OUString::createFromAscii( "libtk" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( ".so" );
aDllName = OUString::createFromAscii( "libtk" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( ".so" );
#endif
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
#ifdef SAL_W32
aDllName = OUString::createFromAscii( "svt" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( "mi.dll" );
aDllName = OUString::createFromAscii( "svt" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( "mi.dll" );
#else
aDllName = OUString::createFromAscii( "libsvt" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( ".so" );
aDllName = OUString::createFromAscii( "libsvt" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( ".so" );
#endif
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
#ifdef SAL_W32
aDllName = OUString::createFromAscii( "i18n" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( "mi.dll" );
aDllName = OUString::createFromAscii( "i18n" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( "mi.dll" );
#else
aDllName = OUString::createFromAscii( "libi18n" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( ".so" );
aDllName = OUString::createFromAscii( "libi18n" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( ".so" );
#endif
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
}
}
catch( Exception& rExc )
......
......@@ -3,6 +3,7 @@
<window xmlns="http://openoffice.org/2000/dialog"
xmlns:dlg="http://openoffice.org/2000/dialog"
xmlns:script="http://openoffice.org/2000/script"
style-id="dialog"
id="window1" title="Test-Dialog" left="50" top="50" height="690" width="400">
......@@ -16,7 +17,10 @@
<dlg:bulletinboard xmlns:ns="http://www.fake" xmlns:dlg="http://openoffice.org/2000/dialog">
<button dlg:id="button1" ns:value="hallo" dlg:left="50" ns:top="50" width="50" height="50" style-id="bla3" xmlns:ns="http://openoffice.org/2000/dialog">
<event listener-type="type" event-method="clicked" script-type="basic" script-code="code" param="testi"/>
<dlg:event listener-type="com.sun.star.awt.XKeyListener" event-method="keyReleased" script-type="StarBasic" script-code="application:ExecutingMacro"/>
<script:event script:event-name="on-rowchange" script:macro-name="ExecutingMacro" script:location="application" script:language="StarBasic"/>
<script:listener-event script:macro-name="ExecutingMacro" script:location="application" script:language="StarBasic" script:listener-type="com.sun.star.awt.XMouseListener" script:listener-method="mouseEntered"/>
<script:listener-event script:macro-name="ExecutingMacro" script:location="application" script:language="StarBasic" script:listener-type="com.sun.star.awt.XMouseListener" script:listener-method="mousePressed" script:listener-param="parameter0, so this will never ever be a script:event, but always a script:listener-event element!"/>
</button>
<button dlg:id="button3" ns:value="hallo2" dlg:left="250" ns:top="50" width="50" height="50" style-id="bla" xmlns:ns="http://openoffice.org/2000/dialog"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment