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 FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ | 7 #ifndef FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ |
8 #define FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ | 8 #define FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ |
9 | 9 |
10 #include "core/include/fpdfapi/fpdf_parser.h" // For CPDF_Point. | 10 #include "core/include/fpdfapi/fpdf_parser.h" // For CPDF_Point. |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 void RemoveAt(int32_t nIndex) { | 202 void RemoveAt(int32_t nIndex) { |
203 if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) | 203 if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) |
204 CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex); | 204 CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex); |
205 } | 205 } |
206 }; | 206 }; |
207 | 207 |
208 class CFX_List : protected CFX_ListContainer, public IFX_List { | 208 class CFX_List : protected CFX_ListContainer, public IFX_List { |
209 public: | 209 public: |
210 CFX_List(); | 210 CFX_List(); |
211 virtual ~CFX_List(); | 211 ~CFX_List() override; |
212 | 212 |
213 public: | 213 // IFX_List: |
214 virtual void SetFontMap(IFX_Edit_FontMap* pFontMap); | 214 void SetFontMap(IFX_Edit_FontMap* pFontMap) override; |
215 virtual void SetFontSize(FX_FLOAT fFontSize); | 215 void SetFontSize(FX_FLOAT fFontSize) override; |
216 | 216 CPDF_Rect GetPlateRect() const override; |
217 virtual CPDF_Rect GetPlateRect() const; | 217 CPDF_Rect GetContentRect() const override; |
218 virtual CPDF_Rect GetContentRect() const; | 218 FX_FLOAT GetFontSize() const override; |
219 | 219 IFX_Edit* GetItemEdit(int32_t nIndex) const override; |
220 virtual FX_FLOAT GetFontSize() const; | 220 int32_t GetCount() const override; |
221 virtual IFX_Edit* GetItemEdit(int32_t nIndex) const; | 221 FX_BOOL IsItemSelected(int32_t nIndex) const override; |
222 virtual int32_t GetCount() const; | 222 FX_FLOAT GetFirstHeight() const override; |
223 virtual FX_BOOL IsItemSelected(int32_t nIndex) const; | 223 void SetMultipleSel(FX_BOOL bMultiple) override; |
224 virtual FX_FLOAT GetFirstHeight() const; | 224 FX_BOOL IsMultipleSel() const override; |
225 | 225 FX_BOOL IsValid(int32_t nItemIndex) const override; |
226 virtual void SetMultipleSel(FX_BOOL bMultiple); | 226 int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const override; |
227 virtual FX_BOOL IsMultipleSel() const; | 227 void Empty() override; |
228 virtual FX_BOOL IsValid(int32_t nItemIndex) const; | 228 CPDF_Rect GetItemRect(int32_t nIndex) const override; |
229 virtual int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const; | 229 int32_t GetItemIndex(const CPDF_Point& point) const override; |
| 230 int32_t GetFirstSelected() const override; |
230 | 231 |
231 protected: | 232 protected: |
232 virtual void Empty(); | |
233 | |
234 void AddItem(const FX_WCHAR* str); | 233 void AddItem(const FX_WCHAR* str); |
235 virtual void ReArrange(int32_t nItemIndex); | 234 virtual void ReArrange(int32_t nItemIndex); |
236 | |
237 virtual CPDF_Rect GetItemRect(int32_t nIndex) const; | |
238 CFX_WideString GetItemText(int32_t nIndex) const; | 235 CFX_WideString GetItemText(int32_t nIndex) const; |
239 | |
240 void SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected); | 236 void SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected); |
241 void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret); | 237 void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret); |
242 | |
243 virtual int32_t GetItemIndex(const CPDF_Point& point) const; | |
244 int32_t GetFirstSelected() const; | |
245 int32_t GetLastSelected() const; | 238 int32_t GetLastSelected() const; |
246 FX_WCHAR Toupper(FX_WCHAR c) const; | 239 FX_WCHAR Toupper(FX_WCHAR c) const; |
247 | 240 |
248 private: | 241 private: |
249 CLST_ArrayTemplate<CFX_ListItem*> m_aListItems; | 242 CLST_ArrayTemplate<CFX_ListItem*> m_aListItems; |
250 FX_FLOAT m_fFontSize; | 243 FX_FLOAT m_fFontSize; |
251 IFX_Edit_FontMap* m_pFontMap; | 244 IFX_Edit_FontMap* m_pFontMap; |
252 FX_BOOL m_bMultiple; | 245 FX_BOOL m_bMultiple; |
253 }; | 246 }; |
254 | 247 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 FX_BOOL m_bNotifyFlag; | 335 FX_BOOL m_bNotifyFlag; |
343 CPDF_Point m_ptScrollPos; | 336 CPDF_Point m_ptScrollPos; |
344 CPLST_Select m_aSelItems; // for multiple | 337 CPLST_Select m_aSelItems; // for multiple |
345 int32_t m_nSelItem; // for single | 338 int32_t m_nSelItem; // for single |
346 int32_t m_nFootIndex; // for multiple | 339 int32_t m_nFootIndex; // for multiple |
347 FX_BOOL m_bCtrlSel; // for multiple | 340 FX_BOOL m_bCtrlSel; // for multiple |
348 int32_t m_nCaretIndex; // for multiple | 341 int32_t m_nCaretIndex; // for multiple |
349 }; | 342 }; |
350 | 343 |
351 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ | 344 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ |
OLD | NEW |