• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

IXMLDOMNodeImpl.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  * 
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  * 
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 /*
00019  * $Id: IXMLDOMNodeImpl.h 569031 2007-08-23 15:05:28Z amassari $
00020  */
00021 
00022 #ifndef ___ixmldomnodeimpl_h___
00023 #define ___ixmldomnodeimpl_h___
00024 
00025 #include <xercesc/util/XercesDefs.hpp>
00026 #include <xercesc/dom/DOMException.hpp>
00027 XERCES_CPP_NAMESPACE_USE
00028 
00029 
00030 //
00031 //   This macro is defined in MSXML.H's compatible with IE5
00032 //      and not defined in those from IE4.
00033 //
00034 //   To correct, install a IE5 or later version of the Microsoft Platform SDK
00035 //      and add \Program Files\Microsoft Platform SDK\Include as the first entry
00036 //      on the Directories tab on the dialog displayed after selecting Tools Options
00037 //      from the Visual Studio IDE.
00038 //
00039 //   See http://xerces.apache.org/xerces-c/build.html#BuildCOM
00040 #ifndef __IXMLDOMNode_INTERFACE_DEFINED__
00041 #error "xerces-dom requires an MSXML.H compatible with IE5 or later.  See http://xerces.apache.org/xerces-c/build.html#BuildCOM for directions to correct this problem."
00042 #endif
00043 
00044 
00045 template <class T, const IID* piid, class tihclass = CComTypeInfoHolder>
00046 class ATL_NO_VTABLE IXMLDOMNodeImpl:
00047         public IDispatchImpl<T,piid,&LIBID_Xerces, XERCES_VERSION_MAJOR, INVK_CAT2_RAW_NUMERIC(XERCES_VERSION_MINOR,XERCES_VERSION_REVISION),tihclass>,
00048         public IIBMXMLDOMNodeIdentity,
00049         public ISupportErrorInfo
00050 {
00051 public:
00052 
00053         IXMLDOMNodeImpl()
00054                 :m_pIXMLDOMDocument(NULL)
00055         {}
00056 
00057         virtual DOMNode* get_DOMNode()              = 0;
00058         virtual DOMNodeType get_DOMNodeType() const = 0;
00059 
00060         void    SetOwnerDoc(IXMLDOMDocument     *p)
00061         {
00062                 m_pIXMLDOMDocument = p;
00063                 if (m_pIXMLDOMDocument != NULL)
00064                         m_pIXMLDOMDocument->AddRef();
00065         }
00066 
00067         // IIBMXMLDOMNodeIdentity
00068         STDMETHOD(get_NodeId)(long *pVal)
00069         {
00070                 ATLTRACE(_T("IXMLDOMNodeImpl::get_NodeId\n"));
00071 
00072                 if (NULL == pVal)
00073                         return E_POINTER;
00074 
00075                 *pVal = reinterpret_cast<long> (get_DOMNode());
00076                 return S_OK;
00077         }
00078 
00079         //   ISupportErrorInfo
00080         HRESULT STDMETHODCALLTYPE InterfaceSupportsErrorInfo(REFIID iid);
00081         
00082 
00083         // IXMLDOMNode
00084     STDMETHOD(get_nodeName)(BSTR  *pVal);
00085         STDMETHOD(get_nodeValue)(VARIANT  *pVal);
00086         STDMETHOD(put_nodeValue)(VARIANT newVal);
00087         STDMETHOD(get_nodeType)(DOMNodeType  *pVal);
00088         STDMETHOD(get_parentNode)(IXMLDOMNode  * *pVal);
00089         STDMETHOD(get_childNodes)(IXMLDOMNodeList  * *pVal);
00090         STDMETHOD(get_firstChild)(IXMLDOMNode  * *pVal);
00091         STDMETHOD(get_lastChild)(IXMLDOMNode  * *pVal);
00092         STDMETHOD(get_previousSibling)(IXMLDOMNode  * *pVal);
00093         STDMETHOD(get_nextSibling)(IXMLDOMNode  * *pVal);
00094         STDMETHOD(get_attributes)(IXMLDOMNamedNodeMap  * *pVal);
00095         STDMETHOD(insertBefore)(IXMLDOMNode  *newChild, VARIANT refChild, IXMLDOMNode  * *outNewChild);
00096         STDMETHOD(replaceChild)(IXMLDOMNode  *newChild, IXMLDOMNode  *oldChild, IXMLDOMNode  * *outNewChild);
00097         STDMETHOD(removeChild)(IXMLDOMNode  *childNode, IXMLDOMNode  * *oldChild);
00098         STDMETHOD(appendChild)(IXMLDOMNode  *newChild, IXMLDOMNode  * *outNewChild);
00099         STDMETHOD(hasChildNodes)(VARIANT_BOOL  *hasChild);
00100         STDMETHOD(get_ownerDocument)(IXMLDOMDocument  * *pVal);
00101         STDMETHOD(cloneNode)(VARIANT_BOOL deep, IXMLDOMNode  * *cloneRoot);
00102         STDMETHOD(get_nodeTypeString)(BSTR  *pVal);
00103         STDMETHOD(get_text)(BSTR  *pVal);
00104         STDMETHOD(put_text)(BSTR newVal);
00105         STDMETHOD(get_specified)(VARIANT_BOOL  *pVal);
00106         STDMETHOD(get_definition)(IXMLDOMNode  * *pVal);
00107         STDMETHOD(get_nodeTypedValue)(VARIANT  *pVal);
00108         STDMETHOD(put_nodeTypedValue)(VARIANT newVal);
00109         STDMETHOD(get_dataType)(VARIANT  *pVal);
00110         STDMETHOD(put_dataType)(BSTR dataTypeName);
00111         STDMETHOD(get_xml)(BSTR  *pVal);
00112         STDMETHOD(transformNode)(IXMLDOMNode  *stylesheet, BSTR  *xmlString);
00113         STDMETHOD(selectNodes)(BSTR queryString, IXMLDOMNodeList  * *resultList);
00114         STDMETHOD(selectSingleNode)(BSTR queryString, IXMLDOMNode  * *resultNode);
00115         STDMETHOD(get_parsed)(VARIANT_BOOL  *pVal);
00116         STDMETHOD(get_namespaceURI)(BSTR  *pVal);
00117         STDMETHOD(get_prefix)(BSTR  *pVal);
00118         STDMETHOD(get_baseName)(BSTR  *pVal);
00119         STDMETHOD(transformNodeToObject)(IXMLDOMNode  *stylesheet, VARIANT outputObject);
00120 
00121 protected:
00122 
00123         IXMLDOMDocument *m_pIXMLDOMDocument;
00124         
00125         void    ReleaseOwnerDoc()
00126         {
00127                 if (m_pIXMLDOMDocument != NULL) {
00128                         m_pIXMLDOMDocument->Release();
00129                         m_pIXMLDOMDocument = NULL;
00130                 }
00131         }
00132 
00133 };
00134 
00135 HRESULT MakeHRESULT(DOMException& ex);
00136 
00137 #include "IXMLDOMNodeImpl.inl"
00138 
00139 #endif // ___ixmldomnodeimpl_h___

Generated on Thu Jan 12 2012 23:13:51 for ACS-10.0 C++ API by  doxygen 1.7.0