Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / embedding / browser / activex / src / xml / XMLElement.h
blobed5a2fd2802ac84cd7edc828c5d270c0cfdff88e
1 // XMLElement.h : Declaration of the CXMLElement
3 #ifndef __XMLELEMENT_H_
4 #define __XMLELEMENT_H_
6 #include "resource.h" // main symbols
8 #include <vector>
9 #include <string>
10 #include <map>
12 typedef std::map<std::string, std::string> StringMap;
13 typedef std::vector< CComQIPtr<IXMLElement, &IID_IXMLElement> > ElementList;
15 /////////////////////////////////////////////////////////////////////////////
16 // CXMLElement
17 class ATL_NO_VTABLE CXMLElement :
18 public CComObjectRootEx<CComSingleThreadModel>,
19 public CComCoClass<CXMLElement, &CLSID_MozXMLElement>,
20 public IDispatchImpl<IXMLElement, &IID_IXMLElement, &LIBID_MozActiveXMLLib>
22 // Pointer to parent
23 IXMLElement *m_pParent;
24 // List of children
25 ElementList m_cChildren;
26 // Tag name
27 std::string m_szTagName;
28 // Text
29 std::string m_szText;
30 // Type
31 long m_nType;
32 // Attribute list
33 StringMap m_cAttributes;
35 public:
36 CXMLElement();
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)
50 END_COM_MAP()
52 // IXMLElement
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);
66 public:
69 typedef CComObject<CXMLElement> CXMLElementInstance;
71 #endif //__XMLELEMENT_H_