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_CORE_IFWL_LISTBOX_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_LISTBOX_H_ |
8 #define XFA_FWL_CORE_IFWL_LISTBOX_H_ | 8 #define XFA_FWL_CORE_IFWL_LISTBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; | 91 void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; |
92 void OnProcessMessage(CFWL_Message* pMessage) override; | 92 void OnProcessMessage(CFWL_Message* pMessage) override; |
93 void OnProcessEvent(CFWL_Event* pEvent) override; | 93 void OnProcessEvent(CFWL_Event* pEvent) override; |
94 void OnDrawWidget(CFX_Graphics* pGraphics, | 94 void OnDrawWidget(CFX_Graphics* pGraphics, |
95 const CFX_Matrix* pMatrix) override; | 95 const CFX_Matrix* pMatrix) override; |
96 | 96 |
97 int32_t CountSelItems(); | 97 int32_t CountSelItems(); |
98 CFWL_ListItem* GetSelItem(int32_t nIndexSel); | 98 CFWL_ListItem* GetSelItem(int32_t nIndexSel); |
99 int32_t GetSelIndex(int32_t nIndex); | 99 int32_t GetSelIndex(int32_t nIndex); |
100 void SetSelItem(CFWL_ListItem* hItem, bool bSelect = true); | 100 void SetSelItem(CFWL_ListItem* hItem, bool bSelect = true); |
101 void GetItemText(CFWL_ListItem* hItem, CFX_WideString& wsText); | 101 void GetDataProviderItemText(CFWL_ListItem* hItem, CFX_WideString& wsText); |
102 | 102 |
103 FX_FLOAT GetItemHeight() const { return m_fItemHeight; } | 103 FX_FLOAT GetItemHeight() const { return m_fItemHeight; } |
104 FX_FLOAT CalcItemHeight(); | 104 FX_FLOAT CalcItemHeight(); |
105 | 105 |
106 protected: | 106 protected: |
107 CFWL_ListItem* GetItem(CFWL_ListItem* hItem, uint32_t dwKeyCode); | 107 CFWL_ListItem* GetListItem(CFWL_ListItem* hItem, uint32_t dwKeyCode); |
108 void SetSelection(CFWL_ListItem* hStart, CFWL_ListItem* hEnd, bool bSelected); | 108 void SetSelection(CFWL_ListItem* hStart, CFWL_ListItem* hEnd, bool bSelected); |
109 CFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); | 109 CFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); |
110 bool ScrollToVisible(CFWL_ListItem* hItem); | 110 bool ScrollToVisible(CFWL_ListItem* hItem); |
111 void InitScrollBar(bool bVert = true); | 111 void InitScrollBar(bool bVert = true); |
112 bool IsShowScrollBar(bool bVert); | 112 bool IsShowScrollBar(bool bVert); |
113 IFWL_ScrollBar* GetVertScrollBar() const { return m_pVertScrollBar.get(); } | 113 IFWL_ScrollBar* GetVertScrollBar() const { return m_pVertScrollBar.get(); } |
114 const CFX_RectF& GetRTClient() const { return m_rtClient; } | 114 const CFX_RectF& GetRTClient() const { return m_rtClient; } |
115 | 115 |
116 private: | 116 private: |
117 void SetSelectionDirect(CFWL_ListItem* hItem, bool bSelect); | 117 void SetSelectionDirect(CFWL_ListItem* hItem, bool bSelect); |
118 bool IsItemSelected(CFWL_ListItem* hItem); | 118 bool IsItemSelected(CFWL_ListItem* hItem); |
119 void ClearSelection(); | 119 void ClearSelection(); |
120 void SelectAll(); | 120 void SelectAll(); |
121 CFWL_ListItem* GetFocusedItem(); | 121 CFWL_ListItem* GetFocusedItem(); |
122 void SetFocusItem(CFWL_ListItem* hItem); | 122 void SetFocusItem(CFWL_ListItem* hItem); |
123 bool GetItemCheckRect(CFWL_ListItem* hItem, CFX_RectF& rtCheck); | 123 bool GetItemCheckRectInternal(CFWL_ListItem* hItem, CFX_RectF& rtCheck); |
124 bool SetItemChecked(CFWL_ListItem* hItem, bool bChecked); | 124 bool SetItemChecked(CFWL_ListItem* hItem, bool bChecked); |
125 bool GetItemChecked(CFWL_ListItem* hItem); | 125 bool GetItemChecked(CFWL_ListItem* hItem); |
126 void DrawBkground(CFX_Graphics* pGraphics, | 126 void DrawBkground(CFX_Graphics* pGraphics, |
127 IFWL_ThemeProvider* pTheme, | 127 IFWL_ThemeProvider* pTheme, |
128 const CFX_Matrix* pMatrix = nullptr); | 128 const CFX_Matrix* pMatrix = nullptr); |
129 void DrawItems(CFX_Graphics* pGraphics, | 129 void DrawItems(CFX_Graphics* pGraphics, |
130 IFWL_ThemeProvider* pTheme, | 130 IFWL_ThemeProvider* pTheme, |
131 const CFX_Matrix* pMatrix = nullptr); | 131 const CFX_Matrix* pMatrix = nullptr); |
132 void DrawItem(CFX_Graphics* pGraphics, | 132 void DrawItem(CFX_Graphics* pGraphics, |
133 IFWL_ThemeProvider* pTheme, | 133 IFWL_ThemeProvider* pTheme, |
(...skipping 27 matching lines...) Expand all Loading... |
161 uint32_t m_dwTTOStyles; | 161 uint32_t m_dwTTOStyles; |
162 int32_t m_iTTOAligns; | 162 int32_t m_iTTOAligns; |
163 CFWL_ListItem* m_hAnchor; | 163 CFWL_ListItem* m_hAnchor; |
164 FX_FLOAT m_fItemHeight; | 164 FX_FLOAT m_fItemHeight; |
165 FX_FLOAT m_fScorllBarWidth; | 165 FX_FLOAT m_fScorllBarWidth; |
166 bool m_bLButtonDown; | 166 bool m_bLButtonDown; |
167 IFWL_ThemeProvider* m_pScrollBarTP; | 167 IFWL_ThemeProvider* m_pScrollBarTP; |
168 }; | 168 }; |
169 | 169 |
170 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ | 170 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ |
OLD | NEW |