| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
| 6 | |
| 7 #ifndef XFA_SRC_FWL_BASEWIDGET_FWL_CHECKBOXIMP_H_ | |
| 8 #define XFA_SRC_FWL_BASEWIDGET_FWL_CHECKBOXIMP_H_ | |
| 9 | |
| 10 #include "xfa/src/fwl/core/fwl_widgetimp.h" | |
| 11 | |
| 12 class CFWL_WidgetImpProperties; | |
| 13 class IFWL_Widget; | |
| 14 class CFWL_CheckBoxImpDelegate; | |
| 15 | |
| 16 class CFWL_CheckBoxImp : public CFWL_WidgetImp { | |
| 17 public: | |
| 18 CFWL_CheckBoxImp(const CFWL_WidgetImpProperties& properties, | |
| 19 IFWL_Widget* pOuter); | |
| 20 ~CFWL_CheckBoxImp(); | |
| 21 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const; | |
| 22 virtual FX_DWORD GetClassID() const; | |
| 23 virtual FWL_ERR Initialize(); | |
| 24 virtual FWL_ERR Finalize(); | |
| 25 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | |
| 26 virtual FWL_ERR Update(); | |
| 27 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | |
| 28 const CFX_Matrix* pMatrix = NULL); | |
| 29 virtual int32_t GetCheckState(); | |
| 30 virtual FWL_ERR SetCheckState(int32_t iCheck); | |
| 31 | |
| 32 protected: | |
| 33 void Layout(); | |
| 34 FX_DWORD GetPartStates(); | |
| 35 void UpdateTextOutStyles(); | |
| 36 void NextStates(); | |
| 37 CFX_RectF m_rtClient; | |
| 38 CFX_RectF m_rtBox; | |
| 39 CFX_RectF m_rtCaption; | |
| 40 CFX_RectF m_rtFocus; | |
| 41 FX_DWORD m_dwTTOStyles; | |
| 42 int32_t m_iTTOAlign; | |
| 43 FX_BOOL m_bBtnDown; | |
| 44 friend class CFWL_CheckBoxImpDelegate; | |
| 45 }; | |
| 46 class CFWL_CheckBoxImpDelegate : public CFWL_WidgetImpDelegate { | |
| 47 public: | |
| 48 CFWL_CheckBoxImpDelegate(CFWL_CheckBoxImp* pOwner); | |
| 49 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | |
| 50 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | |
| 51 const CFX_Matrix* pMatrix = NULL) override; | |
| 52 | |
| 53 protected: | |
| 54 void OnActivate(CFWL_Message* pMsg); | |
| 55 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | |
| 56 void OnLButtonDown(CFWL_MsgMouse* pMsg); | |
| 57 void OnLButtonUp(CFWL_MsgMouse* pMsg); | |
| 58 void OnMouseMove(CFWL_MsgMouse* pMsg); | |
| 59 void OnMouseLeave(CFWL_MsgMouse* pMsg); | |
| 60 void OnKeyDown(CFWL_MsgKey* pMsg); | |
| 61 CFWL_CheckBoxImp* m_pOwner; | |
| 62 }; | |
| 63 | |
| 64 #endif // XFA_SRC_FWL_BASEWIDGET_FWL_CHECKBOXIMP_H_ | |
| OLD | NEW |