| 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 CFX_FloatPoint. | 10 #include "core/include/fpdfapi/fpdf_parser.h" // For CPDF_Point. |
| 11 #include "fpdfsdk/include/fxedit/fx_edit.h" | 11 #include "fpdfsdk/include/fxedit/fx_edit.h" |
| 12 | 12 |
| 13 class IFX_Edit; | 13 class IFX_Edit; |
| 14 | 14 |
| 15 class CLST_Size { | 15 class CLST_Size { |
| 16 public: | 16 public: |
| 17 CLST_Size() : x(0.0f), y(0.0f) {} | 17 CLST_Size() : x(0.0f), y(0.0f) {} |
| 18 | 18 |
| 19 CLST_Size(FX_FLOAT other_x, FX_FLOAT other_y) { | 19 CLST_Size(FX_FLOAT other_x, FX_FLOAT other_y) { |
| 20 x = other_x; | 20 x = other_x; |
| 21 y = other_y; | 21 y = other_y; |
| 22 } | 22 } |
| 23 | 23 |
| 24 void Default() { | 24 void Default() { |
| 25 x = 0.0f; | 25 x = 0.0f; |
| 26 y = 0.0f; | 26 y = 0.0f; |
| 27 } | 27 } |
| 28 | 28 |
| 29 FX_BOOL operator!=(const CLST_Size& size) const { | 29 FX_BOOL operator!=(const CLST_Size& size) const { |
| 30 return FXSYS_memcmp(this, &size, sizeof(CLST_Size)) != 0; | 30 return FXSYS_memcmp(this, &size, sizeof(CLST_Size)) != 0; |
| 31 } | 31 } |
| 32 | 32 |
| 33 FX_FLOAT x, y; | 33 FX_FLOAT x, y; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 class CLST_Rect : public CFX_FloatRect { | 36 class CLST_Rect : public CPDF_Rect { |
| 37 public: | 37 public: |
| 38 CLST_Rect() { left = top = right = bottom = 0.0f; } | 38 CLST_Rect() { left = top = right = bottom = 0.0f; } |
| 39 | 39 |
| 40 CLST_Rect(FX_FLOAT other_left, | 40 CLST_Rect(FX_FLOAT other_left, |
| 41 FX_FLOAT other_top, | 41 FX_FLOAT other_top, |
| 42 FX_FLOAT other_right, | 42 FX_FLOAT other_right, |
| 43 FX_FLOAT other_bottom) { | 43 FX_FLOAT other_bottom) { |
| 44 left = other_left; | 44 left = other_left; |
| 45 top = other_top; | 45 top = other_top; |
| 46 right = other_right; | 46 right = other_right; |
| 47 bottom = other_bottom; | 47 bottom = other_bottom; |
| 48 } | 48 } |
| 49 | 49 |
| 50 CLST_Rect(const CFX_FloatRect& 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() {} | 57 ~CLST_Rect() {} |
| 58 | 58 |
| 59 void Default() { left = top = right = bottom = 0.0f; } | 59 void Default() { left = top = right = bottom = 0.0f; } |
| 60 | 60 |
| 61 const CLST_Rect operator=(const CFX_FloatRect& rect) { | 61 const CLST_Rect operator=(const CPDF_Rect& rect) { |
| 62 left = rect.left; | 62 left = rect.left; |
| 63 top = rect.top; | 63 top = rect.top; |
| 64 right = rect.right; | 64 right = rect.right; |
| 65 bottom = rect.bottom; | 65 bottom = rect.bottom; |
| 66 | 66 |
| 67 return *this; | 67 return *this; |
| 68 } | 68 } |
| 69 | 69 |
| 70 FX_BOOL operator==(const CLST_Rect& rect) const { | 70 FX_BOOL operator==(const CLST_Rect& rect) const { |
| 71 return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) == 0; | 71 return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) == 0; |
| 72 } | 72 } |
| 73 | 73 |
| 74 FX_BOOL operator!=(const CLST_Rect& rect) const { | 74 FX_BOOL operator!=(const CLST_Rect& rect) const { |
| 75 return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) != 0; | 75 return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) != 0; |
| 76 } | 76 } |
| 77 | 77 |
| 78 FX_FLOAT Width() const { return right - left; } | 78 FX_FLOAT Width() const { return right - left; } |
| 79 | 79 |
| 80 FX_FLOAT Height() const { | 80 FX_FLOAT Height() const { |
| 81 if (top > bottom) | 81 if (top > bottom) |
| 82 return top - bottom; | 82 return top - bottom; |
| 83 return bottom - top; | 83 return bottom - top; |
| 84 } | 84 } |
| 85 | 85 |
| 86 CFX_FloatPoint LeftTop() const { return CFX_FloatPoint(left, top); } | 86 CPDF_Point LeftTop() const { return CPDF_Point(left, top); } |
| 87 | 87 |
| 88 CFX_FloatPoint RightBottom() const { return CFX_FloatPoint(right, bottom); } | 88 CPDF_Point RightBottom() const { return CPDF_Point(right, bottom); } |
| 89 | 89 |
| 90 const CLST_Rect operator+=(const CFX_FloatPoint& point) { | 90 const CLST_Rect operator+=(const CPDF_Point& point) { |
| 91 left += point.x; | 91 left += point.x; |
| 92 right += point.x; | 92 right += point.x; |
| 93 top += point.y; | 93 top += point.y; |
| 94 bottom += point.y; | 94 bottom += point.y; |
| 95 | 95 |
| 96 return *this; | 96 return *this; |
| 97 } | 97 } |
| 98 | 98 |
| 99 const CLST_Rect operator-=(const CFX_FloatPoint& point) { | 99 const CLST_Rect operator-=(const CPDF_Point& point) { |
| 100 left -= point.x; | 100 left -= point.x; |
| 101 right -= point.x; | 101 right -= point.x; |
| 102 top -= point.y; | 102 top -= point.y; |
| 103 bottom -= point.y; | 103 bottom -= point.y; |
| 104 | 104 |
| 105 return *this; | 105 return *this; |
| 106 } | 106 } |
| 107 | 107 |
| 108 CLST_Rect operator+(const CFX_FloatPoint& point) const { | 108 CLST_Rect operator+(const CPDF_Point& point) const { |
| 109 return CLST_Rect(left + point.x, top + point.y, right + point.x, | 109 return CLST_Rect(left + point.x, top + point.y, right + point.x, |
| 110 bottom + point.y); | 110 bottom + point.y); |
| 111 } | 111 } |
| 112 | 112 |
| 113 CLST_Rect operator-(const CFX_FloatPoint& point) const { | 113 CLST_Rect operator-(const CPDF_Point& point) const { |
| 114 return CLST_Rect(left - point.x, top - point.y, right - point.x, | 114 return CLST_Rect(left - point.x, top - point.y, right - point.x, |
| 115 bottom - point.y); | 115 bottom - point.y); |
| 116 } | 116 } |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 class CFX_ListItem { | 119 class CFX_ListItem { |
| 120 public: | 120 public: |
| 121 CFX_ListItem(); | 121 CFX_ListItem(); |
| 122 virtual ~CFX_ListItem(); | 122 virtual ~CFX_ListItem(); |
| 123 | 123 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 145 FX_BOOL m_bCaret; | 145 FX_BOOL m_bCaret; |
| 146 CLST_Rect m_rcListItem; | 146 CLST_Rect m_rcListItem; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 class CFX_ListContainer { | 149 class CFX_ListContainer { |
| 150 public: | 150 public: |
| 151 CFX_ListContainer() | 151 CFX_ListContainer() |
| 152 : m_rcPlate(0.0f, 0.0f, 0.0f, 0.0f), | 152 : m_rcPlate(0.0f, 0.0f, 0.0f, 0.0f), |
| 153 m_rcContent(0.0f, 0.0f, 0.0f, 0.0f) {} | 153 m_rcContent(0.0f, 0.0f, 0.0f, 0.0f) {} |
| 154 virtual ~CFX_ListContainer() {} | 154 virtual ~CFX_ListContainer() {} |
| 155 virtual void SetPlateRect(const CFX_FloatRect& rect) { m_rcPlate = rect; } | 155 virtual void SetPlateRect(const CPDF_Rect& rect) { m_rcPlate = rect; } |
| 156 CFX_FloatRect GetPlateRect() const { return m_rcPlate; } | 156 CPDF_Rect GetPlateRect() const { return m_rcPlate; } |
| 157 void SetContentRect(const CLST_Rect& rect) { m_rcContent = rect; } | 157 void SetContentRect(const CLST_Rect& rect) { m_rcContent = rect; } |
| 158 CLST_Rect GetContentRect() const { return m_rcContent; } | 158 CLST_Rect GetContentRect() const { return m_rcContent; } |
| 159 CFX_FloatPoint GetBTPoint() const { | 159 CPDF_Point GetBTPoint() const { |
| 160 return CFX_FloatPoint(m_rcPlate.left, m_rcPlate.top); | 160 return CPDF_Point(m_rcPlate.left, m_rcPlate.top); |
| 161 } | 161 } |
| 162 CFX_FloatPoint GetETPoint() const { | 162 CPDF_Point GetETPoint() const { |
| 163 return CFX_FloatPoint(m_rcPlate.right, m_rcPlate.bottom); | 163 return CPDF_Point(m_rcPlate.right, m_rcPlate.bottom); |
| 164 } | 164 } |
| 165 | 165 |
| 166 public: | 166 public: |
| 167 CFX_FloatPoint InnerToOuter(const CFX_FloatPoint& point) const { | 167 CPDF_Point InnerToOuter(const CPDF_Point& point) const { |
| 168 return CFX_FloatPoint(point.x + GetBTPoint().x, GetBTPoint().y - point.y); | 168 return CPDF_Point(point.x + GetBTPoint().x, GetBTPoint().y - point.y); |
| 169 } | 169 } |
| 170 CFX_FloatPoint OuterToInner(const CFX_FloatPoint& point) const { | 170 CPDF_Point OuterToInner(const CPDF_Point& point) const { |
| 171 return CFX_FloatPoint(point.x - GetBTPoint().x, GetBTPoint().y - point.y); | 171 return CPDF_Point(point.x - GetBTPoint().x, GetBTPoint().y - point.y); |
| 172 } | 172 } |
| 173 CFX_FloatRect InnerToOuter(const CLST_Rect& rect) const { | 173 CPDF_Rect InnerToOuter(const CLST_Rect& rect) const { |
| 174 CFX_FloatPoint ptLeftTop = | 174 CPDF_Point ptLeftTop = InnerToOuter(CPDF_Point(rect.left, rect.top)); |
| 175 InnerToOuter(CFX_FloatPoint(rect.left, rect.top)); | 175 CPDF_Point ptRightBottom = |
| 176 CFX_FloatPoint ptRightBottom = | 176 InnerToOuter(CPDF_Point(rect.right, rect.bottom)); |
| 177 InnerToOuter(CFX_FloatPoint(rect.right, rect.bottom)); | 177 return CPDF_Rect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x, |
| 178 return CFX_FloatRect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x, | 178 ptLeftTop.y); |
| 179 ptLeftTop.y); | |
| 180 } | 179 } |
| 181 CLST_Rect OuterToInner(const CFX_FloatRect& rect) const { | 180 CLST_Rect OuterToInner(const CPDF_Rect& rect) const { |
| 182 CFX_FloatPoint ptLeftTop = | 181 CPDF_Point ptLeftTop = OuterToInner(CPDF_Point(rect.left, rect.top)); |
| 183 OuterToInner(CFX_FloatPoint(rect.left, rect.top)); | 182 CPDF_Point ptRightBottom = |
| 184 CFX_FloatPoint ptRightBottom = | 183 OuterToInner(CPDF_Point(rect.right, rect.bottom)); |
| 185 OuterToInner(CFX_FloatPoint(rect.right, rect.bottom)); | |
| 186 return CLST_Rect(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x, | 184 return CLST_Rect(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x, |
| 187 ptRightBottom.y); | 185 ptRightBottom.y); |
| 188 } | 186 } |
| 189 | 187 |
| 190 private: | 188 private: |
| 191 CFX_FloatRect m_rcPlate; | 189 CPDF_Rect m_rcPlate; |
| 192 CLST_Rect m_rcContent; // positive forever! | 190 CLST_Rect m_rcContent; // positive forever! |
| 193 }; | 191 }; |
| 194 | 192 |
| 195 template <class TYPE> | 193 template <class TYPE> |
| 196 class CLST_ArrayTemplate : public CFX_ArrayTemplate<TYPE> { | 194 class CLST_ArrayTemplate : public CFX_ArrayTemplate<TYPE> { |
| 197 public: | 195 public: |
| 198 FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; } | 196 FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; } |
| 199 TYPE GetAt(int32_t nIndex) const { | 197 TYPE GetAt(int32_t nIndex) const { |
| 200 if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) | 198 if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) |
| 201 return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); | 199 return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); |
| 202 return NULL; | 200 return NULL; |
| 203 } | 201 } |
| 204 void RemoveAt(int32_t nIndex) { | 202 void RemoveAt(int32_t nIndex) { |
| 205 if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) | 203 if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) |
| 206 CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex); | 204 CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex); |
| 207 } | 205 } |
| 208 }; | 206 }; |
| 209 | 207 |
| 210 class CFX_List : protected CFX_ListContainer, public IFX_List { | 208 class CFX_List : protected CFX_ListContainer, public IFX_List { |
| 211 public: | 209 public: |
| 212 CFX_List(); | 210 CFX_List(); |
| 213 ~CFX_List() override; | 211 ~CFX_List() override; |
| 214 | 212 |
| 215 // IFX_List: | 213 // IFX_List: |
| 216 void SetFontMap(IFX_Edit_FontMap* pFontMap) override; | 214 void SetFontMap(IFX_Edit_FontMap* pFontMap) override; |
| 217 void SetFontSize(FX_FLOAT fFontSize) override; | 215 void SetFontSize(FX_FLOAT fFontSize) override; |
| 218 CFX_FloatRect GetPlateRect() const override; | 216 CPDF_Rect GetPlateRect() const override; |
| 219 CFX_FloatRect GetContentRect() const override; | 217 CPDF_Rect GetContentRect() const override; |
| 220 FX_FLOAT GetFontSize() const override; | 218 FX_FLOAT GetFontSize() const override; |
| 221 IFX_Edit* GetItemEdit(int32_t nIndex) const override; | 219 IFX_Edit* GetItemEdit(int32_t nIndex) const override; |
| 222 int32_t GetCount() const override; | 220 int32_t GetCount() const override; |
| 223 FX_BOOL IsItemSelected(int32_t nIndex) const override; | 221 FX_BOOL IsItemSelected(int32_t nIndex) const override; |
| 224 FX_FLOAT GetFirstHeight() const override; | 222 FX_FLOAT GetFirstHeight() const override; |
| 225 void SetMultipleSel(FX_BOOL bMultiple) override; | 223 void SetMultipleSel(FX_BOOL bMultiple) override; |
| 226 FX_BOOL IsMultipleSel() const override; | 224 FX_BOOL IsMultipleSel() const override; |
| 227 FX_BOOL IsValid(int32_t nItemIndex) const override; | 225 FX_BOOL IsValid(int32_t nItemIndex) const override; |
| 228 int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const override; | 226 int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const override; |
| 229 void Empty() override; | 227 void Empty() override; |
| 230 CFX_FloatRect GetItemRect(int32_t nIndex) const override; | 228 CPDF_Rect GetItemRect(int32_t nIndex) const override; |
| 231 int32_t GetItemIndex(const CFX_FloatPoint& point) const override; | 229 int32_t GetItemIndex(const CPDF_Point& point) const override; |
| 232 int32_t GetFirstSelected() const override; | 230 int32_t GetFirstSelected() const override; |
| 233 | 231 |
| 234 protected: | 232 protected: |
| 235 void AddItem(const FX_WCHAR* str); | 233 void AddItem(const FX_WCHAR* str); |
| 236 virtual void ReArrange(int32_t nItemIndex); | 234 virtual void ReArrange(int32_t nItemIndex); |
| 237 CFX_WideString GetItemText(int32_t nIndex) const; | 235 CFX_WideString GetItemText(int32_t nIndex) const; |
| 238 void SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected); | 236 void SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected); |
| 239 void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret); | 237 void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret); |
| 240 int32_t GetLastSelected() const; | 238 int32_t GetLastSelected() const; |
| 241 FX_WCHAR Toupper(FX_WCHAR c) const; | 239 FX_WCHAR Toupper(FX_WCHAR c) const; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 CFX_ArrayTemplate<CPLST_Select_Item*> m_aItems; | 277 CFX_ArrayTemplate<CPLST_Select_Item*> m_aItems; |
| 280 }; | 278 }; |
| 281 | 279 |
| 282 class CFX_ListCtrl : public CFX_List { | 280 class CFX_ListCtrl : public CFX_List { |
| 283 public: | 281 public: |
| 284 CFX_ListCtrl(); | 282 CFX_ListCtrl(); |
| 285 ~CFX_ListCtrl() override; | 283 ~CFX_ListCtrl() override; |
| 286 | 284 |
| 287 // CFX_List | 285 // CFX_List |
| 288 void SetNotify(IFX_List_Notify* pNotify) override; | 286 void SetNotify(IFX_List_Notify* pNotify) override; |
| 289 void OnMouseDown(const CFX_FloatPoint& point, | 287 void OnMouseDown(const CPDF_Point& point, |
| 290 FX_BOOL bShift, | 288 FX_BOOL bShift, |
| 291 FX_BOOL bCtrl) override; | 289 FX_BOOL bCtrl) override; |
| 292 void OnMouseMove(const CFX_FloatPoint& point, | 290 void OnMouseMove(const CPDF_Point& point, |
| 293 FX_BOOL bShift, | 291 FX_BOOL bShift, |
| 294 FX_BOOL bCtrl) override; | 292 FX_BOOL bCtrl) override; |
| 295 void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override; | 293 void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 296 void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) override; | 294 void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 297 void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) override; | 295 void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 298 void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) override; | 296 void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 299 void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) override; | 297 void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 300 void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override; | 298 void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 301 void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) override; | 299 void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 302 FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) override; | 300 FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) override; |
| 303 void SetPlateRect(const CFX_FloatRect& rect) override; | 301 void SetPlateRect(const CPDF_Rect& rect) override; |
| 304 void SetScrollPos(const CFX_FloatPoint& point) override; | 302 void SetScrollPos(const CPDF_Point& point) override; |
| 305 void ScrollToListItem(int32_t nItemIndex) override; | 303 void ScrollToListItem(int32_t nItemIndex) override; |
| 306 CFX_FloatRect GetItemRect(int32_t nIndex) const override; | 304 CPDF_Rect GetItemRect(int32_t nIndex) const override; |
| 307 int32_t GetCaret() const override { return m_nCaretIndex; } | 305 int32_t GetCaret() const override { return m_nCaretIndex; } |
| 308 int32_t GetSelect() const override { return m_nSelItem; } | 306 int32_t GetSelect() const override { return m_nSelItem; } |
| 309 int32_t GetTopItem() const override; | 307 int32_t GetTopItem() const override; |
| 310 CFX_FloatRect GetContentRect() const override; | 308 CPDF_Rect GetContentRect() const override; |
| 311 int32_t GetItemIndex(const CFX_FloatPoint& point) const override; | 309 int32_t GetItemIndex(const CPDF_Point& point) const override; |
| 312 void AddString(const FX_WCHAR* string) override; | 310 void AddString(const FX_WCHAR* string) override; |
| 313 void SetTopItem(int32_t nIndex) override; | 311 void SetTopItem(int32_t nIndex) override; |
| 314 void Select(int32_t nItemIndex) override; | 312 void Select(int32_t nItemIndex) override; |
| 315 void SetCaret(int32_t nItemIndex) override; | 313 void SetCaret(int32_t nItemIndex) override; |
| 316 void Empty() override; | 314 void Empty() override; |
| 317 void Cancel() override; | 315 void Cancel() override; |
| 318 CFX_WideString GetText() const override; | 316 CFX_WideString GetText() const override; |
| 319 void ReArrange(int32_t nItemIndex) override; | 317 void ReArrange(int32_t nItemIndex) override; |
| 320 | 318 |
| 321 virtual CFX_FloatPoint InToOut(const CFX_FloatPoint& point) const; | 319 virtual CPDF_Point InToOut(const CPDF_Point& point) const; |
| 322 virtual CFX_FloatPoint OutToIn(const CFX_FloatPoint& point) const; | 320 virtual CPDF_Point OutToIn(const CPDF_Point& point) const; |
| 323 virtual CFX_FloatRect InToOut(const CFX_FloatRect& rect) const; | 321 virtual CPDF_Rect InToOut(const CPDF_Rect& rect) const; |
| 324 virtual CFX_FloatRect OutToIn(const CFX_FloatRect& rect) const; | 322 virtual CPDF_Rect OutToIn(const CPDF_Rect& rect) const; |
| 325 | 323 |
| 326 private: | 324 private: |
| 327 void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected); | 325 void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected); |
| 328 void SetSingleSelect(int32_t nItemIndex); | 326 void SetSingleSelect(int32_t nItemIndex); |
| 329 void InvalidateItem(int32_t nItemIndex); | 327 void InvalidateItem(int32_t nItemIndex); |
| 330 void SelectItems(); | 328 void SelectItems(); |
| 331 FX_BOOL IsItemVisible(int32_t nItemIndex) const; | 329 FX_BOOL IsItemVisible(int32_t nItemIndex) const; |
| 332 void SetScrollInfo(); | 330 void SetScrollInfo(); |
| 333 void SetScrollPosY(FX_FLOAT fy); | 331 void SetScrollPosY(FX_FLOAT fy); |
| 334 | 332 |
| 335 private: | 333 private: |
| 336 IFX_List_Notify* m_pNotify; | 334 IFX_List_Notify* m_pNotify; |
| 337 FX_BOOL m_bNotifyFlag; | 335 FX_BOOL m_bNotifyFlag; |
| 338 CFX_FloatPoint m_ptScrollPos; | 336 CPDF_Point m_ptScrollPos; |
| 339 CPLST_Select m_aSelItems; // for multiple | 337 CPLST_Select m_aSelItems; // for multiple |
| 340 int32_t m_nSelItem; // for single | 338 int32_t m_nSelItem; // for single |
| 341 int32_t m_nFootIndex; // for multiple | 339 int32_t m_nFootIndex; // for multiple |
| 342 FX_BOOL m_bCtrlSel; // for multiple | 340 FX_BOOL m_bCtrlSel; // for multiple |
| 343 int32_t m_nCaretIndex; // for multiple | 341 int32_t m_nCaretIndex; // for multiple |
| 344 }; | 342 }; |
| 345 | 343 |
| 346 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ | 344 #endif // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ |
| OLD | NEW |