| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_PICTUREBOX_H_ | 7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_PICTUREBOX_H_ |
| 8 #define XFA_FWL_LIGHTWIDGET_CFWL_PICTUREBOX_H_ | 8 #define XFA_FWL_LIGHTWIDGET_CFWL_PICTUREBOX_H_ |
| 9 | 9 |
| 10 #include "xfa/fwl/basewidget/ifwl_picturebox.h" | 10 #include "xfa/fwl/basewidget/ifwl_picturebox.h" |
| 11 #include "xfa/fwl/core/fwl_error.h" | 11 #include "xfa/fwl/core/fwl_error.h" |
| 12 #include "xfa/fwl/lightwidget/cfwl_widget.h" | 12 #include "xfa/fwl/lightwidget/cfwl_widget.h" |
| 13 | 13 |
| 14 class CFWL_PictureBox : public CFWL_Widget { | 14 class CFWL_PictureBox : public CFWL_Widget { |
| 15 public: | 15 public: |
| 16 CFWL_PictureBox(); |
| 17 ~CFWL_PictureBox() override; |
| 18 |
| 16 static CFWL_PictureBox* Create(); | 19 static CFWL_PictureBox* Create(); |
| 20 |
| 17 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); | 21 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); |
| 18 CFX_DIBitmap* GetPicture(); | 22 CFX_DIBitmap* GetPicture(); |
| 19 FWL_Error SetPicture(CFX_DIBitmap* pBitmap); | 23 FWL_Error SetPicture(CFX_DIBitmap* pBitmap); |
| 20 FX_FLOAT GetRotation(); | 24 FX_FLOAT GetRotation(); |
| 21 FWL_Error SetRotation(FX_FLOAT fRotation); | 25 FWL_Error SetRotation(FX_FLOAT fRotation); |
| 22 int32_t GetFlipMode(); | 26 int32_t GetFlipMode(); |
| 23 FWL_Error SetFlipMode(int32_t iFlipMode); | 27 FWL_Error SetFlipMode(int32_t iFlipMode); |
| 24 int32_t GetOpacity(); | 28 int32_t GetOpacity(); |
| 25 FWL_Error SetOpacity(int32_t iOpacity); | 29 FWL_Error SetOpacity(int32_t iOpacity); |
| 26 FWL_Error GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY); | 30 FWL_Error GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY); |
| 27 FWL_Error SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY); | 31 FWL_Error SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY); |
| 28 FWL_Error GetOffset(FX_FLOAT& fx, FX_FLOAT& fy); | 32 FWL_Error GetOffset(FX_FLOAT& fx, FX_FLOAT& fy); |
| 29 FWL_Error SetOffset(FX_FLOAT fx, FX_FLOAT fy); | 33 FWL_Error SetOffset(FX_FLOAT fx, FX_FLOAT fy); |
| 30 CFWL_PictureBox(); | |
| 31 virtual ~CFWL_PictureBox(); | |
| 32 | 34 |
| 33 protected: | 35 protected: |
| 34 class CFWL_PictureBoxDP : public IFWL_PictureBoxDP { | 36 class CFWL_PictureBoxDP : public IFWL_PictureBoxDP { |
| 35 public: | 37 public: |
| 36 CFWL_PictureBoxDP() { | 38 CFWL_PictureBoxDP(); |
| 37 m_fRotation = 0.0f; | 39 |
| 38 m_fScaleX = 1.0f; | 40 // IFWL_DataProvider |
| 39 m_fScaleY = 1.0f; | 41 FWL_Error GetCaption(IFWL_Widget* pWidget, |
| 40 m_fOffSetX = 0.0f; | 42 CFX_WideString& wsCaption) override; |
| 41 m_fOffSetY = 0.0f; | 43 |
| 42 m_pBitmap = NULL; | 44 // IFWL_PictureBoxDP |
| 43 } | 45 CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) override; |
| 44 virtual FWL_Error GetCaption(IFWL_Widget* pWidget, | 46 CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget) override; |
| 45 CFX_WideString& wsCaption); | 47 CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget) override; |
| 46 virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget); | 48 int32_t GetOpacity(IFWL_Widget* pWidget) override; |
| 47 virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget); | 49 int32_t GetFlipMode(IFWL_Widget* pWidget) override; |
| 48 virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget); | 50 FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; |
| 49 virtual int32_t GetOpacity(IFWL_Widget* pWidget); | 51 |
| 50 virtual int32_t GetFlipMode(IFWL_Widget* pWidget); | |
| 51 virtual FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); | |
| 52 CFX_DIBitmap* m_pBitmap; | 52 CFX_DIBitmap* m_pBitmap; |
| 53 int32_t m_iOpacity; | 53 int32_t m_iOpacity; |
| 54 int32_t m_iFlipMode; | 54 int32_t m_iFlipMode; |
| 55 FX_FLOAT m_fRotation; | 55 FX_FLOAT m_fRotation; |
| 56 FX_FLOAT m_fScaleX; | 56 FX_FLOAT m_fScaleX; |
| 57 FX_FLOAT m_fScaleY; | 57 FX_FLOAT m_fScaleY; |
| 58 FX_FLOAT m_fOffSetX; | 58 FX_FLOAT m_fOffSetX; |
| 59 FX_FLOAT m_fOffSetY; | 59 FX_FLOAT m_fOffSetY; |
| 60 CFX_WideString m_wsData; | 60 CFX_WideString m_wsData; |
| 61 }; | 61 }; |
| 62 |
| 62 CFWL_PictureBoxDP m_PictureBoxDP; | 63 CFWL_PictureBoxDP m_PictureBoxDP; |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 #endif // XFA_FWL_LIGHTWIDGET_CFWL_PICTUREBOX_H_ | 66 #endif // XFA_FWL_LIGHTWIDGET_CFWL_PICTUREBOX_H_ |
| OLD | NEW |