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" |
11 #include "PWL_ListCtrl.h" | 11 #include "PWL_ListCtrl.h" |
12 #include "PWL_Wnd.h" | 12 #include "PWL_Wnd.h" |
13 | 13 |
14 class IPWL_IconList_Notify; | 14 class IPWL_IconList_Notify; |
15 class CPWL_IconList_Item; | 15 class CPWL_IconList_Item; |
16 class CPWL_IconList_Content; | 16 class CPWL_IconList_Content; |
17 class CPWL_IconList; | 17 class CPWL_IconList; |
18 class CPWL_Label; | 18 class CPWL_Label; |
19 | 19 |
20 class IPWL_IconList_Notify | 20 class IPWL_IconList_Notify |
21 { | 21 { |
22 public: | 22 public: |
23 virtual ~IPWL_IconList_Notify() { } | 23 virtual ~IPWL_IconList_Notify() { } |
24 » virtual void» » » » » » OnNoteListSelCha
nged(FX_INT32 nItemIndex) = 0; | 24 » virtual void» » » » » » OnNoteListSelCha
nged(int32_t nItemIndex) = 0; |
25 }; | 25 }; |
26 | 26 |
27 class CPWL_IconList_Item : public CPWL_Wnd | 27 class CPWL_IconList_Item : public CPWL_Wnd |
28 { | 28 { |
29 public: | 29 public: |
30 CPWL_IconList_Item(); | 30 CPWL_IconList_Item(); |
31 virtual ~CPWL_IconList_Item(); | 31 virtual ~CPWL_IconList_Item(); |
32 | 32 |
33 virtual CFX_ByteString GetClassName() const; | 33 virtual CFX_ByteString GetClassName() const; |
34 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); | 34 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); |
35 virtual void RePosChildWnd(); | 35 virtual void RePosChildWnd(); |
36 | 36 |
37 void SetSelec
t(FX_BOOL bSelected); | 37 void SetSelec
t(FX_BOOL bSelected); |
38 FX_BOOL IsSelect
ed() const; | 38 FX_BOOL IsSelect
ed() const; |
39 void SetData(
void* pData); | 39 void SetData(
void* pData); |
40 » void» » » » » » » » SetIcon(
FX_INT32 nIconIndex); | 40 » void» » » » » » » » SetIcon(
int32_t nIconIndex); |
41 void SetText(
const CFX_WideString& str); | 41 void SetText(
const CFX_WideString& str); |
42 void SetIconF
illColor(const CPWL_Color& color); | 42 void SetIconF
illColor(const CPWL_Color& color); |
43 CFX_WideString GetText() const; | 43 CFX_WideString GetText() const; |
44 | 44 |
45 protected: | 45 protected: |
46 virtual FX_FLOAT GetItemHeight(FX
_FLOAT fLimitWidth); | 46 virtual FX_FLOAT GetItemHeight(FX
_FLOAT fLimitWidth); |
47 virtual void DrawThisAppearan
ce(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); | 47 virtual void DrawThisAppearan
ce(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); |
48 | 48 |
49 virtual void OnEnabled(); | 49 virtual void OnEnabled(); |
50 virtual void OnDisabled(); | 50 virtual void OnDisabled(); |
51 | 51 |
52 private: | 52 private: |
53 » FX_INT32» » » » » » » m_nIconI
ndex; | 53 » int32_t»» » » » » » m_nIconIndex; |
54 void* m_pData; | 54 void* m_pData; |
55 FX_BOOL m_bSelec
ted; | 55 FX_BOOL m_bSelec
ted; |
56 CPWL_Label* m_pText; | 56 CPWL_Label* m_pText; |
57 CPWL_Color m_crIcon
; | 57 CPWL_Color m_crIcon
; |
58 }; | 58 }; |
59 | 59 |
60 class CPWL_IconList_Content : public CPWL_ListCtrl | 60 class CPWL_IconList_Content : public CPWL_ListCtrl |
61 { | 61 { |
62 public: | 62 public: |
63 » CPWL_IconList_Content(FX_INT32 nListCount); | 63 » CPWL_IconList_Content(int32_t nListCount); |
64 virtual ~CPWL_IconList_Content(); | 64 virtual ~CPWL_IconList_Content(); |
65 | 65 |
66 » void» » » » » » » » SetSelec
t(FX_INT32 nIndex); | 66 » void» » » » » » » » SetSelec
t(int32_t nIndex); |
67 » FX_INT32» » » » » » » GetSelec
t() const; | 67 » int32_t»» » » » » » GetSelect() cons
t; |
68 void SetNotif
y(IPWL_IconList_Notify* pNotify); | 68 void SetNotif
y(IPWL_IconList_Notify* pNotify); |
69 void EnableNo
tify(FX_BOOL bNotify); | 69 void EnableNo
tify(FX_BOOL bNotify); |
70 » void» » » » » » » » SetListD
ata(FX_INT32 nItemIndex, void* pData); | 70 » void» » » » » » » » SetListD
ata(int32_t nItemIndex, void* pData); |
71 » void» » » » » » » » SetListI
con(FX_INT32 nItemIndex, FX_INT32 nIconIndex); | 71 » void» » » » » » » » SetListI
con(int32_t nItemIndex, int32_t nIconIndex); |
72 » void» » » » » » » » SetListS
tring(FX_INT32 nItemIndex, const CFX_WideString& str); | 72 » void» » » » » » » » SetListS
tring(int32_t nItemIndex, const CFX_WideString& str); |
73 void SetIconF
illColor(const CPWL_Color& color); | 73 void SetIconF
illColor(const CPWL_Color& color); |
74 » CFX_WideString» » » » » » GetListString(FX
_INT32 nItemIndex) const; | 74 » CFX_WideString» » » » » » GetListString(in
t32_t nItemIndex) const; |
75 IPWL_IconList_Notify* GetNotify() const; | 75 IPWL_IconList_Notify* GetNotify() const; |
76 » void» » » » » » » » ScrollTo
Item(FX_INT32 nItemIndex); | 76 » void» » » » » » » » ScrollTo
Item(int32_t nItemIndex); |
77 | 77 |
78 protected: | 78 protected: |
79 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); | 79 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); |
80 virtual FX_BOOL OnLButtonDown(co
nst CPDF_Point & point, FX_DWORD nFlag); | 80 virtual FX_BOOL OnLButtonDown(co
nst CPDF_Point & point, FX_DWORD nFlag); |
81 virtual FX_BOOL OnLButtonUp(cons
t CPDF_Point & point, FX_DWORD nFlag); | 81 virtual FX_BOOL OnLButtonUp(cons
t CPDF_Point & point, FX_DWORD nFlag); |
82 virtual FX_BOOL OnMouseMove(cons
t CPDF_Point & point, FX_DWORD nFlag); | 82 virtual FX_BOOL OnMouseMove(cons
t CPDF_Point & point, FX_DWORD nFlag); |
83 virtual FX_BOOL OnKeyDown(FX_WOR
D nChar, FX_DWORD nFlag); | 83 virtual FX_BOOL OnKeyDown(FX_WOR
D nChar, FX_DWORD nFlag); |
84 | 84 |
85 private: | 85 private: |
86 » CPWL_IconList_Item*» » » » » GetListItem(FX_I
NT32 nItemIndex) const; | 86 » CPWL_IconList_Item*» » » » » GetListItem(int3
2_t nItemIndex) const; |
87 » void» » » » » » » » SelectIt
em(FX_INT32 nItemIndex, FX_BOOL bSelect); | 87 » void» » » » » » » » SelectIt
em(int32_t nItemIndex, FX_BOOL bSelect); |
88 » FX_INT32» » » » » » » FindItem
Index(const CPDF_Point& point); | 88 » int32_t»» » » » » » FindItemIndex(co
nst CPDF_Point& point); |
89 | 89 |
90 FX_BOOL m_nSelec
tIndex; | 90 FX_BOOL m_nSelec
tIndex; |
91 IPWL_IconList_Notify* m_pNotify; | 91 IPWL_IconList_Notify* m_pNotify; |
92 FX_BOOL m_bEnabl
eNotify; | 92 FX_BOOL m_bEnabl
eNotify; |
93 FX_BOOL m_bMouse
Down; | 93 FX_BOOL m_bMouse
Down; |
94 » FX_INT32» » » » » » » m_nListC
ount; | 94 » int32_t»» » » » » » m_nListCount; |
95 }; | 95 }; |
96 | 96 |
97 class PWL_CLASS CPWL_IconList : public CPWL_Wnd | 97 class PWL_CLASS CPWL_IconList : public CPWL_Wnd |
98 { | 98 { |
99 public: | 99 public: |
100 » CPWL_IconList(FX_INT32 nListCount); | 100 » CPWL_IconList(int32_t nListCount); |
101 virtual ~CPWL_IconList(); | 101 virtual ~CPWL_IconList(); |
102 | 102 |
103 virtual FX_BOOL OnMouseWheel(sho
rt zDelta, const CPDF_Point & point, FX_DWORD nFlag); | 103 virtual FX_BOOL OnMouseWheel(sho
rt zDelta, const CPDF_Point & point, FX_DWORD nFlag); |
104 | 104 |
105 » void» » » » » » » » SetSelec
t(FX_INT32 nIndex); | 105 » void» » » » » » » » SetSelec
t(int32_t nIndex); |
106 » void» » » » » » » » SetTopIt
em(FX_INT32 nIndex); | 106 » void» » » » » » » » SetTopIt
em(int32_t nIndex); |
107 » FX_INT32» » » » » » » GetSelec
t() const; | 107 » int32_t»» » » » » » GetSelect() cons
t; |
108 void SetNotif
y(IPWL_IconList_Notify* pNotify); | 108 void SetNotif
y(IPWL_IconList_Notify* pNotify); |
109 void EnableNo
tify(FX_BOOL bNotify); | 109 void EnableNo
tify(FX_BOOL bNotify); |
110 » void» » » » » » » » SetListD
ata(FX_INT32 nItemIndex, void* pData); | 110 » void» » » » » » » » SetListD
ata(int32_t nItemIndex, void* pData); |
111 » void» » » » » » » » SetListI
con(FX_INT32 nItemIndex, FX_INT32 nIconIndex); | 111 » void» » » » » » » » SetListI
con(int32_t nItemIndex, int32_t nIconIndex); |
112 » void» » » » » » » » SetListS
tring(FX_INT32 nItemIndex, const CFX_WideString& str); | 112 » void» » » » » » » » SetListS
tring(int32_t nItemIndex, const CFX_WideString& str); |
113 void SetIconF
illColor(const CPWL_Color& color); | 113 void SetIconF
illColor(const CPWL_Color& color); |
114 » CFX_WideString» » » » » » GetListString(FX
_INT32 nItemIndex) const; | 114 » CFX_WideString» » » » » » GetListString(in
t32_t nItemIndex) const; |
115 | 115 |
116 protected: | 116 protected: |
117 virtual void OnCreated(); | 117 virtual void OnCreated(); |
118 virtual void RePosChildWnd(); | 118 virtual void RePosChildWnd(); |
119 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); | 119 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); |
120 | 120 |
121 » virtual void» » » » » » OnNotify(CPWL_Wn
d* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); | 121 » virtual void» » » » » » OnNotify(CPWL_Wn
d* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); |
122 | 122 |
123 private: | 123 private: |
124 CPWL_IconList_Content* m_pListContent; | 124 CPWL_IconList_Content* m_pListContent; |
125 » FX_INT32» » » » » » » m_nListC
ount; | 125 » int32_t»» » » » » » m_nListCount; |
126 }; | 126 }; |
127 | 127 |
128 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ | 128 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ |
OLD | NEW |