- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
- /***********************************************************************
- *
- * 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_