[email protected] | 565477e | 2012-03-16 21:31:33 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Daniel Bratell | bcbca532 | 2017-09-01 10:00:53 | [diff] [blame] | 5 | #ifndef CONTENT_COMMON_TEXT_INPUT_CLIENT_MESSAGES_H_ |
| 6 | #define CONTENT_COMMON_TEXT_INPUT_CLIENT_MESSAGES_H_ |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 7 | |
avi | a9aa7a8 | 2015-12-25 03:06:31 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | |
| 10 | #include "build/build_config.h" |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 11 | #include "ipc/ipc_message_macros.h" |
tfarina | 3b0452d | 2014-12-31 15:20:09 | [diff] [blame] | 12 | #include "ui/gfx/geometry/rect.h" |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 13 | #include "ui/gfx/range/range.h" |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 14 | |
| 15 | #if defined(OS_MACOSX) |
[email protected] | 81fc9f0 | 2011-09-09 23:05:34 | [diff] [blame] | 16 | #include "content/common/mac/attributed_string_coder.h" |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 17 | #endif |
| 18 | |
| 19 | #define IPC_MESSAGE_START TextInputClientMsgStart |
[email protected] | 565477e | 2012-03-16 21:31:33 | [diff] [blame] | 20 | #undef IPC_MESSAGE_EXPORT |
| 21 | #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 22 | |
| 23 | // Browser -> Renderer Messages //////////////////////////////////////////////// |
| 24 | // These messages are sent from the browser to the renderer. Each one has a |
| 25 | // corresponding reply message. |
| 26 | //////////////////////////////////////////////////////////////////////////////// |
| 27 | |
| 28 | // Tells the renderer to send back the character index for a point. |
| 29 | IPC_MESSAGE_ROUTED1(TextInputClientMsg_CharacterIndexForPoint, |
| 30 | gfx::Point) |
| 31 | |
| 32 | // Tells the renderer to send back the rectangle for a given character range. |
| 33 | IPC_MESSAGE_ROUTED1(TextInputClientMsg_FirstRectForCharacterRange, |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 34 | gfx::Range) |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 35 | |
| 36 | // Tells the renderer to send back the text fragment in a given range. |
| 37 | IPC_MESSAGE_ROUTED1(TextInputClientMsg_StringForRange, |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 38 | gfx::Range) |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 39 | |
[email protected] | 6623d87 | 2014-03-18 17:43:13 | [diff] [blame] | 40 | // Tells the renderer to send back the word under the given point and its |
| 41 | // baseline point. |
| 42 | IPC_MESSAGE_ROUTED1(TextInputClientMsg_StringAtPoint, gfx::Point) |
| 43 | |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 44 | //////////////////////////////////////////////////////////////////////////////// |
| 45 | |
| 46 | // Renderer -> Browser Replies ///////////////////////////////////////////////// |
| 47 | // These messages are sent in reply to the above messages. |
| 48 | //////////////////////////////////////////////////////////////////////////////// |
| 49 | |
| 50 | // Reply message for TextInputClientMsg_CharacterIndexForPoint. |
| 51 | IPC_MESSAGE_ROUTED1(TextInputClientReplyMsg_GotCharacterIndexForPoint, |
jam | 97323610 | 2016-02-09 00:47:05 | [diff] [blame] | 52 | uint32_t /* character index */) |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 53 | |
| 54 | // Reply message for TextInputClientMsg_FirstRectForCharacterRange. |
| 55 | IPC_MESSAGE_ROUTED1(TextInputClientReplyMsg_GotFirstRectForRange, |
| 56 | gfx::Rect /* frame rectangle */) |
| 57 | |
| 58 | #if defined(OS_MACOSX) |
| 59 | // Reply message for TextInputClientMsg_StringForRange. |
shuchen | 3146b3a | 2015-09-22 16:08:24 | [diff] [blame] | 60 | IPC_MESSAGE_ROUTED2(TextInputClientReplyMsg_GotStringForRange, |
| 61 | mac::AttributedStringCoder::EncodedString, |
| 62 | gfx::Point) |
[email protected] | 6623d87 | 2014-03-18 17:43:13 | [diff] [blame] | 63 | |
| 64 | // Reply message for TextInputClientMsg_StringAtPoint |
| 65 | IPC_MESSAGE_ROUTED2(TextInputClientReplyMsg_GotStringAtPoint, |
| 66 | mac::AttributedStringCoder::EncodedString, |
| 67 | gfx::Point) |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 68 | #endif // defined(OS_MACOSX) |
| 69 | |
Daniel Bratell | bcbca532 | 2017-09-01 10:00:53 | [diff] [blame] | 70 | #endif // CONTENT_COMMON_TEXT_INPUT_CLIENT_MESSAGES_H_ |