[188] | 1 | #ifndef DOMUserDataHandler_HEADER_GUARD_
|
---|
| 2 | #define DOMUserDataHandler_HEADER_GUARD_
|
---|
| 3 |
|
---|
| 4 | /*
|
---|
| 5 | * The Apache Software License, Version 1.1
|
---|
| 6 | *
|
---|
| 7 | * Copyright (c) 2002 The Apache Software Foundation. All rights
|
---|
| 8 | * reserved.
|
---|
| 9 | *
|
---|
| 10 | * Redistribution and use in source and binary forms, with or without
|
---|
| 11 | * modification, are permitted provided that the following conditions
|
---|
| 12 | * are met:
|
---|
| 13 | *
|
---|
| 14 | * 1. Redistributions of source code must retain the above copyright
|
---|
| 15 | * notice, this list of conditions and the following disclaimer.
|
---|
| 16 | *
|
---|
| 17 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
| 18 | * notice, this list of conditions and the following disclaimer in
|
---|
| 19 | * the documentation and/or other materials provided with the
|
---|
| 20 | * distribution.
|
---|
| 21 | *
|
---|
| 22 | * 3. The end-user documentation included with the redistribution,
|
---|
| 23 | * if any, must include the following acknowledgment:
|
---|
| 24 | * "This product includes software developed by the
|
---|
| 25 | * Apache Software Foundation (http://www.apache.org/)."
|
---|
| 26 | * Alternately, this acknowledgment may appear in the software itself,
|
---|
| 27 | * if and wherever such third-party acknowledgments normally appear.
|
---|
| 28 | *
|
---|
| 29 | * 4. The names "Xerces" and "Apache Software Foundation" must
|
---|
| 30 | * not be used to endorse or promote products derived from this
|
---|
| 31 | * software without prior written permission. For written
|
---|
| 32 | * permission, please contact apache\@apache.org.
|
---|
| 33 | *
|
---|
| 34 | * 5. Products derived from this software may not be called "Apache",
|
---|
| 35 | * nor may "Apache" appear in their name, without prior written
|
---|
| 36 | * permission of the Apache Software Foundation.
|
---|
| 37 | *
|
---|
| 38 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
---|
| 39 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 40 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
| 41 | * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
---|
| 42 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
---|
| 43 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
---|
| 44 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
---|
| 45 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
| 46 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
---|
| 47 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
---|
| 48 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
| 49 | * SUCH DAMAGE.
|
---|
| 50 | * ====================================================================
|
---|
| 51 | *
|
---|
| 52 | * This software consists of voluntary contributions made by many
|
---|
| 53 | * individuals on behalf of the Apache Software Foundation, and was
|
---|
| 54 | * originally based on software copyright (c) 1999, International
|
---|
| 55 | * Business Machines, Inc., http://www.ibm.com . For more information
|
---|
| 56 | * on the Apache Software Foundation, please see
|
---|
| 57 | * <http://www.apache.org/>.
|
---|
| 58 | */
|
---|
| 59 |
|
---|
| 60 | /*
|
---|
| 61 | * $Id: DOMUserDataHandler.hpp,v 1.6 2003/03/07 19:59:09 tng Exp $
|
---|
| 62 | */
|
---|
| 63 |
|
---|
| 64 | #include <xercesc/util/XercesDefs.hpp>
|
---|
| 65 | #include <xercesc/dom/DOMNode.hpp>
|
---|
| 66 |
|
---|
| 67 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
| 68 |
|
---|
| 69 | /**
|
---|
| 70 | * When associating an object to a key on a node using <code>setUserData</code>
|
---|
| 71 | * the application can provide a handler that gets called when the node the
|
---|
| 72 | * object is associated to is being cloned or imported. This can be used by
|
---|
| 73 | * the application to implement various behaviors regarding the data it
|
---|
| 74 | * associates to the DOM nodes. This interface defines that handler.
|
---|
| 75 | *
|
---|
| 76 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
| 77 | *
|
---|
| 78 | * <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>.
|
---|
| 79 | * @since DOM Level 3
|
---|
| 80 | */
|
---|
| 81 | class CDOM_EXPORT DOMUserDataHandler {
|
---|
| 82 | protected:
|
---|
| 83 | // -----------------------------------------------------------------------
|
---|
| 84 | // Hidden constructors
|
---|
| 85 | // -----------------------------------------------------------------------
|
---|
| 86 | /** @name Hidden constructors */
|
---|
| 87 | //@{
|
---|
| 88 | DOMUserDataHandler() {};
|
---|
| 89 | //@}
|
---|
| 90 |
|
---|
| 91 | private:
|
---|
| 92 | // -----------------------------------------------------------------------
|
---|
| 93 | // Unimplemented constructors and operators
|
---|
| 94 | // -----------------------------------------------------------------------
|
---|
| 95 | /** @name Unimplemented constructors and operators */
|
---|
| 96 | //@{
|
---|
| 97 | DOMUserDataHandler(const DOMUserDataHandler &);
|
---|
| 98 | DOMUserDataHandler & operator = (const DOMUserDataHandler &);
|
---|
| 99 | //@}
|
---|
| 100 |
|
---|
| 101 | public:
|
---|
| 102 | // -----------------------------------------------------------------------
|
---|
| 103 | // All constructors are hidden, just the destructor is available
|
---|
| 104 | // -----------------------------------------------------------------------
|
---|
| 105 | /** @name Destructor */
|
---|
| 106 | //@{
|
---|
| 107 | /**
|
---|
| 108 | * Destructor
|
---|
| 109 | *
|
---|
| 110 | */
|
---|
| 111 | virtual ~DOMUserDataHandler() {};
|
---|
| 112 | //@}
|
---|
| 113 |
|
---|
| 114 | // -----------------------------------------------------------------------
|
---|
| 115 | // Class Types
|
---|
| 116 | // -----------------------------------------------------------------------
|
---|
| 117 | /** @name Public Constants */
|
---|
| 118 | //@{
|
---|
| 119 | /**
|
---|
| 120 | * Operation Type
|
---|
| 121 | *
|
---|
| 122 | * <p><code>NODE_CLONED:</code>
|
---|
| 123 | * The node is cloned.</p>
|
---|
| 124 | *
|
---|
| 125 | * <p><code>NODE_IMPORTED</code>
|
---|
| 126 | * The node is imported.</p>
|
---|
| 127 | *
|
---|
| 128 | * <p><code>NODE_DELETED</code>
|
---|
| 129 | * The node is deleted.</p>
|
---|
| 130 | *
|
---|
| 131 | * <p><code>NODE_RENAMED</code>
|
---|
| 132 | * The node is renamed.
|
---|
| 133 | *
|
---|
| 134 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
| 135 | *
|
---|
| 136 | * @since DOM Level 3
|
---|
| 137 | */
|
---|
| 138 | enum DOMOperationType {
|
---|
| 139 | NODE_CLONED = 1,
|
---|
| 140 | NODE_IMPORTED = 2,
|
---|
| 141 | NODE_DELETED = 3,
|
---|
| 142 | NODE_RENAMED = 4
|
---|
| 143 | };
|
---|
| 144 | //@}
|
---|
| 145 |
|
---|
| 146 |
|
---|
| 147 | // -----------------------------------------------------------------------
|
---|
| 148 | // Virtual DOMUserDataHandler interface
|
---|
| 149 | // -----------------------------------------------------------------------
|
---|
| 150 | /** @name Functions introduced in DOM Level 3 */
|
---|
| 151 | //@{
|
---|
| 152 | /**
|
---|
| 153 | * This method is called whenever the node for which this handler is
|
---|
| 154 | * registered is imported or cloned.
|
---|
| 155 | *
|
---|
| 156 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
| 157 | *
|
---|
| 158 | * @param operation Specifies the type of operation that is being
|
---|
| 159 | * performed on the node.
|
---|
| 160 | * @param key Specifies the key for which this handler is being called.
|
---|
| 161 | * @param data Specifies the data for which this handler is being called.
|
---|
| 162 | * @param src Specifies the node being cloned, imported, or renamed.
|
---|
| 163 | * @param dst Specifies the node newly created.
|
---|
| 164 | * @since DOM Level 3
|
---|
| 165 | */
|
---|
| 166 | virtual void handle(DOMOperationType operation,
|
---|
| 167 | const XMLCh* const key,
|
---|
| 168 | void* data,
|
---|
| 169 | const DOMNode* src,
|
---|
| 170 | const DOMNode* dst) = 0;
|
---|
| 171 |
|
---|
| 172 | //@}
|
---|
| 173 |
|
---|
| 174 | };
|
---|
| 175 |
|
---|
| 176 | XERCES_CPP_NAMESPACE_END
|
---|
| 177 |
|
---|
| 178 | #endif
|
---|
| 179 |
|
---|