[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 1 | // Copyright (c) 2011 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 | |
[email protected] | 304017d | 2011-06-17 16:49:18 | [diff] [blame] | 5 | // Multiply-included message file, hence no include guard |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 6 | |
| 7 | #include "ipc/ipc_message_macros.h" |
| 8 | #include "ui/base/range/range.h" |
| 9 | #include "ui/gfx/rect.h" |
| 10 | |
| 11 | #if defined(OS_MACOSX) |
[email protected] | 81fc9f0 | 2011-09-09 23:05:34 | [diff] [blame] | 12 | #include "content/common/mac/attributed_string_coder.h" |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 13 | #endif |
| 14 | |
| 15 | #define IPC_MESSAGE_START TextInputClientMsgStart |
| 16 | |
| 17 | // Browser -> Renderer Messages //////////////////////////////////////////////// |
| 18 | // These messages are sent from the browser to the renderer. Each one has a |
| 19 | // corresponding reply message. |
| 20 | //////////////////////////////////////////////////////////////////////////////// |
| 21 | |
| 22 | // Tells the renderer to send back the character index for a point. |
| 23 | IPC_MESSAGE_ROUTED1(TextInputClientMsg_CharacterIndexForPoint, |
| 24 | gfx::Point) |
| 25 | |
| 26 | // Tells the renderer to send back the rectangle for a given character range. |
| 27 | IPC_MESSAGE_ROUTED1(TextInputClientMsg_FirstRectForCharacterRange, |
| 28 | ui::Range) |
| 29 | |
| 30 | // Tells the renderer to send back the text fragment in a given range. |
| 31 | IPC_MESSAGE_ROUTED1(TextInputClientMsg_StringForRange, |
| 32 | ui::Range) |
| 33 | |
| 34 | //////////////////////////////////////////////////////////////////////////////// |
| 35 | |
| 36 | // Renderer -> Browser Replies ///////////////////////////////////////////////// |
| 37 | // These messages are sent in reply to the above messages. |
| 38 | //////////////////////////////////////////////////////////////////////////////// |
| 39 | |
| 40 | // Reply message for TextInputClientMsg_CharacterIndexForPoint. |
| 41 | IPC_MESSAGE_ROUTED1(TextInputClientReplyMsg_GotCharacterIndexForPoint, |
| 42 | size_t /* character index */) |
| 43 | |
| 44 | // Reply message for TextInputClientMsg_FirstRectForCharacterRange. |
| 45 | IPC_MESSAGE_ROUTED1(TextInputClientReplyMsg_GotFirstRectForRange, |
| 46 | gfx::Rect /* frame rectangle */) |
| 47 | |
| 48 | #if defined(OS_MACOSX) |
| 49 | // Reply message for TextInputClientMsg_StringForRange. |
| 50 | IPC_MESSAGE_ROUTED1(TextInputClientReplyMsg_GotStringForRange, |
| 51 | mac::AttributedStringCoder::EncodedString) |
| 52 | #endif // defined(OS_MACOSX) |
| 53 | |