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_BASEWIDGET_FWL_PICTUREBOXIMP_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_FWL_PICTUREBOXIMP_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_PICTUREBOXIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_PICTUREBOXIMP_H_ |
9 | 9 |
10 #include "xfa/fwl/core/fwl_widgetimp.h" | 10 #include "xfa/fwl/core/fwl_widgetimp.h" |
11 | 11 |
12 class CFWL_WidgetImpProperties; | 12 class CFWL_WidgetImpProperties; |
13 class IFWL_Widget; | 13 class IFWL_Widget; |
14 class CFWL_PictureBoxImpDelegate; | 14 class CFWL_PictureBoxImpDelegate; |
15 | 15 |
16 class CFWL_PictureBoxImp : public CFWL_WidgetImp { | 16 class CFWL_PictureBoxImp : public CFWL_WidgetImp { |
17 public: | 17 public: |
18 CFWL_PictureBoxImp(const CFWL_WidgetImpProperties& properties, | 18 CFWL_PictureBoxImp(const CFWL_WidgetImpProperties& properties, |
19 IFWL_Widget* pOuter); | 19 IFWL_Widget* pOuter); |
20 ~CFWL_PictureBoxImp(); | 20 ~CFWL_PictureBoxImp(); |
21 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const; | 21 virtual FWL_Error GetClassName(CFX_WideString& wsClass) const; |
22 virtual uint32_t GetClassID() const; | 22 virtual uint32_t GetClassID() const; |
23 virtual FWL_ERR Initialize(); | 23 virtual FWL_Error Initialize(); |
24 virtual FWL_ERR Finalize(); | 24 virtual FWL_Error Finalize(); |
25 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 25 virtual FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
26 virtual FWL_ERR Update(); | 26 virtual FWL_Error Update(); |
27 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 27 virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
28 const CFX_Matrix* pMatrix = NULL); | 28 const CFX_Matrix* pMatrix = NULL); |
29 | 29 |
30 protected: | 30 protected: |
31 void DrawBkground(CFX_Graphics* pGraphics, | 31 void DrawBkground(CFX_Graphics* pGraphics, |
32 IFWL_ThemeProvider* pTheme, | 32 IFWL_ThemeProvider* pTheme, |
33 const CFX_Matrix* pMatrix = NULL); | 33 const CFX_Matrix* pMatrix = NULL); |
34 FX_BOOL VStyle(FX_BOOL dwStyle); | 34 FX_BOOL VStyle(FX_BOOL dwStyle); |
35 CFX_RectF m_rtClient; | 35 CFX_RectF m_rtClient; |
36 CFX_RectF m_rtImage; | 36 CFX_RectF m_rtImage; |
37 CFX_Matrix m_matrix; | 37 CFX_Matrix m_matrix; |
38 FX_BOOL m_bTop; | 38 FX_BOOL m_bTop; |
39 FX_BOOL m_bVCenter; | 39 FX_BOOL m_bVCenter; |
40 FX_BOOL m_bButton; | 40 FX_BOOL m_bButton; |
41 friend class CFWL_PictureBoxImpDelegate; | 41 friend class CFWL_PictureBoxImpDelegate; |
42 }; | 42 }; |
| 43 |
43 class CFWL_PictureBoxImpDelegate : public CFWL_WidgetImpDelegate { | 44 class CFWL_PictureBoxImpDelegate : public CFWL_WidgetImpDelegate { |
44 public: | 45 public: |
45 CFWL_PictureBoxImpDelegate(CFWL_PictureBoxImp* pOwner); | 46 CFWL_PictureBoxImpDelegate(CFWL_PictureBoxImp* pOwner); |
46 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 47 void OnDrawWidget(CFX_Graphics* pGraphics, |
47 const CFX_Matrix* pMatrix = NULL) override; | 48 const CFX_Matrix* pMatrix = NULL) override; |
48 | 49 |
49 protected: | 50 protected: |
50 CFWL_PictureBoxImp* m_pOwner; | 51 CFWL_PictureBoxImp* m_pOwner; |
51 }; | 52 }; |
52 | 53 |
53 #endif // XFA_FWL_BASEWIDGET_FWL_PICTUREBOXIMP_H_ | 54 #endif // XFA_FWL_BASEWIDGET_FWL_PICTUREBOXIMP_H_ |
OLD | NEW |