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
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_X_TEXT_EDIT_COMMAND_X11_H_
6 #define UI_EVENTS_X_TEXT_EDIT_COMMAND_X11_H_
10 #include "ui/events/events_export.h"
14 // Represents a command that performs a specific operation on text.
15 // Copy and assignment are explicitly allowed; these objects live in vectors.
16 class EVENTS_EXPORT TextEditCommandAuraLinux
{
23 DELETE_TO_BEGINING_OF_LINE
,
24 DELETE_TO_BEGINING_OF_PARAGRAPH
,
25 DELETE_TO_END_OF_LINE
,
26 DELETE_TO_END_OF_PARAGRAPH
,
37 MOVE_TO_BEGINING_OF_DOCUMENT
,
38 MOVE_TO_BEGINING_OF_LINE
,
39 MOVE_TO_BEGINING_OF_PARAGRAPH
,
40 MOVE_TO_END_OF_DOCUMENT
,
42 MOVE_TO_END_OF_PARAGRAPH
,
55 TextEditCommandAuraLinux(CommandId command_id
,
56 const std::string
& argument
,
57 bool extend_selection
)
58 : command_id_(command_id
),
60 extend_selection_(extend_selection
) {}
62 CommandId
command_id() const { return command_id_
; }
63 const std::string
& argument() const { return argument_
; }
64 bool extend_selection() const { return extend_selection_
; }
66 // We communicate these commands back to blink with a string representation.
67 // This will combine the base command name with "AndModifySelection" if we
68 // have |extend_selection_| set.
69 std::string
GetCommandString() const;
72 CommandId command_id_
;
74 std::string argument_
;
76 // In addition to executing the command, modify the selection.
77 bool extend_selection_
;
82 #endif // UI_EVENTS_X_TEXT_EDIT_COMMAND_X11_H_