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.
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
23 * This file contains the <code>PPB_Talk_Private</code> interface.
32 * The type of permissions that can be requested from the user.
36 * Request permission for screencast.
38 PP_TALKPERMISSION_SCREENCAST
,
40 * Request permission for Remote Desktop.
42 PP_TALKPERMISSION_REMOTING
,
44 * Request permission for continuing Remote Desktop.
46 PP_TALKPERMISSION_REMOTING_CONTINUE
,
48 * Number of permissions.
50 PP_TALKPERMISSION_NUM_PERMISSIONS
52 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkPermission
, 4);
55 * Talk event types reported by the browser.
59 * Indicates that the user took action to terminate the remoting session.
61 PP_TALKEVENT_TERMINATE
,
63 * Indicates that an error occurred (e.g. failed to show the UI).
69 PP_TALKEVENT_NUM_EVENTS
71 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkEvent
, 4);
77 * @addtogroup Typedefs
81 * Callback for Talk events.
83 typedef void (*PP_TalkEventCallback
)(void* user_data
, PP_TalkEvent event
);
89 * @addtogroup Interfaces
93 * Extra interface for Talk.
95 struct PPB_Talk_Private_2_0
{
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
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
134 int32_t (*StartRemoting
)(PP_Resource talk_resource
,
135 PP_TalkEventCallback event_callback
,
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
);
158 #endif /* PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ */