1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XXMLDocumentWrapper.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 //i20156 - new file for xmlsecurity module
33 /** -- idl definition -- **/
35 #ifndef __com_sun_star_xml_wrapper_xxmldocumentwrapper_idl_
36 #define __com_sun_star_xml_wrapper_xxmldocumentwrapper_idl_
38 #include
<com
/sun
/star
/uno
/XInterface.idl
>
39 #include
<com
/sun
/star
/uno
/Exception.idl
>
40 #include
<com
/sun
/star
/xml
/sax
/XDocumentHandler.idl
>
42 module com
{ module sun
{ module star
{ module xml
{ module wrapper
{
44 interface XXMLElementWrapper
;
47 * Interface of XML Document Wrapper.
49 * When converting SAX events into a DOM tree, this interface is
50 * used to manipulate the DOM data in UNO perspective.
52 * Every lauguage has its own methods to manipulate its native DOM
53 * data structure, this interface provides a common method set which
54 * each lauguage have to implement.
56 * In another word, this interface wraps language dependant methods,
57 * then other component can manipulate DOM data through UNO methods.
59 interface XXMLDocumentWrapper
: com
::sun
::star
::uno
::XInterface
62 * Gets the current element.
64 * @return the current element in the SAX event stream
66 XXMLElementWrapper getCurrentElement
();
69 * Sets the current element.
71 * When the current element is replaced outside of this interface, then
72 * uses this method can update the current element pointer.
74 * @param element the new current element
76 void setCurrentElement
([in] XXMLElementWrapper element
);
79 * Removes the current element.
81 * When the current element is removed, then its parent element becomes
82 * the new current element.
84 void removeCurrentElement
();
87 * Checks whether an element is the current element.
89 * @param node the element to be checked
90 * @return <code>true</code> if the node is the current element,
91 * <code>false</code> otherwise
93 boolean isCurrent
([in] XXMLElementWrapper node
);
96 * Checks whether the current element is empty.
98 * @return <code>true</code> if the current element is empty,
99 * <code>false</code> otherwise
101 boolean isCurrentElementEmpty
();
104 * Gets the name of the element.
106 * @param node the element whose name will be gotten
107 * @return the name of the element
109 string getNodeName
([in] XXMLElementWrapper node
);
112 * Clears all useless element in a branch of the DOM tree along the
115 * @param node the start point of the branch to clear
116 * @param reservedDescendants an array including all elements that
117 * need to be reserved (along their
119 * @param stopAtNode the stop element. The operation have
120 * to interrupt when this element is met
123 void clearUselessData
(
124 [in] XXMLElementWrapper node
,
125 [in] sequence
< XXMLElementWrapper
> reservedDescendants
,
126 [in] XXMLElementWrapper stopAtNode
);
129 * Collapses a tree path
131 * Each element in the ancestor path of the node will be checked,
132 * if this element is empty, then deletes it.
134 * @param node the start point of the path from where the tree
135 * path will be collapsed
137 void collapse
([in] XXMLElementWrapper node
);
140 * Converts a part of the DOM tree into SAX events.
142 * @param handler the document handler which will receive
143 * generated SAX events
144 * @param saxEventKeeperHandler the SAXEventKeeper connecting with
145 * this XMLDocumentHandler
146 * @param startNode the start point to generate SAX events
147 * @param endNode the end point where to stop generating
149 void generateSAXEvents
(
150 [in] com
::sun
::star
::xml
::sax
::XDocumentHandler handler
,
151 [in] com
::sun
::star
::xml
::sax
::XDocumentHandler saxEventKeeperHandler
,
152 [in] XXMLElementWrapper startNode
,
153 [in] XXMLElementWrapper endNode
)
154 raises
( com
::sun
::star
::xml
::sax
::SAXException
);
157 * Converts the whole DOM tree into a SAX event stream.
159 * @param handler the document handelr which will receive the SAX event
162 void getTree
([in] com
::sun
::star
::xml
::sax
::XDocumentHandler handler
)
163 raises
( com
::sun
::star
::xml
::sax
::SAXException
);
166 * Rebuild the ID attribute in the branch starting from the particular
169 * @param node the root element of the branch whose ID link will be
172 void rebuildIDLink
([in] XXMLElementWrapper node
);