Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
XMLTags.h
Package: XMLGUI_src.zip [view]
Upload User: kj0090
Upload Date: 2007-03-02
Package Size: 39k
Code Size: 5k
Category:
xml-soap-webservice
Development Platform:
C/C++
- /***********************************************************************
- *
- * This module is part of the XMLGUI system
- *
- * File name: XMLTags.h
- *
- * Creation date: [15 AUGUST 2002]
- *
- * Author(s): [Kolosenko Ruslan]
- *
- * Description: Declares the class XMLTags and descendants
- *
- **********************************************************************/
- #ifndef AFX_XML_TAGS_H_RKOL_8_15_2002_
- #define AFX_XML_TAGS_H_RKOL_8_15_2002_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "XMLGUIMacro.h"
- #include "XMLGUISyntax.h"
- #include "XMLParsingException.h"
- class XMLGUI_EXT_CLASS CXMLTag
- {
- public:
- // constructs CXMLTag object as a root tag of an XML document
- CXMLTag(LPCTSTR szXMLFile);
- // constructs CXMLTag object as a wrapper of an XML node
- CXMLTag(IXMLElement* pXMLElement);
- virtual ~CXMLTag();
- // checks possibility to represent an XML element via CXMLTag object
- // always returns TRUE inasmuch as any XML tag can be represented
- // via generic class CXMLTag
- static BOOL IsTypeValid(IXMLElement* /*pXMLElement*/)
- { return TRUE; } // any pXMLElement is allowed to be represented as CXMLTag
- // returns encapsulated COM interface pointer
- operator IXMLElement*()
- { return m_pXMLElement; }
- // methods for XML data retrieval
- _bstr_t GetTitle(); // returns the name of the XML tag
- _bstr_t GetText(); // returns the text within the XML tag
- int GetAttributeInt(LPCTSTR szAttributeName); // returns value
- // of the specified attribute in numeric format
- _bstr_t GetAttributeString(LPCTSTR szAttributeName); // returns value
- // of the specified attribute in string format
- // static methods for VARIANT values conversions
- static int GetIntegerValue(VARIANT var); // converts VARIANT to number
- static _bstr_t GetStringValue(VARIANT var); // converts VARIANT to string
- protected:
- IXMLDocument* m_pXMLDocument; // non-NULL only if the object is a root XML tag
- IXMLElement* m_pXMLElement; // pointer to encapsulated IXMLElement interface
- };
- class XMLGUI_EXT_CLASS CXMLStylableTag : public CXMLTag
- {
- public:
- // two types of constructors as in the base class CXMLTag
- CXMLStylableTag(LPCTSTR szXMLFile);
- CXMLStylableTag(IXMLElement* pXMLElement);
- virtual ~CXMLStylableTag() {};
- // checks possibility to represent an XML element via CXMLStylableTag object
- // always returns TRUE allowing any tag to be assigned "style" attribute
- static BOOL IsTypeValid(IXMLElement* /*pXMLElement*/)
- { return TRUE; }
- DWORD GetStyles() // returns set of assigned window styles
- { return m_nStyles; }
- DWORD GetExStyles() // returns set of assigned window ex.styles
- { return m_nExStyles; }
- protected:
- DWORD m_nStyles; // assigned window styles
- DWORD m_nExStyles; // assigned extended window styles
- // parses string of the "style" attribute and sets member variables
- void ParseStylesAttribute(LPXMLGUIStylesValues pTagSpecificStyleSyntax = NULL,
- LPXMLGUIStylesValues pTagSpecificExStyleSyntax = NULL);
- // searches for Windows style constant through the specified syntax structure
- DWORD LookupStylesSet(LPXMLGUIStylesValues pStylesSet, LPCTSTR szStyle);
- };
- class XMLGUI_EXT_CLASS CXMLDialogTag : public CXMLStylableTag
- {
- public:
- // two types of constructors as in the base class CXMLStylableTag
- CXMLDialogTag(LPCTSTR szXMLFile);
- CXMLDialogTag(IXMLElement* pXMLElement);
- virtual ~CXMLDialogTag() {};
- // checks possibility to represent an XML element via CXMLDialogTag object
- // the tag name should be equal to "DIALOG" to allow such representation
- static BOOL IsTypeValid(IXMLElement* pXMLElement)
- { _bstr_t strTitle = CXMLTag(pXMLElement).GetTitle();
- return !!strTitle && !wcscmp((const wchar_t*)strTitle,TAG_DIALOG); }
- };
- class XMLGUI_EXT_CLASS CXMLControlTag : public CXMLStylableTag
- {
- public:
- // only one constructor is available,
- // CXMLControlTag object cannot be a root tag
- // and thus there's no way to build the object from an XML file
- CXMLControlTag(IXMLElement* pXMLElement);
- virtual ~CXMLControlTag() {};
- // checks possibility to represent an XML element via CXMLControlTag object
- // the tag name should be equal to "CONTROL" to allow such representation
- static BOOL IsTypeValid(IXMLElement* pXMLElement)
- { _bstr_t strTitle = CXMLTag(pXMLElement).GetTitle();
- return !!strTitle && !wcscmp((const wchar_t*)strTitle,TAG_CONTROL); }
- // control-specific functions
- _bstr_t GetWindowClass(); // returns window class for the control
- WORD GetWindowClassOrdinal(); // returns class ordinal for the control
- BOOL IsActiveX() // checks whether CXMLControlTag object
- { return m_bActiveX; } // represents an OLE control
- protected:
- XMLGUIControlSyntax* m_pControlSyntax; // points to syntax structure for controls
- // of predefined window classes
- BOOL m_bActiveX; // TRUE if XML tag describes an OLE control
- };
- #endif // AFX_XML_TAGS_H_RKOL_8_15_2002_