PropertySet.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/PropertySet.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //  $Revision: #2 $
00023 //
00024 
00025 #ifndef _DWFTK_PROPERTY_SET_H
00026 #define _DWFTK_PROPERTY_SET_H
00027 
00032 
00033 #include "dwfcore/Vector.h"
00034 
00035 #include "dwf/Toolkit.h"
00036 #include "dwf/package/utility/PropertyContainer.h"
00037 
00038 namespace DWFToolkit
00039 {
00040 
00058 class DWFPropertySet : public DWFPropertyContainer
00059                      , public DWFXMLBuildable
00060                        _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00061 {
00062 
00063     //
00064     // Management of this class will occur only through the content class
00065     //
00066     friend class DWFContent;
00067 
00068 public:
00069 
00073     typedef _DWFTK_STD_VECTOR(DWFPropertySet*)          tList;
00077     typedef DWFVectorIterator<DWFPropertySet*, _DWFTK_STL_ALLOCATOR<DWFPropertySet*> >          tListIterator;
00081     typedef DWFStringKeySkipList<DWFPropertySet*>       tMap;
00086     typedef DWFCachingIterator<DWFPropertySet*>         tCachingIterator;
00090     typedef DWFIterator<DWFPropertySet*>                tIterator;
00091 
00096     typedef enum teUnresolvedAttributes
00097     {
00098         ePropertySetReferences
00099 
00100     } teUnresolvedAttributes;
00101 
00106     typedef enum teQueryIDType
00107     {
00111         eUUID,
00115         eSchemaID,
00119         eSetID
00120 
00121     } teQueryIDType;
00122 
00123 public:
00124 
00131     _DWFTK_API
00132     DWFPropertySet( const DWFString& zLabel = /*NOXLATE*/L"" )
00133         throw();
00134 
00140     _DWFTK_API
00141     virtual ~DWFPropertySet()
00142         throw();
00143 
00150     _DWFTK_API
00151     const DWFString& getLabel() const
00152         throw()
00153     {
00154         return _zLabel;
00155     }
00156 
00163     _DWFTK_API
00164     void setLabel( const DWFString& zLabel = /*NOXLATE*/L"" )
00165         throw()
00166     {
00167         _zLabel = zLabel;
00168     }
00169 
00178     _DWFTK_API
00179     const DWFString& getSchemaID() const
00180         throw()
00181     {
00182         return _zSchemaID;
00183     }
00184 
00190     _DWFTK_API
00191     void setSchemaID( const DWFString& zSchemaID )
00192         throw()
00193     {
00194         _zSchemaID = zSchemaID;
00195     }
00196 
00210     _DWFTK_API
00211     const DWFString& getSetID() const
00212         throw()
00213     {
00214         return _zSetID;
00215     }
00216 
00224     _DWFTK_API
00225     void setSetID( const DWFString& zSetID )
00226         throw()
00227     {
00228         _zSetID = zSetID;
00229     }
00230 
00237     _DWFTK_API
00238     bool isClosed() const
00239         throw()
00240     {
00241         return _bClosed;
00242     }
00243 
00251     _DWFTK_API
00252     void setClosed( const DWFString& zSetID )
00253         throw( DWFException );
00254 
00261     _DWFTK_API
00262     void unsetClosed()
00263         throw()
00264     {
00265         _bClosed = false;
00266     }
00267 
00269     //
00270     // Property Queries
00271 
00282     _DWFTK_API
00283     virtual const DWFProperty* getProperty( const DWFString& zName,
00284                                             const DWFString& zCategory = /*NOXLATE*/L"",
00285                                             bool bSearchClosedSets = false )
00286         throw( DWFException );
00287 
00299     _DWFTK_API
00300     virtual const DWFProperty* getProperty( const DWFString& zID,
00301                                             const DWFString& zName,
00302                                             const DWFString& zCategory,
00303                                             teQueryIDType eIDType = eSchemaID )
00304         throw();
00305 
00315     _DWFTK_API
00316     virtual DWFProperty::tIterator* getAllProperties( bool bSearchClosedSets = false )
00317         throw();
00318 
00329     _DWFTK_API
00330     virtual DWFProperty::tIterator* getAllProperties( const DWFString& zCategory,
00331                                                       bool bSearchClosedSets = false )
00332         throw();
00333 
00343     _DWFTK_API
00344     virtual DWFPropertySet* getPropertySet( const DWFString& zID,
00345                                             teQueryIDType eIDType = eSchemaID ) const
00346         throw();
00347 
00359     _DWFTK_API
00360     virtual DWFPropertySet::tIterator* getPropertySets( bool bReturnClosedSets = false )
00361         throw();
00362 
00363 
00365 
00373     _DWFTK_API
00374     virtual DWFPropertySet* addPropertySet( const DWFString& zLabel = /*NOXLATE*/L"" )
00375         throw( DWFException );
00376 
00384     _DWFTK_API
00385     virtual void addPropertySet( DWFPropertySet* pPropertySet )
00386         throw( DWFException );
00387 
00395     _DWFTK_API
00396     virtual void referencePropertySet( DWFPropertySet* pPropertySet )
00397         throw( DWFException );
00398 
00403     _DWFTK_API
00404     virtual void parseAttributeList( const char** /*ppAttributeList*/ )
00405         throw( DWFException )
00406     {;}
00407 
00411     _DWFTK_API
00412     virtual void parseAttributeList( const char** ppAttributeList,
00413                                      tUnresolvedList& rUnresolved )
00414         throw( DWFException );
00415 
00424     _DWFTK_API
00425     void setContent( DWFContent* pContent )
00426         throw();
00427 
00433     _DWFTK_API
00434     DWFContent* getContent() const
00435         throw()
00436     {
00437         return _pContent;
00438     }
00439 
00446     _DWFTK_API
00447     void setParentSet( DWFPropertySet* pParent )
00448         throw()
00449     {
00450         _pParent = pParent;
00451     }
00452 
00459     _DWFTK_API
00460     DWFPropertySet* getParentSet() const
00461         throw()
00462     {
00463         return _pParent;
00464     }
00465 
00478     _DWFTK_API
00479     virtual void addPropertyContainer( DWFPropertyContainer* pPropertySet )
00480         throw( DWFException );
00481 
00494     _DWFTK_API
00495     virtual void referencePropertyContainer( const DWFPropertyContainer& rPropertySet )
00496         throw( DWFException );
00497 
00498 protected:
00499 
00508     _DWFTK_API
00509     virtual void identify( const DWFString& zID )
00510         throw()
00511     {
00512         DWFPropertyContainer::identify( zID );
00513     }
00514 
00515 #ifndef DWFTK_READ_ONLY
00516 
00524     _DWFTK_API
00525     virtual void _serializeAttributes( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00526         throw( DWFException );
00527 
00537     _DWFTK_API
00538     virtual void _serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00539         throw( DWFException );
00540 
00541 #endif
00542 
00543 protected:
00544 
00545     _DWFTK_API
00546     virtual void _getAllProperties( DWFProperty::tList& oProperties,
00547                                     DWFProperty::tMap& oMap,
00548                                     bool bSearchClosedSets = false )
00549         throw();
00550 
00551     _DWFTK_API
00552     virtual void _getAllProperties( DWFProperty::tList& oProperties,
00553                                     DWFProperty::tMap& oMap,
00554                                     const DWFString& zCategory,
00555                                     bool bSearchClosedSets = false )
00556         throw();
00557 
00558     _DWFTK_API
00559     virtual void _getPropertySets( DWFPropertySet::tList& oPropertySets,
00560                                   bool bReturnClosedSets = false )
00561         throw();
00562 
00563 private:
00564 
00565     void _getProperties( DWFProperty::tList& oProperties,
00566                          DWFProperty::tMap& oMap,
00567                          const DWFProperty::tList& oOrderedProperties )
00568         throw();
00569 
00570 
00571     void _getProperties( DWFProperty::tList& oProperties,
00572                          DWFProperty::tMap& oMap,
00573                          const DWFString& zCategory,
00574                          DWFProperty::tMap& oSetProperties )
00575         throw();
00576 
00577 protected:
00578 
00579     DWFString                   _zLabel;
00580 
00581     DWFString                   _zSchemaID;
00582     DWFString                   _zSetID;
00583 
00584     bool                        _bClosed;
00585 
00586     DWFContent*                 _pContent;
00587 
00588     //
00589     //  Parent Container - should be a property set or a content element.
00590     //  If null, it still may have an owner, just not either of the above two.
00591     //
00592     DWFPropertySet*             _pParent;
00593 
00594 private:
00595 
00596     //
00597     // Not Implemented
00598     //
00599     DWFPropertySet( const DWFPropertySet& );
00600     DWFPropertySet& operator=( const DWFPropertySet& );
00601 };
00602 
00603 }
00604 
00605 #endif
00606 

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