FixedPageResourceExtractor.h

00001 //
00002 //  Copyright (c) 2007 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,
00008 //  AS TO THE CORRECTNESS OF THIS CODE OR ANY DERIVATIVE
00009 //  WORKS WHICH INCORPORATE IT.
00010 //
00011 //  AUTODESK PROVIDES THE CODE ON AN "AS-IS" BASIS
00012 //  AND EXPLICITLY DISCLAIMS ANY LIABILITY, INCLUDING
00013 //  CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00014 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00015 //
00016 //  Use, duplication, or disclosure by the U.S. Government is subject to
00017 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00018 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00019 //  Data and Computer Software), as applicable.
00020 //
00021 
00022 
00023 #ifndef _DWFTK_DWFXFixedPageResourceExtractor_H
00024 #define _DWFTK_DWFXFixedPageResourceExtractor_H
00025 
00026 #include "dwfcore/XML.h"
00027 #include "dwf/Toolkit.h"
00028 
00029 namespace DWFCore
00030 {
00031 //
00032 // fwd decl
00033 //
00034 class DWFXMLParser;
00035 class DWFBufferOutputStream;
00036 }
00037 
00038 namespace DWFToolkit
00039 {
00040 
00049 
00050 class DWFXFixedPageResourceExtractor : public DWFCore::DWFXMLCallback
00051                              _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00052 {
00053 public:
00054     _DWFTK_API
00055     DWFXFixedPageResourceExtractor( DWFInputStream* pFixedPagePartStream, bool bOwnStream )
00056         throw( DWFException );
00057     
00058     _DWFTK_API
00059     virtual ~DWFXFixedPageResourceExtractor()
00060         throw();
00061 
00062     _DWFTK_API
00063     void parse()
00064         throw( DWFException );
00065 
00069     _DWFTK_API
00070     void notifyStartElement( const char*   zName,
00071                              const char**  ppAttributeList )
00072         throw();
00073 
00077     _DWFTK_API
00078     void notifyEndElement( const char* zName )
00079         throw();
00080 
00084     _DWFTK_API
00085     void notifyStartNamespace( const char* zPrefix,
00086                                const char* zURI )
00087         throw();
00088 
00092     _DWFTK_API
00093     void notifyEndNamespace( const char* zPrefix )
00094         throw();
00095 
00099     _DWFTK_API
00100     void notifyCharacterData( const char* zCData, 
00101                               int nLength ) 
00102         throw();
00103 
00113     _DWFTK_API
00114     DWFInputStream* getResourceStream( const DWFString& zLocator )
00115         throw( DWFException );
00116 
00117 private:
00118     DWFInputStream*             _pFixedPagePartStream;
00119     bool                        _bOwnStream;
00120     DWFCore::DWFXMLParser*      _pParser;
00121     DWFXMLSerializer*           _pResourceSerializer;
00122     DWFBufferOutputStream*      _pCurrentResourceOutputStream;
00123     int                         _nCanvasElementDepth;
00124     int                         _nResourceCanvasElementDepth;
00125     DWFUUID                     _oUUID;
00126     DWFString                   _zLocator;
00127 
00128     typedef _DWFTK_STD_MAP(DWFString, DWFBufferOutputStream*)  _tResourceLocatorToStream;
00129     _tResourceLocatorToStream                                  _oResourceStreamMap;  
00130 };
00131 
00132 }
00133 
00134 #endif

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