ContentManager.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2005-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/ContentManager.h#1 $
00019 //  $DateTime: 2008/02/20 08:38:28 $
00020 //  $Author: appacsviewers $
00021 //  $Change: 84992 $
00022 //
00023 
00024 #ifndef _DWFTK_CONTENT_MANAGER_H
00025 #define _DWFTK_CONTENT_MANAGER_H
00026 
00031 
00032 #include "dwfcore/STL.h"
00033 #include "dwfcore/UUID.h"
00034 #include "dwfcore/Owner.h"
00035 using namespace DWFCore;
00036 
00037 #include "dwf/Toolkit.h"
00038 #include "dwf/package/XML.h"
00039 #include "dwf/package/Content.h"
00040 #include "dwf/package/Section.h"
00041 namespace DWFToolkit
00042 {
00043 
00059 class DWFContentManager : protected DWFOwner
00060                         , public DWFOwnable
00061 #ifndef DWFTK_READ_ONLY
00062                         , public DWFXMLSerializable
00063 #endif
00064                         _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00065 {
00066 
00067 public:
00068 
00081     _DWFTK_API
00082     DWFContentManager( DWFPackageReader* pPackageReader = NULL )
00083         throw();
00084 
00090     _DWFTK_API
00091     virtual ~DWFContentManager()
00092         throw();
00093 
00101     _DWFTK_API
00102     DWFContent::tMap::Iterator* getContents()
00103         throw()
00104     {
00105         return _oContent.iterator();
00106     }
00107 
00116     _DWFTK_API
00117     DWFContent* getContent( const DWFString& zContentID = /*NOXLATE*/L"" )
00118         throw( DWFException );
00119 
00127     _DWFTK_API
00128     DWFContent* getContentByHREF( const DWFString& zHREF )
00129         throw();
00130 
00137     _DWFTK_API
00138     size_t getContentCount() const
00139         throw()
00140     {
00141         return _oContent.size();
00142     }
00143 
00156     _DWFTK_API
00157     DWFContent* addContent( const DWFString& zID = /*NOXLATE*/L"", DWFPackageReader* pReader = NULL )
00158         throw( DWFException );
00159 
00172     _DWFTK_API
00173     DWFContent* insertContent( DWFContent* pContent )
00174         throw( DWFException );
00175 
00183     _DWFTK_API
00184     void removeContents( DWFContent::tList& roRemovedContent )
00185         throw();
00186 
00199     _DWFTK_API
00200     DWFContent* removeContent( const DWFString& zContentID,
00201                                const DWFString& zNewPrimaryID = /*NOXLATE*/L"",
00202                                bool bDeleteIfOwned = true )
00203         throw( DWFException );
00204 
00218     _DWFTK_API
00219     void mergeContent( bool bPrimaryHasPriority = true )
00220         throw();
00221 
00228     _DWFTK_API
00229     DWFUUID* getIDProvider() const
00230         throw()
00231     {
00232         return _pUUIDProvider;
00233     }
00234 
00235 #ifndef DWFTK_READ_ONLY
00236 
00240     _DWFTK_API
00241     void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00242         throw( DWFException );
00243 
00244 #endif
00245 
00249     _DWFTK_API
00250     virtual void notifyOwnableDeletion( DWFOwnable& rOwnable )
00251         throw( DWFException );
00252 
00253 private:
00254 
00255     typedef std::map<DWFString, DWFContent*>        _tResourceToContentMap;
00256 
00257 private:
00258 
00259     //
00260     //  One of the content objects will be the primary object of the package.
00261     //  During a merge, all content gets merged into this.
00262     //
00263     DWFContent*                         _pPrimaryContent;
00264 
00265     //
00266     //  The list of contents that are managed by this class. This is the main
00267     //  container of the contents. This maps the content GUIDs to the contents.
00268     //
00269     DWFContent::tMap                    _oContent;
00270 
00271     //
00272     // This will provide the UUIDs required to create new items in the content
00273     // The content will ask for this ID provider wherever it is needed.
00274     //
00275     DWFUUID*                            _pUUIDProvider;
00276 
00277     //
00278     // This is used during the load of a DWF package with content libraries
00279     //
00280     DWFPackageReader*                   _pPackageReader;
00281 
00282 private:
00283 
00284     DWFContentManager( const DWFContentManager& );
00285     DWFContentManager& operator=( const DWFContentManager& );
00286 
00287 };
00288 
00289 }
00290 
00291 #endif
00292 

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