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