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_IFWL_PICTUREBOX_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_PICTUREBOX_H_ |
8 #define XFA_FWL_CORE_IFWL_PICTUREBOX_H_ | 8 #define XFA_FWL_CORE_IFWL_PICTUREBOX_H_ |
9 | 9 |
10 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" | 10 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" |
11 #include "xfa/fwl/core/fwl_error.h" | 11 #include "xfa/fwl/core/fwl_error.h" |
12 #include "xfa/fwl/core/ifwl_dataprovider.h" | 12 #include "xfa/fwl/core/ifwl_dataprovider.h" |
13 #include "xfa/fwl/core/ifwl_widget.h" | 13 #include "xfa/fwl/core/ifwl_widget.h" |
14 | 14 |
15 #define FWL_CLASS_PictureBox L"FWL_PICTUREBOX" | |
16 #define FWL_STYLEEXT_PTB_Left 0L << 0 | 15 #define FWL_STYLEEXT_PTB_Left 0L << 0 |
17 #define FWL_STYLEEXT_PTB_Center 1L << 0 | 16 #define FWL_STYLEEXT_PTB_Center 1L << 0 |
18 #define FWL_STYLEEXT_PTB_Right 2L << 0 | 17 #define FWL_STYLEEXT_PTB_Right 2L << 0 |
19 #define FWL_STYLEEXT_PTB_Top 0L << 2 | 18 #define FWL_STYLEEXT_PTB_Top 0L << 2 |
20 #define FWL_STYLEEXT_PTB_Vcenter 1L << 2 | 19 #define FWL_STYLEEXT_PTB_Vcenter 1L << 2 |
21 #define FWL_STYLEEXT_PTB_Bottom 2L << 2 | 20 #define FWL_STYLEEXT_PTB_Bottom 2L << 2 |
22 #define FWL_STYLEEXT_PTB_Normal 0L << 4 | 21 #define FWL_STYLEEXT_PTB_Normal 0L << 4 |
23 #define FWL_STYLEEXT_PTB_AutoSize 1L << 4 | 22 #define FWL_STYLEEXT_PTB_AutoSize 1L << 4 |
24 #define FWL_STYLEEXT_PTB_StretchImage 2L << 4 | 23 #define FWL_STYLEEXT_PTB_StretchImage 2L << 4 |
25 #define FWL_STYLEEXT_PTB_StretchHImage 3L << 4 | 24 #define FWL_STYLEEXT_PTB_StretchHImage 3L << 4 |
(...skipping 16 matching lines...) Expand all Loading... |
42 virtual int32_t GetFlipMode(IFWL_Widget* pWidget) = 0; | 41 virtual int32_t GetFlipMode(IFWL_Widget* pWidget) = 0; |
43 virtual FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) = 0; | 42 virtual FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) = 0; |
44 }; | 43 }; |
45 | 44 |
46 class IFWL_PictureBox : public IFWL_Widget { | 45 class IFWL_PictureBox : public IFWL_Widget { |
47 public: | 46 public: |
48 explicit IFWL_PictureBox(const CFWL_WidgetImpProperties& properties); | 47 explicit IFWL_PictureBox(const CFWL_WidgetImpProperties& properties); |
49 ~IFWL_PictureBox() override; | 48 ~IFWL_PictureBox() override; |
50 | 49 |
51 // IFWL_Widget | 50 // IFWL_Widget |
52 FWL_Error GetClassName(CFX_WideString& wsClass) const override; | |
53 FWL_Type GetClassID() const override; | 51 FWL_Type GetClassID() const override; |
54 FWL_Error Initialize() override; | 52 FWL_Error Initialize() override; |
55 FWL_Error Finalize() override; | 53 void Finalize() override; |
56 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 54 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
57 FWL_Error Update() override; | 55 FWL_Error Update() override; |
58 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 56 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
59 const CFX_Matrix* pMatrix = nullptr) override; | 57 const CFX_Matrix* pMatrix = nullptr) override; |
60 | 58 |
61 protected: | 59 protected: |
62 friend class CFWL_PictureBoxImpDelegate; | 60 friend class CFWL_PictureBoxImpDelegate; |
63 | 61 |
64 void DrawBkground(CFX_Graphics* pGraphics, | 62 void DrawBkground(CFX_Graphics* pGraphics, |
65 IFWL_ThemeProvider* pTheme, | 63 IFWL_ThemeProvider* pTheme, |
(...skipping 12 matching lines...) Expand all Loading... |
78 public: | 76 public: |
79 CFWL_PictureBoxImpDelegate(IFWL_PictureBox* pOwner); | 77 CFWL_PictureBoxImpDelegate(IFWL_PictureBox* pOwner); |
80 void OnDrawWidget(CFX_Graphics* pGraphics, | 78 void OnDrawWidget(CFX_Graphics* pGraphics, |
81 const CFX_Matrix* pMatrix = nullptr) override; | 79 const CFX_Matrix* pMatrix = nullptr) override; |
82 | 80 |
83 protected: | 81 protected: |
84 IFWL_PictureBox* m_pOwner; | 82 IFWL_PictureBox* m_pOwner; |
85 }; | 83 }; |
86 | 84 |
87 #endif // XFA_FWL_CORE_IFWL_PICTUREBOX_H_ | 85 #endif // XFA_FWL_CORE_IFWL_PICTUREBOX_H_ |
OLD | NEW |