Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

Section.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2005 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_SECTION_H
00021 #define _DWFTK_SECTION_H
00022 
00023 
00028 
00029 
00030 #include "dwfcore/STL.h"
00031 #include "dwfcore/Owner.h"
00032 #include "dwfcore/SkipList.h"
00033 using namespace DWFCore;
00034 
00035 #include "dwf/Toolkit.h"
00036 #include "dwf/package/XML.h"
00037 #include "dwf/package/Source.h"
00038 #include "dwf/package/Resource.h"
00039 #include "dwf/package/Interface.h"
00040 #include "dwf/package/ObjectDefinition.h"
00041 #include "dwf/package/ObjectDefinitionResource.h"
00042 #include "dwf/package/writer/PackageWriter.h"
00043 #include "dwf/package/reader/PackageReader.h"
00044 #include "dwf/package/reader/ObjectDefinitionReader.h"
00045 #include "dwf/package/reader/SectionDescriptorReader.h"
00046 #include "dwf/package/utility/ResourceContainer.h"
00047 #include "dwf/package/utility/PropertyContainer.h"
00048 #include "dwf/package/utility/DefinedObjectContainer.h"
00049 
00050 namespace DWFToolkit
00051 {
00052 
00071 class DWFSection : public    DWFXMLBuildable
00072 #ifndef DWFTK_READ_ONLY
00073                  , public    DWFXMLSerializable
00074 #endif
00075                  , public    DWFOwnable
00076                  , public    DWFResourceContainer
00077                  , public    DWFPropertyContainer
00078                  , protected DWFXMLElementBuilder 
00079 {
00080 
00081 public:
00082 
00086     typedef vector<DWFSection*>                                         tList;
00090     typedef DWFWCharKeySkipList<DWFSection*>                            tMap;
00094     typedef multimap<const wchar_t*, DWFSection*, tDWFWCharCompareLess> tMultiMap;
00095 
00096 public:
00097 
00107     class Factory : public DWFToolkitMemory
00108     {
00109 
00110     public:
00111 
00115         typedef vector<DWFSection::Factory*>                tList;
00119         typedef DWFWCharKeySkipList<DWFSection::Factory*>   tMap;
00120 
00121     public:
00122 
00129         _DWFTK_API
00130         Factory( const DWFString& zType )
00131             throw();
00132 
00138         _DWFTK_API
00139         virtual ~Factory()
00140             throw();
00141 
00148         _DWFTK_API
00149         const DWFString& type() const
00150             throw();
00151 
00166         _DWFTK_API
00167         virtual DWFSection* build( const DWFString&     zName,
00168                                    const DWFString&     zTitle,
00169                                    DWFPackageReader*    pPackageReader )
00170             throw( DWFException );
00171 
00187         _DWFTK_API
00188         virtual DWFSection* build( const DWFString&     zType,
00189                                    const DWFString&     zName,
00190                                    const DWFString&     zTitle,
00191                                    DWFPackageReader*    pPackageReader )
00192             throw( DWFException );
00193 
00194     private:
00195 
00196         DWFString _zType;
00197     };
00198 
00199 public:
00200 
00213     _DWFTK_API
00214     DWFSection( DWFPackageReader* pPackageReader )
00215         throw();
00216 
00232     _DWFTK_API
00233     DWFSection( const DWFString&  zType,
00234                 const DWFString&  zName,
00235                 const DWFString&  zTitle,
00236                 DWFPackageReader* pPackageReader )
00237         throw();
00238 
00253     _DWFTK_API
00254     DWFSection( const DWFString& zType,
00255                 const DWFString& zTitle,
00256                 const DWFString& zObjectID,
00257                 double           nVersion,
00258                 double           nPlotOrder,
00259                 const DWFSource& rSource )
00260         throw();
00261 
00268     _DWFTK_API
00269     DWFSection( const DWFSection& rSection )
00270         throw();
00271 
00278     _DWFTK_API
00279     DWFSection& operator=( const DWFSection& rSection )
00280         throw();
00281 
00287     _DWFTK_API
00288     virtual ~DWFSection()
00289         throw();
00290 
00303     _DWFTK_API
00304     const DWFString& name() const
00305         throw()
00306     {
00307         return _zName;
00308     }
00309 
00325     _DWFTK_API
00326     virtual void rename( const DWFString& zName )
00327         throw();
00328 
00335     _DWFTK_API
00336     const DWFString& type() const
00337         throw()
00338     {
00339         return _zType;
00340     }
00341 
00348     _DWFTK_API
00349     const DWFString& title() const
00350         throw()
00351     {
00352         return _zTitle;
00353     }
00354 
00365     _DWFTK_API
00366     const DWFSource& source() const
00367         throw()
00368     {
00369         return _oSource;
00370     }
00371 
00380     _DWFTK_API
00381     void addSource( const DWFSource& rSource )
00382         throw();
00383 
00395     _DWFTK_API
00396     virtual DWFInterface* buildInterface()
00397         throw( DWFException )
00398     {
00399         return NULL;
00400     }
00401 
00412     _DWFTK_API
00413     const DWFString& objectID() const
00414         throw()
00415     {
00416         return _zObjectID;
00417     }
00418 
00428     _DWFTK_API
00429     double version() const
00430         throw()
00431     {
00432         return _nVersion;
00433     }
00434 
00441     _DWFTK_API
00442     double order() const
00443         throw()
00444     {
00445         return _nPlotOrder;
00446     }
00447 
00456     _DWFTK_API
00457     virtual void reorder( double nPlotOrder )
00458         throw()
00459     {
00460         _nPlotOrder = nPlotOrder;
00461     }
00462 
00476     _DWFTK_API
00477     virtual
00478     const DWFResource& readDescriptor( DWFSectionDescriptorReader* pSectionDescriptorReader = NULL ) const
00479         throw( DWFException );
00480 
00492     _DWFTK_API
00493     virtual 
00494     void readDescriptor( DWFSectionDescriptorReader& rSectionDescriptorReader,
00495                          DWFResource&                rResource ) const
00496         throw( DWFException );
00497 
00509     _DWFTK_API
00510     virtual 
00511     void readDescriptor( DWFSectionDescriptorReader& rSectionDescriptorReader,
00512                          DWFInputStream&             rSectionDescriptorStream ) const
00513         throw( DWFException );
00514 
00523     _DWFTK_API
00524     virtual DWFObjectDefinition* getObjectDefinition() const
00525         throw( DWFException );
00526 
00539     _DWFTK_API
00540     virtual 
00541     void getObjectDefinition( DWFObjectDefinitionReader& rObjectDefinitionReader,
00542                               DWFResource*               pResource = NULL ) const
00543         throw( DWFException );
00544 
00556     _DWFTK_API
00557     virtual 
00558     void getObjectDefinition( DWFObjectDefinitionReader& rObjectDefinitionReader,
00559                               DWFInputStream&            rObjectDefinitionStream ) const
00560         throw( DWFException );
00561 
00565     _DWFTK_API
00566     virtual void parseAttributeList( const char** ppAttributeList )
00567         throw( DWFException );
00568 
00569 #ifndef DWFTK_READ_ONLY
00570 
00574     _DWFTK_API
00575     virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00576         throw( DWFException );
00577 
00578 #endif
00579 
00580 
00581 protected:
00582 
00583     DWFString           _zType;
00584     DWFString           _zName;
00585     DWFString           _zTitle;
00586     DWFString           _zObjectID;
00587     double              _nVersion;
00588     double              _nPlotOrder;
00589     DWFSource           _oSource;
00590 
00591     DWFPackageReader*   _pPackageReader;
00592 
00593 protected:
00594 
00598     virtual DWFResource* buildResource( const char**      ppAttributeList,
00599                                         DWFPackageReader* pPackageReader )
00600         throw( DWFException );
00601 
00605     virtual DWFFontResource* buildFontResource( const char**      ppAttributeList,
00606                                                 DWFPackageReader* pPackageReader )
00607         throw( DWFException );
00608 
00612     virtual DWFImageResource* buildImageResource( const char**      ppAttributeList,
00613                                                   DWFPackageReader* pPackageReader )
00614         throw( DWFException );
00615 
00619     DWFGraphicResource* buildGraphicResource( const char**      ppAttributeList,
00620                                               DWFPackageReader* pPackageReader )
00621         throw( DWFException );
00622 
00623 private:
00624 
00625     //
00626     //
00627     //
00628     void _parseDocument( DWFInputStream& rDocumentStream,
00629                          DWFXMLCallback& rDocumentReader ) const
00630         throw( DWFException );
00631 };
00632 
00633 }
00634 
00635 #endif

Generated on Tue May 17 12:38:51 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1