Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

XMLCOM.h

Go to the documentation of this file.
00001 //
00002 // XMLCOM.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #if !defined(AFX_XMLCOM_H__0B25B479_D7BF_452C_BB49_FAB08B746E0A__INCLUDED_)
00023 #define AFX_XMLCOM_H__0B25B479_D7BF_452C_BB49_FAB08B746E0A__INCLUDED_
00024 
00025 #pragma once
00026 
00027 class CXMLNode;
00028 class CXMLElement;
00029 class CXMLAttribute;
00030 class CXMLCOMCol;
00031 
00032 
00033 class CXMLCOM : public CComObject
00034 {
00035 // Construction
00036 public:
00037         CXMLCOM(CXMLNode* pNode);
00038         virtual ~CXMLCOM();
00039 
00040 // Attributes
00041 public:
00042         CXMLNode*       m_pNode;
00043 
00044 // Operations
00045 public:
00046         static IUnknown*        Wrap(CXMLNode* pNode, REFIID pIID);
00047         static CXMLElement*     Unwrap(ISXMLElement* pInterface);
00048 
00049 // Automation
00050 public:
00051         BEGIN_INTERFACE_PART(XMLNode, ISXMLNode)
00052                 DECLARE_DISPATCH()
00053                 STDMETHOD(get_Parent)(ISXMLElement FAR* FAR* ppParent);
00054                 STDMETHOD(get_Type)(SXMLNodeType FAR* pnType);
00055                 STDMETHOD(get_AsNode)(ISXMLNode FAR* FAR* ppNode);
00056                 STDMETHOD(get_AsElement)(ISXMLNode FAR* FAR* ppElement);
00057                 STDMETHOD(get_AsAttribute)(ISXMLNode FAR* FAR* ppAttribute);
00058                 STDMETHOD(get_Name)(BSTR FAR* psName);
00059                 STDMETHOD(put_Name)(BSTR sName);
00060                 STDMETHOD(get_Value)(BSTR FAR* psValue);
00061                 STDMETHOD(put_Value)(BSTR sValue);
00062                 STDMETHOD(Delete)();
00063                 STDMETHOD(IsNamed)(BSTR sName, VARIANT_BOOL FAR* pbResult);
00064         END_INTERFACE_PART(XMLNode)
00065 
00066         BEGIN_INTERFACE_PART(XMLElement, ISXMLElement)
00067                 DECLARE_DISPATCH()
00068                 STDMETHOD(get_Parent)(ISXMLElement FAR* FAR* ppParent);
00069                 STDMETHOD(get_Type)(SXMLNodeType FAR* pnType);
00070                 STDMETHOD(get_AsNode)(ISXMLNode FAR* FAR* ppNode);
00071                 STDMETHOD(get_AsElement)(ISXMLNode FAR* FAR* ppElement);
00072                 STDMETHOD(get_AsAttribute)(ISXMLNode FAR* FAR* ppAttribute);
00073                 STDMETHOD(get_Name)(BSTR FAR* psName);
00074                 STDMETHOD(put_Name)(BSTR sName);
00075                 STDMETHOD(get_Value)(BSTR FAR* psValue);
00076                 STDMETHOD(put_Value)(BSTR sValue);
00077                 STDMETHOD(Delete)();
00078                 STDMETHOD(IsNamed)(BSTR sName, VARIANT_BOOL FAR* pbResult);
00079                 STDMETHOD(get_Elements)(ISXMLElements FAR* FAR* ppElements);
00080                 STDMETHOD(get_Attributes)(ISXMLAttributes FAR* FAR* ppAttributes);
00081                 STDMETHOD(Detach)();
00082                 STDMETHOD(Clone)(ISXMLElement FAR* FAR* ppClone);
00083                 STDMETHOD(ToString)(BSTR FAR* psValue);
00084                 STDMETHOD(ToStringEx)(VARIANT_BOOL bHeader, VARIANT_BOOL bNewlines, BSTR FAR* psValue);
00085                 STDMETHOD(FromString)(BSTR sXML, ISXMLElement FAR* FAR* ppElement);
00086                 STDMETHOD(GetWords)(BSTR FAR* psWords);
00087         END_INTERFACE_PART(XMLElement)
00088 
00089         BEGIN_INTERFACE_PART(XMLAttribute, ISXMLAttribute)
00090                 DECLARE_DISPATCH()
00091                 STDMETHOD(get_Parent)(ISXMLElement FAR* FAR* ppParent);
00092                 STDMETHOD(get_Type)(SXMLNodeType FAR* pnType);
00093                 STDMETHOD(get_AsNode)(ISXMLNode FAR* FAR* ppNode);
00094                 STDMETHOD(get_AsElement)(ISXMLNode FAR* FAR* ppElement);
00095                 STDMETHOD(get_AsAttribute)(ISXMLNode FAR* FAR* ppAttribute);
00096                 STDMETHOD(get_Name)(BSTR FAR* psName);
00097                 STDMETHOD(put_Name)(BSTR sName);
00098                 STDMETHOD(get_Value)(BSTR FAR* psValue);
00099                 STDMETHOD(put_Value)(BSTR sValue);
00100                 STDMETHOD(Delete)();
00101                 STDMETHOD(IsNamed)(BSTR sName, VARIANT_BOOL FAR* pbResult);
00102                 STDMETHOD(Detach)();
00103                 STDMETHOD(Clone)(ISXMLAttribute FAR* FAR* ppClone);
00104         END_INTERFACE_PART(XMLAttribute)
00105 
00106         DECLARE_INTERFACE_MAP()
00107 
00108         friend class CXMLCOMCol;
00109 
00110 };
00111 
00112 class CXMLCOMCol : public CComObject
00113 {
00114 // Construction
00115 public:
00116         CXMLCOMCol(CXMLElement* pElement);
00117         virtual ~CXMLCOMCol();
00118 
00119 // Attributes
00120 public:
00121         CXMLElement*    m_pElement;
00122 
00123 // Operations
00124 public:
00125         static ISXMLElements*   WrapElements(CXMLElement* pElement);
00126         static ISXMLAttributes* WrapAttributes(CXMLElement* pElement);
00127 
00128 // Automation
00129 protected:
00130         BEGIN_INTERFACE_PART(XMLElements, ISXMLElements)
00131                 DECLARE_DISPATCH()
00132                 STDMETHOD(get__NewEnum)(IUnknown FAR* FAR* ppEnum);
00133                 STDMETHOD(get_Item)(VARIANT vIndex, ISXMLElement FAR* FAR* ppElement);
00134                 STDMETHOD(get_Count)(LONG FAR* pnCount);
00135                 STDMETHOD(Create)(BSTR strName, ISXMLElement FAR* FAR* ppElement);
00136                 STDMETHOD(Attach)(ISXMLElement FAR* pElement);
00137                 STDMETHOD(RemoveAll)();
00138                 STDMETHOD(get_First)(ISXMLElement FAR* FAR* ppElement);
00139                 STDMETHOD(get_ByName)(BSTR sName, ISXMLElement FAR* FAR* ppElement);
00140         END_INTERFACE_PART(XMLElements)
00141 
00142         BEGIN_INTERFACE_PART(XMLAttributes, ISXMLAttributes)
00143                 DECLARE_DISPATCH()
00144                 STDMETHOD(get__NewEnum)(IUnknown FAR* FAR* ppEnum);
00145                 STDMETHOD(get_Item)(VARIANT vIndex, ISXMLAttribute FAR* FAR* ppAttribute);
00146                 STDMETHOD(get_Count)(LONG FAR* pnCount);
00147                 STDMETHOD(Add)(BSTR strName, BSTR strValue);
00148                 STDMETHOD(Create)(BSTR strName, ISXMLAttribute FAR* FAR* ppAttribute);
00149                 STDMETHOD(Attach)(ISXMLAttribute FAR* pAttribute);
00150                 STDMETHOD(RemoveAll)();
00151                 STDMETHOD(get_ByName)(BSTR sName, ISXMLAttribute FAR* FAR* ppAttribute);
00152                 STDMETHOD(get_Get)(BSTR sName, BSTR FAR* psValue);
00153         END_INTERFACE_PART(XMLAttributes)
00154 
00155         BEGIN_INTERFACE_PART(EnumVARIANT, IEnumVARIANT)
00156                 STDMETHOD(Next)(THIS_ DWORD celt, VARIANT FAR* rgvar, DWORD FAR* pceltFetched);
00157                 STDMETHOD(Skip)(THIS_ DWORD celt);
00158                 STDMETHOD(Reset)(THIS);
00159                 STDMETHOD(Clone)(THIS_ IEnumVARIANT FAR* FAR* ppenum);
00160                 POSITION        m_posCurrent;
00161                 BOOL            m_bAttributes;
00162         END_INTERFACE_PART(EnumVARIANT)
00163 
00164         DECLARE_INTERFACE_MAP()
00165 
00166 };
00167 
00168 #endif // !defined(AFX_XMLCOM_H__0B25B479_D7BF_452C_BB49_FAB08B746E0A__INCLUDED_)

Generated on Thu Dec 15 10:39:54 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2