1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICON_H_ 8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICON_H_ 9 10 #include "../../../core/include/fxcrt/fx_string.h" 11 #include "PWL_Wnd.h" 12 13 class PWL_CLASS CPWL_Image : public CPWL_Wnd 14 { 15 public: 16 CPWL_Image(); 17 virtual ~CPWL_Image(); 18 19 virtual CFX_ByteString GetImageAppStream(); 20 21 virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale); 22 virtual void GetImageOffset(FX_FLOAT & x,FX_FLOAT & y); 23 virtual CPDF_Stream * GetPDFStream(); 24 25 public: 26 void SetPDFStream(CPDF_Stream* pStream); 27 void GetImageSize(FX_FLOAT & fWidth,FX_FLOAT & fHeight); 28 CPDF_Matrix GetImageMatrix(); 29 CFX_ByteString GetImageAlias(); 30 void SetImageAlias(FX_LPCSTR sImageAlias); 31 32 protected: 33 CPDF_Stream* m_pPDFStream; 34 CFX_ByteString m_sImageAlias; 35 }; 36 37 class PWL_CLASS CPWL_Icon : public CPWL_Image 38 { 39 public: 40 CPWL_Icon(); 41 virtual ~CPWL_Icon(); 42 GetIconFit()43 virtual CPDF_IconFit * GetIconFit(){return m_pIconFit;}; 44 45 virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale); 46 virtual void GetImageOffset(FX_FLOAT & x,FX_FLOAT & y); 47 48 FX_INT32 GetScaleMethod(); 49 FX_BOOL IsProportionalScale(); 50 void GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom); 51 FX_BOOL GetFittingBounds(); 52 SetIconFit(CPDF_IconFit * pIconFit)53 void SetIconFit(CPDF_IconFit * pIconFit){m_pIconFit = pIconFit;}; 54 55 private: 56 CPDF_IconFit * m_pIconFit; 57 }; 58 59 60 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICON_H_ 61