1 // Copyright 2012 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 // Multiply-included message file, no include guard.
9 #include "base/basictypes.h"
10 #include "ipc/ipc_message_macros.h"
11 #include "ui/base/events/event_constants.h"
12 #include "ui/gfx/native_widget_types.h"
14 #define IPC_MESSAGE_START MetroViewerMsgStart
16 IPC_ENUM_TRAITS(ui::EventType
)
17 IPC_ENUM_TRAITS(ui::EventFlags
)
19 // Messages sent from the viewer to the browser:
21 // Inform the browser of the surface to target for compositing.
22 IPC_MESSAGE_CONTROL1(MetroViewerHostMsg_SetTargetSurface
,
23 gfx::NativeViewId
/* target hwnd */)
24 // Informs the browser that the mouse moved.
25 IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_MouseMoved
,
26 int32
, /* x-coordinate */
27 int32
, /* y-coordinate */
29 // Informs the brower that a mouse button was pressed.
30 IPC_MESSAGE_CONTROL5(MetroViewerHostMsg_MouseButton
,
31 int32
, /* x-coordinate */
32 int32
, /* y-coordinate */
34 ui::EventType
, /* event type */
35 ui::EventFlags
/* event flags */)
36 // Informs the browser that a key was pressed.
37 IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_KeyDown
,
38 uint32
, /* virtual key */
39 uint32
, /* repeat count */
40 uint32
, /* scan code */
41 uint32
/* key state */);
42 // Informs the browser that a key was released.
43 IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_KeyUp
,
44 uint32
, /* virtual key */
45 uint32
, /* repeat count */
46 uint32
, /* scan code */
47 uint32
/* key state */);
48 IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_Character
,
49 uint32
, /* virtual key */
50 uint32
, /* repeat count */
51 uint32
, /* scan code */
52 uint32
/* key state */);
53 // Informs the browser that the visibiliy of the viewer has changed.
54 IPC_MESSAGE_CONTROL1(MetroViewerHostMsg_VisibilityChanged
,
57 IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchDown
,
58 int32
, /* x-coordinate */
59 int32
, /* y-coordinate */
60 uint64
) /* timestamp */
61 IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchUp
,
62 int32
, /* x-coordinate */
63 int32
, /* y-coordinate */
64 uint64
) /* timestamp */
65 IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_TouchMoved
,
66 int32
, /* x-coordinate */
67 int32
, /* y-coordinate */
68 uint64
) /* timestamp */
70 // Informs the browser of the result of a file save as operation.
71 IPC_MESSAGE_CONTROL3(MetroViewerHostMsg_FileSaveAsDone
,
73 string16
, /* filename */
74 int) /* filter_index */
76 // Informs the browser of the result of a file open operation.
77 IPC_MESSAGE_CONTROL2(MetroViewerHostMsg_FileOpenDone
,
79 string16
) /* filename */
81 IPC_MESSAGE_CONTROL2(MetroViewerHostMsg_MultiFileOpenDone
,
83 std::vector
<base::FilePath
>) /* filenames */
86 // Messages sent from the browser to the viewer:
88 // Requests the viewer to change the pointer to a new cursor.
89 IPC_MESSAGE_CONTROL1(MetroViewerHostMsg_SetCursor
,
92 // This structure contains the parameters sent to the viewer process to display
93 // the file save dialog.
94 IPC_STRUCT_BEGIN(MetroViewerHostMsg_SaveAsDialogParams
)
96 // The title of the file save dialog if any.
97 IPC_STRUCT_MEMBER(string16
, title
)
99 // The suggested file name.
100 IPC_STRUCT_MEMBER(string16
, suggested_name
)
102 // The save as filter to be used.
103 IPC_STRUCT_MEMBER(string16
, filter
)
106 IPC_STRUCT_MEMBER(uint32
, filter_index
)
108 // The default extension.
109 IPC_STRUCT_MEMBER(string16
, default_extension
)
113 // Requests the viewer to display the file save dialog.
114 IPC_MESSAGE_CONTROL1(MetroViewerHostMsg_DisplayFileSaveAs
,
115 MetroViewerHostMsg_SaveAsDialogParams
)
117 // Requests the viewer to display the file open dialog.
118 IPC_MESSAGE_CONTROL4(MetroViewerHostMsg_DisplayFileOpen
,
119 string16
, /* title */
120 string16
, /* filter */
121 string16
, /* Default path */
122 bool) /* allow_multi_select */