Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Side by Side Diff: ui/wm/public/text_edit_command_x11.h

Issue 213283004: linux_aura: Port GtkKeybindingsHandler to Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Abort attempts to rewrite unit tests due to linking issues. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef UI_WM_PUBLIC_TEXT_EDIT_COMMAND_X11_H_
sky 2014/03/31 20:44:05 I tend to feel these classes are not particularly
6 #define UI_WM_PUBLIC_TEXT_EDIT_COMMAND_X11_H_
7
8 #include <string>
9
10 #include "ui/wm/core/wm_core_export.h"
11
12 namespace ui {
13 namespace wm {
14
15 // Represents a command that performs a specific transformation on text.
16 class WM_CORE_EXPORT TextEditCommandX11 {
sky 2014/03/31 20:44:05 Document copy and assignment explicitly allowed.
17 public:
18 enum CommandId {
19 COPY,
20 CUT,
21 DELETE_BACKWARD,
22 DELETE_FORWARD,
23 DELETE_TO_BEGINING_OF_LINE,
24 DELETE_TO_BEGINING_OF_PARAGRAPH,
25 DELETE_TO_END_OF_LINE,
26 DELETE_TO_END_OF_PARAGRAPH,
27 DELETE_WORD_BACKWARD,
28 DELETE_WORD_FORWARD,
29 INSERT_TEXT,
30 MOVE_BACKWARD,
31 MOVE_DOWN,
32 MOVE_FORWARD,
33 MOVE_LEFT,
34 MOVE_PAGE_DOWN,
35 MOVE_PAGE_UP,
36 MOVE_RIGHT,
37 MOVE_TO_BEGINING_OF_DOCUMENT,
38 MOVE_TO_BEGINING_OF_LINE,
39 MOVE_TO_BEGINING_OF_PARAGRAPH,
40 MOVE_TO_END_OF_DOCUMENT,
41 MOVE_TO_END_OF_LINE,
42 MOVE_TO_END_OF_PARAGRAPH,
43 MOVE_UP,
44 MOVE_WORD_BACKWARD,
45 MOVE_WORD_FORWARD,
46 MOVE_WORD_LEFT,
47 MOVE_WORD_RIGHT,
48 PASTE,
49 SELECT_ALL,
50 SET_MARK,
51 UNSELECT,
52 INVALID_COMMAND,
53 };
54
55 TextEditCommandX11(CommandId command_id,
56 const std::string& argument,
57 bool extend_selection)
58 : command_id_(command_id),
59 argument_(argument),
60 extend_selection_(extend_selection) {}
61
62 CommandId command_id() const { return command_id_; }
63 std::string argument() const { return argument_; }
sky 2014/03/31 20:44:05 const std::string&
64 bool extend_selection() const { return extend_selection_; }
65
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;
70
71 private:
72 CommandId command_id_;
sky 2014/03/31 20:44:05 const (same for 74).
Elliot Glaysher 2014/03/31 21:40:09 You can't have const members for classes which can
73
74 std::string argument_;
75
76 // In addition to executing the command, modify the selection.
77 bool extend_selection_;
78 };
79
80 } // namespace wm
81 } // namespace ui
82
83 #endif // UI_WM_PUBLIC_TEXT_EDIT_COMMAND_X11_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698