ContentPresentationDocument.h

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_CONTENTPRESENTATIONDOCUMENT_H
00021 #define _DWFTK_CONTENTPRESENTATIONDOCUMENT_H
00022 
00027 
00028 
00029 #include "dwf/Toolkit.h"
00030 #include "dwf/package/XML.h"
00031 #include "dwf/presentation/reader/ContentPresentationReader.h"
00032 #include "dwf/presentation/utility/ContentPresentationContainer.h"
00033 
00034 namespace DWFToolkit
00035 {
00036 
00044 class DWFContentPresentationDocument : public DWFContentPresentationContainer
00045                                      , public DWFContentPresentationReader
00046                                        _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00047 {
00048 
00049 public:
00050 
00063     _DWFTK_API
00064     DWFContentPresentationDocument( DWFPackageReader*  pPackageReader )
00065         throw();
00066 
00072     _DWFTK_API
00073     DWFContentPresentationDocument()
00074         throw();
00075 
00081     _DWFTK_API
00082     virtual ~DWFContentPresentationDocument()
00083         throw();
00084 
00094     _DWFTK_API
00095     virtual
00096     DWFContentPresentationNode::tList::Iterator* getNodes()
00097     {
00098         return _oNodes.iterator();
00099     }
00100 
00101 
00108     _DWFTK_API
00109     virtual
00110     DWFContentPresentationNode* getNode( const DWFString& zID )
00111     {
00112         DWFContentPresentationNode** ppNode = _oIDToNode.find( zID );
00113         if (ppNode)
00114         {
00115             return *ppNode;
00116         }
00117         else
00118         {
00119             return NULL;
00120         }
00121     }
00122 
00123 
00130     _DWFTK_API
00131     virtual
00132     DWFContentPresentationView* getView( const DWFString& zID )
00133     {
00134         DWFContentPresentationView** ppView = _oIDToView.find( zID );
00135         if (ppView)
00136         {
00137             return *ppView;
00138         }
00139         return NULL;
00140     }
00141 
00142 
00146     _DWFTK_API
00147     virtual double provideVersion( double nVersion)
00148         throw();
00149 
00153     _DWFTK_API
00154     virtual DWFContentPresentation* providePresentation( DWFContentPresentation* pPresentation )
00155         throw();
00156 
00160     _DWFTK_API
00161     virtual DWFContentPresentationView* provideView( DWFContentPresentationView* pView )
00162         throw();
00163 
00167     _DWFTK_API
00168     virtual DWFPropertyReference* providePropertyReference( DWFPropertyReference* pPropertyReference )
00169         throw();
00170 
00174     _DWFTK_API
00175     virtual DWFContentPresentationNode* provideNode( DWFContentPresentationNode* pNode )
00176         throw();
00177 
00181     _DWFTK_API
00182     virtual DWFContentPresentationReferenceNode* provideReferenceNode( DWFContentPresentationReferenceNode* pReferenceNode )
00183         throw();
00184 
00188     _DWFTK_API
00189     virtual DWFContentPresentationModelViewNode* provideModelViewNode( DWFContentPresentationModelViewNode* pModelViewNode )
00190         throw();
00191 
00192 #ifndef DWFTK_READ_ONLY
00193 
00201     DWFXMLSerializable& getSerializable() const
00202         throw()
00203     {
00204         return (DWFXMLSerializable&)_oSerializer;
00205     }
00206 
00207 private:
00208 
00209     //
00210     // in order to avoid bizarre diamond patterns and
00211     // excessively overload base implementations,
00212     // all container classes must define and implementation this
00213     // internal [PRIVATE] class utility for serializing themselves into XML.
00214     //
00215     class _Serializer : public DWFXMLSerializable
00216                         _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00217     {
00218 
00219     public:
00220 
00221         _Serializer()
00222             throw()
00223             : DWFXMLSerializable()
00224             , _pDocument( NULL )
00225         {;}
00226 
00227         virtual ~_Serializer()
00228             throw()
00229         {;}
00230 
00231         void is( DWFContentPresentationDocument* pDocument )
00232         {
00233             _pDocument = pDocument;
00234         }
00235 
00236         //
00237         //
00238         //
00239         virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00240             throw( DWFException );
00241 
00242     private:
00243 
00244         DWFContentPresentationDocument* _pDocument;
00245     };
00246 
00247 private:
00248 
00249     friend class _Serializer;
00250     _Serializer _oSerializer;
00251 
00252 #endif
00253 
00254 private:
00255 
00256     DWFString   _zType;
00257     char*       _pBuffer;
00258     float       _nVersion;
00259     DWFString   _zHRef;
00260 
00261     unsigned char _nProviderFlags;
00262 
00263     DWFContentPresentationNode::tMap                    _oIDToNode;
00264     DWFContentPresentationNode::tList                   _oNodes;
00265     DWFContentPresentationView::tMap                    _oIDToView;
00266 
00267     DWFContentPresentationDocument( const DWFContentPresentationDocument& );
00268     DWFContentPresentationDocument& operator=( const DWFContentPresentationDocument& );
00269 };
00270 
00271 }
00272 
00273 #endif
00274 

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