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_LISTBOXIMP_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_FWL_LISTBOXIMP_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_LISTBOXIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_LISTBOXIMP_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void SelectAll(); | 59 void SelectAll(); |
60 IFWL_ListItem* GetFocusedItem(); | 60 IFWL_ListItem* GetFocusedItem(); |
61 void SetFocusItem(IFWL_ListItem* hItem); | 61 void SetFocusItem(IFWL_ListItem* hItem); |
62 IFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); | 62 IFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); |
63 FX_BOOL GetItemCheckRect(IFWL_ListItem* hItem, CFX_RectF& rtCheck); | 63 FX_BOOL GetItemCheckRect(IFWL_ListItem* hItem, CFX_RectF& rtCheck); |
64 FX_BOOL SetItemChecked(IFWL_ListItem* hItem, FX_BOOL bChecked); | 64 FX_BOOL SetItemChecked(IFWL_ListItem* hItem, FX_BOOL bChecked); |
65 FX_BOOL GetItemChecked(IFWL_ListItem* hItem); | 65 FX_BOOL GetItemChecked(IFWL_ListItem* hItem); |
66 FX_BOOL ScrollToVisible(IFWL_ListItem* hItem); | 66 FX_BOOL ScrollToVisible(IFWL_ListItem* hItem); |
67 void DrawBkground(CFX_Graphics* pGraphics, | 67 void DrawBkground(CFX_Graphics* pGraphics, |
68 IFWL_ThemeProvider* pTheme, | 68 IFWL_ThemeProvider* pTheme, |
69 const CFX_Matrix* pMatrix = NULL); | 69 const CFX_Matrix* pMatrix = nullptr); |
70 void DrawItems(CFX_Graphics* pGraphics, | 70 void DrawItems(CFX_Graphics* pGraphics, |
71 IFWL_ThemeProvider* pTheme, | 71 IFWL_ThemeProvider* pTheme, |
72 const CFX_Matrix* pMatrix = NULL); | 72 const CFX_Matrix* pMatrix = nullptr); |
73 void DrawItem(CFX_Graphics* pGraphics, | 73 void DrawItem(CFX_Graphics* pGraphics, |
74 IFWL_ThemeProvider* pTheme, | 74 IFWL_ThemeProvider* pTheme, |
75 IFWL_ListItem* hItem, | 75 IFWL_ListItem* hItem, |
76 int32_t Index, | 76 int32_t Index, |
77 const CFX_RectF& rtItem, | 77 const CFX_RectF& rtItem, |
78 const CFX_Matrix* pMatrix = NULL); | 78 const CFX_Matrix* pMatrix = nullptr); |
79 void DrawStatic(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); | 79 void DrawStatic(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); |
80 CFX_SizeF CalcSize(FX_BOOL bAutoSize = FALSE); | 80 CFX_SizeF CalcSize(FX_BOOL bAutoSize = FALSE); |
81 void GetItemSize(CFX_SizeF& size, | 81 void GetItemSize(CFX_SizeF& size, |
82 IFWL_ListItem* hItem, | 82 IFWL_ListItem* hItem, |
83 FX_FLOAT fWidth, | 83 FX_FLOAT fWidth, |
84 FX_FLOAT fHeight, | 84 FX_FLOAT fHeight, |
85 FX_BOOL bAutoSize = FALSE); | 85 FX_BOOL bAutoSize = FALSE); |
86 FX_FLOAT GetMaxTextWidth(); | 86 FX_FLOAT GetMaxTextWidth(); |
87 FX_FLOAT GetScrollWidth(); | 87 FX_FLOAT GetScrollWidth(); |
88 FX_FLOAT GetItemHeigt(); | 88 FX_FLOAT GetItemHeigt(); |
(...skipping 13 matching lines...) Expand all Loading... |
102 FX_FLOAT m_fScorllBarWidth; | 102 FX_FLOAT m_fScorllBarWidth; |
103 FX_BOOL m_bLButtonDown; | 103 FX_BOOL m_bLButtonDown; |
104 IFWL_ThemeProvider* m_pScrollBarTP; | 104 IFWL_ThemeProvider* m_pScrollBarTP; |
105 }; | 105 }; |
106 class CFWL_ListBoxImpDelegate : public CFWL_WidgetImpDelegate { | 106 class CFWL_ListBoxImpDelegate : public CFWL_WidgetImpDelegate { |
107 public: | 107 public: |
108 CFWL_ListBoxImpDelegate(CFWL_ListBoxImp* pOwner); | 108 CFWL_ListBoxImpDelegate(CFWL_ListBoxImp* pOwner); |
109 void OnProcessMessage(CFWL_Message* pMessage) override; | 109 void OnProcessMessage(CFWL_Message* pMessage) override; |
110 void OnProcessEvent(CFWL_Event* pEvent) override; | 110 void OnProcessEvent(CFWL_Event* pEvent) override; |
111 void OnDrawWidget(CFX_Graphics* pGraphics, | 111 void OnDrawWidget(CFX_Graphics* pGraphics, |
112 const CFX_Matrix* pMatrix = NULL) override; | 112 const CFX_Matrix* pMatrix = nullptr) override; |
113 | 113 |
114 protected: | 114 protected: |
115 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 115 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
116 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 116 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
117 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 117 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
118 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); | 118 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); |
119 void OnKeyDown(CFWL_MsgKey* pMsg); | 119 void OnKeyDown(CFWL_MsgKey* pMsg); |
120 void OnVK(IFWL_ListItem* hItem, FX_BOOL bShift, FX_BOOL bCtrl); | 120 void OnVK(IFWL_ListItem* hItem, FX_BOOL bShift, FX_BOOL bCtrl); |
121 FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); | 121 FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); |
122 void DispatchSelChangedEv(); | 122 void DispatchSelChangedEv(); |
123 CFWL_ListBoxImp* m_pOwner; | 123 CFWL_ListBoxImp* m_pOwner; |
124 }; | 124 }; |
125 | 125 |
126 #endif // XFA_FWL_BASEWIDGET_FWL_LISTBOXIMP_H_ | 126 #endif // XFA_FWL_BASEWIDGET_FWL_LISTBOXIMP_H_ |
OLD | NEW |