opc/Package.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/Package.h#4 $
00019 //  $DateTime: 2008/10/07 14:45:56 $
00020 //  $Author: clarkt $
00021 //  $Change: 115654 $
00022 //  $Revision: #4 $
00023 //
00024 //
00025 
00026 #ifndef _DWFTK_OPCPACKAGE_H
00027 #define _DWFTK_OPCPACKAGE_H
00028 
00029 
00030 #include "dwf/opc/PartContainer.h"
00031 #include "dwf/opc/RelationshipContainerInterface.h"
00032 
00033 namespace DWFToolkit
00034 {
00035 
00036 //
00037 //  fwd declarations
00038 //
00039 class OPCRelationshipContainer;
00040 class OPCContentTypes;
00041 class OPCCoreProperties;
00042 class OPCPhysicalLayerWriter;
00043 class OPCPhysicalLayerReader;
00044 
00045 class OPCPackage : public OPCRelationshipContainerInterface
00046                  , public OPCPartContainer
00047 {
00048 
00049 public:
00050 
00054     static const wchar_t* const kzURI_PackageRels;
00055     static const wchar_t* const kzURI_PackageDigitalSignature;
00056     static const wchar_t* const kzURI_PackageDigitalSignatureRels;
00057     static const wchar_t* const kzURI_PackageDigitalSignatureExt;
00058     static const wchar_t* const kzURI_PackageDigitalSignatureXPS;
00059 
00060     _DWFTK_API
00061     OPCPackage()
00062         throw( DWFException );
00063 
00064     _DWFTK_API
00065     virtual ~OPCPackage()
00066         throw();
00067 
00068 
00069     _DWFTK_API
00070     OPCContentTypes * const contentTypes() const
00071         throw()
00072     {
00073         return _pContentTypes;
00074     }
00075 
00082     _DWFTK_API
00083     OPCCoreProperties * const coreProperties() const
00084         throw()
00085     {
00086         return _pCoreProperties;
00087     }
00088 
00101     _DWFTK_API
00102     void virtual setCoreProperties( OPCCoreProperties* pCorePropertiesPart, 
00103                                     bool bOwn = true )
00104         throw( DWFException );
00105 
00106     _DWFTK_API
00107     void setThumbnail (OPCPart* pThumbnailPart)
00108         throw();
00109 
00110     _DWFTK_API
00111     void readRelationships (OPCPhysicalLayerReader* pReader)
00112         throw( DWFException);
00113 
00117     _DWFTK_API
00118     virtual OPCRelationship* addRelationship( OPCPart* pTargetPart, 
00119                                               const DWFString& zRelationshipType, 
00120                                               OPCRelationship::teTargetMode eTargetMode = OPCRelationship::eInternal )
00121         throw( DWFException );
00122 
00126     _DWFTK_API
00127     virtual bool deleteRelationship( OPCRelationship* pRelationship )
00128         throw();
00129 
00133     _DWFTK_API
00134     virtual size_t relationshipCount() const
00135         throw();
00136 
00140     _DWFTK_API
00141     virtual OPCRelationship::tIterator* relationships()
00142         throw();
00143 
00147     _DWFTK_API
00148     virtual OPCRelationship::tIterator* relationshipsByTarget( const DWFString& zTargetURI ) const
00149         throw();
00150 
00154     _DWFTK_API
00155     virtual OPCRelationship::tIterator* relationshipsByTarget( OPCPart* pPart ) const
00156         throw();
00157 
00161     _DWFTK_API
00162     virtual OPCRelationship::tIterator* relationshipsByType( const DWFString& zType ) const
00163         throw();
00164 
00168     _DWFTK_API
00169     virtual void deleteRelationshipsByTarget( OPCPart* pPart )
00170         throw( DWFException );
00171 
00175     _DWFTK_API
00176     virtual DWFInputStream* getRelationshipsInputStream()
00177         throw( DWFException );
00178 
00179 #ifndef DWFTK_READ_ONLY
00180 
00181     _DWFTK_API
00182     virtual void serialize( OPCPhysicalLayerWriter& rWriter )
00183         throw( DWFException );
00184 
00185 #endif
00186 
00187 private:
00188 
00189     OPCRelationshipContainer *  _pRelsContainer;
00190 
00191     OPCCoreProperties *         _pCoreProperties;
00192     OPCContentTypes *           _pContentTypes;
00193 
00194     OPCPart*                    _pThumbnailPart;
00195 
00196 };
00197 
00198 #ifdef  _DWFCORE_WIN32_SYSTEM
00199 #ifndef DWFTK_STATIC
00200 
00201 _declspec(selectany) const wchar_t* const OPCPackage::kzURI_PackageRels        = L"/_rels/.rels";
00202 _declspec(selectany) const wchar_t* const OPCPackage::kzURI_PackageDigitalSignature         = L"/package/services/digital-signature/origin.psdsor";
00203 _declspec(selectany) const wchar_t* const OPCPackage::kzURI_PackageDigitalSignatureRels     = L"/package/services/digital-signature/_rels/origin.psdsor.rels";
00204 _declspec(selectany) const wchar_t* const OPCPackage::kzURI_PackageDigitalSignatureExt      = L".psdsxs";
00205 _declspec(selectany) const wchar_t* const OPCPackage::kzURI_PackageDigitalSignatureXPS      = L"http://schemas.microsoft.com/xps";
00206 #endif
00207 #endif
00208 
00209 }
00210 
00211 #endif

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