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_CFWL_COMBOBOX_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
8 #define XFA_FWL_CORE_CFWL_COMBOBOX_H_ | 8 #define XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 void RemoveStates(uint32_t dwStates) override; | 61 void RemoveStates(uint32_t dwStates) override; |
62 void Update() override; | 62 void Update() override; |
63 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 63 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
64 void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; | 64 void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; |
65 void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; | 65 void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; |
66 void OnProcessMessage(CFWL_Message* pMessage) override; | 66 void OnProcessMessage(CFWL_Message* pMessage) override; |
67 void OnProcessEvent(CFWL_Event* pEvent) override; | 67 void OnProcessEvent(CFWL_Event* pEvent) override; |
68 void OnDrawWidget(CFX_Graphics* pGraphics, | 68 void OnDrawWidget(CFX_Graphics* pGraphics, |
69 const CFX_Matrix* pMatrix) override; | 69 const CFX_Matrix* pMatrix) override; |
70 | 70 |
71 void GetTextByIndex(int32_t iIndex, CFX_WideString& wsText) const; | 71 CFX_WideString GetTextByIndex(int32_t iIndex) const; |
72 int32_t GetCurSel() const { return m_iCurSel; } | 72 int32_t GetCurSel() const { return m_iCurSel; } |
73 void SetCurSel(int32_t iSel); | 73 void SetCurSel(int32_t iSel); |
74 | 74 |
75 void AddString(const CFX_WideStringC& wsText); | 75 void AddString(const CFX_WideStringC& wsText); |
76 bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range. | 76 bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range. |
77 void RemoveAll(); | 77 void RemoveAll(); |
78 | 78 |
79 void SetEditText(const CFX_WideString& wsText); | 79 void SetEditText(const CFX_WideString& wsText); |
80 CFX_WideString GetEditText() const; | 80 CFX_WideString GetEditText() const; |
81 | 81 |
(...skipping 12 matching lines...) Expand all Loading... |
94 bool EditCanSelectAll() const { return m_pEdit->GetTextLength() > 0; } | 94 bool EditCanSelectAll() const { return m_pEdit->GetTextLength() > 0; } |
95 bool EditCopy(CFX_WideString& wsCopy) const { return m_pEdit->Copy(wsCopy); } | 95 bool EditCopy(CFX_WideString& wsCopy) const { return m_pEdit->Copy(wsCopy); } |
96 bool EditCut(CFX_WideString& wsCut) { return m_pEdit->Cut(wsCut); } | 96 bool EditCut(CFX_WideString& wsCut) { return m_pEdit->Cut(wsCut); } |
97 bool EditPaste(const CFX_WideString& wsPaste) { | 97 bool EditPaste(const CFX_WideString& wsPaste) { |
98 return m_pEdit->Paste(wsPaste); | 98 return m_pEdit->Paste(wsPaste); |
99 } | 99 } |
100 void EditSelectAll() { m_pEdit->AddSelRange(0); } | 100 void EditSelectAll() { m_pEdit->AddSelRange(0); } |
101 void EditDelete() { m_pEdit->ClearText(); } | 101 void EditDelete() { m_pEdit->ClearText(); } |
102 void EditDeSelect() { m_pEdit->ClearSelections(); } | 102 void EditDeSelect() { m_pEdit->ClearSelections(); } |
103 | 103 |
104 void GetBBox(CFX_RectF& rect) const; | 104 CFX_RectF GetBBox() const; |
105 void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); | 105 void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); |
106 | 106 |
107 void DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); | 107 void DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); |
108 bool IsDropListVisible() const { | 108 bool IsDropListVisible() const { |
109 return m_pComboBoxProxy && | 109 return m_pComboBoxProxy && |
110 !(m_pComboBoxProxy->GetStates() & FWL_WGTSTATE_Invisible); | 110 !(m_pComboBoxProxy->GetStates() & FWL_WGTSTATE_Invisible); |
111 } | 111 } |
112 void ShowDropList(bool bActivate); | 112 void ShowDropList(bool bActivate); |
113 | 113 |
114 CFWL_ComboEdit* GetComboEdit() const { return m_pEdit.get(); } | 114 CFWL_ComboEdit* GetComboEdit() const { return m_pEdit.get(); } |
(...skipping 24 matching lines...) Expand all Loading... |
139 void DisForm_InitComboEdit(); | 139 void DisForm_InitComboEdit(); |
140 void DisForm_ShowDropList(bool bActivate); | 140 void DisForm_ShowDropList(bool bActivate); |
141 bool DisForm_IsDropListVisible() const { | 141 bool DisForm_IsDropListVisible() const { |
142 return !(m_pListBox->GetStates() & FWL_WGTSTATE_Invisible); | 142 return !(m_pListBox->GetStates() & FWL_WGTSTATE_Invisible); |
143 } | 143 } |
144 void DisForm_ModifyStylesEx(uint32_t dwStylesExAdded, | 144 void DisForm_ModifyStylesEx(uint32_t dwStylesExAdded, |
145 uint32_t dwStylesExRemoved); | 145 uint32_t dwStylesExRemoved); |
146 void DisForm_Update(); | 146 void DisForm_Update(); |
147 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); | 147 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); |
148 void DisForm_DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); | 148 void DisForm_DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); |
149 void DisForm_GetBBox(CFX_RectF& rect) const; | 149 CFX_RectF DisForm_GetBBox() const; |
150 void DisForm_Layout(); | 150 void DisForm_Layout(); |
151 void DisForm_OnProcessMessage(CFWL_Message* pMessage); | 151 void DisForm_OnProcessMessage(CFWL_Message* pMessage); |
152 void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg); | 152 void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg); |
153 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); | 153 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
154 void DisForm_OnKey(CFWL_MsgKey* pMsg); | 154 void DisForm_OnKey(CFWL_MsgKey* pMsg); |
155 | 155 |
156 CFX_RectF m_rtClient; | 156 CFX_RectF m_rtClient; |
157 CFX_RectF m_rtContent; | 157 CFX_RectF m_rtContent; |
158 CFX_RectF m_rtBtn; | 158 CFX_RectF m_rtBtn; |
159 CFX_RectF m_rtList; | 159 CFX_RectF m_rtList; |
160 CFX_RectF m_rtProxy; | 160 CFX_RectF m_rtProxy; |
161 CFX_RectF m_rtHandler; | 161 CFX_RectF m_rtHandler; |
162 std::unique_ptr<CFWL_ComboEdit> m_pEdit; | 162 std::unique_ptr<CFWL_ComboEdit> m_pEdit; |
163 std::unique_ptr<CFWL_ComboList> m_pListBox; | 163 std::unique_ptr<CFWL_ComboList> m_pListBox; |
164 CFWL_ComboBoxProxy* m_pComboBoxProxy; // Can this be a unique_ptr? | 164 CFWL_ComboBoxProxy* m_pComboBoxProxy; // Can this be a unique_ptr? |
165 bool m_bLButtonDown; | 165 bool m_bLButtonDown; |
166 bool m_bUpFormHandler; | 166 bool m_bUpFormHandler; |
167 int32_t m_iCurSel; | 167 int32_t m_iCurSel; |
168 int32_t m_iBtnState; | 168 int32_t m_iBtnState; |
169 FX_FLOAT m_fComboFormHandler; | 169 FX_FLOAT m_fComboFormHandler; |
170 FX_FLOAT m_fItemHeight; | 170 FX_FLOAT m_fItemHeight; |
171 }; | 171 }; |
172 | 172 |
173 #endif // XFA_FWL_CORE_CFWL_COMBOBOX_H_ | 173 #endif // XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
OLD | NEW |