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 XFA_FWL_CORE_IFWL_COMBOBOX_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_COMBOBOX_H_ |
8 #define XFA_FWL_CORE_IFWL_COMBOBOX_H_ | 8 #define XFA_FWL_CORE_IFWL_COMBOBOX_H_ |
9 | 9 |
10 #include "xfa/fwl/core/ifwl_form.h" | 10 #include "xfa/fwl/core/ifwl_form.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 }; | 78 }; |
79 | 79 |
80 class IFWL_ComboBox : public IFWL_Widget { | 80 class IFWL_ComboBox : public IFWL_Widget { |
81 public: | 81 public: |
82 explicit IFWL_ComboBox(const IFWL_App* app, | 82 explicit IFWL_ComboBox(const IFWL_App* app, |
83 std::unique_ptr<CFWL_WidgetProperties> properties); | 83 std::unique_ptr<CFWL_WidgetProperties> properties); |
84 ~IFWL_ComboBox() override; | 84 ~IFWL_ComboBox() override; |
85 | 85 |
86 // IFWL_Widget | 86 // IFWL_Widget |
87 FWL_Type GetClassID() const override; | 87 FWL_Type GetClassID() const override; |
88 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | 88 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
89 FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, | 89 void ModifyStylesEx(uint32_t dwStylesExAdded, |
90 uint32_t dwStylesExRemoved) override; | 90 uint32_t dwStylesExRemoved) override; |
91 void SetStates(uint32_t dwStates, bool bSet = true) override; | 91 void SetStates(uint32_t dwStates, bool bSet = true) override; |
92 FWL_Error Update() override; | 92 void Update() override; |
93 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 93 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
94 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 94 void DrawWidget(CFX_Graphics* pGraphics, |
95 const CFX_Matrix* pMatrix = nullptr) override; | 95 const CFX_Matrix* pMatrix = nullptr) override; |
96 FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; | 96 void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; |
97 void OnProcessMessage(CFWL_Message* pMessage) override; | 97 void OnProcessMessage(CFWL_Message* pMessage) override; |
98 void OnProcessEvent(CFWL_Event* pEvent) override; | 98 void OnProcessEvent(CFWL_Event* pEvent) override; |
99 void OnDrawWidget(CFX_Graphics* pGraphics, | 99 void OnDrawWidget(CFX_Graphics* pGraphics, |
100 const CFX_Matrix* pMatrix) override; | 100 const CFX_Matrix* pMatrix) override; |
101 | 101 |
102 int32_t GetCurSel(); | 102 int32_t GetCurSel(); |
103 FWL_Error SetCurSel(int32_t iSel); | 103 FWL_Error SetCurSel(int32_t iSel); |
104 FWL_Error SetEditText(const CFX_WideString& wsText); | 104 void SetEditText(const CFX_WideString& wsText); |
105 int32_t GetEditTextLength() const; | 105 int32_t GetEditTextLength() const; |
106 FWL_Error GetEditText(CFX_WideString& wsText, | 106 FWL_Error GetEditText(CFX_WideString& wsText, |
107 int32_t nStart = 0, | 107 int32_t nStart = 0, |
108 int32_t nCount = -1) const; | 108 int32_t nCount = -1) const; |
109 FWL_Error SetEditSelRange(int32_t nStart, int32_t nCount = -1); | 109 FWL_Error SetEditSelRange(int32_t nStart, int32_t nCount = -1); |
110 int32_t GetEditSelRange(int32_t nIndex, int32_t& nStart); | 110 int32_t GetEditSelRange(int32_t nIndex, int32_t& nStart); |
111 int32_t GetEditLimit(); | 111 int32_t GetEditLimit(); |
112 FWL_Error SetEditLimit(int32_t nLimit); | 112 FWL_Error SetEditLimit(int32_t nLimit); |
113 FWL_Error EditDoClipboard(int32_t iCmd); | 113 FWL_Error EditDoClipboard(int32_t iCmd); |
114 bool EditRedo(const IFDE_TxtEdtDoRecord* pRecord); | 114 bool EditRedo(const IFDE_TxtEdtDoRecord* pRecord); |
115 bool EditUndo(const IFDE_TxtEdtDoRecord* pRecord); | 115 bool EditUndo(const IFDE_TxtEdtDoRecord* pRecord); |
116 IFWL_ListBox* GetListBoxt(); | 116 IFWL_ListBox* GetListBoxt(); |
117 bool AfterFocusShowDropList(); | 117 bool AfterFocusShowDropList(); |
118 FWL_Error OpenDropDownList(bool bActivate); | 118 FWL_Error OpenDropDownList(bool bActivate); |
119 bool EditCanUndo(); | 119 bool EditCanUndo(); |
120 bool EditCanRedo(); | 120 bool EditCanRedo(); |
121 bool EditUndo(); | 121 bool EditUndo(); |
122 bool EditRedo(); | 122 bool EditRedo(); |
123 bool EditCanCopy(); | 123 bool EditCanCopy(); |
124 bool EditCanCut(); | 124 bool EditCanCut(); |
125 bool EditCanSelectAll(); | 125 bool EditCanSelectAll(); |
126 bool EditCopy(CFX_WideString& wsCopy); | 126 bool EditCopy(CFX_WideString& wsCopy); |
127 bool EditCut(CFX_WideString& wsCut); | 127 bool EditCut(CFX_WideString& wsCut); |
128 bool EditPaste(const CFX_WideString& wsPaste); | 128 bool EditPaste(const CFX_WideString& wsPaste); |
129 bool EditSelectAll(); | 129 bool EditSelectAll(); |
130 bool EditDelete(); | 130 bool EditDelete(); |
131 bool EditDeSelect(); | 131 bool EditDeSelect(); |
132 FWL_Error GetBBox(CFX_RectF& rect); | 132 FWL_Error GetBBox(CFX_RectF& rect); |
133 FWL_Error EditModifyStylesEx(uint32_t dwStylesExAdded, | 133 void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); |
134 uint32_t dwStylesExRemoved); | |
135 | 134 |
136 void DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); | 135 void DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); |
137 bool IsDropListShowed(); | 136 bool IsDropListShowed(); |
138 void ShowDropList(bool bActivate); | 137 void ShowDropList(bool bActivate); |
139 | 138 |
140 IFWL_ComboEdit* GetComboEdit() const { return m_pEdit.get(); } | 139 IFWL_ComboEdit* GetComboEdit() const { return m_pEdit.get(); } |
141 void ProcessSelChanged(bool bLButtonUp); | 140 void ProcessSelChanged(bool bLButtonUp); |
142 int32_t GetCurrentSelection() const { return m_iCurSel; } | 141 int32_t GetCurrentSelection() const { return m_iCurSel; } |
143 | 142 |
144 protected: | 143 protected: |
145 FX_FLOAT GetListHeight(); | 144 FX_FLOAT GetListHeight(); |
146 bool IsDropDownStyle() const; | 145 bool IsDropDownStyle() const; |
147 void MatchEditText(); | 146 void MatchEditText(); |
148 void SynchrEditText(int32_t iListItem); | 147 void SynchrEditText(int32_t iListItem); |
149 void Layout(); | 148 void Layout(); |
150 void ReSetTheme(); | 149 void ReSetTheme(); |
151 void ReSetEditAlignment(); | 150 void ReSetEditAlignment(); |
152 void ReSetListItemAlignment(); | 151 void ReSetListItemAlignment(); |
153 void InitProxyForm(); | 152 void InitProxyForm(); |
154 void DisForm_InitComboList(); | 153 void DisForm_InitComboList(); |
155 void DisForm_InitComboEdit(); | 154 void DisForm_InitComboEdit(); |
156 void DisForm_ShowDropList(bool bActivate); | 155 void DisForm_ShowDropList(bool bActivate); |
157 bool DisForm_IsDropListShowed(); | 156 bool DisForm_IsDropListShowed(); |
158 FWL_Error DisForm_ModifyStylesEx(uint32_t dwStylesExAdded, | 157 void DisForm_ModifyStylesEx(uint32_t dwStylesExAdded, |
159 uint32_t dwStylesExRemoved); | 158 uint32_t dwStylesExRemoved); |
160 FWL_Error DisForm_Update(); | 159 void DisForm_Update(); |
161 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); | 160 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); |
162 FWL_Error DisForm_DrawWidget(CFX_Graphics* pGraphics, | 161 void DisForm_DrawWidget(CFX_Graphics* pGraphics, |
163 const CFX_Matrix* pMatrix = nullptr); | 162 const CFX_Matrix* pMatrix = nullptr); |
164 FWL_Error DisForm_GetBBox(CFX_RectF& rect); | 163 FWL_Error DisForm_GetBBox(CFX_RectF& rect); |
165 void DisForm_Layout(); | 164 void DisForm_Layout(); |
166 | 165 |
167 CFX_RectF m_rtClient; | 166 CFX_RectF m_rtClient; |
168 CFX_RectF m_rtContent; | 167 CFX_RectF m_rtContent; |
169 CFX_RectF m_rtBtn; | 168 CFX_RectF m_rtBtn; |
170 CFX_RectF m_rtList; | 169 CFX_RectF m_rtList; |
171 CFX_RectF m_rtProxy; | 170 CFX_RectF m_rtProxy; |
172 CFX_RectF m_rtHandler; | 171 CFX_RectF m_rtHandler; |
173 std::unique_ptr<IFWL_ComboEdit> m_pEdit; | 172 std::unique_ptr<IFWL_ComboEdit> m_pEdit; |
(...skipping 16 matching lines...) Expand all Loading... |
190 void OnKey(CFWL_MsgKey* pMsg); | 189 void OnKey(CFWL_MsgKey* pMsg); |
191 void DoSubCtrlKey(CFWL_MsgKey* pMsg); | 190 void DoSubCtrlKey(CFWL_MsgKey* pMsg); |
192 void DisForm_OnProcessMessage(CFWL_Message* pMessage); | 191 void DisForm_OnProcessMessage(CFWL_Message* pMessage); |
193 void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg); | 192 void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg); |
194 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet = true); | 193 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet = true); |
195 void DisForm_OnKey(CFWL_MsgKey* pMsg); | 194 void DisForm_OnKey(CFWL_MsgKey* pMsg); |
196 | 195 |
197 }; | 196 }; |
198 | 197 |
199 #endif // XFA_FWL_CORE_IFWL_COMBOBOX_H_ | 198 #endif // XFA_FWL_CORE_IFWL_COMBOBOX_H_ |
OLD | NEW |