| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium 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 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ |
| 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 bool Cut(); | 170 bool Cut(); |
| 171 | 171 |
| 172 // Copies the currently selected text and puts it to clipboard. Returns true | 172 // Copies the currently selected text and puts it to clipboard. Returns true |
| 173 // if something was copied to the clipboard. | 173 // if something was copied to the clipboard. |
| 174 bool Copy(); | 174 bool Copy(); |
| 175 | 175 |
| 176 // Pastes text from the clipboard at current cursor position. Returns true | 176 // Pastes text from the clipboard at current cursor position. Returns true |
| 177 // if any text is pasted. | 177 // if any text is pasted. |
| 178 bool Paste(); | 178 bool Paste(); |
| 179 | 179 |
| 180 // Transposes the characters to either side of the insertion point and |
| 181 // advances the insertion point past both of them. Returns true if text is |
| 182 // changed. |
| 183 bool Transpose(); |
| 184 |
| 180 // Tells if any text is selected, even if the selection is in composition | 185 // Tells if any text is selected, even if the selection is in composition |
| 181 // text. | 186 // text. |
| 182 bool HasSelection() const; | 187 bool HasSelection() const; |
| 183 | 188 |
| 184 // Deletes the selected text. This method shouldn't be called with | 189 // Deletes the selected text. This method shouldn't be called with |
| 185 // composition text. | 190 // composition text. |
| 186 void DeleteSelection(); | 191 void DeleteSelection(); |
| 187 | 192 |
| 188 // Deletes the selected text (if any) and insert text at given position. | 193 // Deletes the selected text (if any) and insert text at given position. |
| 189 void DeleteSelectionAndInsertTextAt(const base::string16& new_text, | 194 void DeleteSelectionAndInsertTextAt(const base::string16& new_text, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // 2) new edit is added. (redo history is cleared) | 294 // 2) new edit is added. (redo history is cleared) |
| 290 // 3) redone all undone edits. | 295 // 3) redone all undone edits. |
| 291 EditHistory::iterator current_edit_; | 296 EditHistory::iterator current_edit_; |
| 292 | 297 |
| 293 DISALLOW_COPY_AND_ASSIGN(TextfieldModel); | 298 DISALLOW_COPY_AND_ASSIGN(TextfieldModel); |
| 294 }; | 299 }; |
| 295 | 300 |
| 296 } // namespace views | 301 } // namespace views |
| 297 | 302 |
| 298 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ | 303 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ |
| OLD | NEW |