diff options
Diffstat (limited to 'offapi/com/sun/star/xml/input')
-rw-r--r-- | offapi/com/sun/star/xml/input/SaxDocumentHandler.idl | 50 | ||||
-rw-r--r-- | offapi/com/sun/star/xml/input/XAttributes.idl | 121 | ||||
-rw-r--r-- | offapi/com/sun/star/xml/input/XElement.idl | 114 | ||||
-rw-r--r-- | offapi/com/sun/star/xml/input/XNamespaceMapping.idl | 59 | ||||
-rw-r--r-- | offapi/com/sun/star/xml/input/XRoot.idl | 91 |
5 files changed, 435 insertions, 0 deletions
diff --git a/offapi/com/sun/star/xml/input/SaxDocumentHandler.idl b/offapi/com/sun/star/xml/input/SaxDocumentHandler.idl new file mode 100644 index 000000000..970d11f99 --- /dev/null +++ b/offapi/com/sun/star/xml/input/SaxDocumentHandler.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_input_SaxDocumentHandler_idl__ +#define __com_sun_star_xml_input_SaxDocumentHandler_idl__ + +#include <com/sun/star/xml/input/XRoot.idl> +#include <com/sun/star/xml/sax/XDocumentHandler.idl> +#include <com/sun/star/lang/XInitialization.idl> + + +module com { module sun { module star { module xml { module input { + +/** This service helps parsing files by providing a SAX document handler + interface for a SAX parsers. + You have to instantiate this service passing an XRoot instance. + + @internal +*/ +service SaxDocumentHandler +{ + /** to be passed to a SAX parser + */ + interface com::sun::star::xml::sax::XDocumentHandler; + + /** to be used to pass XRoot object + */ + interface com::sun::star::lang::XInitialization; +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/input/XAttributes.idl b/offapi/com/sun/star/xml/input/XAttributes.idl new file mode 100644 index 000000000..254699e46 --- /dev/null +++ b/offapi/com/sun/star/xml/input/XAttributes.idl @@ -0,0 +1,121 @@ +/* -*- 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_input_XAttributes_idl__ +#define __com_sun_star_xml_input_XAttributes_idl__ + +#include <com/sun/star/uno/XInterface.idl> + + +module com { module sun { module star { module xml { module input { + +/** An element's attributes + + @internal +*/ +interface XAttributes : com::sun::star::uno::XInterface +{ + /** Gets the number of attributes. + + @return + number of attributes + */ + long getLength(); + + /** Gets attribute index passing a QName. + + @param qName + QName + @return + attribute index or -1, if not found + */ + long getIndexByQName( [in] string qName ); + + /** Gets attribute index passing a namespace uid and a local name. + + @param uid + namespace uid + @param localName + local name + @return + attribute index or -1, if not found + */ + long getIndexByUidName( [in] long uid, [in] string localName ); + + /** Gets the QName of an attribute. + + @param nIndex + index + @return + QName of attribute or empty string, if invalid index + */ + string getQNameByIndex( [in] long nIndex ); + + /** Gets the namespace uid of an attribute. + + @param nIndex + index + @return + namespace uid of attribute or -1, if invalid index + */ + long getUidByIndex( [in] long nIndex ); + + /** Gets the local name of an attribute. + + @param nIndex + index + @return + local name of attribute or empty string, if invalid index + */ + string getLocalNameByIndex( [in] long nIndex ); + + /** Gets the value of an attribute. + + @param nIndex + index + @return + value string or empty string, if invalid index + */ + string getValueByIndex( [in] long nIndex ); + + /** For convenience: Gets the value of an attribute passing uid, local name. + + @param uid + namespace uid + @param localName + local name + @return + value string or empty string, if invalid uid/local name + */ + string getValueByUidName( [in] long uid, [in] string localName ); + + /** Gets the type of an attribute, if possible. + + @param nIndex + index + @return + type of attribute (if possible, else empty string) + */ + string getTypeByIndex( [in] long nIndex ); +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/input/XElement.idl b/offapi/com/sun/star/xml/input/XElement.idl new file mode 100644 index 000000000..f79daa2ac --- /dev/null +++ b/offapi/com/sun/star/xml/input/XElement.idl @@ -0,0 +1,114 @@ +/* -*- 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_input_XElement_idl__ +#define __com_sun_star_xml_input_XElement_idl__ + +#include <com/sun/star/xml/input/XAttributes.idl> +#include <com/sun/star/xml/sax/SAXException.idl> + + +module com { module sun { module star { module xml { module input { + +/** Capsule around an XML element. + + @internal +*/ +interface XElement : com::sun::star::uno::XInterface +{ + /** Gets the parent context. + + @return + parent context + */ + XElement getParent(); + + /** Gets the local name of this element. + + @return + local name of this element + */ + string getLocalName(); + + /** Gets the namespace uid of this element. + + @return + namespace uid of this element + */ + long getUid(); + + /** Gets the attributes of this element. + + @return + attributes of this element + */ + XAttributes getAttributes(); + + /** Called upon each occurring child element. + + @param uid + namespace uid of element + @param localName + local name of element + @param xAttributes + attributes of element + @return + child import context + */ + XElement startChildElement( + [in] long uid, [in] string localName, [in] XAttributes xAttributes ) + raises (com::sun::star::xml::sax::SAXException); + + /** Called upon retrieval of characters. + + @param chars + characters + */ + void characters( [in] string chars ) + raises (com::sun::star::xml::sax::SAXException); + + /** Receives notification of white space that can be ignored. + + @param whitespace + white space characters + */ + void ignorableWhitespace( [in] string whitespace ) + raises (com::sun::star::xml::sax::SAXException); + + /** Receives notification of a processing instruction. + + @param target + target + @param data + data + */ + void processingInstruction( + [in] string target, [in] string data ) + raises (com::sun::star::xml::sax::SAXException); + + /** Receives notification of element closing. + */ + void endElement() + raises (com::sun::star::xml::sax::SAXException); +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/input/XNamespaceMapping.idl b/offapi/com/sun/star/xml/input/XNamespaceMapping.idl new file mode 100644 index 000000000..08b8fb824 --- /dev/null +++ b/offapi/com/sun/star/xml/input/XNamespaceMapping.idl @@ -0,0 +1,59 @@ +/* -*- 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_input_XNamespaceMapping_idl__ +#define __com_sun_star_xml_input_XNamespaceMapping_idl__ + +#include <com/sun/star/container/NoSuchElementException.idl> + + +module com { module sun { module star { module xml { module input { + +/** Interface to map XML namespace URI strings to ordinals (URI-id, short uid). + + @internal +*/ +interface XNamespaceMapping : com::sun::star::uno::XInterface +{ + /** Creates a unique ordinal passing an XML namespace URI. + + @param uri + XML namespace URI + @return + uid + */ + long getUidByUri( [in] string uri ); + + /** Gets the corresponding XML namespace URI passing a uid (created using + getUidByUri()). + + @param uid + uid + @return + XML namespace URI + */ + string getUriByUid( [in] long uid ) + raises (com::sun::star::container::NoSuchElementException); +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/input/XRoot.idl b/offapi/com/sun/star/xml/input/XRoot.idl new file mode 100644 index 000000000..8efb1a140 --- /dev/null +++ b/offapi/com/sun/star/xml/input/XRoot.idl @@ -0,0 +1,91 @@ +/* -*- 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_input_XRoot_idl__ +#define __com_sun_star_xml_input_XRoot_idl__ + +#include <com/sun/star/xml/input/XNamespaceMapping.idl> +#include <com/sun/star/xml/input/XElement.idl> +#include <com/sun/star/xml/input/XAttributes.idl> +#include <com/sun/star/xml/sax/SAXException.idl> +#include <com/sun/star/xml/sax/XLocator.idl> + + +module com { module sun { module star { module xml { module input { + +/** Root interface being passed to SaxDocumentHandler service upon + instantiation. + + @internal +*/ +interface XRoot : com::sun::star::uno::XInterface +{ + /** Receives notification of the beginning of a document. + + @param xMapping + mapping to obtain ids out of XML namespace URIs + and vice versa + */ + void startDocument( + [in] XNamespaceMapping xMapping ) + 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 a processing instruction. + + @param target + target + @param data + data + */ + void processingInstruction( + [in] string target, [in] string data ) + raises (com::sun::star::xml::sax::SAXException); + + /** Receives an object for locating the origin of SAX document events. + + @param locator + locator + */ + void setDocumentLocator( + [in] com::sun::star::xml::sax::XLocator locator ) + raises (com::sun::star::xml::sax::SAXException); + + /** Called upon root element. + + @param uid + namespace uid of element + @param localName + local name of element + @param xAttributes + attributes of element + */ + XElement startRootElement( + [in] long uid, [in] string localName, [in] XAttributes xAttributes ) + raises (com::sun::star::xml::sax::SAXException); +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |