ObjectDefinitionReader.h

Go to the documentation of this file.
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 
00019 
00020 #ifndef _DWFTK_OBJECT_DEFINITION_READER_H
00021 #define _DWFTK_OBJECT_DEFINITION_READER_H
00022 
00023 
00028 
00029 #include "dwfcore/Core.h"
00030 #include "dwfcore/STL.h"
00031 #include "dwfcore/XML.h"
00032 using namespace DWFCore;
00033 
00034 #include "dwf/package/XML.h"
00035 #include "dwf/package/Property.h"
00036 #include "dwf/package/DefinedObject.h"
00037 #include "dwf/package/reader/PackageReader.h"
00038 
00039 
00040 namespace DWFToolkit
00041 {
00042 
00058 class DWFObjectDefinitionReader : public DWFCore::DWFXMLCallback
00059                                     _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00060 {
00061 
00062 public:
00063 
00071     typedef enum
00072     {
00076         eProvideNone                =   0x00,
00077 
00081         eProvideVersion             =   0x01,
00082 
00086         eProvideProperties          =   0x02,
00090         eProvideObjects             =   0x04,
00094         eProvideInstances           =   0x08,
00095 
00099         eProvideAttributes          =   0x01,
00103         eProvideElements            =   0x0E,
00104 
00108         eProvideAll                 =   0xFF
00109 
00110     } teProviderType;
00111 
00112     typedef _DWFTK_STD_VECTOR(DWFString)    tStringVector;
00113 
00114 public:
00115 
00123     _DWFTK_API
00124     DWFObjectDefinitionReader( DWFPackageReader* pPackageReader = NULL,
00125                                unsigned char     nProviderFlags = eProvideAll )
00126         throw();
00127 
00133     _DWFTK_API
00134     virtual ~DWFObjectDefinitionReader()
00135         throw();
00136 
00137         //
00138         //
00139         // Provider callbacks for known attributes of the Manifest
00140         //
00141         //
00142 
00143     //
00144     //
00145     //
00146     _DWFTK_API
00147     DWFObjectDefinitionReader* filter() const
00148         throw();
00149 
00150     //
00151     //
00152     //
00153     _DWFTK_API
00154     void setFilter( DWFObjectDefinitionReader* pFilter )
00155         throw();
00156 
00164     _DWFTK_API
00165     virtual double provideVersion( double nVersion)
00166         throw();
00167 
00178     _DWFTK_API
00179     virtual void provideProperties( const DWFString&        zID,
00180                                     tStringVector*          pPropertyRefs,
00181                                     DWFProperty::tList*     pPropertyList )
00182         throw();
00183 
00192     _DWFTK_API
00193     virtual DWFDefinedObject* provideObject( DWFDefinedObject* pObject )
00194         throw();
00195 
00204     _DWFTK_API
00205     virtual DWFDefinedObjectInstance* provideInstance( DWFDefinedObjectInstance* pInstance )
00206         throw();
00207 
00211     _DWFTK_API
00212     void notifyStartElement( const char*   zName,
00213                              const char**  ppAttributeList )
00214         throw();
00215 
00219     _DWFTK_API
00220     void notifyEndElement( const char*     zName )
00221         throw();
00222 
00226     _DWFTK_API
00227     void notifyStartNamespace( const char* zPrefix,
00228                                const char* zURI )
00229         throw();
00230 
00234     _DWFTK_API
00235     void notifyEndNamespace( const char*   zPrefix )
00236         throw();
00237 
00241     _DWFTK_API
00242     void notifyCharacterData( const char* zCData, 
00243                               int         nLength ) 
00244         throw();
00245 
00246 protected:
00247 
00251     DWFPackageReader* _pPackageReader;
00252 
00257     DWFXMLElementBuilder        _oDefaultElementBuilder;
00258 
00264     DWFXMLElementBuilder*       _pElementBuilder;
00265 
00266 private:
00267 
00268     unsigned char _nProviderFlags;
00269     unsigned char _nCurrentCollectionProvider;
00270     unsigned long _nInstanceSequence;
00271 
00272     DWFString               _zCurrentID;
00273     DWFDefinedObject*       _pCurrentObject;
00274     tStringVector*          _pCurrentRefs;
00275     DWFProperty::tList*     _pCurrentProperties;
00276 
00277     DWFObjectDefinitionReader* _pReaderFilter;
00278 
00279 private:
00280 
00281     void _provideVersion( double nVersion)
00282         throw();
00283 
00284     void _provideProperties( const DWFString&           zID,
00285                              tStringVector*             pPropertyRefs,
00286                              DWFProperty::tList*        pPropertyList )
00287         throw();
00288 
00289     void _provideObject( DWFDefinedObject* pObject )
00290         throw();
00291 
00292     void _provideInstance( DWFDefinedObjectInstance* pInstance )
00293         throw();
00294 
00295     //
00296     // Not implemented
00297     //
00298 
00299     DWFObjectDefinitionReader( const DWFObjectDefinitionReader& );
00300     DWFObjectDefinitionReader& operator=( const DWFObjectDefinitionReader& );
00301 };
00302 
00303 }
00304 
00305 #endif

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