/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// // OdOleSsItemHandler.h: interface for the OdOleSsItemHandler class. // ////////////////////////////////////////////////////////////////////// #if !defined(_ODOLESSITEMHANDLERIMPL_INCLUDED_) #define _ODOLESSITEMHANDLERIMPL_INCLUDED_ #include "TD_PackPush.h" #include "OdBinaryData.h" #include "OleItemHandler.h" #include "OleItemHandlerBase.h" /** \details This class portable implements an OLE handler. Library: Source code provided. */ class OdOleSsItemHandlerImpl : public OdOleItemHandlerBase { OdBinaryData m_buff; OdGiRasterImagePtr m_pImage; //#ifdef USE_METAFILE_SUPPORT mutable OdGiRasterImagePtr m_pImageCache; // last gotten via metafile conversion mutable bool m_bImageCacheChecked; //#endif OdBinaryData m_dataMetafile; // WMF or EMF(dgn) // TODO render it if m_pImage.isNull() OdOleItemHandler::Type m_type; OdString m_sUserType, m_sLinkPath, m_sLinkName; public: ODRX_DECLARE_MEMBERS(OdOleSsItemHandlerImpl); /** \details Default constructor. */ OdOleSsItemHandlerImpl(); /** \details Destructor. */ ~OdOleSsItemHandlerImpl() override; /** \details Returns the data size (in bytes) of the compound document of the OdOleItemHandler object. */ OdUInt32 getCompoundDocumentDataSize() const override; /** \details Writes the compound document data of this OdOleItemHandler object to the specified stream. \param streamBuf [out] StreamBuf object to which the data are to be written. */ void getCompoundDocument(OdStreamBuf& streamBuf) const override; /** \details Reads the compound document data of this OdOleItemHandler object from the specified stream. \param nDataSize [in] Number of bytes to be written. \param stream [out] StreamBuf object from which the data are to be read. */ void setCompoundDocument(OdUInt32 nDataSize, OdStreamBuf& stream) override; // OdGiSelfGdiDrawable: /** \details This function is called to have a GDI self-drawable to draw itself. Returns false if implementation is missing or in error case. \param drawObj [in] Object to be drawn. \param hdc [in] Handle to the device context. \param rect [in] Screen rectangle in device coordinates (pixels). */ bool draw(const OdGiCommonDraw& drawObj, void* hdc, const OdGsDCRect& rect) const override; // OdGiSelfGiDrawablePE: /** \details Returns false to create HDC and draw via OdGiSelfGdiDrawable interface. \param pDestGeom [in] Pointer to the Conveyor object. \param pContext [in] Pointer to the Conveyor context. \param regenType [in] Regen type value. \param origin [in] Drawn object's origin. \param u [in] Drawn object's width vector. \param v [in] Drawn object's height vector. \param rect [in] Screen rectangle in device coordinates (pixels). \param isExport [in] Boolean flag. */ bool draw(OdGiConveyorGeometry* pDestGeom, OdGiConveyorContext* pContext, OdGiRegenType regenType, const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, const OdGsDCRect& rect, bool isExport = false); /** \details Returns the type of the OdDbOleFrame of this OdOleItemHandler object. \remarks type() returns one of the following: Name Value kUnknown 0 kLink 1 kEmbedded 2 kStatic 3
*/ Type type() const override; /** \details Returns the user type of this OleItemHandler object. */ OdString userType() const override; /** \details Returns the link name of this OleItemHandler object. */ OdString linkName() const override; /** \details Returns the link path of this OleItemHandler object. */ OdString linkPath() const override; /** \details Returns the draw aspect of this OdOleItemHandler object. \remarks drawAspect() returns one of the following: Name Value kContent 1 kThumbnail 2 kIcon 4 kDocPrint 8
*/ DvAspect drawAspect() const override; /** \details Embeds a raster image to this OdOleItemHandler object. \param pImage [in] Path to a raster image. \param pRxDb [in] Pointer to a database object. \returns Returns true if a raster image is successfully embedded to the OdOleItemHandler object, or returns false in the other case. */ bool embedRaster(OdGiRasterImagePtr pImage, OdRxObject* pRxDb = NULL) override; //bool embedRasterFromFile(const OdString& path); // Returns OdGiRasterImagePtr() if there is only WMF data are present. OdGiRasterImagePtr getRaster(bool) const override; // Some OLE entities contain only WMF or EMF previews (is not raster), for example, entities with Microsoft ExcelŽ content. // ODA Kernel API does not have the cross-platform ability to draw WMFs now. bool getImageData(OdBinaryData& data, OdString* psExtSuffix = NULL) const override; }; /** \details This template class is a specialization of the OdSmartPtr class for OdOleSsItemHandlerImpl object pointers. */ typedef OdSmartPtr OdOleSsItemHandlerImplPtr; /** \details This class represents a protocol extension for OdOleItemHandler objects. Library: Source code provided. */ class OdGiSelfGiDrawablePEImpl : public OdGiSelfGiDrawablePE { public: ODRX_DECLARE_MEMBERS(OdGiSelfGiDrawablePEImpl); /** \details Returns false to create HDC and draw via OdGiSelfGdiDrawable interface. \param pRxObject [in] Pointer to OdRxObject object. \param pDestGeom [in] Pointer to the Conveyor object. \param pContext [in] Pointer to the Conveyor context. \param regenType [in] Regen type value. \param origin [in] Drawn object's origin. \param u [in] Drawn object's width vector. \param v [in] Drawn object's height vector. \param rect [in] Screen rectangle in device coordinates (pixels). \param isExport [in] Boolean flag. */ bool draw(OdRxObject* pRxObject, OdGiConveyorGeometry* pDestGeom, OdGiConveyorContext* pContext, OdGiRegenType regenType, const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, const OdGsDCRect& rect, bool isExport = false) const override; }; #include "TD_PackPop.h" #endif // !defined(_ODOLESSITEMHANDLERIMPL_INCLUDED_)