From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- offapi/com/sun/star/xml/sax/FastParser.idl | 23 +++ offapi/com/sun/star/xml/sax/FastToken.idl | 46 ++++++ offapi/com/sun/star/xml/sax/FastTokenHandler.idl | 33 ++++ offapi/com/sun/star/xml/sax/InputSource.idl | 74 +++++++++ offapi/com/sun/star/xml/sax/Parser.idl | 37 +++++ offapi/com/sun/star/xml/sax/SAXException.idl | 55 +++++++ .../star/xml/sax/SAXInvalidCharacterException.idl | 43 +++++ offapi/com/sun/star/xml/sax/SAXParseException.idl | 63 ++++++++ offapi/com/sun/star/xml/sax/Writer.idl | 39 +++++ offapi/com/sun/star/xml/sax/XAttributeList.idl | 87 ++++++++++ offapi/com/sun/star/xml/sax/XDTDHandler.idl | 66 ++++++++ offapi/com/sun/star/xml/sax/XDocumentHandler.idl | 100 ++++++++++++ offapi/com/sun/star/xml/sax/XEntityResolver.idl | 57 +++++++ offapi/com/sun/star/xml/sax/XErrorHandler.idl | 68 ++++++++ .../sun/star/xml/sax/XExtendedDocumentHandler.idl | 78 +++++++++ offapi/com/sun/star/xml/sax/XFastAttributeList.idl | 160 +++++++++++++++++++ .../com/sun/star/xml/sax/XFastContextHandler.idl | 137 ++++++++++++++++ .../com/sun/star/xml/sax/XFastDocumentHandler.idl | 72 +++++++++ .../com/sun/star/xml/sax/XFastNamespaceHandler.idl | 51 ++++++ offapi/com/sun/star/xml/sax/XFastParser.idl | 176 +++++++++++++++++++++ .../com/sun/star/xml/sax/XFastSAXSerializable.idl | 80 ++++++++++ offapi/com/sun/star/xml/sax/XFastTokenHandler.idl | 64 ++++++++ offapi/com/sun/star/xml/sax/XLocator.idl | 62 ++++++++ offapi/com/sun/star/xml/sax/XParser.idl | 93 +++++++++++ offapi/com/sun/star/xml/sax/XSAXSerializable.idl | 69 ++++++++ offapi/com/sun/star/xml/sax/XWriter.idl | 50 ++++++ 26 files changed, 1883 insertions(+) create mode 100644 offapi/com/sun/star/xml/sax/FastParser.idl create mode 100644 offapi/com/sun/star/xml/sax/FastToken.idl create mode 100644 offapi/com/sun/star/xml/sax/FastTokenHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/InputSource.idl create mode 100644 offapi/com/sun/star/xml/sax/Parser.idl create mode 100644 offapi/com/sun/star/xml/sax/SAXException.idl create mode 100644 offapi/com/sun/star/xml/sax/SAXInvalidCharacterException.idl create mode 100644 offapi/com/sun/star/xml/sax/SAXParseException.idl create mode 100644 offapi/com/sun/star/xml/sax/Writer.idl create mode 100644 offapi/com/sun/star/xml/sax/XAttributeList.idl create mode 100644 offapi/com/sun/star/xml/sax/XDTDHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/XDocumentHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/XEntityResolver.idl create mode 100644 offapi/com/sun/star/xml/sax/XErrorHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/XExtendedDocumentHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/XFastAttributeList.idl create mode 100644 offapi/com/sun/star/xml/sax/XFastContextHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/XFastDocumentHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/XFastNamespaceHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/XFastParser.idl create mode 100644 offapi/com/sun/star/xml/sax/XFastSAXSerializable.idl create mode 100644 offapi/com/sun/star/xml/sax/XFastTokenHandler.idl create mode 100644 offapi/com/sun/star/xml/sax/XLocator.idl create mode 100644 offapi/com/sun/star/xml/sax/XParser.idl create mode 100644 offapi/com/sun/star/xml/sax/XSAXSerializable.idl create mode 100644 offapi/com/sun/star/xml/sax/XWriter.idl (limited to 'offapi/com/sun/star/xml/sax') 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 000000000..4f2382217 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/FastParser.idl @@ -0,0 +1,23 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_COM_SUN_STAR_XML_SAX_FASTPARSER_IDL +#define INCLUDED_COM_SUN_STAR_XML_SAX_FASTPARSER_IDL + +#include + +module com { module sun { module star { module xml { module sax { + +service FastParser: XFastParser; + +}; }; }; }; }; + +#endif + +/* 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 000000000..772c8bfbc --- /dev/null +++ b/offapi/com/sun/star/xml/sax/FastToken.idl @@ -0,0 +1,46 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_FastToken_idl__ +#define __com_sun_star_xml_sax_FastToken_idl__ + +#include + + +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; +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..eccca85de --- /dev/null +++ b/offapi/com/sun/star/xml/sax/FastTokenHandler.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 . + */ +#ifndef __com_sun_star_xml_sax_FastTokenHandler_idl__ +#define __com_sun_star_xml_sax_FastTokenHandler_idl__ + +#include + + +module com { module sun { module star { module xml { module sax { + +service FastTokenHandler : XFastTokenHandler; + +}; }; }; }; }; + +#endif + +/* 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 000000000..992a7d871 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/InputSource.idl @@ -0,0 +1,74 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_InputSource_idl__ +#define __com_sun_star_xml_sax_InputSource_idl__ + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** specifies the Datasource plus some additional information for the parser. + +

There are two places where the application will deliver this input + source to the parser: +

+
    +
  • as the argument of XParser::parseStream()
  • +
  • as the return value of XEntityResolver::resolveEntity(). +
  • +
+ */ +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. + +

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. ?xml encoding="EUC-JP"? ).

+ */ + 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; +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..8ddee4e50 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/Parser.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 . + */ +#ifndef __com_sun_star_xml_sax_Parser_idl__ +#define __com_sun_star_xml_sax_Parser_idl__ + +#include + +module com { module sun { module star { module xml { module sax { + + +/** + Service that provides a SAX parser. + */ +published service Parser : XParser; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..6bd174072 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/SAXException.idl @@ -0,0 +1,55 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_SAXException_idl__ +#define __com_sun_star_xml_sax_SAXException_idl__ + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** encapsulates the details of an XML parse error or warning. + +

This structure is a replacement for the Java class + org.xml.sax.SAXException.

+ +

Some abbreviations:

+
    +
  • SAX = Simple API for XML
  • +
  • URI = Uniform Resource Identifier
  • +
  • DTD = document type definition
  • +
+ */ +published exception SAXException: com::sun::star::uno::Exception +{ + + /** This field may contain a wrapped exception. + */ + any WrappedException; + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..1d17bc0c6 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/SAXInvalidCharacterException.idl @@ -0,0 +1,43 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_SAXInvalidCharacterException_idl__ +#define __com_sun_star_xml_sax_SAXInvalidCharacterException_idl__ + +#include + + + +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 +{ + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..b5640ff75 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/SAXParseException.idl @@ -0,0 +1,63 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_SAXParseException_idl__ +#define __com_sun_star_xml_sax_SAXParseException_idl__ + +#include + + + +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; + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..91a24207c --- /dev/null +++ b/offapi/com/sun/star/xml/sax/Writer.idl @@ -0,0 +1,39 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_Writer_idl__ +#define __com_sun_star_xml_sax_Writer_idl__ + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** + @since LibreOffice 4.0 + */ +service Writer : XWriter; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..51924375e --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XAttributeList.idl @@ -0,0 +1,87 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XAttributeList_idl__ +#define __com_sun_star_xml_sax_XAttributeList_idl__ + +#include + + +module com { module sun { module star { module xml { module sax { + + +/** specifies an element's attributes. + +

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. + +

+

This interface is a poor IDL version of the Java interface + org.xml.sax.AttributeList. 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.

+ */ +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 ); +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..7bc06ba8d --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XDTDHandler.idl @@ -0,0 +1,66 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XDTDHandler_idl__ +#define __com_sun_star_xml_sax_XDTDHandler_idl__ + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** receives events according to the DTD of the document. + +

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 + startDocument event, and before the first startElement + 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. +

+ */ +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 ); + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..9c5f7dc6b --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XDocumentHandler.idl @@ -0,0 +1,100 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XDocumentHandler_idl__ +#define __com_sun_star_xml_sax_XDocumentHandler_idl__ + +#include + +#include + +#include + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** receives notification of general document events. + +

This interface is an IDL version of the Java interface + org.xml.sax.DocumentHandler with some smaller + adaptations.

+ */ +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 ); + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..ad479dc7c --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XEntityResolver.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 . + */ +#ifndef __com_sun_star_xml_sax_XEntityResolver_idl__ +#define __com_sun_star_xml_sax_XEntityResolver_idl__ + +#include + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** makes it possible to modify the behavior of resolving external + preferences. + +

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.

+ */ +published interface XEntityResolver: com::sun::star::uno::XInterface +{ + + /** @returns + InputSource for the external entity. + +

If aInputStream 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 ); + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..568e14c78 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XErrorHandler.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 . + */ +#ifndef __com_sun_star_xml_sax_XErrorHandler_idl__ +#define __com_sun_star_xml_sax_XErrorHandler_idl__ + +#include + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** is the basic interface for SAX error handlers. + +

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.

+ +

This interface is a slight adaptation of the Java interface + org.xml.sax.ErrorHandler. In IDL, no exception can be passed + as an argument, so an any serves as the container. The type of the + exception is SAXParseException or an instance of a derived class.

+ */ +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 ); + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..23dc57cfb --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XExtendedDocumentHandler.idl @@ -0,0 +1,78 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XExtendedDocumentHandler_idl__ +#define __com_sun_star_xml_sax_XExtendedDocumentHandler_idl__ + +#include + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** this interface does not conform to the SAX-standard. + +

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. + +

Any string coming in via character handler may include chars, + that would otherwise be interpreted as markup.

+ */ + void startCDATA() + raises( com::sun::star::xml::sax::SAXException ); + + /** informs about the end of a CDATA-Section. + +

Note that startCDATA/endCDATA MUST NOT enclose any + startElement/endElement-call!

+ */ + 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 ); +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..840fc920b --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastAttributeList.idl @@ -0,0 +1,160 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XFastAttributeList_idl__ +#define __com_sun_star_xml_sax_XFastAttributeList_idl__ + +#include +#include +#include +#include + + +module com { module sun { module star { module xml { module sax { + + +/** a container for the attributes of an XML element. + +
Attributes are separated into known attributes and unknown attributes. +

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.
+ + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.
+ + 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 + or operation. + + @returns + `TRUE`, if the attribute is available + */ + boolean hasAttribute( [in] long Token ); + + /** retrieves the token of an attribute value.
+ + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.
+ + 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 + or 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.
+ + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.
+ + 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 + or 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 Default is returned. + + */ + long getOptionalValueToken( [in] long Token, [in] long Default ); + + /** retrieves the value of an attribute.
+ + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.
+ + 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 + or 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.
+ + @param Token + contains the integer token from the XFastTokenHandler + registered at the XFastParser.
+ + 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 + or 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(); +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..da53a0ce7 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastContextHandler.idl @@ -0,0 +1,137 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XFastContextHandler_idl__ +#define __com_sun_star_xml_sax_XFastContextHandler_idl__ + +#include + +#include + +#include + +#include + + + +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.
+ + If the element has a namespace that was registered with the + XFastParser, Element contains the integer + token of the elements local name from the XFastTokenHandler + and the integer token of the namespace combined with an arithmetic + or 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. + +
If the element has a namespace that was registered with the + XFastParser, Element contains the + integer token of the elements local name from the + XFastTokenHandler and the integer token of the + namespace combined with an arithmetic or 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 ); + }; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..27c68e221 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastDocumentHandler.idl @@ -0,0 +1,72 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XFastDocumentHandler_idl__ +#define __com_sun_star_xml_sax_XFastDocumentHandler_idl__ + +#include + +#include + +#include +#include +#include + + + +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 ); + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..c427325f0 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastNamespaceHandler.idl @@ -0,0 +1,51 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XFastNamespaceHandler_idl__ +#define __com_sun_star_xml_sax_XFastNamespaceHandler_idl__ + +#include + +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 ); + +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..9d4439144 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastParser.idl @@ -0,0 +1,176 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XFastParser_idl__ +#define __com_sun_star_xml_sax_XFastParser_idl__ + +#include + +#include + +#include + +#include + +#include +#include +#include + +#include + +#include + +#include + +#include + +#include + +#include + + +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. + +

Before parsing is possible you have to set your + XFastDocumentHandler using setFastDocumentHandler(). + +

Parsing starts with calling parseStream(). If the parser + finds a valid XML file with the given InputSource, it calls + XFastDocumentHandler::startDocument() first. + +

This parser generates either "fast" events that use integer token + values for namespaces, elements and attributes or "unknown" events for + elements that are unknown. + +

A namespace is unknown if the namespace URL was not registered with + registerNamespace(). + +

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. + +

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. + +

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. +
The parent context for the root element is the XFastDocumentHandler + itself. + +

If the parent context returns an empty reference, no further events for + the element and all of its children are created. + +

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. + +

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. + +

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. + +

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. + +

Set the desired handlers before calling this method.

+ */ + 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.
+ @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. + +

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.

+ */ + 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. + +

Set the language of the error messages. Useful when the parsing + errors will be presented to the user.

+ */ + 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 > replacements); +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..16f2bfeeb --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastSAXSerializable.idl @@ -0,0 +1,80 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_xml_sax_XFastSAXSerializable_idl__ +#define __com_sun_star_xml_sax_XFastSAXSerializable_idl__ + +#include +#include +#include +#include + +module com { module sun { module star { module xml { module sax { + +/** serializes a DOM tree by generating FastSAX events. + +

+

+ + @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 +

+ 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. +

+ @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. +

+ + @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 > registerNamespaces) + raises( com::sun::star::xml::sax::SAXException ); +}; + +}; }; }; }; }; + +#endif + +/* 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 000000000..d6bb02889 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XFastTokenHandler.idl @@ -0,0 +1,64 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XFastTokenHandler_idl__ +#define __com_sun_star_xml_sax_XFastTokenHandler_idl__ + +#include + + +module com { module sun { module star { module xml { module sax { + + +/** interface to translate XML strings to integer tokens. + +

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 ); +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..65d601da4 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XLocator.idl @@ -0,0 +1,62 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XLocator_idl__ +#define __com_sun_star_xml_sax_XLocator_idl__ + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** makes it possible to associate a SAX event with a document location. + +

This interface is an IDL version of the Java interface + org.xml.sax.Locator.

+ */ +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(); +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..8b770dab0 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XParser.idl @@ -0,0 +1,93 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XParser_idl__ +#define __com_sun_star_xml_sax_XParser_idl__ + +#include + +#include + +#include + +#include + +#include + +#include + +#include + +#include + +#include + + + +module com { module sun { module star { module xml { module sax { + + +/** specifies a SAX parser. + +

This interface is an IDL version of the Java interface + org.xml.sax.Parser with some minor adaptations.

+ */ +published interface XParser: com::sun::star::uno::XInterface +{ + /** parses an XML document from a stream. + +

Set the desired handlers before calling this method.

+ */ + 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. + +

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.

+ */ + 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. + +

Set the language of the error messages. Useful when the parsing + errors will be presented to the user.

+ */ + void setLocale( [in] com::sun::star::lang::Locale locale ); +}; + + +}; }; }; }; }; + +#endif + +/* 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 000000000..ebba020b1 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XSAXSerializable.idl @@ -0,0 +1,69 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_xml_sax_XSAXSerializable_idl__ +#define __com_sun_star_xml_sax_XSAXSerializable_idl__ + +#include +#include + +module com { module sun { module star { module xml { module sax { + +/** serializes a DOM tree by generating SAX events. + +

+

+ + @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 +

+ 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. +

+ + @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 ); + +}; + +}; }; }; }; }; + +#endif + +/* 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 000000000..62d3d7425 --- /dev/null +++ b/offapi/com/sun/star/xml/sax/XWriter.idl @@ -0,0 +1,50 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_xml_sax_XWriter_idl__ +#define __com_sun_star_xml_sax_XWriter_idl__ + +#include +#include +#include + +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 > replacements ); +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3