1d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir//i20156 - new file for xmlsecurity module
25cdf0e10cSrcweir
26cdf0e10cSrcweir/** -- idl definition -- **/
27cdf0e10cSrcweir
28cdf0e10cSrcweir#ifndef __com_sun_star_xml_crypto_sax_xsaxeventkeeper_idl_
29cdf0e10cSrcweir#define __com_sun_star_xml_crypto_sax_xsaxeventkeeper_idl_
30cdf0e10cSrcweir
31cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32cdf0e10cSrcweir#include <com/sun/star/uno/Exception.idl>
33cdf0e10cSrcweir#include <com/sun/star/xml/sax/XDocumentHandler.idl>
34cdf0e10cSrcweir
35cdf0e10cSrcweir#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.idl>
36cdf0e10cSrcweir#include <com/sun/star/xml/wrapper/XXMLElementWrapper.idl>
37cdf0e10cSrcweir
38cdf0e10cSrcweirmodule com { module sun { module star { module xml { module crypto { module sax {
39cdf0e10cSrcweir
40cdf0e10cSrcweir/**
41cdf0e10cSrcweir * Interface of SAX Event Keeper.
42cdf0e10cSrcweir * <p>
43cdf0e10cSrcweir * This interface is used to manipulate element marks in a SAX event stream.
44cdf0e10cSrcweir * <p>
45cdf0e10cSrcweir * There are two kinds of element mark, one is element collector, which is
46cdf0e10cSrcweir * used to collect a particular element from the SAX event stream; the other
47cdf0e10cSrcweir * is blocker, which is used to block the SAX event stream.
48cdf0e10cSrcweir */
49cdf0e10cSrcweirinterface XSAXEventKeeper : com::sun::star::uno::XInterface
50cdf0e10cSrcweir{
51cdf0e10cSrcweir	/**
52cdf0e10cSrcweir	 * Adds a new element collector on the next element in the SAX event
53cdf0e10cSrcweir	 * stream.
54cdf0e10cSrcweir	 *
55cdf0e10cSrcweir	 * @return   the keeper id of the new element collector
56cdf0e10cSrcweir	 */
57cdf0e10cSrcweir	long addElementCollector();
58cdf0e10cSrcweir
59cdf0e10cSrcweir	/**
60cdf0e10cSrcweir	 * Removes an element collector.
61cdf0e10cSrcweir	 *
62cdf0e10cSrcweir	 * @param id   the keeper id of the element collector to be removed
63cdf0e10cSrcweir	 */
64cdf0e10cSrcweir	void removeElementCollector([in] long id);
65cdf0e10cSrcweir
66cdf0e10cSrcweir	/**
67cdf0e10cSrcweir	 * Adds a new blocker on the next element in the SAX event stream.
68cdf0e10cSrcweir	 * <p>
69cdf0e10cSrcweir	 * No SAX event starting from the next element will be forwarded until
70cdf0e10cSrcweir	 * this blocker is removed.
71cdf0e10cSrcweir	 *
72cdf0e10cSrcweir	 * @return   the keeper id of the new blocker
73cdf0e10cSrcweir	 */
74cdf0e10cSrcweir	long addBlocker();
75cdf0e10cSrcweir
76cdf0e10cSrcweir	/**
77cdf0e10cSrcweir	 * Removes a blocker
78cdf0e10cSrcweir	 *
79cdf0e10cSrcweir	 * @param id   the keeper id of the blocker to be removed
80cdf0e10cSrcweir	 */
81cdf0e10cSrcweir	void removeBlocker([in] long id);
82cdf0e10cSrcweir
83cdf0e10cSrcweir	/**
84cdf0e10cSrcweir	 * Checks whether the SAX event stream is blocking.
85cdf0e10cSrcweir	 *
86cdf0e10cSrcweir	 * @return   <code>true</code> if blocking, <code>false</code> otherwise
87cdf0e10cSrcweir	 */
88cdf0e10cSrcweir	boolean isBlocking();
89cdf0e10cSrcweir
90cdf0e10cSrcweir	/**
91cdf0e10cSrcweir	 * Gets the element of an element mark.
92cdf0e10cSrcweir	 *
93cdf0e10cSrcweir	 * @param id   the keeper id of the element mark, it can be a element
94cdf0e10cSrcweir	 *             collector or a blocker
95cdf0e10cSrcweir	 */
96cdf0e10cSrcweir	com::sun::star::xml::wrapper::XXMLElementWrapper getElement([in] long id);
97cdf0e10cSrcweir
98cdf0e10cSrcweir	/**
99cdf0e10cSrcweir	 * Sets the element of an element mark.
100cdf0e10cSrcweir	 * <p>
101cdf0e10cSrcweir	 * When an element is replaced outside of this interface, then uses this method
102cdf0e10cSrcweir	 * can restore the link between an element mark and its working element.
103cdf0e10cSrcweir	 *
104cdf0e10cSrcweir	 * @param id         the keeper id of the element mark to be set
105cdf0e10cSrcweir	 * @param aElement   the new element for this element mark.
106cdf0e10cSrcweir	 */
107cdf0e10cSrcweir	void setElement(
108cdf0e10cSrcweir		[in] long id,
109cdf0e10cSrcweir		[in] com::sun::star::xml::wrapper::XXMLElementWrapper aElement);
110cdf0e10cSrcweir
111cdf0e10cSrcweir	/**
112cdf0e10cSrcweir	 * Sets the next document handler in the SAX chain.
113cdf0e10cSrcweir	 * <p>
114cdf0e10cSrcweir	 * This handler will receive SAX events forwarded by the SAXEventKeeper.
115cdf0e10cSrcweir	 *
116cdf0e10cSrcweir	 * @param nextHandler   the next handler in the SAX chain
117cdf0e10cSrcweir	 * @return              the old next handler
118cdf0e10cSrcweir	 */
119cdf0e10cSrcweir	com::sun::star::xml::sax::XDocumentHandler setNextHandler(
120cdf0e10cSrcweir		[in] com::sun::star::xml::sax::XDocumentHandler nextHandler);
121cdf0e10cSrcweir
122cdf0e10cSrcweir	/**
123cdf0e10cSrcweir	 * Prints information about all bufferred elements.
124cdf0e10cSrcweir	 *
125*a893be29SPedro Giffuni	 * @return   a tree-style string including all buffer information
126cdf0e10cSrcweir	 */
127cdf0e10cSrcweir	string printBufferNodeTree();
128cdf0e10cSrcweir
129cdf0e10cSrcweir	/**
130cdf0e10cSrcweir	 * Gets the element which current blocking happens.
131cdf0e10cSrcweir	 * <p>
132cdf0e10cSrcweir	 * This element is the working element of the first blocker in tree order.
133cdf0e10cSrcweir	 *
134cdf0e10cSrcweir	 * @return   the current blocking element
135cdf0e10cSrcweir	 */
136cdf0e10cSrcweir	com::sun::star::xml::wrapper::XXMLElementWrapper getCurrentBlockingNode();
137cdf0e10cSrcweir};
138cdf0e10cSrcweir
139cdf0e10cSrcweir} ; } ; } ; } ; } ; } ;
140cdf0e10cSrcweir
141cdf0e10cSrcweir
142cdf0e10cSrcweir#endif
143cdf0e10cSrcweir
144