| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 bottom = other_bottom; | 47 bottom = other_bottom; |
| 48 } | 48 } |
| 49 | 49 |
| 50 CLST_Rect(const CPDF_Rect& rect) { | 50 CLST_Rect(const CPDF_Rect& rect) { |
| 51 left = rect.left; | 51 left = rect.left; |
| 52 top = rect.top; | 52 top = rect.top; |
| 53 right = rect.right; | 53 right = rect.right; |
| 54 bottom = rect.bottom; | 54 bottom = rect.bottom; |
| 55 } | 55 } |
| 56 | 56 |
| 57 ~CLST_Rect() {} |
| 58 |
| 57 void Default() { left = top = right = bottom = 0.0f; } | 59 void Default() { left = top = right = bottom = 0.0f; } |
| 58 | 60 |
| 59 const CLST_Rect operator=(const CPDF_Rect& rect) { | 61 const CLST_Rect operator=(const CPDF_Rect& rect) { |
| 60 left = rect.left; | 62 left = rect.left; |
| 61 top = rect.top; | 63 top = rect.top; |
| 62 right = rect.right; | 64 right = rect.right; |
| 63 bottom = rect.bottom; | 65 bottom = rect.bottom; |
| 64 | 66 |
| 65 return *this; | 67 return *this; |
| 66 } | 68 } |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 void Done(); | 280 void Done(); |
| 279 void DeselectAll(); | 281 void DeselectAll(); |
| 280 | 282 |
| 281 private: | 283 private: |
| 282 CFX_ArrayTemplate<CPLST_Select_Item*> m_aItems; | 284 CFX_ArrayTemplate<CPLST_Select_Item*> m_aItems; |
| 283 }; | 285 }; |
| 284 | 286 |
| 285 class CFX_ListCtrl : public CFX_List { | 287 class CFX_ListCtrl : public CFX_List { |
| 286 public: | 288 public: |
| 287 CFX_ListCtrl(); | 289 CFX_ListCtrl(); |
| 288 virtual ~CFX_ListCtrl(); | 290 ~CFX_ListCtrl() override; |
| 289 | 291 |
| 290 public: | 292 // CFX_List |
| 291 void SetNotify(IFX_List_Notify* pNotify); | 293 void SetNotify(IFX_List_Notify* pNotify) override; |
| 292 | 294 void OnMouseDown(const CPDF_Point& point, |
| 293 void OnMouseDown(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl); | 295 FX_BOOL bShift, |
| 294 void OnMouseMove(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl); | 296 FX_BOOL bCtrl) override; |
| 295 void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl); | 297 void OnMouseMove(const CPDF_Point& point, |
| 296 void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl); | 298 FX_BOOL bShift, |
| 297 void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl); | 299 FX_BOOL bCtrl) override; |
| 298 void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl); | 300 void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 299 void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl); | 301 void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 300 void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl); | 302 void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 301 void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl); | 303 void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 302 FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl); | 304 void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 305 void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 306 void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 307 FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 308 void SetPlateRect(const CPDF_Rect& rect) override; |
| 309 void SetScrollPos(const CPDF_Point& point) override; |
| 310 void ScrollToListItem(int32_t nItemIndex) override; |
| 311 CPDF_Rect GetItemRect(int32_t nIndex) const override; |
| 312 int32_t GetCaret() const override { return m_nCaretIndex; } |
| 313 int32_t GetSelect() const override { return m_nSelItem; } |
| 314 int32_t GetTopItem() const override; |
| 315 CPDF_Rect GetContentRect() const override; |
| 316 int32_t GetItemIndex(const CPDF_Point& point) const override; |
| 317 void AddString(const FX_WCHAR* string) override; |
| 318 void SetTopItem(int32_t nIndex) override; |
| 319 void Select(int32_t nItemIndex) override; |
| 320 void SetCaret(int32_t nItemIndex) override; |
| 321 void Empty() override; |
| 322 void Cancel() override; |
| 323 CFX_WideString GetText() const override; |
| 324 void ReArrange(int32_t nItemIndex) override; |
| 303 | 325 |
| 304 virtual CPDF_Point InToOut(const CPDF_Point& point) const; | 326 virtual CPDF_Point InToOut(const CPDF_Point& point) const; |
| 305 virtual CPDF_Point OutToIn(const CPDF_Point& point) const; | 327 virtual CPDF_Point OutToIn(const CPDF_Point& point) const; |
| 306 virtual CPDF_Rect InToOut(const CPDF_Rect& rect) const; | 328 virtual CPDF_Rect InToOut(const CPDF_Rect& rect) const; |
| 307 virtual CPDF_Rect OutToIn(const CPDF_Rect& rect) const; | 329 virtual CPDF_Rect OutToIn(const CPDF_Rect& rect) const; |
| 308 | 330 |
| 309 virtual void SetPlateRect(const CPDF_Rect& rect); | |
| 310 void SetScrollPos(const CPDF_Point& point); | |
| 311 void ScrollToListItem(int32_t nItemIndex); | |
| 312 virtual CPDF_Rect GetItemRect(int32_t nIndex) const; | |
| 313 int32_t GetCaret() const { return m_nCaretIndex; } | |
| 314 int32_t GetSelect() const { return m_nSelItem; } | |
| 315 int32_t GetTopItem() const; | |
| 316 virtual CPDF_Rect GetContentRect() const; | |
| 317 virtual int32_t GetItemIndex(const CPDF_Point& point) const; | |
| 318 | |
| 319 void AddString(const FX_WCHAR* string); | |
| 320 void SetTopItem(int32_t nIndex); | |
| 321 void Select(int32_t nItemIndex); | |
| 322 virtual void SetCaret(int32_t nItemIndex); | |
| 323 virtual void Empty(); | |
| 324 virtual void Cancel(); | |
| 325 CFX_WideString GetText() const; | |
| 326 | |
| 327 private: | 331 private: |
| 328 void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected); | 332 void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected); |
| 329 void SetSingleSelect(int32_t nItemIndex); | 333 void SetSingleSelect(int32_t nItemIndex); |
| 330 void InvalidateItem(int32_t nItemIndex); | 334 void InvalidateItem(int32_t nItemIndex); |
| 331 void SelectItems(); | 335 void SelectItems(); |
| 332 FX_BOOL IsItemVisible(int32_t nItemIndex) const; | 336 FX_BOOL IsItemVisible(int32_t nItemIndex) const; |
| 333 void SetScrollInfo(); | 337 void SetScrollInfo(); |
| 334 void SetScrollPosY(FX_FLOAT fy); | 338 void SetScrollPosY(FX_FLOAT fy); |
| 335 virtual void ReArrange(int32_t nItemIndex); | |
| 336 | 339 |
| 337 private: | 340 private: |
| 338 IFX_List_Notify* m_pNotify; | 341 IFX_List_Notify* m_pNotify; |
| 339 FX_BOOL m_bNotifyFlag; | 342 FX_BOOL m_bNotifyFlag; |
| 340 CPDF_Point m_ptScrollPos; | 343 CPDF_Point m_ptScrollPos; |
| 341 CPLST_Select m_aSelItems; // for multiple | 344 CPLST_Select m_aSelItems; // for multiple |
| 342 int32_t m_nSelItem; // for single | 345 int32_t m_nSelItem; // for single |
| 343 int32_t m_nFootIndex; // for multiple | 346 int32_t m_nFootIndex; // for multiple |
| 344 FX_BOOL m_bCtrlSel; // for multiple | 347 FX_BOOL m_bCtrlSel; // for multiple |
| 345 int32_t m_nCaretIndex; // for multiple | 348 int32_t m_nCaretIndex; // for multiple |
| 346 }; | 349 }; |
| 347 | 350 |
| 348 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ | 351 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ |
| OLD | NEW |