1*cdf0e10cSrcweir/************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir//i20156 - new file for xmlsecurity module 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir/** -- idl definition -- **/ 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir#ifndef __com_sun_star_xml_wrapper_xxmldocumentwrapper_idl_ 33*cdf0e10cSrcweir#define __com_sun_star_xml_wrapper_xxmldocumentwrapper_idl_ 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 36*cdf0e10cSrcweir#include <com/sun/star/uno/Exception.idl> 37*cdf0e10cSrcweir#include <com/sun/star/xml/sax/XDocumentHandler.idl> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweirmodule com { module sun { module star { module xml { module wrapper { 40*cdf0e10cSrcweir 41*cdf0e10cSrcweirinterface XXMLElementWrapper; 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir/** 44*cdf0e10cSrcweir * Interface of XML Document Wrapper. 45*cdf0e10cSrcweir * <p> 46*cdf0e10cSrcweir * When converting SAX events into a DOM tree, this interface is 47*cdf0e10cSrcweir * used to manipulate the DOM data in UNO perspective. 48*cdf0e10cSrcweir * <p> 49*cdf0e10cSrcweir * Every lauguage has its own methods to manipulate its native DOM 50*cdf0e10cSrcweir * data structure, this interface provides a common method set which 51*cdf0e10cSrcweir * each lauguage have to implement. 52*cdf0e10cSrcweir * <p> 53*cdf0e10cSrcweir * In another word, this interface wraps language dependant methods, 54*cdf0e10cSrcweir * then other component can manipulate DOM data through UNO methods. 55*cdf0e10cSrcweir */ 56*cdf0e10cSrcweirinterface XXMLDocumentWrapper : com::sun::star::uno::XInterface 57*cdf0e10cSrcweir{ 58*cdf0e10cSrcweir /** 59*cdf0e10cSrcweir * Gets the current element. 60*cdf0e10cSrcweir * 61*cdf0e10cSrcweir * @return the current element in the SAX event stream 62*cdf0e10cSrcweir */ 63*cdf0e10cSrcweir XXMLElementWrapper getCurrentElement(); 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir /** 66*cdf0e10cSrcweir * Sets the current element. 67*cdf0e10cSrcweir * <p> 68*cdf0e10cSrcweir * When the current element is replaced outside of this interface, then 69*cdf0e10cSrcweir * uses this method can update the current element pointer. 70*cdf0e10cSrcweir * 71*cdf0e10cSrcweir * @param element the new current element 72*cdf0e10cSrcweir */ 73*cdf0e10cSrcweir void setCurrentElement([in] XXMLElementWrapper element); 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir /** 76*cdf0e10cSrcweir * Removes the current element. 77*cdf0e10cSrcweir * <p> 78*cdf0e10cSrcweir * When the current element is removed, then its parent element becomes 79*cdf0e10cSrcweir * the new current element. 80*cdf0e10cSrcweir */ 81*cdf0e10cSrcweir void removeCurrentElement(); 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir /** 84*cdf0e10cSrcweir * Checks whether an element is the current element. 85*cdf0e10cSrcweir * 86*cdf0e10cSrcweir * @param node the element to be checked 87*cdf0e10cSrcweir * @return <code>true</code> if the node is the current element, 88*cdf0e10cSrcweir * <code>false</code> otherwise 89*cdf0e10cSrcweir */ 90*cdf0e10cSrcweir boolean isCurrent([in] XXMLElementWrapper node); 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir /** 93*cdf0e10cSrcweir * Checks whether the current element is empty. 94*cdf0e10cSrcweir * 95*cdf0e10cSrcweir * @return <code>true</code> if the current element is empty, 96*cdf0e10cSrcweir * <code>false</code> otherwise 97*cdf0e10cSrcweir */ 98*cdf0e10cSrcweir boolean isCurrentElementEmpty(); 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir /** 101*cdf0e10cSrcweir * Gets the name of the element. 102*cdf0e10cSrcweir * 103*cdf0e10cSrcweir * @param node the element whose name will be gotten 104*cdf0e10cSrcweir * @return the name of the element 105*cdf0e10cSrcweir */ 106*cdf0e10cSrcweir string getNodeName([in] XXMLElementWrapper node); 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir /** 109*cdf0e10cSrcweir * Clears all useless element in a branch of the DOM tree along the 110*cdf0e10cSrcweir * tree order. 111*cdf0e10cSrcweir * 112*cdf0e10cSrcweir * @param node the start point of the branch to clear 113*cdf0e10cSrcweir * @param reservedDescendants an array including all elements that 114*cdf0e10cSrcweir * need to be reserved (along their 115*cdf0e10cSrcweir * ancestor path) 116*cdf0e10cSrcweir * @param stopAtNode the stop element. The operation have 117*cdf0e10cSrcweir * to interrupt when this element is met 118*cdf0e10cSrcweir * during clearing 119*cdf0e10cSrcweir */ 120*cdf0e10cSrcweir void clearUselessData( 121*cdf0e10cSrcweir [in] XXMLElementWrapper node, 122*cdf0e10cSrcweir [in] sequence< XXMLElementWrapper > reservedDescendants, 123*cdf0e10cSrcweir [in] XXMLElementWrapper stopAtNode); 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir /** 126*cdf0e10cSrcweir * Collapses a tree path 127*cdf0e10cSrcweir * <p> 128*cdf0e10cSrcweir * Each element in the ancestor path of the node will be checked, 129*cdf0e10cSrcweir * if this element is empty, then deletes it. 130*cdf0e10cSrcweir * 131*cdf0e10cSrcweir * @param node the start point of the path from where the tree 132*cdf0e10cSrcweir * path will be collapsed 133*cdf0e10cSrcweir */ 134*cdf0e10cSrcweir void collapse([in] XXMLElementWrapper node); 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir /** 137*cdf0e10cSrcweir * Converts a part of the DOM tree into SAX events. 138*cdf0e10cSrcweir * 139*cdf0e10cSrcweir * @param handler the document handler which will receive 140*cdf0e10cSrcweir * generated SAX events 141*cdf0e10cSrcweir * @param saxEventKeeperHandler the SAXEventKeeper connecting with 142*cdf0e10cSrcweir * this XMLDocumentHandler 143*cdf0e10cSrcweir * @param startNode the start point to generate SAX events 144*cdf0e10cSrcweir * @param endNode the end point where to stop generating 145*cdf0e10cSrcweir */ 146*cdf0e10cSrcweir void generateSAXEvents( 147*cdf0e10cSrcweir [in] com::sun::star::xml::sax::XDocumentHandler handler, 148*cdf0e10cSrcweir [in] com::sun::star::xml::sax::XDocumentHandler saxEventKeeperHandler, 149*cdf0e10cSrcweir [in] XXMLElementWrapper startNode, 150*cdf0e10cSrcweir [in] XXMLElementWrapper endNode) 151*cdf0e10cSrcweir raises( com::sun::star::xml::sax::SAXException ); 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir /** 154*cdf0e10cSrcweir * Converts the whole DOM tree into a SAX event stream. 155*cdf0e10cSrcweir * 156*cdf0e10cSrcweir * @param handler the document handelr which will receive the SAX event 157*cdf0e10cSrcweir * stream 158*cdf0e10cSrcweir */ 159*cdf0e10cSrcweir void getTree([in] com::sun::star::xml::sax::XDocumentHandler handler) 160*cdf0e10cSrcweir raises( com::sun::star::xml::sax::SAXException ); 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir /** 163*cdf0e10cSrcweir * Rebuild the ID attribute in the branch starting from the particular 164*cdf0e10cSrcweir * element. 165*cdf0e10cSrcweir * 166*cdf0e10cSrcweir * @param node the root element of the branch whose ID link will be 167*cdf0e10cSrcweir * built 168*cdf0e10cSrcweir */ 169*cdf0e10cSrcweir void rebuildIDLink([in] XXMLElementWrapper node); 170*cdf0e10cSrcweir}; 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir} ; } ; } ; } ; } ; 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir#endif 176*cdf0e10cSrcweir 177