ContentPresentationContainer.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 //  $Header: //DWF/Development/Components/Internal/DWF Toolkit/v7.6/develop/global/src/dwf/presentation/utility/ContentPresentationContainer.h#3 $
00020 //  $DateTime: 2008/12/09 00:24:37 $
00021 //  $Author: gaoje $
00022 //  $Change: 125697 $
00023 
00024 #ifndef _DWFTK_CONTENT_PRESENTATION_CONTAINER_H
00025 #define _DWFTK_CONTENT_PRESENTATION_CONTAINER_H
00026 
00027 
00032 
00033 #include "dwfcore/Owner.h"
00034 #include "dwfcore/STL.h"
00035 #include "dwfcore/SkipList.h"
00036 using namespace DWFCore;
00037 
00038 #include "dwf/Toolkit.h"
00039 #include "dwf/presentation/ContentPresentation.h"
00040 
00041 namespace DWFToolkit
00042 {
00043 
00053 class DWFContentPresentationContainer : protected DWFOwner
00054                                        _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00055 {
00056 
00057 public:
00058 
00065     _DWFTK_API
00066     DWFContentPresentationContainer()
00067         throw();
00068 
00076     _DWFTK_API
00077     virtual ~DWFContentPresentationContainer()
00078         throw();
00079 
00092     _DWFTK_API
00093     virtual void addPresentation( DWFContentPresentation* pPresentation, bool bOwnPresentation = true )
00094         throw( DWFException );
00095 
00106     _DWFTK_API
00107     virtual DWFContentPresentation::tList::Iterator* getPresentations( )
00108         throw();
00109 
00120     _DWFTK_API
00121     virtual DWFContentPresentation::tList::ConstIterator* getPresentations( ) const
00122         throw();
00123 
00135     _DWFTK_API
00136     virtual void removePresentation( DWFContentPresentation* pPresentation,
00137                                      bool                    bDeleteIfOwned )
00138         throw( DWFException );
00139 
00146     _DWFTK_API
00147     size_t presentationCount() const
00148         throw()
00149     {
00150         return _oPresentations.size();
00151     }
00152 
00153 
00154 #ifndef DWFTK_READ_ONLY
00155 
00163     DWFXMLSerializable& getSerializable() const
00164         throw()
00165     {
00166         return (DWFXMLSerializable&)_oSerializer;
00167     }
00168 #endif
00169 
00173     _DWFTK_API
00174     virtual void notifyOwnerChanged( DWFOwnable& rOwnable )
00175         throw( DWFException );
00176 
00180     _DWFTK_API
00181     virtual void notifyOwnableDeletion( DWFOwnable& rOwnable )
00182         throw( DWFException );
00183 
00184 #ifndef DWFTK_READ_ONLY
00185 
00186 private:
00187 
00188     //
00189     // in order to avoid bizarre diamond patterns and
00190     // excessively overload base implementations,
00191     // all container classes must define and implementation this
00192     // internal [PRIVATE] class utility for serializing themselves into XML.
00193     //
00194     class _Serializer : public DWFXMLSerializable
00195                         _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00196     {
00197 
00198     public:
00199 
00200         _Serializer()
00201             throw()
00202             : DWFXMLSerializable()
00203             , _pContainer( NULL )
00204         {;}
00205 
00206         virtual ~_Serializer()
00207             throw()
00208         {;}
00209 
00210         void is( DWFContentPresentationContainer* pContainer )
00211         {
00212             _pContainer = pContainer;
00213         }
00214 
00215         //
00216         //
00217         //
00218         virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00219             throw( DWFException );
00220 
00221     private:
00222 
00223         DWFContentPresentationContainer* _pContainer;
00224     };
00225 
00226 private:
00227 
00228     friend class _Serializer;
00229     _Serializer _oSerializer;
00230 
00231 #endif
00232 
00233 
00234 protected:
00235 
00239     DWFContentPresentation::tList      _oPresentations;
00240 
00241         typedef DWFStringKeySkipList<size_t>     IDToPostionMap;
00242         IDToPostionMap                                            posMap;
00243 
00244 private:
00245 
00246     DWFContentPresentationContainer( const DWFContentPresentationContainer& );
00247     DWFContentPresentationContainer& operator=( const DWFContentPresentationContainer& );
00248 };
00249 
00250 }
00251 
00252 #endif

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