1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28//i20156 - new file for xmlsecurity module
29
30/** -- idl definition -- **/
31
32#ifndef __com_sun_star_xml_crypto_sax_xsaxeventkeeper_idl_
33#define __com_sun_star_xml_crypto_sax_xsaxeventkeeper_idl_
34
35#include <com/sun/star/uno/XInterface.idl>
36#include <com/sun/star/uno/Exception.idl>
37#include <com/sun/star/xml/sax/XDocumentHandler.idl>
38
39#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.idl>
40#include <com/sun/star/xml/wrapper/XXMLElementWrapper.idl>
41
42module com { module sun { module star { module xml { module crypto { module sax {
43
44/**
45 * Interface of SAX Event Keeper.
46 * <p>
47 * This interface is used to manipulate element marks in a SAX event stream.
48 * <p>
49 * There are two kinds of element mark, one is element collector, which is
50 * used to collect a particular element from the SAX event stream; the other
51 * is blocker, which is used to block the SAX event stream.
52 */
53interface XSAXEventKeeper : com::sun::star::uno::XInterface
54{
55	/**
56	 * Adds a new element collector on the next element in the SAX event
57	 * stream.
58	 *
59	 * @return   the keeper id of the new element collector
60	 */
61	long addElementCollector();
62
63	/**
64	 * Removes an element collector.
65	 *
66	 * @param id   the keeper id of the element collector to be removed
67	 */
68	void removeElementCollector([in] long id);
69
70	/**
71	 * Adds a new blocker on the next element in the SAX event stream.
72	 * <p>
73	 * No SAX event starting from the next element will be forwarded until
74	 * this blocker is removed.
75	 *
76	 * @return   the keeper id of the new blocker
77	 */
78	long addBlocker();
79
80	/**
81	 * Removes a blocker
82	 *
83	 * @param id   the keeper id of the blocker to be removed
84	 */
85	void removeBlocker([in] long id);
86
87	/**
88	 * Checks whether the SAX event stream is blocking.
89	 *
90	 * @return   <code>true</code> if blocking, <code>false</code> otherwise
91	 */
92	boolean isBlocking();
93
94	/**
95	 * Gets the element of an element mark.
96	 *
97	 * @param id   the keeper id of the element mark, it can be a element
98	 *             collector or a blocker
99	 */
100	com::sun::star::xml::wrapper::XXMLElementWrapper getElement([in] long id);
101
102	/**
103	 * Sets the element of an element mark.
104	 * <p>
105	 * When an element is replaced outside of this interface, then uses this method
106	 * can restore the link between an element mark and its working element.
107	 *
108	 * @param id         the keeper id of the element mark to be set
109	 * @param aElement   the new element for this element mark.
110	 */
111	void setElement(
112		[in] long id,
113		[in] com::sun::star::xml::wrapper::XXMLElementWrapper aElement);
114
115	/**
116	 * Sets the next document handler in the SAX chain.
117	 * <p>
118	 * This handler will receive SAX events forwarded by the SAXEventKeeper.
119	 *
120	 * @param nextHandler   the next handler in the SAX chain
121	 * @return              the old next handler
122	 */
123	com::sun::star::xml::sax::XDocumentHandler setNextHandler(
124		[in] com::sun::star::xml::sax::XDocumentHandler nextHandler);
125
126	/**
127	 * Prints information about all bufferred elements.
128	 *
129	 * @return   a tree-style string including all buffer informtion
130	 */
131	string printBufferNodeTree();
132
133	/**
134	 * Gets the element which current blocking happens.
135	 * <p>
136	 * This element is the working element of the first blocker in tree order.
137	 *
138	 * @return   the current blocking element
139	 */
140	com::sun::star::xml::wrapper::XXMLElementWrapper getCurrentBlockingNode();
141};
142
143} ; } ; } ; } ; } ; } ;
144
145
146#endif
147
148