| 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_EVENTS_X_TEXT_EDIT_COMMAND_X11_H_ | 5 #ifndef UI_BASE_IME_LINUX_TEXT_EDIT_COMMAND_AURALINUX_H_ |
| 6 #define UI_EVENTS_X_TEXT_EDIT_COMMAND_X11_H_ | 6 #define UI_BASE_IME_LINUX_TEXT_EDIT_COMMAND_AURALINUX_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/events/events_export.h" | 10 #include "ui/base/ime/ui_base_ime_export.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 // Represents a command that performs a specific operation on text. | 14 // Represents a command that performs a specific operation on text. |
| 15 // Copy and assignment are explicitly allowed; these objects live in vectors. | 15 // Copy and assignment are explicitly allowed; these objects live in vectors. |
| 16 class EVENTS_EXPORT TextEditCommandAuraLinux { | 16 class UI_BASE_IME_EXPORT TextEditCommandAuraLinux { |
| 17 public: | 17 public: |
| 18 enum CommandId { | 18 enum CommandId { |
| 19 COPY, | 19 COPY, |
| 20 CUT, | 20 CUT, |
| 21 DELETE_BACKWARD, | 21 DELETE_BACKWARD, |
| 22 DELETE_FORWARD, | 22 DELETE_FORWARD, |
| 23 DELETE_TO_BEGINNING_OF_LINE, | 23 DELETE_TO_BEGINNING_OF_LINE, |
| 24 DELETE_TO_BEGINNING_OF_PARAGRAPH, | 24 DELETE_TO_BEGINNING_OF_PARAGRAPH, |
| 25 DELETE_TO_END_OF_LINE, | 25 DELETE_TO_END_OF_LINE, |
| 26 DELETE_TO_END_OF_PARAGRAPH, | 26 DELETE_TO_END_OF_PARAGRAPH, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 46 MOVE_WORD_LEFT, | 46 MOVE_WORD_LEFT, |
| 47 MOVE_WORD_RIGHT, | 47 MOVE_WORD_RIGHT, |
| 48 PASTE, | 48 PASTE, |
| 49 SELECT_ALL, | 49 SELECT_ALL, |
| 50 SET_MARK, | 50 SET_MARK, |
| 51 UNSELECT, | 51 UNSELECT, |
| 52 INVALID_COMMAND | 52 INVALID_COMMAND |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 TextEditCommandAuraLinux(CommandId command_id, | 55 TextEditCommandAuraLinux(CommandId command_id, |
| 56 const std::string& argument, | 56 const std::string& argument, |
| 57 bool extend_selection) | 57 bool extend_selection) |
| 58 : command_id_(command_id), | 58 : command_id_(command_id), |
| 59 argument_(argument), | 59 argument_(argument), |
| 60 extend_selection_(extend_selection) {} | 60 extend_selection_(extend_selection) {} |
| 61 | 61 |
| 62 CommandId command_id() const { return command_id_; } | 62 CommandId command_id() const { return command_id_; } |
| 63 const std::string& argument() const { return argument_; } | 63 const std::string& argument() const { return argument_; } |
| 64 bool extend_selection() const { return extend_selection_; } | 64 bool extend_selection() const { return extend_selection_; } |
| 65 | 65 |
| 66 // We communicate these commands back to blink with a string representation. | 66 // We communicate these commands back to blink with a string representation. |
| 67 // This will combine the base command name with "AndModifySelection" if we | 67 // This will combine the base command name with "AndModifySelection" if we |
| 68 // have |extend_selection_| set. | 68 // have |extend_selection_| set. |
| 69 std::string GetCommandString() const; | 69 std::string GetCommandString() const; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 CommandId command_id_; | 72 CommandId command_id_; |
| 73 | 73 |
| 74 std::string argument_; | 74 std::string argument_; |
| 75 | 75 |
| 76 // In addition to executing the command, modify the selection. | 76 // In addition to executing the command, modify the selection. |
| 77 bool extend_selection_; | 77 bool extend_selection_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace ui | 80 } // namespace ui |
| 81 | 81 |
| 82 #endif // UI_EVENTS_X_TEXT_EDIT_COMMAND_X11_H_ | 82 #endif // UI_BASE_IME_LINUX_TEXT_EDIT_COMMAND_AURALINUX_H_ |
| OLD | NEW |