XamlW2XParser.h

00001 //
00002 //  Copyright (c) 1996-2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 #if !defined XAML_W2X_PARSER
00019 #define XAML_W2X_PARSER
00020 
00021 #include "XAML/pch.h"
00022 #include "XAML/XamlClassFactory.h"
00023 #include "XAML/XamlXML.h"
00024 #include "dwfcore/XMLParser.h"
00025 
00026 class WT_XAML_W2X_Parser : public DWFXMLCallback
00027 {
00028 public:
00029     WT_XAML_W2X_Parser(WT_XAML_File& file) throw(WT_Result);
00030     virtual ~WT_XAML_W2X_Parser() throw();
00031 
00032     WT_XAML_File&            xamlFile() { return _rXamlFile; }
00033     WT_XAML_Class_Factory*   xamlClassFactory() { return _pClassFactory; }
00034     DWFXMLParser*            w2xParser() { return _pW2XParser; }
00035 
00036     WT_Result                parseW2X();
00037 
00038     bool                     isParsingFinished() { return w2xParser()->isParsingFinished(); }
00039     int                      insideMacroDraw() { return _nInsideMacroDraw; }
00040 
00041 protected:
00042     WT_Result                Create_Object_Shell(const char* pcName);
00043     WT_Result                Create_Named_View_List_Shell();
00044     WT_Result                Create_Named_View_In_List();
00045     WT_Result                Create_URL_List_Shell();
00046     WT_Result                Create_Attribute_URL_List_Shell();
00047     WT_Result                Create_URL_Item_In_List();
00048     WT_Result                Create_Attribute_URL_Item_In_List();
00049     WT_Result                Create_Image_Color_Map();
00050     WT_Result                Create_Image_Shell();
00051     WT_Result                Create_PNG_Group4_Image_Shell();
00052     WT_Result                Create_Polymarker_Shell();
00053     WT_Result                Create_User_Hatch_Pattern_Shell();
00054     WT_Result                Create_Hatch_Pattern_In_User_Hatch_Pattern();
00055     WT_Result                Create_DWF_Header();
00056     WT_Result                Create_Polygon_Shell();    
00057 
00058 private:  
00059     // DWFXMLCallback handlers here
00060     void notifyStartElement( const char* zName, const char** ppAttributeList ) throw();
00061     void notifyEndElement( const char* zName ) throw();
00062     void notifyCharacterData( const char* zCData, int nLength ) throw();
00063     void notifyStartNamespace( const char* zPrefix, const char* zURI ) throw();
00064     void notifyEndNamespace( const char* zPrefix ) throw();
00065 
00066     void _processStartElement(void) throw();
00067     void _processEndElement(void) throw();
00068 
00069 private:
00070     //list kind of object
00071     WT_Object*                   _pListKindOfObject;
00072     DWFXMLParser*                _pW2XParser;
00073     WT_XAML_File&                _rXamlFile;
00074     XamlXML::tAttributeMap       _oMap;
00075     WT_XAML_Class_Factory*       _pClassFactory;
00076     int                          _nLastIndex;
00077     WT_String                    _zCurrentElementName;
00078     bool                         _bPendingElementEnded;
00079     bool                         _bSuspended;
00080     bool                         _bAttributeURLStarted;
00081     int                          _nInsideMacroDraw;
00082 };
00083 
00084 #endif //XAML_W2X_PARSER

Generated on Tue Jan 6 22:40:06 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5