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_PUSHBUTTONIMP_H_ | |
8 #define XFA_SRC_FWL_BASEWIDGET_FWL_PUSHBUTTONIMP_H_ | |
9 | |
10 #include "xfa/src/fwl/core/fwl_widgetimp.h" | |
11 | |
12 class CFWL_WidgetImpProperties; | |
13 class IFWL_Widget; | |
14 class CFWL_PushButtonImpDelegate; | |
15 | |
16 class CFWL_PushButtonImp : public CFWL_WidgetImp { | |
17 public: | |
18 CFWL_PushButtonImp(const CFWL_WidgetImpProperties& properties, | |
19 IFWL_Widget* pOuter); | |
20 virtual ~CFWL_PushButtonImp(); | |
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 SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE); | |
27 virtual FWL_ERR Update(); | |
28 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | |
29 const CFX_Matrix* pMatrix = NULL); | |
30 | |
31 protected: | |
32 void DrawBkground(CFX_Graphics* pGraphics, | |
33 IFWL_ThemeProvider* pTheme, | |
34 const CFX_Matrix* pMatrix); | |
35 void DrawText(CFX_Graphics* pGraphics, | |
36 IFWL_ThemeProvider* pTheme, | |
37 const CFX_Matrix* pMatrix); | |
38 FX_DWORD GetPartStates(); | |
39 void UpdateTextOutStyles(); | |
40 CFX_RectF m_rtClient; | |
41 CFX_RectF m_rtCaption; | |
42 FX_BOOL m_bBtnDown; | |
43 FX_DWORD m_dwTTOStyles; | |
44 int32_t m_iTTOAlign; | |
45 friend class CFWL_PushButtonImpDelegate; | |
46 }; | |
47 class CFWL_PushButtonImpDelegate : public CFWL_WidgetImpDelegate { | |
48 public: | |
49 CFWL_PushButtonImpDelegate(CFWL_PushButtonImp* pOwner); | |
50 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | |
51 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; | |
52 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | |
53 const CFX_Matrix* pMatrix = NULL) override; | |
54 | |
55 protected: | |
56 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | |
57 void OnLButtonDown(CFWL_MsgMouse* pMsg); | |
58 void OnLButtonUp(CFWL_MsgMouse* pMsg); | |
59 void OnMouseMove(CFWL_MsgMouse* pMsg); | |
60 void OnMouseLeave(CFWL_MsgMouse* pMsg); | |
61 void OnKeyDown(CFWL_MsgKey* pMsg); | |
62 CFWL_PushButtonImp* m_pOwner; | |
63 }; | |
64 | |
65 #endif // XFA_SRC_FWL_BASEWIDGET_FWL_PUSHBUTTONIMP_H_ | |
OLD | NEW |