cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / ppapi / c / private / ppb_talk_private.h
blob7fc11ccc628006a18aed9d5c12314708f8f825ea
1 /* Copyright (c) 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.
4 */
6 /* From private/ppb_talk_private.idl modified Thu Jun 6 10:54:19 2013. */
8 #ifndef PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_
9 #define PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_
11 #include "ppapi/c/pp_completion_callback.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/pp_stdint.h"
17 #define PPB_TALK_PRIVATE_INTERFACE_1_0 "PPB_Talk_Private;1.0"
18 #define PPB_TALK_PRIVATE_INTERFACE_2_0 "PPB_Talk_Private;2.0"
19 #define PPB_TALK_PRIVATE_INTERFACE PPB_TALK_PRIVATE_INTERFACE_2_0
21 /**
22 * @file
23 * This file contains the <code>PPB_Talk_Private</code> interface.
27 /**
28 * @addtogroup Enums
29 * @{
31 /**
32 * The type of permissions that can be requested from the user.
34 typedef enum {
35 /**
36 * Request permission for screencast.
38 PP_TALKPERMISSION_SCREENCAST,
39 /**
40 * Request permission for Remote Desktop.
42 PP_TALKPERMISSION_REMOTING,
43 /**
44 * Request permission for continuing Remote Desktop.
46 PP_TALKPERMISSION_REMOTING_CONTINUE,
47 /**
48 * Number of permissions.
50 PP_TALKPERMISSION_NUM_PERMISSIONS
51 } PP_TalkPermission;
52 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkPermission, 4);
54 /**
55 * Talk event types reported by the browser.
57 typedef enum {
58 /**
59 * Indicates that the user took action to terminate the remoting session.
61 PP_TALKEVENT_TERMINATE,
62 /**
63 * Indicates that an error occurred (e.g. failed to show the UI).
65 PP_TALKEVENT_ERROR,
66 /**
67 * Number of events
69 PP_TALKEVENT_NUM_EVENTS
70 } PP_TalkEvent;
71 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkEvent, 4);
72 /**
73 * @}
76 /**
77 * @addtogroup Typedefs
78 * @{
80 /**
81 * Callback for Talk events.
83 typedef void (*PP_TalkEventCallback)(void* user_data, PP_TalkEvent event);
84 /**
85 * @}
88 /**
89 * @addtogroup Interfaces
90 * @{
92 /**
93 * Extra interface for Talk.
95 struct PPB_Talk_Private_2_0 {
96 /**
97 * Creates a Talk_Private resource.
99 PP_Resource (*Create)(PP_Instance instance);
101 * Requests permission from the user using a system modal dialog.
103 * <code>permission</code> specifies the type of permission to request from
104 * the user.
106 * <code>callback</code> is the completion callback. It will be issued with 1
107 * as the result if the user gave permission, or 0 if the user denied.
109 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING
110 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a
111 * request in progress.
113 int32_t (*RequestPermission)(PP_Resource talk_resource,
114 PP_TalkPermission permission,
115 struct PP_CompletionCallback callback);
117 * Shows the remoting-in-progress UI and registers a callback for events.
119 * <code>event_callback</code> is the callback for session releated events.
120 * It will only start receiving events after the completion callback has been
121 * issued. This callback will be called on the pepper main thread.
123 * <code>user_data</code> is an opaque value used when
124 * <code>event_callback</code> is invoked.
126 * <code>callback</code> is the completion callback.
128 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING
129 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a
130 * request in progress. PP_ERROR_INPROGRESS will also be returned if a
131 * previous call to StartRemoting succeeded without a corresponding
132 * StopRemoting call.
134 int32_t (*StartRemoting)(PP_Resource talk_resource,
135 PP_TalkEventCallback event_callback,
136 void* user_data,
137 struct PP_CompletionCallback callback);
139 * Hides the remoting-in-progress UI and unregisters the event callback.
141 * <code>callback</code> is the completion callback.
143 int32_t (*StopRemoting)(PP_Resource talk_resource,
144 struct PP_CompletionCallback callback);
147 typedef struct PPB_Talk_Private_2_0 PPB_Talk_Private;
149 struct PPB_Talk_Private_1_0 {
150 PP_Resource (*Create)(PP_Instance instance);
151 int32_t (*GetPermission)(PP_Resource talk_resource,
152 struct PP_CompletionCallback callback);
155 * @}
158 #endif /* PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ */