ContentTypes.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/opc/ContentTypes.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //  $Revision: #2 $
00023 //
00024 //
00025 
00026 #ifndef _DWFTK_OPCCONTENTTYPES_H
00027 #define _DWFTK_OPCCONTENTTYPES_H
00028 
00029 
00030 #include "dwf/opc/XMLPart.h"
00031 
00032 namespace DWFToolkit
00033 {
00034 
00047 class OPCContentTypes : public OPCXMLPart
00048 {
00049 
00053     static const char* const kzName;
00054 
00055 public:
00056 
00062     _DWFTK_API
00063     OPCContentTypes()
00064         throw();
00065 
00071     _DWFTK_API
00072     virtual ~OPCContentTypes()
00073         throw();
00074 
00084     _DWFTK_API
00085     bool addContentType( const DWFString& zExtension, const DWFString& zType )
00086         throw();
00087 
00097     _DWFTK_API
00098     bool addOverride( const DWFString& zPartURI, const DWFString& zType )
00099         throw();
00100 
00110     _DWFTK_API
00111     DWFString extensionType( const DWFString& zExtension ) const
00112         throw();
00113 
00123     _DWFTK_API
00124     DWFString partType( const DWFString& zPartURI ) const
00125         throw();
00126 
00127 
00128 #ifndef DWFTK_READ_ONLY
00129 
00130     _DWFTK_API
00131     virtual void serializeXML( DWFXMLSerializer& rSerializer )
00132         throw( DWFException );
00133 
00134 #endif
00135 
00136 private:
00137 
00138     typedef std::map<DWFString, DWFString> _tTypeMap;
00139 
00140 private:
00141 
00142     _tTypeMap _oExtensions;
00143     _tTypeMap _oOverrides;
00144 
00145 private:
00146 
00147     //
00148     // Not implemented
00149     //
00150     OPCContentTypes( const OPCContentTypes& );
00151     OPCContentTypes& operator=( const OPCContentTypes& );
00152 
00153 };
00154 
00155 //
00156 // required for win32 dll external linkage
00157 //
00158 #ifdef  _DWFCORE_WIN32_SYSTEM
00159 #ifndef DWFTK_STATIC
00160 
00161 //DNT_START
00162 _declspec(selectany) const char* const OPCContentTypes::kzName = "[Content_Types].xml";
00163 //DNT_END
00164 
00165 #endif
00166 #endif
00167 
00168 
00169 }
00170 
00171 #endif

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