CustomProperties.h

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 //  $Header: //DWF/Development/Components/Internal/DWF Toolkit/v7.6/develop/global/src/dwf/dwfx/CustomProperties.h#1 $
00019 //  $DateTime: 2008/02/20 08:38:28 $
00020 //  $Author: appacsviewers $
00021 //  $Change: 84992 $
00022 //  $Revision: #1 $
00023 //
00024 //
00025 
00026 #ifndef _DWFTK_DWFXCUSTOMPROPERTIES_H
00027 #define _DWFTK_DWFXCUSTOMPROPERTIES_H
00028 
00029 #include "dwf/opc/XMLPart.h"
00030 #include "dwf/dwfx/reader/CustomPropertiesReader.h"
00031 #include "dwf/package/PropertySet.h"
00032 
00033 namespace DWFToolkit
00034 {
00035 
00036 class DWFXCustomProperties : public OPCXMLPart
00037                            , public DWFXCustomPropertiesReader
00038 {
00039 
00040 public:
00041 
00045     static const char* const kzName;
00046 
00047 public:
00048 
00054     _DWFTK_API
00055     DWFXCustomProperties()
00056         throw( DWFException );
00057 
00061     _DWFTK_API
00062     virtual ~DWFXCustomProperties()
00063         throw();
00064 
00075     _DWFTK_API
00076     void addProperty( DWFProperty* pProperty,
00077                       bool         bOwnProperty )
00078         throw( DWFException );    
00079 
00092     _DWFTK_API
00093     DWFProperty* addProperty( const DWFString& zName,
00094                               const DWFString& zValue,
00095                               const DWFString& zCategory = /*NOXLATE*/L"",
00096                               const DWFString& zType = /*NOXLATE*/L"",
00097                               const DWFString& zUnits = /*NOXLATE*/L"" )
00098         throw( DWFException );
00099 
00108     _DWFTK_API
00109     void removeProperty( DWFProperty* pProperty,
00110                          bool         bDeleteIfOwned=true )
00111         throw( DWFException );
00112 
00124     _DWFTK_API
00125     const DWFProperty* const findProperty( const DWFString& zName,
00126                                            const DWFString& zCategory = /*NOXLATE*/L"" )
00127         throw();
00128 
00142     _DWFTK_API
00143     DWFProperty::tMap::Iterator* getProperties( const DWFString& zCategory = /*NOXLATE*/L"" )
00144         throw();    
00145 
00152     _DWFTK_API
00153     DWFPropertySet* getPropertySet()
00154         throw()
00155     {
00156         return &_oPropertySet;
00157     }
00158 
00159 public:
00160 
00161     _DWFTK_API
00162     virtual DWFProperty* provideProperty( DWFProperty* pProperty )
00163         throw();
00164 
00165 #ifndef DWFTK_READ_ONLY
00166 
00170     _DWFTK_API
00171     virtual void serializeXML( DWFXMLSerializer& rSerializer )
00172         throw( DWFException );
00173 
00174 #endif
00175 
00176 private:
00177 
00178     DWFPropertySet  _oPropertySet;
00179 
00180 };
00181 
00182 
00183 //
00184 // required for win32 dll external linkage
00185 //
00186 #ifdef  _DWFCORE_WIN32_SYSTEM
00187 #ifndef DWFTK_STATIC
00188 
00189 //DNT_START
00190 
00191 _declspec(selectany) const char* const DWFXCustomProperties::kzName = "CustomProperties.xml";
00192 
00193 //DNT_END
00194 
00195 #endif
00196 #endif
00197 
00198 }
00199 
00200 #endif
00201 
00202 
00203 

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