• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  */
5 
6 /* From private/ppb_talk_private.idl modified Thu Jun  6 10:54:19 2013. */
7 
8 #ifndef PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_
9 #define PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_
10 
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"
16 
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
20 
21 /**
22  * @file
23  * This file contains the <code>PPB_Talk_Private</code> interface.
24  */
25 
26 
27 /**
28  * @addtogroup Enums
29  * @{
30  */
31 /**
32  * The type of permissions that can be requested from the user.
33  */
34 typedef enum {
35   /**
36    * Request permission for screencast.
37    */
38   PP_TALKPERMISSION_SCREENCAST,
39   /**
40    * Request permission for Remote Desktop.
41    */
42   PP_TALKPERMISSION_REMOTING,
43   /**
44    * Request permission for continuing Remote Desktop.
45    */
46   PP_TALKPERMISSION_REMOTING_CONTINUE,
47   /**
48    * Number of permissions.
49    */
50   PP_TALKPERMISSION_NUM_PERMISSIONS
51 } PP_TalkPermission;
52 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkPermission, 4);
53 
54 /**
55  * Talk event types reported by the browser.
56  */
57 typedef enum {
58   /**
59    * Indicates that the user took action to terminate the remoting session.
60    */
61   PP_TALKEVENT_TERMINATE,
62   /**
63    * Indicates that an error occurred (e.g. failed to show the UI).
64    */
65   PP_TALKEVENT_ERROR,
66   /**
67    * Number of events
68    */
69   PP_TALKEVENT_NUM_EVENTS
70 } PP_TalkEvent;
71 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkEvent, 4);
72 /**
73  * @}
74  */
75 
76 /**
77  * @addtogroup Typedefs
78  * @{
79  */
80 /**
81  * Callback for Talk events.
82  */
83 typedef void (*PP_TalkEventCallback)(void* user_data, PP_TalkEvent event);
84 /**
85  * @}
86  */
87 
88 /**
89  * @addtogroup Interfaces
90  * @{
91  */
92 /**
93  * Extra interface for Talk.
94  */
95 struct PPB_Talk_Private_2_0 {
96   /**
97    * Creates a Talk_Private resource.
98    */
99   PP_Resource (*Create)(PP_Instance instance);
100   /**
101    * Requests permission from the user using a system modal dialog.
102    *
103    * <code>permission</code> specifies the type of permission to request from
104    * the user.
105    *
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.
108    *
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.
112    */
113   int32_t (*RequestPermission)(PP_Resource talk_resource,
114                                PP_TalkPermission permission,
115                                struct PP_CompletionCallback callback);
116   /**
117    * Shows the remoting-in-progress UI and registers a callback for events.
118    *
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.
122    *
123    * <code>user_data</code> is an opaque value used when
124    * <code>event_callback</code> is invoked.
125    *
126    * <code>callback</code> is the completion callback.
127    *
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.
133    */
134   int32_t (*StartRemoting)(PP_Resource talk_resource,
135                            PP_TalkEventCallback event_callback,
136                            void* user_data,
137                            struct PP_CompletionCallback callback);
138   /**
139    * Hides the remoting-in-progress UI and unregisters the event callback.
140    *
141    * <code>callback</code> is the completion callback.
142    */
143   int32_t (*StopRemoting)(PP_Resource talk_resource,
144                           struct PP_CompletionCallback callback);
145 };
146 
147 typedef struct PPB_Talk_Private_2_0 PPB_Talk_Private;
148 
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);
153 };
154 /**
155  * @}
156  */
157 
158 #endif  /* PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ */
159 
160