diff options
Diffstat (limited to 'offapi/com/sun/star/xml/sax')
26 files changed, 1653 insertions, 0 deletions
diff --git a/offapi/com/sun/star/xml/sax/FastParser.idl b/offapi/com/sun/star/xml/sax/FastParser.idl new file mode 100644 index 0000000000..5eaa3482a2 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/FastParser.idl @@ -0,0 +1,16 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +module com { module sun { module star { module xml { module sax { + +service FastParser: XFastParser; + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/FastToken.idl b/offapi/com/sun/star/xml/sax/FastToken.idl new file mode 100644 index 0000000000..3a092735e1 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/FastToken.idl @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module xml { module sax { + + +constants FastToken +{ + + /** specifies an unknown token. + */ + const long DONTKNOW = -1; + + + /** specifies the first namespace token + */ + const long NAMESPACE = 0x00010000; +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/FastTokenHandler.idl b/offapi/com/sun/star/xml/sax/FastTokenHandler.idl new file mode 100644 index 0000000000..26d5e86c79 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/FastTokenHandler.idl @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module xml { module sax { + +service FastTokenHandler : XFastTokenHandler; + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/InputSource.idl b/offapi/com/sun/star/xml/sax/InputSource.idl new file mode 100644 index 0000000000..e4cc329fd6 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/InputSource.idl @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** specifies the Datasource plus some additional information for the parser. + + <p>There are two places where the application will deliver this input + source to the parser: + </p> + <ul> + <li>as the argument of XParser::parseStream()</li> + <li>as the return value of XEntityResolver::resolveEntity(). + </li> + </ul> + */ +published struct InputSource +{ + /** contains the byte input stream of the document. + */ + com::sun::star::io::XInputStream aInputStream; + + + /** contains the encoding of the data stream. This is used by the parser + to do Unicode conversions. + + <p>Note that in general you do not need to specify an encoding. + Either it is UTF-8 or UTF-16 which is recognized by the parser + or it is specified in the first line of the XML-File + ( e.g. <em>?xml encoding="EUC-JP"?</em> ).</p> + */ + string sEncoding; + + + /** contains the public Id of the document, for example, needed in + exception-message strings. + */ + string sPublicId; + + + /** contains the system ID of the document. + */ + string sSystemId; +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/Parser.idl b/offapi/com/sun/star/xml/sax/Parser.idl new file mode 100644 index 0000000000..6fdfc1064b --- /dev/null +++ b/offapi/com/sun/star/xml/sax/Parser.idl @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +module com { module sun { module star { module xml { module sax { + + +/** + Service that provides a SAX parser. + */ +published service Parser : XParser; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/SAXException.idl b/offapi/com/sun/star/xml/sax/SAXException.idl new file mode 100644 index 0000000000..2be5366ee4 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/SAXException.idl @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** encapsulates the details of an XML parse error or warning. + + <p>This structure is a replacement for the Java class + <em>org.xml.sax.SAXException</em>. </p> + + <p>Some abbreviations: </p> + <ul> + <li>SAX = Simple API for XML </li> + <li>URI = Uniform Resource Identifier </li> + <li>DTD = document type definition </li> + </ul> + */ +published exception SAXException: com::sun::star::uno::Exception +{ + + /** This field may contain a wrapped exception. + */ + any WrappedException; + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/SAXInvalidCharacterException.idl b/offapi/com/sun/star/xml/sax/SAXInvalidCharacterException.idl new file mode 100644 index 0000000000..860f99af5c --- /dev/null +++ b/offapi/com/sun/star/xml/sax/SAXInvalidCharacterException.idl @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** stores information for locating the error in the original XML document. + + @see XLocator + */ +published exception SAXInvalidCharacterException: com::sun::star::xml::sax::SAXException +{ + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/SAXParseException.idl b/offapi/com/sun/star/xml/sax/SAXParseException.idl new file mode 100644 index 0000000000..b413dc942b --- /dev/null +++ b/offapi/com/sun/star/xml/sax/SAXParseException.idl @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** stores information for locating the error in the original XML document. + + @see XLocator + */ +published exception SAXParseException: com::sun::star::xml::sax::SAXException +{ + + /** contains the public identifier of the document where the exception + has occurred. + */ + string PublicId; + + + /** contains the system identifier of the document. + */ + string SystemId; + + + /** contains the line number in the document. + */ + long LineNumber; + + + /** contains the column number in the document. + */ + long ColumnNumber; + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/Writer.idl b/offapi/com/sun/star/xml/sax/Writer.idl new file mode 100644 index 0000000000..14f06b1ea4 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/Writer.idl @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** + @since LibreOffice 4.0 + */ +service Writer : XWriter; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XAttributeList.idl b/offapi/com/sun/star/xml/sax/XAttributeList.idl new file mode 100644 index 0000000000..2be0b03135 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XAttributeList.idl @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module xml { module sax { + + +/** specifies an element's attributes. + + <p>This interface describes a name-type-value triple which describes a + single attribute of a tag. Implementors are encouraged to implement the + com::sun::star::util::XCloneable interface also to + allow the user to make a copy of the instance. + + </p> + <p>This interface is a poor IDL version of the Java interface + <em>org.xml.sax.AttributeList</em>. For example in getValueByName, it does + not allow to distinguish a missing value (for which the Java interface + returns null) from an empty string value.</p> + */ +published interface XAttributeList: com::sun::star::uno::XInterface +{ + + /** @returns + the number of attributes in this list. + */ + short getLength(); + + + /** @returns + the name of an attribute in this list (by position). + */ + string getNameByIndex( [in] short i ); + + + /** @returns + the type of an attribute in the list (by position). + Non-validating parsers may return CDATA only. + */ + string getTypeByIndex( [in] short i ); + + + /** @returns + the type of an attribute in the list (by name). + Non-validating parsers may return CDATA only. + */ + string getTypeByName( [in] string aName ); + + + /** @returns + the value of an attribute in the list (by position). + */ + string getValueByIndex( [in] short i ); + + + /** @returns + the value of an attribute in the list (by name). + */ + string getValueByName( [in] string aName ); +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XDTDHandler.idl b/offapi/com/sun/star/xml/sax/XDTDHandler.idl new file mode 100644 index 0000000000..47c04cb665 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XDTDHandler.idl @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** receives events according to the DTD of the document. + + <p>The SAX parser may report these events in any order, regardless of the + order in which the notations and unparsed entities were declared; however, + all DTD events must be reported after the document handler's + <code>startDocument</code> event, and before the first <code>startElement</code> + event. It is up to the application to store the information for future + use (perhaps in a hash table or object tree). If the application encounters + attributes of type "NOTATION", "ENTITY", or "ENTITIES", it can use the + information that it obtained through this interface to find the entity + and/or notation that corresponds with the attribute value. + </p> + */ +published interface XDTDHandler: com::sun::star::uno::XInterface +{ + + /** receives notification of a notation declaration event. + */ + void notationDecl( [in] string sName, + [in] string sPublicId, + [in] string sSystemId ); + + + /** receives notification of an unparsed entity declaration event. + */ + void unparsedEntityDecl( [in] string sName, + [in] string sPublicId, + [in] string sSystemId, + [in] string sNotationName ); + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XDocumentHandler.idl b/offapi/com/sun/star/xml/sax/XDocumentHandler.idl new file mode 100644 index 0000000000..eb347bc896 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XDocumentHandler.idl @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** receives notification of general document events. + + <p>This interface is an IDL version of the Java interface + <em>org.xml.sax.DocumentHandler</em> with some smaller + adaptations.</p> + */ +published interface XDocumentHandler: com::sun::star::uno::XInterface +{ + + /** receives notification of the beginning of a document. + */ + void startDocument() + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of the end of a document. + */ + void endDocument() + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of the beginning of an element . + */ + void startElement( [in] string aName, + [in] com::sun::star::xml::sax::XAttributeList xAttribs ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of the end of an element. + */ + void endElement( [in] string aName ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of character data. + */ + void characters( [in] string aChars ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of white space that can be ignored. + */ + void ignorableWhitespace( [in] string aWhitespaces ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of a processing instruction. + */ + void processingInstruction( [in] string aTarget, + [in] string aData ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives an object for locating the origin of SAX document events. + */ + void setDocumentLocator( [in] com::sun::star::xml::sax::XLocator xLocator ) + raises( com::sun::star::xml::sax::SAXException ); + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XEntityResolver.idl b/offapi/com/sun/star/xml/sax/XEntityResolver.idl new file mode 100644 index 0000000000..299cadf9b6 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XEntityResolver.idl @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** makes it possible to modify the behavior of resolving external + preferences. + + <p>Usually, the parser has a default behavior of resolving external + references (See documentation of the parser implementation). + Use this interface to modify or reimplement this behavior.</p> + */ +published interface XEntityResolver: com::sun::star::uno::XInterface +{ + + /** @returns + InputSource for the external entity. + + <p>If <var>aInputStream</var> is a valid reference to an input stream, + the parser uses this InputSource. Otherwise the + parser seeks for the entity using its default behavior. + */ + InputSource resolveEntity( [in] string sPublicId, [in] string sSystemId ); + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XErrorHandler.idl b/offapi/com/sun/star/xml/sax/XErrorHandler.idl new file mode 100644 index 0000000000..ee9cf07e7c --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XErrorHandler.idl @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** is the basic interface for SAX error handlers. + + <p>If a SAX application needs to implement customized error handling, + it must implement this interface and then register an instance with the + SAX parser using the parser's XParser::setErrorhandler() + method. The parser will then report all errors and warnings through this + interface. </p> + + <p>This interface is a slight adaptation of the Java interface + <code>org.xml.sax.ErrorHandler</code>. In IDL, no exception can be passed + as an argument, so an <code>any</code> serves as the container. The type of the + exception is SAXParseException or an instance of a derived class.</p> + */ +published interface XErrorHandler: com::sun::star::uno::XInterface +{ + /** receives notification of a recoverable error. + */ + void error( [in] any aSAXParseException ) + raises( com::sun::star::xml::sax::SAXException ); + + /** receives notification of a non-recoverable error. + */ + void fatalError( [in] any aSAXParseException ) + raises( com::sun::star::xml::sax::SAXException ); + + /** receives notification of a warning. + */ + void warning( [in] any aSAXParseException ) + raises( com::sun::star::xml::sax::SAXException ); + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XExtendedDocumentHandler.idl b/offapi/com/sun/star/xml/sax/XExtendedDocumentHandler.idl new file mode 100644 index 0000000000..c4fe608d17 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XExtendedDocumentHandler.idl @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** this interface does not conform to the SAX-standard. + + <p>Note: Whether or not every callback is supported is dependent + on the parser implementation. + */ +published interface XExtendedDocumentHandler: com::sun::star::xml::sax::XDocumentHandler +{ + /** receives notification about the start of a CDATA section in the + XML-source. + + <p>Any string coming in via character handler may include chars, + that would otherwise be interpreted as markup. </p> + */ + void startCDATA() + raises( com::sun::star::xml::sax::SAXException ); + + /** informs about the end of a CDATA-Section. + + <p>Note that <code>startCDATA/endCDATA</code> MUST NOT enclose any + <code>startElement/endElement</code>-call!</p> + */ + void endCDATA() + raises( com::sun::star::xml::sax::SAXException ); + + /** receives notification about a comment in the XML-source. + */ + void comment( [in] string sComment ) + raises( com::sun::star::xml::sax::SAXException ); + + /** informs a writer that it is allowable to insert a line break and + indentation before the next XDocumentHandler-call. + */ + void allowLineBreak() + raises( com::sun::star::xml::sax::SAXException ); + + /** notifies that any characters that cannot be handled by other callback + methods are announced through this method. + */ + void unknown( [in] string sString ) + raises( com::sun::star::xml::sax::SAXException ); +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XFastAttributeList.idl b/offapi/com/sun/star/xml/sax/XFastAttributeList.idl new file mode 100644 index 0000000000..1459f2d15a --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastAttributeList.idl @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module xml { module sax { + + +/** a container for the attributes of an XML element. + + <br>Attributes are separated into known attributes and unknown attributes. + <p>Known attributes have a local name that is known to the XFastTokenHandler + registered at the XFastParser which created the sax event containing + this attributes. If an attribute also has a namespace, that must be registered + at the XFastParser, else this attribute is also unknown even if + the local name is known. + */ +interface XFastAttributeList: com::sun::star::uno::XInterface +{ + /** checks if an attribute is available.<br> + + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.<br> + + If the attribute name has a namespace that was registered with the + XFastParser, Token contains the integer token of the + attributes local name from the XFastTokenHandler and + the integer token of the namespace combined with an arithmetic + <b>or</b> operation. + + @returns + `TRUE`, if the attribute is available + */ + boolean hasAttribute( [in] long Token ); + + /** retrieves the token of an attribute value.<br> + + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.<br> + + If the attribute name has a namespace that was registered with the + XFastParser, Token contains the integer token of the + attributes local name from the XFastTokenHandler and + the integer token of the namespace combined with an arithmetic + <b>or</b> operation. + + @returns + The integer token of the value from the attribute or FastToken::Invalid + + @throws SAXEXception + if the attribute is not available + + */ + long getValueToken( [in] long Token ) + raises( SAXException ); + + /**retrieves the token of an attribute value.<br> + + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.<br> + + If the attribute name has a namespace that was registered with the + XFastParser, Token contains the integer token of the + attributes local name from the XFastTokenHandler and + the integer token of the namespace combined with an arithmetic + <b>or</b> operation. + + @param Default + This value will be returned if the attribute is not available + + @returns + If the attribute is available it returns the integer token of the value + from the attribute or FastToken::Invalid. + If not the value of <code>Default</code> is returned. + + */ + long getOptionalValueToken( [in] long Token, [in] long Default ); + + /** retrieves the value of an attribute.<br> + + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.<br> + + If the attribute name has a namespace that was registered with the + XFastParser, Token contains the integer token of the + attributes local name from the XFastTokenHandler and + the integer token of the namespace combined with an arithmetic + <b>or</b> operation. + + @returns + The string value from the attribute. + + @throws SAXEXception + if the attribute is not available + + */ + string getValue( [in] long Token ) + raises( SAXException ); + + /** retrieves the value of an attribute.<br> + + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.<br> + + If the attribute name has a namespace that was registered with the + XFastParser, Token contains the integer token of the + attributes local name from the XFastTokenHandler and + the integer token of the namespace combined with an arithmetic + <b>or</b> operation. + + @returns + The string value from the attribute or an empty string if the + attribute is not available. + */ + string getOptionalValue( [in] long Token ); + + /** returns a sequence of attributes which names and or namespaces URLS + can not be translated to tokens. + */ + sequence< ::com::sun::star::xml::Attribute > getUnknownAttributes(); + + /** returns a sequence of attributes which names and or namespaces URLS + are translated to tokens. + */ + sequence< ::com::sun::star::xml::FastAttribute > getFastAttributes(); +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XFastContextHandler.idl b/offapi/com/sun/star/xml/sax/XFastContextHandler.idl new file mode 100644 index 0000000000..7798b703c6 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastContextHandler.idl @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** receives notification of sax document events from a + XFastParser. + + @see XFastDocumentHandler + */ +interface XFastContextHandler: com::sun::star::uno::XInterface +{ + + /** receives notification of the beginning of an element . + + @param Element + contains the integer token from the XFastTokenHandler + registered at the XFastParser.<br> + + If the element has a namespace that was registered with the + XFastParser, <code>Element</code> contains the integer + token of the elements local name from the XFastTokenHandler + and the integer token of the namespace combined with an arithmetic + <b>or</b> operation. + + @param Attribs + Contains a XFastAttributeList to access the attributes + from the element. + + */ + void startFastElement( [in] long Element, [in] XFastAttributeList Attribs ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of the beginning of an unknown element . + + @param Namespace + contains the namespace url (not the prefix!) of this element. + @param Name + contains the elements local name. + @param Attribs + Contains a XFastAttributeList to access the attributes + from the element. + */ + void startUnknownElement( [in] string Namespace, [in] string Name, [in] XFastAttributeList Attribs ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of the end of a known element. + @see startFastElement + */ + void endFastElement( [in] long Element ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of the end of a known element. + @see startUnknownElement + */ + void endUnknownElement( [in] string Namespace, [in] string Name ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of the beginning of a known child element. + + @param Element + contains the integer token from the XFastTokenHandler + registered at the XFastParser. + + <br>If the element has a namespace that was registered with the + XFastParser, <code>Element</code> contains the + integer token of the elements local name from the + XFastTokenHandler and the integer token of the + namespace combined with an arithmetic <b>or</b> operation. + + @param Attribs + Contains a XFastAttributeList to access the attributes + from the element. + */ + XFastContextHandler createFastChildContext( [in] long Element, [in] XFastAttributeList Attribs ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of the beginning of an unknown child element . + + @param Namespace + contains the namespace url (not the prefix!) of this element. + @param Name + contains the elements local name. + @param Attribs + Contains a XFastAttributeList to access the attributes + the element. + */ + XFastContextHandler createUnknownChildContext( [in] string Namespace, [in] string Name, [in] XFastAttributeList Attribs ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of character data. + */ + void characters( [in] string aChars ) + raises( com::sun::star::xml::sax::SAXException ); + }; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XFastDocumentHandler.idl b/offapi/com/sun/star/xml/sax/XFastDocumentHandler.idl new file mode 100644 index 0000000000..cb808dfaf2 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastDocumentHandler.idl @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** receives notification of sax document events from a + XFastParser + */ +interface XFastDocumentHandler: XFastContextHandler +{ + + /** called by the parser when parsing of an XML stream is started. + */ + void startDocument() + raises( com::sun::star::xml::sax::SAXException ); + + + /** called by the parser after the last XML element of a stream is processed. + */ + void endDocument() + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives notification of a processing instruction. + @since LibreOffice 6.0 + */ + void processingInstruction( [in] string aTarget, [in] string aData ) + raises( com::sun::star::xml::sax::SAXException ); + + + /** receives an object for locating the origin of SAX document events. + */ + void setDocumentLocator( [in] com::sun::star::xml::sax::XLocator xLocator ) + raises( com::sun::star::xml::sax::SAXException ); + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XFastNamespaceHandler.idl b/offapi/com/sun/star/xml/sax/XFastNamespaceHandler.idl new file mode 100644 index 0000000000..6554261734 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastNamespaceHandler.idl @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +module com { module sun { module star { module xml { module sax { + +/** Stores and manages namespace declarations of a sax + document parsed by XFastParser. + + @since LibreOffice 5.3 + */ +interface XFastNamespaceHandler: com::sun::star::uno::XInterface +{ + + /** receives notification of namespace declarations + from a XFastParser. + */ + void registerNamespace( [in] string NamespacePrefix, [in] string NamespaceURI ); + + + /** retrieves the namespace URI of a namespace prefix + */ + string getNamespaceURI( [in] string NamespacePrefix ); + +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XFastParser.idl b/offapi/com/sun/star/xml/sax/XFastParser.idl new file mode 100644 index 0000000000..8f17b3ddaf --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastParser.idl @@ -0,0 +1,148 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module xml { module sax { + + +/** specifies a SAX parser that uses integer values for known XML names + (elements, attributes and attribute values). The parser also handles + namespaces and allows to have individual contexts for each XML element. + + <p>Before parsing is possible you have to set your + XFastDocumentHandler using setFastDocumentHandler(). + + <p>Parsing starts with calling parseStream(). If the parser + finds a valid XML file with the given InputSource, it calls + XFastDocumentHandler::startDocument() first. + + <p>This parser generates either "fast" events that use integer token + values for namespaces, elements and attributes or "unknown" events for + elements that are unknown. + + <p>A namespace is unknown if the namespace URL was not registered with + registerNamespace(). + + <p>An element is unknown if no XFastTokenHandler is set + or if the XFastTokenHandler does not return a valid + identifier for the elements local name. An element is also unknown if + the elements local name is known but it uses a namespace that is unknown. + + <p>Setting a XFastTokenHandler with setTokenHandler() + is optional, but without a XFastTokenHandler you will only + get unknown sax events. This can be useful if you are only interested + in the namespace handling and/or the context feature. + + <p>For each element the parser sends a create child element event to the + elements parent context by calling + XFastContextHandler::createFastChildContext() for known + elements or XFastContextHandler::createUnknownChildContext() + for unknown elements. + <br>The parent context for the root element is the XFastDocumentHandler + itself. + + <p>If the parent context returns an empty reference, no further events for + the element and all of its children are created. + + <p>If a valid context is returned this context gets a start event by a call to + XFastContextHandler::startFastElement() for known elements or + XFastContextHandler::startUnknownElement() for unknown elements. + + <p>After processing all its child elements the context gets an end event by a call to + XFastContextHandler::endFastElement() for known elements or + XFastContextHandler::endUnknownElement() for unknown elements. + + <p>It is valid to return one instance of XFastContextHandler more + than once. It is even possible to only use the XFastDocumentHandler + by always returning a reference to itself for each create child context event. + + <p>After the last element is processed the parser generates an end document + event at the XFastDocumentHandler by calling + XFastDocumentHandler::endDocument(). + + @see http://wiki.openoffice.org/wiki/FastParser +*/ +interface XFastParser: com::sun::star::uno::XInterface +{ + /** parses an XML document from a stream. + + <p>Set the desired handlers before calling this method.</p> + */ + void parseStream( [in] InputSource aInputSource ) + raises( SAXException, com::sun::star::io::IOException ); + + + /** Application must register a document event handler to get + sax events for the parsed stream. + */ + void setFastDocumentHandler( [in] XFastDocumentHandler Handler ); + + + /** must be registered to translate known XML names to integer tokens. + */ + void setTokenHandler( [in] XFastTokenHandler Handler ); + + + /** registers a known namespace url with the given integer token.<br> + @param NamespaceURL the namespace URL. + @param NamespaceToken + an integer token that must be greater than FastToken::NAMESPACE. + */ + void registerNamespace( [in] string NamespaceURL, [in] long NamespaceToken ) + raises( com::sun::star::lang::IllegalArgumentException ); + + /** allows an application to register an error event handler. + + <p>Note that the error handler can throw an exception when an error or + warning occurs. Note that an exception is thrown by the parser when + an unrecoverable (fatal) error occurs.</p> + */ + void setErrorHandler( [in] XErrorHandler Handler ); + + /** allows an application to register a DTD-Handler. + */ + void setEntityResolver( [in] XEntityResolver Resolver ); + + /** sets a locale specified for localization of warnings and error messages. + + <p>Set the language of the error messages. Useful when the parsing + errors will be presented to the user.</p> + */ + void setLocale( [in] com::sun::star::lang::Locale locale ); + + /** Gets the namespace url string. + */ + string getNamespaceURL( [in] string prefix ) + raises( com::sun::star::lang::IllegalArgumentException ); + + /** @since LibreOffice 5.3 */ + void setNamespaceHandler( [in] XFastNamespaceHandler Handler); + + /** + * Simulate a DTD file. + * Will allow to use customized entity references like ∞ . + * @since LibreOffice 7.1 + */ + void setCustomEntityNames( [in] sequence< beans::Pair<string,string> > replacements); +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XFastSAXSerializable.idl b/offapi/com/sun/star/xml/sax/XFastSAXSerializable.idl new file mode 100644 index 0000000000..107afa7075 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastSAXSerializable.idl @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +module com { module sun { module star { module xml { module sax { + +/** serializes a DOM tree by generating FastSAX events. + + <p> + </p> + + @since OOo 3.1 + +*/ +interface XFastSAXSerializable +{ + + /** serializes an object (e.g. a DOM tree) that represents an XML document + by generating fast SAX events. + + @param handler + the SAX event handler that should receive the generated events + @param tokenHandler + the fast SAX token handler that is used to translate names + @param namespaces + a list of namespace declarations that will be added to the root + element node of the XML document + <p> + This is necessary mostly because the DOM implementation does + not permit attaching namespaces declarations directly to nodes, + which may lead to duplicate namespace declarations on export, + and thus larger documents. + Note that the first part of each tuple is the prefix, + e.g. "office", and the second is the numeric namespace identifier. + </p> + @param registerNamespaces + a list of namespace url / namespace token pairs. you need + to register all namespace in order to have them recognized + during export. Namespace tokens must be greater than + FastToken::NAMESPACE. + </p> + + @throws com::sun::star::xml::sax::SAXException + if serializing the XML document fails + */ + void fastSerialize([in] com::sun::star::xml::sax::XFastDocumentHandler handler, + [in] com::sun::star::xml::sax::XFastTokenHandler tokenHandler, + [in] sequence< com::sun::star::beans::StringPair > namespaces, + [in] sequence< com::sun::star::beans::Pair<string, long> > registerNamespaces) + raises( com::sun::star::xml::sax::SAXException ); +}; + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XFastTokenHandler.idl b/offapi/com/sun/star/xml/sax/XFastTokenHandler.idl new file mode 100644 index 0000000000..ceecca71c8 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastTokenHandler.idl @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + +module com { module sun { module star { module xml { module sax { + + +/** interface to translate XML strings to integer tokens. + + <p>An instance of this interface can be registered at a XFastParser. + It should be able to translate all XML names (element local names, + attribute local names and constant attribute values) to integer tokens. + + A token value must be greater or equal to zero and less than + FastToken::NAMESPACE. If a string identifier is not known + to this instance, FastToken::DONTKNOW is returned. + */ +interface XFastTokenHandler: com::sun::star::uno::XInterface +{ + + /** returns an integer token for the given string + + @param Identifier + the string given as a byte sequence encoded in UTF-8 + + @returns + a unique integer token for the given String or FastToken::DONTKNOW + if the identifier is not known to this instance. + */ + long getTokenFromUTF8( [in] sequence< byte > Identifier ); + + + /** returns an identifier for the given integer token as a byte + sequence encoded in UTF-8. + */ + sequence< byte > getUTF8Identifier( [in] long Token ); +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XLocator.idl b/offapi/com/sun/star/xml/sax/XLocator.idl new file mode 100644 index 0000000000..c8380dff76 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XLocator.idl @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** makes it possible to associate a SAX event with a document location. + + <p>This interface is an IDL version of the Java interface + <em>org.xml.sax.Locator</em>.</p> + */ +published interface XLocator: com::sun::star::uno::XInterface +{ + /** @returns + the column number where the current document event ends. + */ + long getColumnNumber(); + + /** @returns + the line number where the current document event ends. + */ + long getLineNumber(); + + /** @returns + the public identifier for the current document event. + */ + string getPublicId(); + + /** @returns + the system identifier for the current document event. + */ + string getSystemId(); +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XParser.idl b/offapi/com/sun/star/xml/sax/XParser.idl new file mode 100644 index 0000000000..168661a968 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XParser.idl @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + + + +module com { module sun { module star { module xml { module sax { + + +/** specifies a SAX parser. + + <p>This interface is an IDL version of the Java interface + <em>org.xml.sax.Parser</em> with some minor adaptations.</p> + */ +published interface XParser: com::sun::star::uno::XInterface +{ + /** parses an XML document from a stream. + + <p>Set the desired handlers before calling this method.</p> + */ + void parseStream( [in] com::sun::star::xml::sax::InputSource aInputSource ) + raises( com::sun::star::xml::sax::SAXException, + com::sun::star::io::IOException ); + + /** allows an application to register a document event handler. + */ + void setDocumentHandler( [in] com::sun::star::xml::sax::XDocumentHandler xHandler ); + + /** allows an application to register an error event handler. + + <p>Note that the error handler can throw an exception when an error or + warning occurs. Note that an exception is thrown by the parser when + an unrecoverable (fatal) error occurs.</p> + */ + void setErrorHandler( [in] com::sun::star::xml::sax::XErrorHandler xHandler ); + + /** allows an application to register a DTD-Handler. + */ + void setDTDHandler( [in] com::sun::star::xml::sax::XDTDHandler xHandler ); + + /** allows an application to register a DTD-Handler. + */ + void setEntityResolver( [in] com::sun::star::xml::sax::XEntityResolver xResolver ); + + /** sets a locale specified for localization of warnings and error messages. + + <p>Set the language of the error messages. Useful when the parsing + errors will be presented to the user.</p> + */ + void setLocale( [in] com::sun::star::lang::Locale locale ); +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XSAXSerializable.idl b/offapi/com/sun/star/xml/sax/XSAXSerializable.idl new file mode 100644 index 0000000000..2e59df8715 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XSAXSerializable.idl @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +module com { module sun { module star { module xml { module sax { + +/** serializes a DOM tree by generating SAX events. + + <p> + </p> + + @since OOo 3.0 + +*/ +interface XSAXSerializable +{ + + /** serializes an object (e.g. a DOM tree) that represents an XML document + by generating SAX events. + + @param handler + the SAX event handler that should receive the generated events + @param namespaces + a list of namespace declarations that will be added to the root + element node of the XML document + <p> + This is necessary mostly because the DOM implementation does + not permit attaching namespaces declarations directly to nodes, + which may lead to duplicate namespace declarations on export, + and thus larger documents. + Note that the first part of each tuple is the prefix, + e.g. "office", and the second is the full namespace URI. + </p> + + @throws com::sun::star::xml::sax::SAXException + if serializing the XML document fails + */ + void serialize([in] com::sun::star::xml::sax::XDocumentHandler handler, + [in] sequence< com::sun::star::beans::StringPair > namespaces) + raises( com::sun::star::xml::sax::SAXException ); + +}; + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/sax/XWriter.idl b/offapi/com/sun/star/xml/sax/XWriter.idl new file mode 100644 index 0000000000..7a1094aa6e --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XWriter.idl @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +module com { module sun { module star { module xml { module sax { + + +/** + Provides a unified interface for the new-style Writer service to implement. + + @since LibreOffice 4.0 + */ +interface XWriter +{ + interface com::sun::star::io::XActiveDataSource; + interface com::sun::star::xml::sax::XExtendedDocumentHandler; + + /** Adds support for custom entity names list + * @since LibreOffice 7.2 + */ + void setCustomEntityNames( [in] sequence< com::sun::star::beans::Pair<string,string> > replacements ); +}; + + +}; }; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |