ContentPresentationResource.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 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_CONTENT_PRESENTATION_RESOURCE_H
00021 #define _DWFTK_CONTENT_PRESENTATION_RESOURCE_H
00022 
00023 
00028 
00029 
00030 #include "dwf/Toolkit.h"
00031 #include "dwf/package/Resource.h"
00032 #include "dwf/presentation/ContentPresentationDocument.h"
00033 
00034 
00035 namespace DWFToolkit
00036 {
00037 
00048 class DWFContentPresentationResource : public DWFResource
00049                                      , public DWFContentPresentationDocument
00050                                      _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00051 {
00052 
00053 public:
00054 
00067     _DWFTK_API
00068     DWFContentPresentationResource( DWFPackageReader*  pPackageReader )
00069         throw();
00070 
00083     _DWFTK_API
00084     DWFContentPresentationResource( const DWFString& zRole )
00085         throw();
00086 
00092     _DWFTK_API
00093     virtual ~DWFContentPresentationResource()
00094         throw();
00095 
00096 #ifndef DWFTK_READ_ONLY
00097 
00098     //
00099     // Returns a stream for reading the resource data
00100     // The caller is responsible for releasing the pointer
00101     // with the \b DWFCORE_FREE_OBJECT macro.
00102     // 
00103     // This resource object is a bit special since it's created
00104     // on-demand when a section with defined objects is serialized.
00105     // This method is overridden in order to provide a real byte stream
00106     // for the package writer to use to create the object defintion document
00107     //
00108     // bCache is ignored
00109 
00126     _DWFTK_API
00127     virtual DWFInputStream* getInputStream( bool bCache = false )
00128         throw( DWFException );
00129 
00133     _DWFTK_API
00134     const DWFXMLNamespace& addNamespace( const DWFString& zNamespace, 
00135                                          const DWFString& zXMLNS )
00136         throw( DWFException );
00137 
00141     _DWFTK_API
00142     void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00143         throw( DWFException );
00144 
00145 private:
00146 
00147     typedef std::map<DWFString, DWFXMLNamespace>    _tNamespaceMap;
00148     _tNamespaceMap                                  _oAddedNamespaces;
00149 
00150 #endif
00151 
00152 private:
00153 
00154     DWFString   _zType;
00155     char*       _pBuffer;
00156         bool            _bSerialized;
00157 
00158 private:
00159 
00160     DWFContentPresentationResource( const DWFContentPresentationResource& );
00161     DWFContentPresentationResource& operator=( const DWFContentPresentationResource& );
00162 };
00163 
00164 
00165 }
00166 
00167 #endif

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