| 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/fwl_sdadapterimp.h" | 10 #include "xfa/fwl/core/fwl_sdadapterimp.h" |
| 11 #include "xfa/fwl/core/ifwl_widgetdelegate.h" | 11 #include "xfa/fwl/core/ifwl_widgetdelegate.h" |
| 12 #include "xfa/fxfa/app/xfa_ffpageview.h" | 12 #include "xfa/fxfa/app/xfa_ffpageview.h" |
| 13 #include "xfa/fxfa/app/xfa_ffwidget.h" | 13 #include "xfa/fxfa/app/xfa_ffwidget.h" |
| 14 #include "xfa/include/fwl/lightwidget/widget.h" | 14 #include "xfa/include/fwl/lightwidget/widget.h" |
| 15 | 15 |
| 16 #define XFA_MINUI_HEIGHT 4.32f | 16 #define XFA_MINUI_HEIGHT 4.32f |
| 17 #define XFA_DEFAULTUI_HEIGHT 2.0f | 17 #define XFA_DEFAULTUI_HEIGHT 2.0f |
| 18 | 18 |
| 19 class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { | 19 class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { |
| 20 public: | 20 public: |
| 21 CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); | 21 CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); |
| 22 virtual ~CXFA_FFField(); | 22 virtual ~CXFA_FFField(); |
| 23 | 23 |
| 24 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, | 24 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, |
| 25 FX_DWORD dwStatus, | 25 uint32_t dwStatus, |
| 26 FX_BOOL bDrawFocus = FALSE); | 26 FX_BOOL bDrawFocus = FALSE); |
| 27 virtual void RenderWidget(CFX_Graphics* pGS, | 27 virtual void RenderWidget(CFX_Graphics* pGS, |
| 28 CFX_Matrix* pMatrix = NULL, | 28 CFX_Matrix* pMatrix = NULL, |
| 29 FX_DWORD dwStatus = 0, | 29 uint32_t dwStatus = 0, |
| 30 int32_t iRotate = 0); | 30 int32_t iRotate = 0); |
| 31 virtual FX_BOOL IsLoaded(); | 31 virtual FX_BOOL IsLoaded(); |
| 32 virtual FX_BOOL LoadWidget(); | 32 virtual FX_BOOL LoadWidget(); |
| 33 virtual void UnloadWidget(); | 33 virtual void UnloadWidget(); |
| 34 virtual FX_BOOL PerformLayout(); | 34 virtual FX_BOOL PerformLayout(); |
| 35 virtual void UpdateFWL(); | 35 virtual void UpdateFWL(); |
| 36 FX_DWORD UpdateUIProperty(); | 36 uint32_t UpdateUIProperty(); |
| 37 virtual FX_BOOL OnMouseEnter(); | 37 virtual FX_BOOL OnMouseEnter(); |
| 38 virtual FX_BOOL OnMouseExit(); | 38 virtual FX_BOOL OnMouseExit(); |
| 39 virtual FX_BOOL OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 39 virtual FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 40 virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 40 virtual FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 41 virtual FX_BOOL OnLButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 41 virtual FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 42 virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 42 virtual FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 43 virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, | 43 virtual FX_BOOL OnMouseWheel(uint32_t dwFlags, |
| 44 int16_t zDelta, | 44 int16_t zDelta, |
| 45 FX_FLOAT fx, | 45 FX_FLOAT fx, |
| 46 FX_FLOAT fy); | 46 FX_FLOAT fy); |
| 47 virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 47 virtual FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 48 virtual FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 48 virtual FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 49 virtual FX_BOOL OnRButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 49 virtual FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 50 | 50 |
| 51 virtual FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget); | 51 virtual FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget); |
| 52 virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget); | 52 virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget); |
| 53 virtual FX_BOOL OnKeyDown(FX_DWORD dwKeyCode, FX_DWORD dwFlags); | 53 virtual FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags); |
| 54 virtual FX_BOOL OnKeyUp(FX_DWORD dwKeyCode, FX_DWORD dwFlags); | 54 virtual FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags); |
| 55 virtual FX_BOOL OnChar(FX_DWORD dwChar, FX_DWORD dwFlags); | 55 virtual FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags); |
| 56 virtual FX_DWORD OnHitTest(FX_FLOAT fx, FX_FLOAT fy); | 56 virtual uint32_t OnHitTest(FX_FLOAT fx, FX_FLOAT fy); |
| 57 virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy); | 57 virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy); |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); | 60 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); |
| 61 virtual void SetFWLRect(); | 61 virtual void SetFWLRect(); |
| 62 void SetFWLThemeProvider(); | 62 void SetFWLThemeProvider(); |
| 63 CFWL_Widget* GetNormalWidget() { return m_pNormalWidget; } | 63 CFWL_Widget* GetNormalWidget() { return m_pNormalWidget; } |
| 64 void FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy); | 64 void FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy); |
| 65 void LayoutCaption(); | 65 void LayoutCaption(); |
| 66 void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL); | 66 void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL); |
| 67 | 67 |
| 68 int32_t CalculateOverride(); | 68 int32_t CalculateOverride(); |
| 69 int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); | 69 int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); |
| 70 FX_BOOL ProcessCommittedData(); | 70 FX_BOOL ProcessCommittedData(); |
| 71 virtual FX_BOOL CommitData(); | 71 virtual FX_BOOL CommitData(); |
| 72 virtual FX_BOOL IsDataChanged(); | 72 virtual FX_BOOL IsDataChanged(); |
| 73 void DrawHighlight(CFX_Graphics* pGS, | 73 void DrawHighlight(CFX_Graphics* pGS, |
| 74 CFX_Matrix* pMatrix, | 74 CFX_Matrix* pMatrix, |
| 75 FX_DWORD dwStatus, | 75 uint32_t dwStatus, |
| 76 FX_BOOL bEllipse = FALSE); | 76 FX_BOOL bEllipse = FALSE); |
| 77 void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); | 77 void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); |
| 78 void TranslateFWLMessage(CFWL_Message* pMessage); | 78 void TranslateFWLMessage(CFWL_Message* pMessage); |
| 79 void CapPlacement(); | 79 void CapPlacement(); |
| 80 void CapTopBottomPlacement(CXFA_Caption caption, | 80 void CapTopBottomPlacement(CXFA_Caption caption, |
| 81 const CFX_RectF& rtWidget, | 81 const CFX_RectF& rtWidget, |
| 82 int32_t iCapPlacement); | 82 int32_t iCapPlacement); |
| 83 void CapLeftRightPlacement(CXFA_Caption caption, | 83 void CapLeftRightPlacement(CXFA_Caption caption, |
| 84 const CFX_RectF& rtWidget, | 84 const CFX_RectF& rtWidget, |
| 85 int32_t iCapPlacement); | 85 int32_t iCapPlacement); |
| 86 void SetEditScrollOffset(); | 86 void SetEditScrollOffset(); |
| 87 | 87 |
| 88 public: | 88 public: |
| 89 virtual int32_t OnProcessMessage(CFWL_Message* pMessage); | 89 virtual int32_t OnProcessMessage(CFWL_Message* pMessage); |
| 90 virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); | 90 virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); |
| 91 virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 91 virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, |
| 92 const CFX_Matrix* pMatrix = NULL); | 92 const CFX_Matrix* pMatrix = NULL); |
| 93 | 93 |
| 94 protected: | 94 protected: |
| 95 CFWL_Widget* m_pNormalWidget; | 95 CFWL_Widget* m_pNormalWidget; |
| 96 CFX_RectF m_rtUI; | 96 CFX_RectF m_rtUI; |
| 97 CFX_RectF m_rtCaption; | 97 CFX_RectF m_rtCaption; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 #endif // XFA_FXFA_APP_XFA_FFFIELD_H_ | 100 #endif // XFA_FXFA_APP_XFA_FFFIELD_H_ |
| OLD | NEW |