| 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_FXFA_APP_XFA_FFFIELD_H_ | 7 #ifndef XFA_FXFA_APP_XFA_FFFIELD_H_ |
| 8 #define XFA_FXFA_APP_XFA_FFFIELD_H_ | 8 #define XFA_FXFA_APP_XFA_FFFIELD_H_ |
| 9 | 9 |
| 10 #include "xfa/fwl/core/ifwl_widgetdelegate.h" | 10 #include "xfa/fwl/core/ifwl_widgetdelegate.h" |
| 11 #include "xfa/fwl/lightwidget/cfwl_widget.h" | 11 #include "xfa/fwl/lightwidget/cfwl_widget.h" |
| 12 #include "xfa/fxfa/include/xfa_ffpageview.h" | 12 #include "xfa/fxfa/include/xfa_ffpageview.h" |
| 13 #include "xfa/fxfa/include/xfa_ffwidget.h" | 13 #include "xfa/fxfa/include/xfa_ffwidget.h" |
| 14 | 14 |
| 15 #define XFA_MINUI_HEIGHT 4.32f | 15 #define XFA_MINUI_HEIGHT 4.32f |
| 16 #define XFA_DEFAULTUI_HEIGHT 2.0f | 16 #define XFA_DEFAULTUI_HEIGHT 2.0f |
| 17 | 17 |
| 18 class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { | 18 class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { |
| 19 public: | 19 public: |
| 20 CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); | 20 CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); |
| 21 virtual ~CXFA_FFField(); | 21 virtual ~CXFA_FFField(); |
| 22 | 22 |
| 23 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, | 23 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, |
| 24 uint32_t dwStatus, | 24 uint32_t dwStatus, |
| 25 FX_BOOL bDrawFocus = FALSE); | 25 FX_BOOL bDrawFocus = FALSE); |
| 26 virtual void RenderWidget(CFX_Graphics* pGS, | 26 virtual void RenderWidget(CFX_Graphics* pGS, |
| 27 CFX_Matrix* pMatrix = NULL, | 27 CFX_Matrix* pMatrix = nullptr, |
| 28 uint32_t dwStatus = 0, | 28 uint32_t dwStatus = 0, |
| 29 int32_t iRotate = 0); | 29 int32_t iRotate = 0); |
| 30 virtual FX_BOOL IsLoaded(); | 30 virtual FX_BOOL IsLoaded(); |
| 31 virtual FX_BOOL LoadWidget(); | 31 virtual FX_BOOL LoadWidget(); |
| 32 virtual void UnloadWidget(); | 32 virtual void UnloadWidget(); |
| 33 virtual FX_BOOL PerformLayout(); | 33 virtual FX_BOOL PerformLayout(); |
| 34 virtual void UpdateFWL(); | 34 virtual void UpdateFWL(); |
| 35 uint32_t UpdateUIProperty(); | 35 uint32_t UpdateUIProperty(); |
| 36 virtual FX_BOOL OnMouseEnter(); | 36 virtual FX_BOOL OnMouseEnter(); |
| 37 virtual FX_BOOL OnMouseExit(); | 37 virtual FX_BOOL OnMouseExit(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 55 virtual FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy); | 55 virtual FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy); |
| 56 virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy); | 56 virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy); |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); | 59 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); |
| 60 virtual void SetFWLRect(); | 60 virtual void SetFWLRect(); |
| 61 void SetFWLThemeProvider(); | 61 void SetFWLThemeProvider(); |
| 62 CFWL_Widget* GetNormalWidget() { return m_pNormalWidget; } | 62 CFWL_Widget* GetNormalWidget() { return m_pNormalWidget; } |
| 63 void FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy); | 63 void FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy); |
| 64 void LayoutCaption(); | 64 void LayoutCaption(); |
| 65 void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL); | 65 void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = nullptr); |
| 66 | 66 |
| 67 int32_t CalculateOverride(); | 67 int32_t CalculateOverride(); |
| 68 int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); | 68 int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); |
| 69 FX_BOOL ProcessCommittedData(); | 69 FX_BOOL ProcessCommittedData(); |
| 70 virtual FX_BOOL CommitData(); | 70 virtual FX_BOOL CommitData(); |
| 71 virtual FX_BOOL IsDataChanged(); | 71 virtual FX_BOOL IsDataChanged(); |
| 72 void DrawHighlight(CFX_Graphics* pGS, | 72 void DrawHighlight(CFX_Graphics* pGS, |
| 73 CFX_Matrix* pMatrix, | 73 CFX_Matrix* pMatrix, |
| 74 uint32_t dwStatus, | 74 uint32_t dwStatus, |
| 75 FX_BOOL bEllipse = FALSE); | 75 FX_BOOL bEllipse = FALSE); |
| 76 void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); | 76 void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); |
| 77 void TranslateFWLMessage(CFWL_Message* pMessage); | 77 void TranslateFWLMessage(CFWL_Message* pMessage); |
| 78 void CapPlacement(); | 78 void CapPlacement(); |
| 79 void CapTopBottomPlacement(CXFA_Caption caption, | 79 void CapTopBottomPlacement(CXFA_Caption caption, |
| 80 const CFX_RectF& rtWidget, | 80 const CFX_RectF& rtWidget, |
| 81 int32_t iCapPlacement); | 81 int32_t iCapPlacement); |
| 82 void CapLeftRightPlacement(CXFA_Caption caption, | 82 void CapLeftRightPlacement(CXFA_Caption caption, |
| 83 const CFX_RectF& rtWidget, | 83 const CFX_RectF& rtWidget, |
| 84 int32_t iCapPlacement); | 84 int32_t iCapPlacement); |
| 85 void SetEditScrollOffset(); | 85 void SetEditScrollOffset(); |
| 86 | 86 |
| 87 public: | 87 public: |
| 88 virtual void OnProcessMessage(CFWL_Message* pMessage); | 88 virtual void OnProcessMessage(CFWL_Message* pMessage); |
| 89 virtual void OnProcessEvent(CFWL_Event* pEvent); | 89 virtual void OnProcessEvent(CFWL_Event* pEvent); |
| 90 virtual void OnDrawWidget(CFX_Graphics* pGraphics, | 90 virtual void OnDrawWidget(CFX_Graphics* pGraphics, |
| 91 const CFX_Matrix* pMatrix = NULL); | 91 const CFX_Matrix* pMatrix = nullptr); |
| 92 | 92 |
| 93 protected: | 93 protected: |
| 94 CFWL_Widget* m_pNormalWidget; | 94 CFWL_Widget* m_pNormalWidget; |
| 95 CFX_RectF m_rtUI; | 95 CFX_RectF m_rtUI; |
| 96 CFX_RectF m_rtCaption; | 96 CFX_RectF m_rtCaption; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 #endif // XFA_FXFA_APP_XFA_FFFIELD_H_ | 99 #endif // XFA_FXFA_APP_XFA_FFFIELD_H_ |
| OLD | NEW |