summaryrefslogtreecommitdiff
path: root/offapi/com/sun/star/xml/crypto/sax/XSAXEventKeeper.idl
blob: 20f8a0289f5c8ec32c57e3ebe0087f222ce877b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

//i20156 - new file for xmlsecurity module

/** -- idl definition -- **/

#ifndef __com_sun_star_xml_crypto_sax_xsaxeventkeeper_idl_
#define __com_sun_star_xml_crypto_sax_xsaxeventkeeper_idl_

#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/uno/Exception.idl>
#include <com/sun/star/xml/sax/XDocumentHandler.idl>

#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.idl>
#include <com/sun/star/xml/wrapper/XXMLElementWrapper.idl>

module com { module sun { module star { module xml { module crypto { module sax {

/**
 * Interface of SAX Event Keeper.
 * <p>
 * This interface is used to manipulate element marks in a SAX event stream.
 * <p>
 * There are two kinds of element mark, one is element collector, which is
 * used to collect a particular element from the SAX event stream; the other
 * is blocker, which is used to block the SAX event stream.
 */
interface XSAXEventKeeper : com::sun::star::uno::XInterface
{
    /**
     * Adds a new element collector on the next element in the SAX event
     * stream.
     *
     * @return   the keeper id of the new element collector
     */
    long addElementCollector();

    /**
     * Removes an element collector.
     *
     * @param id   the keeper id of the element collector to be removed
     */
    void removeElementCollector([in] long id);

    /**
     * Adds a new blocker on the next element in the SAX event stream.
     * <p>
     * No SAX event starting from the next element will be forwarded until
     * this blocker is removed.
     *
     * @return   the keeper id of the new blocker
     */
    long addBlocker();

    /**
     * Removes a blocker
     *
     * @param id   the keeper id of the blocker to be removed
     */
    void removeBlocker([in] long id);

    /**
     * Checks whether the SAX event stream is blocking.
     *
     * @return   <code>true</code> if blocking, <code>false</code> otherwise
     */
    boolean isBlocking();

    /**
     * Gets the element of an element mark.
     *
     * @param id   the keeper id of the element mark, it can be a element
     *             collector or a blocker
     */
    com::sun::star::xml::wrapper::XXMLElementWrapper getElement([in] long id);

    /**
     * Sets the element of an element mark.
     * <p>
     * When an element is replaced outside of this interface, then uses this method
     * can restore the link between an element mark and its working element.
     *
     * @param id         the keeper id of the element mark to be set
     * @param aElement   the new element for this element mark.
     */
    void setElement(
        [in] long id,
        [in] com::sun::star::xml::wrapper::XXMLElementWrapper aElement);

    /**
     * Sets the next document handler in the SAX chain.
     * <p>
     * This handler will receive SAX events forwarded by the SAXEventKeeper.
     *
     * @param nextHandler   the next handler in the SAX chain
     * @return              the old next handler
     */
    com::sun::star::xml::sax::XDocumentHandler setNextHandler(
        [in] com::sun::star::xml::sax::XDocumentHandler nextHandler);

    /**
     * Prints information about all bufferred elements.
     *
     * @return   a tree-style string including all buffer informtion
     */
    string printBufferNodeTree();

    /**
     * Gets the element which current blocking happens.
     * <p>
     * This element is the working element of the first blocker in tree order.
     *
     * @return   the current blocking element
     */
    com::sun::star::xml::wrapper::XXMLElementWrapper getCurrentBlockingNode();
};

} ; } ; } ; } ; } ; } ;


#endif