source: NonGTP/Xerces/xerces/include/xercesc/dom/DOMUserDataHandler.hpp @ 358

Revision 358, 4.6 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1#ifndef DOMUserDataHandler_HEADER_GUARD_
2#define DOMUserDataHandler_HEADER_GUARD_
3
4/*
5 * Copyright 2002,2004 The Apache Software Foundation.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *      http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20/*
21 * $Id: DOMUserDataHandler.hpp,v 1.7 2004/09/08 13:55:39 peiyongz Exp $
22 */
23
24#include <xercesc/util/XercesDefs.hpp>
25#include <xercesc/dom/DOMNode.hpp>
26
27XERCES_CPP_NAMESPACE_BEGIN
28
29/**
30 * When associating an object to a key on a node using <code>setUserData</code>
31 *  the application can provide a handler that gets called when the node the
32 * object is associated to is being cloned or imported. This can be used by
33 * the application to implement various behaviors regarding the data it
34 * associates to the DOM nodes. This interface defines that handler.
35 *
36 * <p><b>"Experimental - subject to change"</b></p>
37 *
38 * <p>See also the <a href='http://www.w3.org/2001/07/WD-DOM-Level-3-Core-20010726'>Document Object Model (DOM) Level 3 Core Specification</a>.
39 * @since DOM Level 3
40 */
41class CDOM_EXPORT DOMUserDataHandler {
42protected:
43    // -----------------------------------------------------------------------
44    //  Hidden constructors
45    // -----------------------------------------------------------------------
46    /** @name Hidden constructors */
47    //@{   
48    DOMUserDataHandler() {};
49    //@}
50
51private:
52    // -----------------------------------------------------------------------
53    // Unimplemented constructors and operators
54    // -----------------------------------------------------------------------
55    /** @name Unimplemented constructors and operators */
56    //@{
57    DOMUserDataHandler(const DOMUserDataHandler &);
58    DOMUserDataHandler & operator = (const DOMUserDataHandler &);
59    //@}
60
61public:
62    // -----------------------------------------------------------------------
63    //  All constructors are hidden, just the destructor is available
64    // -----------------------------------------------------------------------
65    /** @name Destructor */
66    //@{
67    /**
68     * Destructor
69     *
70     */
71    virtual ~DOMUserDataHandler() {};
72    //@}
73
74    // -----------------------------------------------------------------------
75    //  Class Types
76    // -----------------------------------------------------------------------
77    /** @name Public Constants */
78    //@{
79    /**
80     * Operation Type
81     *
82     * <p><code>NODE_CLONED:</code>
83     * The node is cloned.</p>
84     *
85     * <p><code>NODE_IMPORTED</code>
86     * The node is imported.</p>
87     *
88     * <p><code>NODE_DELETED</code>
89     * The node is deleted.</p>
90     *
91     * <p><code>NODE_RENAMED</code>
92     * The node is renamed.
93     *
94     * <p><b>"Experimental - subject to change"</b></p>
95     *
96     * @since DOM Level 3
97     */
98    enum DOMOperationType {
99        NODE_CLONED               = 1,
100        NODE_IMPORTED             = 2,
101        NODE_DELETED              = 3,
102        NODE_RENAMED              = 4
103    };
104    //@}
105
106
107    // -----------------------------------------------------------------------
108    //  Virtual DOMUserDataHandler interface
109    // -----------------------------------------------------------------------
110    /** @name Functions introduced in DOM Level 3 */
111    //@{
112    /**
113     * This method is called whenever the node for which this handler is
114     * registered is imported or cloned.
115     *
116     * <p><b>"Experimental - subject to change"</b></p>
117     *
118     * @param operation Specifies the type of operation that is being
119     *   performed on the node.
120     * @param key Specifies the key for which this handler is being called.
121     * @param data Specifies the data for which this handler is being called.
122     * @param src Specifies the node being cloned, imported, or renamed.
123     * @param dst Specifies the node newly created.
124     * @since DOM Level 3
125     */
126    virtual void handle(DOMOperationType operation,
127                        const XMLCh* const key,
128                        void* data,
129                        const DOMNode* src,
130                        const DOMNode* dst) = 0;
131
132    //@}
133
134};
135
136XERCES_CPP_NAMESPACE_END
137
138#endif
139
Note: See TracBrowser for help on using the repository browser.