| 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_CORE_CFWL_PICTUREBOX_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_PICTUREBOX_H_ |
| 8 #define XFA_FWL_CORE_CFWL_PICTUREBOX_H_ | 8 #define XFA_FWL_CORE_CFWL_PICTUREBOX_H_ |
| 9 | 9 |
| 10 #include "xfa/fwl/core/cfwl_widget.h" | 10 #include "xfa/fwl/core/cfwl_widget.h" |
| 11 #include "xfa/fwl/core/fwl_error.h" | 11 #include "xfa/fwl/core/fwl_error.h" |
| 12 #include "xfa/fwl/core/ifwl_picturebox.h" | 12 #include "xfa/fwl/core/ifwl_picturebox.h" |
| 13 | 13 |
| 14 class CFWL_PictureBox : public CFWL_Widget { | 14 class CFWL_PictureBox : public CFWL_Widget, public IFWL_PictureBoxDP { |
| 15 public: | 15 public: |
| 16 CFWL_PictureBox(const IFWL_App*); | 16 CFWL_PictureBox(const IFWL_App*); |
| 17 ~CFWL_PictureBox() override; | 17 ~CFWL_PictureBox() override; |
| 18 | 18 |
| 19 void Initialize(); | 19 void Initialize(); |
| 20 | 20 |
| 21 CFX_DIBitmap* GetPicture(); | 21 CFX_DIBitmap* GetPicture(); |
| 22 FWL_Error SetPicture(CFX_DIBitmap* pBitmap); | 22 FWL_Error SetPicture(CFX_DIBitmap* pBitmap); |
| 23 FX_FLOAT GetRotation(); | 23 FX_FLOAT GetRotation(); |
| 24 FWL_Error SetRotation(FX_FLOAT fRotation); | 24 FWL_Error SetRotation(FX_FLOAT fRotation); |
| 25 int32_t GetFlipMode(); | 25 int32_t GetFlipMode(); |
| 26 FWL_Error SetFlipMode(int32_t iFlipMode); | 26 FWL_Error SetFlipMode(int32_t iFlipMode); |
| 27 int32_t GetOpacity(); | 27 int32_t GetOpacity(); |
| 28 FWL_Error SetOpacity(int32_t iOpacity); | 28 FWL_Error SetOpacity(int32_t iOpacity); |
| 29 FWL_Error GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY); | 29 FWL_Error GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY); |
| 30 FWL_Error SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY); | 30 FWL_Error SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY); |
| 31 FWL_Error GetOffset(FX_FLOAT& fx, FX_FLOAT& fy); | 31 FWL_Error GetOffset(FX_FLOAT& fx, FX_FLOAT& fy); |
| 32 FWL_Error SetOffset(FX_FLOAT fx, FX_FLOAT fy); | 32 FWL_Error SetOffset(FX_FLOAT fx, FX_FLOAT fy); |
| 33 | 33 |
| 34 protected: | 34 // IFWL_DataProvider |
| 35 class CFWL_PictureBoxDP : public IFWL_PictureBoxDP { | 35 FWL_Error GetCaption(IFWL_Widget* pWidget, |
| 36 public: | 36 CFX_WideString& wsCaption) override; |
| 37 CFWL_PictureBoxDP(); | |
| 38 | 37 |
| 39 // IFWL_DataProvider | 38 // IFWL_PictureBoxDP |
| 40 FWL_Error GetCaption(IFWL_Widget* pWidget, | 39 CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) override; |
| 41 CFX_WideString& wsCaption) override; | 40 CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget) override; |
| 41 CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget) override; |
| 42 int32_t GetOpacity(IFWL_Widget* pWidget) override; |
| 43 int32_t GetFlipMode(IFWL_Widget* pWidget) override; |
| 44 FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; |
| 42 | 45 |
| 43 // IFWL_PictureBoxDP | 46 private: |
| 44 CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) override; | 47 CFX_DIBitmap* m_pBitmap; |
| 45 CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget) override; | 48 int32_t m_iOpacity; |
| 46 CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget) override; | 49 int32_t m_iFlipMode; |
| 47 int32_t GetOpacity(IFWL_Widget* pWidget) override; | 50 FX_FLOAT m_fRotation; |
| 48 int32_t GetFlipMode(IFWL_Widget* pWidget) override; | 51 FX_FLOAT m_fScaleX; |
| 49 FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; | 52 FX_FLOAT m_fScaleY; |
| 50 | 53 FX_FLOAT m_fOffSetX; |
| 51 CFX_DIBitmap* m_pBitmap; | 54 FX_FLOAT m_fOffSetY; |
| 52 int32_t m_iOpacity; | 55 CFX_WideString m_wsData; |
| 53 int32_t m_iFlipMode; | |
| 54 FX_FLOAT m_fRotation; | |
| 55 FX_FLOAT m_fScaleX; | |
| 56 FX_FLOAT m_fScaleY; | |
| 57 FX_FLOAT m_fOffSetX; | |
| 58 FX_FLOAT m_fOffSetY; | |
| 59 CFX_WideString m_wsData; | |
| 60 }; | |
| 61 | |
| 62 CFWL_PictureBoxDP m_PictureBoxDP; | |
| 63 }; | 56 }; |
| 64 | 57 |
| 65 #endif // XFA_FWL_CORE_CFWL_PICTUREBOX_H_ | 58 #endif // XFA_FWL_CORE_CFWL_PICTUREBOX_H_ |
| OLD | NEW |