Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

IXMLDOMNodeImpl.h

Go to the documentation of this file.
00001 /* 00002 * Copyright 1999-2001,2004 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 /* 00018 * $Log: IXMLDOMNodeImpl.h,v $ 00019 * Revision 1.6 2004/09/08 13:55:35 peiyongz 00020 * Apache License Version 2.0 00021 * 00022 * Revision 1.5 2004/02/25 18:38:33 amassari 00023 * The COM wrapper doesn't use the deprecated DOM anymore 00024 * 00025 * Revision 1.4 2004/02/12 13:49:43 amassari 00026 * Updated version to 2.5 00027 * 00028 * Revision 1.3 2003/11/21 12:05:48 amassari 00029 * Updated version to 2.4 00030 * 00031 * Revision 1.2 2003/03/14 12:44:49 tng 00032 * [Bug 17147] C++ namespace breaks build of XercesCOM DLL 00033 * 00034 * Revision 1.1.1.1 2002/02/01 22:21:39 peiyongz 00035 * sane_include 00036 * 00037 * Revision 1.6 2001/05/11 13:25:00 tng 00038 * Copyright update. 00039 * 00040 * Revision 1.5 2001/01/19 15:17:54 tng 00041 * COM Updates by Curt Arnold: changed 1.3 to 1.4, updated the GUID's so 00042 * both can coexist and fixed a new minor bugs. Most of the changes involved 00043 * error reporting, now a DOM defined error will return an HRESULT of 00044 * 0x80040600 + code and will set an error description to the error name. 00045 * 00046 * Revision 1.4 2000/06/19 20:05:56 rahulj 00047 * Changes for increased conformance and stability. Submitted by 00048 * Curt.Arnold@hyprotech.com. Verified by Joe Polastre. 00049 * 00050 * Revision 1.3 2000/06/03 00:28:54 andyh 00051 * COM Wrapper changes from Curt Arnold 00052 * 00053 * Revision 1.2 2000/03/30 02:00:12 abagchi 00054 * Initial checkin of working code with Copyright Notice 00055 * 00056 */ 00057 00058 #ifndef ___ixmldomnodeimpl_h___ 00059 #define ___ixmldomnodeimpl_h___ 00060 00061 #include <xercesc/util/XercesDefs.hpp> 00062 #include <xercesc/dom/DOMException.hpp> 00063 XERCES_CPP_NAMESPACE_USE 00064 00065 00066 // 00067 // This macro is defined in MSXML.H's compatible with IE5 00068 // and not defined in those from IE4. 00069 // 00070 // To correct, install a IE5 or later version of the Microsoft Platform SDK 00071 // and add \Program Files\Microsoft Platform SDK\Include as the first entry 00072 // on the Directories tab on the dialog displayed after selecting Tools Options 00073 // from the Visual Studio IDE. 00074 // 00075 // See http://xml.apache.org/xerces-c/build.html#BuildCOM 00076 #ifndef __IXMLDOMNode_INTERFACE_DEFINED__ 00077 #error "xerces-dom requires an MSXML.H compatible with IE5 or later. See http://xml.apache.org/xerces-c/build.html#BuildCOM for directions to correct this problem." 00078 #endif 00079 00080 00081 template <class T, const IID* piid, class tihclass = CComTypeInfoHolder> 00082 class ATL_NO_VTABLE IXMLDOMNodeImpl: 00083 public IDispatchImpl<T,piid,&LIBID_Xerces, 2, 50,tihclass>, 00084 public IIBMXMLDOMNodeIdentity, 00085 public ISupportErrorInfo 00086 { 00087 public: 00088 00089 IXMLDOMNodeImpl() 00090 :m_pIXMLDOMDocument(NULL) 00091 {} 00092 00093 virtual DOMNode* get_DOMNode() = 0; 00094 virtual DOMNodeType get_DOMNodeType() const = 0; 00095 00096 void SetOwnerDoc(IXMLDOMDocument *p) 00097 { 00098 m_pIXMLDOMDocument = p; 00099 if (m_pIXMLDOMDocument != NULL) 00100 m_pIXMLDOMDocument->AddRef(); 00101 } 00102 00103 // IIBMXMLDOMNodeIdentity 00104 STDMETHOD(get_NodeId)(long *pVal) 00105 { 00106 ATLTRACE(_T("IXMLDOMNodeImpl::get_NodeId\n")); 00107 00108 if (NULL == pVal) 00109 return E_POINTER; 00110 00111 *pVal = reinterpret_cast<long> (get_DOMNode()); 00112 return S_OK; 00113 } 00114 00115 // ISupportErrorInfo 00116 HRESULT STDMETHODCALLTYPE InterfaceSupportsErrorInfo(REFIID iid); 00117 00118 00119 // IXMLDOMNode 00120 STDMETHOD(get_nodeName)(BSTR *pVal); 00121 STDMETHOD(get_nodeValue)(VARIANT *pVal); 00122 STDMETHOD(put_nodeValue)(VARIANT newVal); 00123 STDMETHOD(get_nodeType)(DOMNodeType *pVal); 00124 STDMETHOD(get_parentNode)(IXMLDOMNode * *pVal); 00125 STDMETHOD(get_childNodes)(IXMLDOMNodeList * *pVal); 00126 STDMETHOD(get_firstChild)(IXMLDOMNode * *pVal); 00127 STDMETHOD(get_lastChild)(IXMLDOMNode * *pVal); 00128 STDMETHOD(get_previousSibling)(IXMLDOMNode * *pVal); 00129 STDMETHOD(get_nextSibling)(IXMLDOMNode * *pVal); 00130 STDMETHOD(get_attributes)(IXMLDOMNamedNodeMap * *pVal); 00131 STDMETHOD(insertBefore)(IXMLDOMNode *newChild, VARIANT refChild, IXMLDOMNode * *outNewChild); 00132 STDMETHOD(replaceChild)(IXMLDOMNode *newChild, IXMLDOMNode *oldChild, IXMLDOMNode * *outNewChild); 00133 STDMETHOD(removeChild)(IXMLDOMNode *childNode, IXMLDOMNode * *oldChild); 00134 STDMETHOD(appendChild)(IXMLDOMNode *newChild, IXMLDOMNode * *outNewChild); 00135 STDMETHOD(hasChildNodes)(VARIANT_BOOL *hasChild); 00136 STDMETHOD(get_ownerDocument)(IXMLDOMDocument * *pVal); 00137 STDMETHOD(cloneNode)(VARIANT_BOOL deep, IXMLDOMNode * *cloneRoot); 00138 STDMETHOD(get_nodeTypeString)(BSTR *pVal); 00139 STDMETHOD(get_text)(BSTR *pVal); 00140 STDMETHOD(put_text)(BSTR newVal); 00141 STDMETHOD(get_specified)(VARIANT_BOOL *pVal); 00142 STDMETHOD(get_definition)(IXMLDOMNode * *pVal); 00143 STDMETHOD(get_nodeTypedValue)(VARIANT *pVal); 00144 STDMETHOD(put_nodeTypedValue)(VARIANT newVal); 00145 STDMETHOD(get_dataType)(VARIANT *pVal); 00146 STDMETHOD(put_dataType)(BSTR dataTypeName); 00147 STDMETHOD(get_xml)(BSTR *pVal); 00148 STDMETHOD(transformNode)(IXMLDOMNode *stylesheet, BSTR *xmlString); 00149 STDMETHOD(selectNodes)(BSTR queryString, IXMLDOMNodeList * *resultList); 00150 STDMETHOD(selectSingleNode)(BSTR queryString, IXMLDOMNode * *resultNode); 00151 STDMETHOD(get_parsed)(VARIANT_BOOL *pVal); 00152 STDMETHOD(get_namespaceURI)(BSTR *pVal); 00153 STDMETHOD(get_prefix)(BSTR *pVal); 00154 STDMETHOD(get_baseName)(BSTR *pVal); 00155 STDMETHOD(transformNodeToObject)(IXMLDOMNode *stylesheet, VARIANT outputObject); 00156 00157 protected: 00158 00159 IXMLDOMDocument *m_pIXMLDOMDocument; 00160 00161 void ReleaseOwnerDoc() 00162 { 00163 if (m_pIXMLDOMDocument != NULL) { 00164 m_pIXMLDOMDocument->Release(); 00165 m_pIXMLDOMDocument = NULL; 00166 } 00167 } 00168 00169 }; 00170 00171 HRESULT MakeHRESULT(DOMException& ex); 00172 00173 #include "IXMLDOMNodeImpl.inl" 00174 00175 #endif // ___ixmldomnodeimpl_h___

Generated on Thu Apr 30 02:30:51 2009 for ACS C++ API by doxygen 1.3.8