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_PDFWINDOW_PWL_ICONLIST_H_ | 7 #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ |
8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ | 8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ |
9 | 9 |
10 #include "core/include/fxcrt/fx_string.h" | 10 #include "core/include/fxcrt/fx_string.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void SetListIcon(int32_t nItemIndex, int32_t nIconIndex); | 68 void SetListIcon(int32_t nItemIndex, int32_t nIconIndex); |
69 void SetListString(int32_t nItemIndex, const CFX_WideString& str); | 69 void SetListString(int32_t nItemIndex, const CFX_WideString& str); |
70 void SetIconFillColor(const CPWL_Color& color); | 70 void SetIconFillColor(const CPWL_Color& color); |
71 CFX_WideString GetListString(int32_t nItemIndex) const; | 71 CFX_WideString GetListString(int32_t nItemIndex) const; |
72 IPWL_IconList_Notify* GetNotify() const; | 72 IPWL_IconList_Notify* GetNotify() const; |
73 void ScrollToItem(int32_t nItemIndex); | 73 void ScrollToItem(int32_t nItemIndex); |
74 | 74 |
75 protected: | 75 protected: |
76 // CPWL_ListCtrl | 76 // CPWL_ListCtrl |
77 void CreateChildWnd(const PWL_CREATEPARAM& cp) override; | 77 void CreateChildWnd(const PWL_CREATEPARAM& cp) override; |
78 FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; | 78 FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; |
79 FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; | 79 FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; |
80 FX_BOOL OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) override; | 80 FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override; |
81 FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; | 81 FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; |
82 | 82 |
83 private: | 83 private: |
84 CPWL_IconList_Item* GetListItem(int32_t nItemIndex) const; | 84 CPWL_IconList_Item* GetListItem(int32_t nItemIndex) const; |
85 void SelectItem(int32_t nItemIndex, FX_BOOL bSelect); | 85 void SelectItem(int32_t nItemIndex, FX_BOOL bSelect); |
86 int32_t FindItemIndex(const CPDF_Point& point); | 86 int32_t FindItemIndex(const CFX_FloatPoint& point); |
87 | 87 |
88 int32_t m_nSelectIndex; | 88 int32_t m_nSelectIndex; |
89 IPWL_IconList_Notify* m_pNotify; | 89 IPWL_IconList_Notify* m_pNotify; |
90 FX_BOOL m_bEnableNotify; | 90 FX_BOOL m_bEnableNotify; |
91 FX_BOOL m_bMouseDown; | 91 FX_BOOL m_bMouseDown; |
92 int32_t m_nListCount; | 92 int32_t m_nListCount; |
93 }; | 93 }; |
94 | 94 |
95 class CPWL_IconList : public CPWL_Wnd { | 95 class CPWL_IconList : public CPWL_Wnd { |
96 public: | 96 public: |
97 CPWL_IconList(int32_t nListCount); | 97 CPWL_IconList(int32_t nListCount); |
98 ~CPWL_IconList() override; | 98 ~CPWL_IconList() override; |
99 | 99 |
100 void SetSelect(int32_t nIndex); | 100 void SetSelect(int32_t nIndex); |
101 void SetTopItem(int32_t nIndex); | 101 void SetTopItem(int32_t nIndex); |
102 int32_t GetSelect() const; | 102 int32_t GetSelect() const; |
103 void SetNotify(IPWL_IconList_Notify* pNotify); | 103 void SetNotify(IPWL_IconList_Notify* pNotify); |
104 void EnableNotify(FX_BOOL bNotify); | 104 void EnableNotify(FX_BOOL bNotify); |
105 void SetListData(int32_t nItemIndex, void* pData); | 105 void SetListData(int32_t nItemIndex, void* pData); |
106 void SetListIcon(int32_t nItemIndex, int32_t nIconIndex); | 106 void SetListIcon(int32_t nItemIndex, int32_t nIconIndex); |
107 void SetListString(int32_t nItemIndex, const CFX_WideString& str); | 107 void SetListString(int32_t nItemIndex, const CFX_WideString& str); |
108 void SetIconFillColor(const CPWL_Color& color); | 108 void SetIconFillColor(const CPWL_Color& color); |
109 CFX_WideString GetListString(int32_t nItemIndex) const; | 109 CFX_WideString GetListString(int32_t nItemIndex) const; |
110 | 110 |
111 protected: | 111 protected: |
112 // CPWL_Wnd | 112 // CPWL_Wnd |
113 FX_BOOL OnMouseWheel(short zDelta, | 113 FX_BOOL OnMouseWheel(short zDelta, |
114 const CPDF_Point& point, | 114 const CFX_FloatPoint& point, |
115 FX_DWORD nFlag) override; | 115 FX_DWORD nFlag) override; |
116 void OnCreated() override; | 116 void OnCreated() override; |
117 void RePosChildWnd() override; | 117 void RePosChildWnd() override; |
118 void CreateChildWnd(const PWL_CREATEPARAM& cp) override; | 118 void CreateChildWnd(const PWL_CREATEPARAM& cp) override; |
119 void OnNotify(CPWL_Wnd* pWnd, | 119 void OnNotify(CPWL_Wnd* pWnd, |
120 FX_DWORD msg, | 120 FX_DWORD msg, |
121 intptr_t wParam = 0, | 121 intptr_t wParam = 0, |
122 intptr_t lParam = 0) override; | 122 intptr_t lParam = 0) override; |
123 | 123 |
124 private: | 124 private: |
125 CPWL_IconList_Content* m_pListContent; | 125 CPWL_IconList_Content* m_pListContent; |
126 int32_t m_nListCount; | 126 int32_t m_nListCount; |
127 }; | 127 }; |
128 | 128 |
129 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ | 129 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ |
OLD | NEW |