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_COMBOBOX_H_ | 7 #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_COMBOBOX_H_ |
8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_COMBOBOX_H_ | 8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_COMBOBOX_H_ |
9 | 9 |
10 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" | 10 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" |
11 #include "fpdfsdk/include/pdfwindow/PWL_ListBox.h" | 11 #include "fpdfsdk/include/pdfwindow/PWL_ListBox.h" |
12 #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" | 12 #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" |
13 | 13 |
14 class CPWL_CBEdit : public CPWL_Edit { | 14 class CPWL_CBEdit : public CPWL_Edit { |
15 public: | 15 public: |
16 CPWL_CBEdit() {} | 16 CPWL_CBEdit() {} |
17 ~CPWL_CBEdit() override {} | 17 ~CPWL_CBEdit() override {} |
18 }; | 18 }; |
19 | 19 |
20 class CPWL_CBListBox : public CPWL_ListBox { | 20 class CPWL_CBListBox : public CPWL_ListBox { |
21 public: | 21 public: |
22 CPWL_CBListBox() {} | 22 CPWL_CBListBox() {} |
23 ~CPWL_CBListBox() override {} | 23 ~CPWL_CBListBox() override {} |
24 | 24 |
25 // CPWL_ListBox | 25 // CPWL_ListBox |
26 FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; | 26 FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; |
27 | 27 |
28 FX_BOOL OnKeyDownWithExit(FX_WORD nChar, FX_BOOL& bExit, FX_DWORD nFlag); | 28 FX_BOOL OnKeyDownWithExit(FX_WORD nChar, FX_BOOL& bExit, FX_DWORD nFlag); |
29 FX_BOOL OnCharWithExit(FX_WORD nChar, FX_BOOL& bExit, FX_DWORD nFlag); | 29 FX_BOOL OnCharWithExit(FX_WORD nChar, FX_BOOL& bExit, FX_DWORD nFlag); |
30 }; | 30 }; |
31 | 31 |
32 #define PWL_COMBOBOX_BUTTON_WIDTH 13 | 32 #define PWL_COMBOBOX_BUTTON_WIDTH 13 |
33 | 33 |
34 class CPWL_CBButton : public CPWL_Wnd { | 34 class CPWL_CBButton : public CPWL_Wnd { |
35 public: | 35 public: |
36 CPWL_CBButton() {} | 36 CPWL_CBButton() {} |
37 ~CPWL_CBButton() override {} | 37 ~CPWL_CBButton() override {} |
38 | 38 |
39 // CPWL_Wnd | 39 // CPWL_Wnd |
40 void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; | 40 void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; |
41 void DrawThisAppearance(CFX_RenderDevice* pDevice, | 41 void DrawThisAppearance(CFX_RenderDevice* pDevice, |
42 CFX_Matrix* pUser2Device) override; | 42 CFX_Matrix* pUser2Device) override; |
43 FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; | 43 FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; |
44 FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; | 44 FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; |
45 }; | 45 }; |
46 | 46 |
47 class CPWL_ComboBox : public CPWL_Wnd { | 47 class CPWL_ComboBox : public CPWL_Wnd { |
48 public: | 48 public: |
49 CPWL_ComboBox(); | 49 CPWL_ComboBox(); |
50 ~CPWL_ComboBox() override {} | 50 ~CPWL_ComboBox() override {} |
51 | 51 |
52 CPWL_Edit* GetEdit() const { return m_pEdit; } | 52 CPWL_Edit* GetEdit() const { return m_pEdit; } |
53 | 53 |
54 // CPWL_Wnd: | 54 // CPWL_Wnd: |
55 CFX_ByteString GetClassName() const override; | 55 CFX_ByteString GetClassName() const override; |
56 void OnCreate(PWL_CREATEPARAM& cp) override; | 56 void OnCreate(PWL_CREATEPARAM& cp) override; |
57 FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; | 57 FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; |
58 FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; | 58 FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; |
59 void OnNotify(CPWL_Wnd* pWnd, | 59 void OnNotify(CPWL_Wnd* pWnd, |
60 FX_DWORD msg, | 60 FX_DWORD msg, |
61 intptr_t wParam = 0, | 61 intptr_t wParam = 0, |
62 intptr_t lParam = 0) override; | 62 intptr_t lParam = 0) override; |
63 void CreateChildWnd(const PWL_CREATEPARAM& cp) override; | 63 void CreateChildWnd(const PWL_CREATEPARAM& cp) override; |
64 void RePosChildWnd() override; | 64 void RePosChildWnd() override; |
65 CPDF_Rect GetFocusRect() const override; | 65 CFX_FloatRect GetFocusRect() const override; |
66 void SetFocus() override; | 66 void SetFocus() override; |
67 void KillFocus() override; | 67 void KillFocus() override; |
68 | 68 |
69 void SetFillerNotify(IPWL_Filler_Notify* pNotify); | 69 void SetFillerNotify(IPWL_Filler_Notify* pNotify); |
70 | 70 |
71 CFX_WideString GetText() const; | 71 CFX_WideString GetText() const; |
72 void SetText(const FX_WCHAR* text); | 72 void SetText(const FX_WCHAR* text); |
73 | 73 |
74 void AddString(const FX_WCHAR* string); | 74 void AddString(const FX_WCHAR* string); |
75 int32_t GetSelect() const; | 75 int32_t GetSelect() const; |
(...skipping 12 matching lines...) Expand all Loading... |
88 private: | 88 private: |
89 void CreateEdit(const PWL_CREATEPARAM& cp); | 89 void CreateEdit(const PWL_CREATEPARAM& cp); |
90 void CreateButton(const PWL_CREATEPARAM& cp); | 90 void CreateButton(const PWL_CREATEPARAM& cp); |
91 void CreateListBox(const PWL_CREATEPARAM& cp); | 91 void CreateListBox(const PWL_CREATEPARAM& cp); |
92 void SetPopup(FX_BOOL bPopup); | 92 void SetPopup(FX_BOOL bPopup); |
93 | 93 |
94 CPWL_CBEdit* m_pEdit; | 94 CPWL_CBEdit* m_pEdit; |
95 CPWL_CBButton* m_pButton; | 95 CPWL_CBButton* m_pButton; |
96 CPWL_CBListBox* m_pList; | 96 CPWL_CBListBox* m_pList; |
97 FX_BOOL m_bPopup; | 97 FX_BOOL m_bPopup; |
98 CPDF_Rect m_rcOldWindow; | 98 CFX_FloatRect m_rcOldWindow; |
99 int32_t m_nPopupWhere; | 99 int32_t m_nPopupWhere; |
100 int32_t m_nSelectItem; | 100 int32_t m_nSelectItem; |
101 IPWL_Filler_Notify* m_pFillerNotify; | 101 IPWL_Filler_Notify* m_pFillerNotify; |
102 | 102 |
103 void* m_pFormFiller; | 103 void* m_pFormFiller; |
104 }; | 104 }; |
105 | 105 |
106 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_COMBOBOX_H_ | 106 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_COMBOBOX_H_ |
OLD | NEW |