1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <cppuhelper/implbase.hxx>
23 #include <com/sun/star/xml/sax/XAttributeList.hpp>
25 #include <xmlscript/xmlscriptdllapi.h>
27 namespace com::sun::star::xml::sax
{ class XDocumentHandler
; }
28 namespace com::sun::star::io
{ class XInputStream
; }
29 namespace com::sun::star::io
{ class XOutputStream
; }
34 /*##################################################################################################
38 ##################################################################################################*/
42 : public cppu::WeakImplHelper
< css::xml::sax::XAttributeList
>
45 XMLElement( OUString
const & name
)
49 /** Adds a sub element of element.
51 @param xElem element reference
54 css::uno::Reference
< css::xml::sax::XAttributeList
> const & xElem
);
56 /** Gets sub element of given index. The index follows order in which sub elements were added.
58 @param nIndex index of sub element
60 css::uno::Reference
< css::xml::sax::XAttributeList
> const & getSubElement( sal_Int32 nIndex
);
62 /** Adds an attribute to elements.
64 @param rAttrName qname of attribute
65 @param rValue value string of element
67 void addAttribute( OUString
const & rAttrName
, OUString
const & rValue
);
69 /** Dumps out element (and all sub elements).
71 @param xOut document handler to be written to
74 css::uno::Reference
< css::xml::sax::XDocumentHandler
> const & xOut
);
75 /** Dumps out sub elements (and all further sub elements).
77 @param xOut document handler to be written to
80 css::uno::Reference
< css::xml::sax::XDocumentHandler
> const & xOut
);
83 virtual sal_Int16 SAL_CALL
getLength() override
;
84 virtual OUString SAL_CALL
getNameByIndex( sal_Int16 nPos
) override
;
85 virtual OUString SAL_CALL
getTypeByIndex( sal_Int16 nPos
) override
;
86 virtual OUString SAL_CALL
getTypeByName( OUString
const & rName
) override
;
87 virtual OUString SAL_CALL
getValueByIndex( sal_Int16 nPos
) override
;
88 virtual OUString SAL_CALL
getValueByName( OUString
const & rName
) override
;
91 ::std::vector
< css::uno::Reference
<
92 css::xml::sax::XAttributeList
> > _subElems
;
95 ::std::vector
< OUString
> _attrNames
;
96 ::std::vector
< OUString
> _attrValues
;
101 /*##################################################################################################
105 ##################################################################################################*/
107 XMLSCRIPT_DLLPUBLIC
css::uno::Reference
< css::io::XInputStream
>
109 std::vector
<sal_Int8
>&& rInData
);
111 XMLSCRIPT_DLLPUBLIC
css::uno::Reference
< css::io::XInputStream
>
113 const sal_Int8
* pData
, int len
);
115 XMLSCRIPT_DLLPUBLIC
css::uno::Reference
< css::io::XOutputStream
>
117 std::vector
<sal_Int8
> * pOutData
);
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */