blob: c8c8c8e8bb0b52299df46b317c6ac9eea18f717b [file] [log] [blame]
[email protected]565477e2012-03-16 21:31:331// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]d4cff272011-05-02 15:46:012// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Daniel Bratellbcbca5322017-09-01 10:00:535#ifndef CONTENT_COMMON_TEXT_INPUT_CLIENT_MESSAGES_H_
6#define CONTENT_COMMON_TEXT_INPUT_CLIENT_MESSAGES_H_
[email protected]d4cff272011-05-02 15:46:017
avia9aa7a82015-12-25 03:06:318#include <stddef.h>
9
10#include "build/build_config.h"
[email protected]d4cff272011-05-02 15:46:0111#include "ipc/ipc_message_macros.h"
tfarina3b0452d2014-12-31 15:20:0912#include "ui/gfx/geometry/rect.h"
[email protected]db4fc1e2013-09-06 20:01:5113#include "ui/gfx/range/range.h"
[email protected]d4cff272011-05-02 15:46:0114
15#if defined(OS_MACOSX)
[email protected]81fc9f02011-09-09 23:05:3416#include "content/common/mac/attributed_string_coder.h"
[email protected]d4cff272011-05-02 15:46:0117#endif
18
19#define IPC_MESSAGE_START TextInputClientMsgStart
[email protected]565477e2012-03-16 21:31:3320#undef IPC_MESSAGE_EXPORT
21#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
[email protected]d4cff272011-05-02 15:46:0122
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.
29IPC_MESSAGE_ROUTED1(TextInputClientMsg_CharacterIndexForPoint,
30 gfx::Point)
31
32// Tells the renderer to send back the rectangle for a given character range.
33IPC_MESSAGE_ROUTED1(TextInputClientMsg_FirstRectForCharacterRange,
[email protected]db4fc1e2013-09-06 20:01:5134 gfx::Range)
[email protected]d4cff272011-05-02 15:46:0135
36// Tells the renderer to send back the text fragment in a given range.
37IPC_MESSAGE_ROUTED1(TextInputClientMsg_StringForRange,
[email protected]db4fc1e2013-09-06 20:01:5138 gfx::Range)
[email protected]d4cff272011-05-02 15:46:0139
[email protected]6623d872014-03-18 17:43:1340// Tells the renderer to send back the word under the given point and its
41// baseline point.
42IPC_MESSAGE_ROUTED1(TextInputClientMsg_StringAtPoint, gfx::Point)
43
[email protected]d4cff272011-05-02 15:46:0144////////////////////////////////////////////////////////////////////////////////
45
46// Renderer -> Browser Replies /////////////////////////////////////////////////
47// These messages are sent in reply to the above messages.
48////////////////////////////////////////////////////////////////////////////////
49
50// Reply message for TextInputClientMsg_CharacterIndexForPoint.
51IPC_MESSAGE_ROUTED1(TextInputClientReplyMsg_GotCharacterIndexForPoint,
jam973236102016-02-09 00:47:0552 uint32_t /* character index */)
[email protected]d4cff272011-05-02 15:46:0153
54// Reply message for TextInputClientMsg_FirstRectForCharacterRange.
55IPC_MESSAGE_ROUTED1(TextInputClientReplyMsg_GotFirstRectForRange,
56 gfx::Rect /* frame rectangle */)
57
58#if defined(OS_MACOSX)
59// Reply message for TextInputClientMsg_StringForRange.
shuchen3146b3a2015-09-22 16:08:2460IPC_MESSAGE_ROUTED2(TextInputClientReplyMsg_GotStringForRange,
61 mac::AttributedStringCoder::EncodedString,
62 gfx::Point)
[email protected]6623d872014-03-18 17:43:1363
64// Reply message for TextInputClientMsg_StringAtPoint
65IPC_MESSAGE_ROUTED2(TextInputClientReplyMsg_GotStringAtPoint,
66 mac::AttributedStringCoder::EncodedString,
67 gfx::Point)
[email protected]d4cff272011-05-02 15:46:0168#endif // defined(OS_MACOSX)
69
Daniel Bratellbcbca5322017-09-01 10:00:5370#endif // CONTENT_COMMON_TEXT_INPUT_CLIENT_MESSAGES_H_