1 // XMLElement.h : Declaration of the CXMLElement
3 #ifndef __XMLELEMENT_H_
4 #define __XMLELEMENT_H_
6 #include "resource.h" // main symbols
12 typedef std::map
<std::string
, std::string
> StringMap
;
13 typedef std::vector
< CComQIPtr
<IXMLElement
, &IID_IXMLElement
> > ElementList
;
15 /////////////////////////////////////////////////////////////////////////////
17 class ATL_NO_VTABLE CXMLElement
:
18 public CComObjectRootEx
<CComSingleThreadModel
>,
19 public CComCoClass
<CXMLElement
, &CLSID_MozXMLElement
>,
20 public IDispatchImpl
<IXMLElement
, &IID_IXMLElement
, &LIBID_MozActiveXMLLib
>
23 IXMLElement
*m_pParent
;
25 ElementList m_cChildren
;
27 std::string m_szTagName
;
33 StringMap m_cAttributes
;
37 virtual ~CXMLElement();
39 virtual HRESULT
SetParent(IXMLElement
*pParent
);
40 virtual HRESULT
PutType(long nType
);
41 virtual HRESULT
ReleaseAll();
43 DECLARE_REGISTRY_RESOURCEID(IDR_XMLELEMENT
)
45 DECLARE_PROTECT_FINAL_CONSTRUCT()
47 BEGIN_COM_MAP(CXMLElement
)
48 COM_INTERFACE_ENTRY(IXMLElement
)
49 COM_INTERFACE_ENTRY(IDispatch
)
53 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_tagName(/* [out][retval] */ BSTR __RPC_FAR
*p
);
54 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE
put_tagName(/* [in] */ BSTR p
);
55 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_parent(/* [out][retval] */ IXMLElement __RPC_FAR
*__RPC_FAR
*ppParent
);
56 virtual /* [id] */ HRESULT STDMETHODCALLTYPE
setAttribute(/* [in] */ BSTR strPropertyName
, /* [in] */ VARIANT PropertyValue
);
57 virtual /* [id] */ HRESULT STDMETHODCALLTYPE
getAttribute(/* [in] */ BSTR strPropertyName
, /* [out][retval] */ VARIANT __RPC_FAR
*PropertyValue
);
58 virtual /* [id] */ HRESULT STDMETHODCALLTYPE
removeAttribute(/* [in] */ BSTR strPropertyName
);
59 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_children(/* [out][retval] */ IXMLElementCollection __RPC_FAR
*__RPC_FAR
*pp
);
60 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_type(/* [out][retval] */ long __RPC_FAR
*plType
);
61 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE
get_text(/* [out][retval] */ BSTR __RPC_FAR
*p
);
62 virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE
put_text(/* [in] */ BSTR p
);
63 virtual /* [id] */ HRESULT STDMETHODCALLTYPE
addChild(/* [in] */ IXMLElement __RPC_FAR
*pChildElem
, long lIndex
, long lReserved
);
64 virtual /* [id] */ HRESULT STDMETHODCALLTYPE
removeChild(/* [in] */ IXMLElement __RPC_FAR
*pChildElem
);
69 typedef CComObject
<CXMLElement
> CXMLElementInstance
;
71 #endif //__XMLELEMENT_H_