PackageManifestReader.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 //  $Header: //DWF/Development/Components/Internal/DWF Toolkit/v7.6/develop/global/src/dwf/package/reader/PackageManifestReader.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //  $Revision: #2 $
00023 //
00024 
00025 
00026 #ifndef _DWFTK_PACKAGE_MANIFEST_READER_H
00027 #define _DWFTK_PACKAGE_MANIFEST_READER_H
00028 
00033 
00034 #include "dwfcore/Core.h"
00035 #include "dwfcore/XML.h"
00036 using namespace DWFCore;
00037 
00038 #include "dwf/package/XML.h"
00039 #include "dwf/package/Section.h"
00040 #include "dwf/package/Property.h"
00041 #include "dwf/package/Interface.h"
00042 #include "dwf/package/Dependency.h"
00043 #include "dwf/package/reader/PackageReader.h"
00044 
00045 
00046 
00047 namespace DWFToolkit
00048 {
00049 
00050 class DWFPackageContentPresentations;
00051 
00080 class DWFManifestReader : public DWFCore::DWFXMLCallback
00081                           _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00082 {
00083 
00084 public:
00085 
00093     typedef enum teProviderType
00094     {
00098         eProvideNone            =   0x00,
00099 
00103         eProvideVersion         =   0x01,
00107         eProvideObjectID        =   0x02,
00108 
00112         eProvideDependencies    =   0x04,
00116         eProvideInterfaces      =   0x08,
00120         eProvideProperties      =   0x10,
00124         eProvideSections        =   0x20,
00128         eProvideContents  =   0x40,
00132         eProvideContentPresentations  =   0x80,
00133 
00137         eProvideAttributes      =   0x03,
00141         eProvideElements        =   0xFC,
00142 
00146         eProvideAll             =   0xFF
00147 
00148     } teProviderType;
00149 
00150 public:
00151 
00159     _DWFTK_API
00160     DWFManifestReader( DWFPackageReader* pPackageReader = NULL,
00161                        unsigned char     nProviderFlags = eProvideAll )
00162         throw();
00163 
00169     _DWFTK_API
00170     virtual ~DWFManifestReader()
00171         throw();
00172 
00180     _DWFTK_API
00181     DWFManifestReader* filter() const
00182         throw();
00183 
00192     _DWFTK_API
00193     void setFilter( DWFManifestReader* pFilter )
00194         throw();
00195 
00203     _DWFTK_API
00204     virtual double provideVersion( double nVersion )
00205         throw( DWFException );
00206 
00214     _DWFTK_API
00215     virtual const char* provideObjectID( const char* zObjectID )
00216         throw( DWFException );
00217 
00226     _DWFTK_API
00227     virtual DWFDependency* provideDependency( DWFDependency* pDependency )
00228         throw( DWFException );
00229 
00238     _DWFTK_API
00239     virtual DWFInterface* provideInterface( DWFInterface* pInterface )
00240         throw( DWFException );
00241 
00250     _DWFTK_API
00251     virtual DWFProperty* provideProperty( DWFProperty* pProperty )
00252         throw( DWFException );
00253 
00262     _DWFTK_API
00263     virtual DWFSection* provideSection( DWFSection* pSection )
00264         throw( DWFException );
00265 
00276     _DWFTK_API
00277     virtual DWFContent* provideContent( DWFContent* pContent )
00278         throw( DWFException );
00279 
00290     _DWFTK_API
00291     virtual DWFPackageContentPresentations* provideContentPresentations( DWFPackageContentPresentations* pPackageContentPresentations )
00292         throw( DWFException );
00293 
00297     _DWFTK_API
00298     void notifyStartElement( const char*   zName,
00299                              const char**  ppAttributeList )
00300         throw();
00301 
00305     _DWFTK_API
00306     void notifyEndElement( const char*     zName )
00307         throw();
00308 
00312     _DWFTK_API
00313     void notifyStartNamespace( const char* zPrefix,
00314                                const char* zURI )
00315         throw();
00316 
00320     _DWFTK_API
00321     void notifyEndNamespace( const char*   zPrefix )
00322         throw();
00323 
00327     _DWFTK_API
00328     void notifyCharacterData( const char* zCData, 
00329                               int         nLength ) 
00330         throw();
00331 
00332 protected:
00333 
00337     DWFPackageReader*       _pPackageReader;
00338 
00343     DWFXMLElementBuilder    _oDefaultElementBuilder;
00344 
00350     DWFXMLElementBuilder*   _pElementBuilder;
00351 
00352 private:
00353 
00354     void _provideVersion( double nVersion )
00355         throw();
00356 
00357     void _provideObjectID( const char* zObjectID )
00358         throw();
00359 
00360     void _provideDependency( DWFDependency* pDependency )
00361         throw();
00362 
00363     void _provideInterface( DWFInterface* pInterface )
00364         throw();
00365 
00366     void _provideProperty( DWFProperty* pProperty )
00367         throw();
00368 
00369     void _provideSection( DWFSection* pSection )
00370         throw();
00371 
00372     void _provideContent( DWFContent* pContent )
00373         throw();
00374 
00375     void _provideContentPresentations( DWFPackageContentPresentations* pPackageContentPresentations )
00376         throw();
00377 
00378 private:
00379 
00380     unsigned char _nProviderFlags;
00381     unsigned char _nCurrentCollectionProvider;
00382 
00383     DWFXMLBuildable*    _pCurrentElement;
00384     DWFManifestReader*  _pFilter;
00385 
00386 private:
00387 
00388     //
00389     // Not implemented
00390     //
00391 
00392     DWFManifestReader( const DWFManifestReader& );
00393     DWFManifestReader& operator=( const DWFManifestReader& );
00394 };
00395 
00396 }
00397 
00398 #endif

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