ContentResourceReader.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2005-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 //  $Header: //DWF/Development/Components/Internal/DWF Toolkit/v7.6/develop/global/src/dwf/package/reader/ContentResourceReader.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //  $Revision: #2 $
00023 //
00024 
00025 #ifndef _DWFTK_CONTENT_RESOURCE_READER_H
00026 #define _DWFTK_CONTENT_RESOURCE_READER_H
00027 
00032 
00033 #include <stack>
00034 #include "dwfcore/STL.h"
00035 #include "dwfcore/XML.h"
00036 using namespace DWFCore;
00037 
00038 #include "dwf/Toolkit.h"
00039 #include "dwf/package/XML.h"
00040 
00041 namespace DWFToolkit
00042 {
00043 
00056 class DWFContentResourceReader : public DWFCore::DWFXMLCallback
00057                                  _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00058 {
00059 
00060 public:
00061 
00068     typedef enum teProviderType
00069     {
00073         eProvideNone                =   0x00,
00074 
00078         eProvideVersion             =   0x01,
00079 
00083         eProvideInstances           =   0x10,
00084 
00088         eProvideAttributes          =   0x0F,
00089 
00093         eProvideElements            =   0xF0,
00094 
00098         eProvideAll                 =   0xFF
00099 
00100     } teProviderType;
00101 
00105     typedef DWFXMLBuildable::tUnresolvedList            tUnresolvedList;
00106 
00107 public:
00108 
00115     _DWFTK_API
00116     DWFContentResourceReader( unsigned int nProviderFlags = eProvideAll )
00117         throw();
00118 
00124     _DWFTK_API
00125     virtual ~DWFContentResourceReader()
00126         throw();
00127     
00136     _DWFTK_API
00137     void setResourceObjectID( const DWFString& zObjectID )
00138         throw();
00139 
00148     _DWFTK_API
00149     DWFContentResourceReader* filter() const
00150         throw()
00151     {
00152         return _pFilter;
00153     }
00154 
00160     _DWFTK_API
00161     void setFilter( DWFContentResourceReader* pFilter )
00162         throw();
00163 
00165 
00169     _DWFTK_API
00170     void notifyStartElement( const char*   zName,
00171                              const char**  ppAttributeList )
00172         throw();
00173 
00177     _DWFTK_API
00178     void notifyEndElement( const char*     zName )
00179         throw();
00180 
00184     _DWFTK_API
00185     void notifyStartNamespace( const char* /*zPrefix*/,
00186                                const char* /*zURI*/ )
00187         throw()
00188     {;}
00189 
00193     _DWFTK_API
00194     void notifyEndNamespace( const char*   /*zPrefix*/ )
00195         throw()
00196     {;}
00197 
00201     _DWFTK_API
00202     void notifyCharacterData( const char* /*zCData*/,
00203                               int         /*nLength*/ )
00204         throw()
00205     {;}
00206 
00214     _DWFTK_API
00215     virtual const char* provideContentResourceVersion( const char* zVersion )
00216         throw( DWFException );
00217 
00228     _DWFTK_API
00229     virtual DWFInstance* provideInstance( DWFInstance* pInstance, 
00230                                           const DWFString& zRenderableID,
00231                                           const DWFString& zResourceObjectID )
00232         throw( DWFException );
00233 
00241     _DWFTK_API
00242     virtual void resolveInstances()
00243         throw()
00244     {;}
00245 
00246 private:
00247 
00248     _DWFTK_API
00249     void _provideContentResourceVersion( const char* zVersion )
00250         throw( DWFException );
00251 
00252     _DWFTK_API
00253     void _provideInstance( DWFInstance* pInstance )
00254         throw( DWFException );
00255 
00256     _DWFTK_API
00257     DWFString _findAttributeValue( const char*  pAttributeName,
00258                                    const char** ppAttributeList )
00259         throw();
00260 
00261 protected:
00262 
00267     DWFXMLElementBuilder        _oDefaultElementBuilder;
00268 
00274     DWFXMLElementBuilder*       _pElementBuilder;
00275 
00276 private:
00277 
00278     unsigned int                _nCurrentCollectionProvider;
00279     unsigned int                _nProviderFlags;
00280 
00281     DWFInstance*                _pCurrentInstance;
00282     DWFContentResourceReader*   _pFilter;
00283 
00284     DWFString                   _zRenderableID;
00285 
00286     DWFString                   _zResourceObjectID;
00287 
00288 private:
00289 
00290     //
00291     // Not implemented
00292     //
00293     DWFContentResourceReader( const DWFContentResourceReader& );
00294     DWFContentResourceReader& operator=( const DWFContentResourceReader& );
00295 
00296 };
00297 
00298 }
00299 
00300 
00301 #endif
00302 
00303 

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