ContentPresentationNode.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/ContentPresentationNode.h#2 $
00020 //  $DateTime: 2008/06/18 18:08:14 $
00021 //  $Author: gaoje $
00022 //  $Change: 101166 $
00023 
00024 #ifndef _DWFTK_CONTENT_PRESENTATION_NODE_H
00025 #define _DWFTK_CONTENT_PRESENTATION_NODE_H
00026 
00027 
00032 
00033 #include "dwfcore/STL.h"
00034 #include "dwfcore/DWFXMLSerializer.h"
00035 #include "dwfcore/Vector.h"
00036 #include "dwfcore/SkipList.h"
00037 using namespace DWFCore;
00038 
00039 #include "dwf/Toolkit.h"
00040 #include "dwf/package/Resource.h"
00041 #include "dwf/presentation/utility/ContentPresentationNodeContainer.h"
00042 namespace DWFToolkit
00043 {
00044 
00045 //
00046 // fwd decl
00047 //
00048 class DWFContentPresentationReader;
00049 class DWFImageResource;
00050 class DWFSection;
00051 
00064 
00065 class DWFContentPresentationNode  : public DWFContentPresentationNodeContainer
00066                                   , public DWFXMLBuildable
00067 #ifndef DWFTK_READ_ONLY
00068                                   , public DWFXMLSerializable
00069 #endif
00070                                   _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00071 {
00072     friend class DWFContentPresentationNodeContainer;
00073 
00074 public:
00078     typedef DWFOrderedVector<DWFContentPresentationNode*>            tList;
00082     typedef DWFStringKeySkipList<DWFContentPresentationNode*>         tMap;
00086     typedef DWFIterator<DWFContentPresentationNode*>                  tIterator;
00087 
00088 
00089 public:
00090 
00098     _DWFTK_API
00099     DWFContentPresentationNode( const DWFString& zLabel = /*NOXLATE*/L"",
00100                                 const DWFString& zID = /*NOXLATE*/L"" )
00101         throw();
00108     _DWFTK_API
00109     virtual ~DWFContentPresentationNode()
00110         throw();
00111 
00118     _DWFTK_API
00119     virtual void setID( const DWFString& zID )
00120         throw( DWFException );
00121 
00128     _DWFTK_API
00129     virtual const DWFString& id() const
00130         throw();
00131 
00138     _DWFTK_API
00139     virtual void setLabel( const DWFString& zLabel )
00140         throw();
00141 
00149     _DWFTK_API
00150     virtual const DWFString& label() const
00151         throw();
00152 
00160     _DWFTK_API
00161     virtual void setDefaultIconResource( DWFImageResource& rImageResource, DWFSection& rContainingSection )
00162         throw();
00163 
00172     _DWFTK_API
00173     virtual void setDefaultIconResource( DWFImageResource& rImageResource )
00174         throw();
00175 
00182     _DWFTK_API
00183     virtual void setDefaultIconResourceURI( const DWFString& zURI )
00184         throw();
00185 
00195     _DWFTK_API
00196     virtual const DWFString& defaultIconResourceURI() const
00197         throw();
00198 
00206     _DWFTK_API
00207     virtual void setActiveIconResource( DWFImageResource& rImageResource, DWFSection& rContainingSection )
00208         throw();
00209 
00218     _DWFTK_API
00219     virtual void setActiveIconResource( DWFImageResource& rImageResource )
00220         throw();
00221 
00228     _DWFTK_API
00229     virtual void setActiveIconResourceURI( const DWFString& zURI )
00230         throw();
00231 
00241     _DWFTK_API
00242     virtual const DWFString& activeIconResourceURI() const
00243         throw();
00244 
00253     _DWFTK_API
00254     virtual void setExpandedIconResource( DWFImageResource& rImageResource, DWFSection& rContainingSection )
00255         throw();
00256 
00266     _DWFTK_API
00267     virtual void setExpandedIconResource( DWFImageResource& rImageResource )
00268         throw();
00269 
00276     _DWFTK_API
00277     virtual void setExpandedIconResourceURI( const DWFString& zURI )
00278         throw();
00279 
00289     _DWFTK_API
00290     virtual const DWFString& expandedIconResourceURI() const
00291         throw();
00292 
00301     _DWFTK_API
00302     virtual void addChild( DWFContentPresentationNode* pNode )
00303         throw( DWFException );
00304 
00315     _DWFTK_API
00316     virtual DWFContentPresentationNode::tList::Iterator* getChildren( )
00317         throw();
00318 
00327     _DWFTK_API
00328     virtual void removeChild( DWFContentPresentationNode* pNode,
00329                               bool                        bDelete )
00330         throw( DWFException );
00331 
00347     _DWFTK_API
00348     virtual void setGroupExclusivity( bool bExclusive )
00349         throw();
00350 
00359     _DWFTK_API
00360     virtual bool groupExclusivity() const
00361         throw();
00362 
00369     _DWFTK_API
00370     virtual void setHidden( bool bHidden )
00371         throw()
00372     {
00373         _bHidden = bHidden;
00374     }
00375 
00382     _DWFTK_API
00383     virtual bool hidden() const
00384         throw()
00385     {
00386         return _bHidden;
00387     }
00388 
00395     _DWFTK_API
00396     virtual DWFContentPresentationNodeContainer* parent() const
00397         throw()
00398     {
00399         return _pParent;
00400     }
00401 
00402 
00406     _DWFTK_API
00407     virtual void parseAttributeList( const char** ppAttributeList )
00408         throw( DWFException );
00409 
00410 #ifndef DWFTK_READ_ONLY
00411 
00415     _DWFTK_API
00416     virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00417         throw( DWFException );
00418 
00419 #endif
00420 protected:
00421 
00422     //
00423     //
00424     //
00425     DWFResource* containingResource();
00426 
00427 #ifndef DWFTK_READ_ONLY
00428     //
00429     //
00430     //
00431     void generateResourceURI( DWFXMLSerializer& rSerializer, DWFResource* pResource, DWFSection* pSection, DWFString& zResourceURI );
00432     
00433 #endif
00434 
00435 private:
00436 
00437     DWFContentPresentationNode( const DWFContentPresentationNode& );
00438     DWFContentPresentationNode& operator=( const DWFContentPresentationNode& );
00439 
00440     void setParent( DWFContentPresentationNodeContainer* pParent )
00441     {
00442         _pParent = pParent;
00443     }
00444 
00445 private:
00446 
00447     DWFString                               _zID;
00448     DWFString                               _zLabel;
00449     bool                                    _bExclusive;
00450 
00451     DWFString                               _zDefaultIconResourceURI;
00452     DWFString                               _zActiveIconResourceURI;
00453     DWFString                               _zExpandedIconResourceURI;
00454 
00455     DWFImageResource*                       _pDefaultIconResource;
00456     DWFSection*                             _pSectionContainingDefaultIconResource;
00457 
00458     DWFImageResource*                       _pActiveIconResource;
00459     DWFSection*                             _pSectionContainingActiveIconResource;
00460 
00461     DWFImageResource*                       _pExpandedIconResource;
00462     DWFSection*                             _pSectionContainingExpandedIconResource;
00463 
00464     bool                                    _bHidden;
00465     DWFContentPresentationNodeContainer*    _pParent;
00466 };
00467 
00468 }
00469 
00470 #endif

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