[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 1 | // Copyright (c) 2011 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 | #ifndef PPAPI_THUNK_INSTANCE_API_H_ |
| 6 | #define PPAPI_THUNK_INSTANCE_API_H_ |
| 7 | |
[email protected] | 0346023 | 2011-10-10 17:23:57 | [diff] [blame] | 8 | #include "ppapi/c/dev/ppb_url_util_dev.h" |
[email protected] | 18d871f | 2011-09-08 16:56:34 | [diff] [blame] | 9 | #include "ppapi/c/pp_completion_callback.h" |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 10 | #include "ppapi/c/ppb_instance.h" |
| 11 | #include "ppapi/c/pp_bool.h" |
| 12 | #include "ppapi/c/pp_size.h" |
| 13 | #include "ppapi/c/private/ppb_instance_private.h" |
| 14 | #include "ppapi/proxy/interface_id.h" |
| 15 | |
| 16 | namespace ppapi { |
| 17 | namespace thunk { |
| 18 | |
| 19 | class PPB_Instance_FunctionAPI { |
| 20 | public: |
[email protected] | cb4fdad | 2011-06-27 22:25:29 | [diff] [blame] | 21 | virtual ~PPB_Instance_FunctionAPI() {} |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 22 | |
| 23 | virtual PP_Bool BindGraphics(PP_Instance instance, PP_Resource device) = 0; |
| 24 | virtual PP_Bool IsFullFrame(PP_Instance instance) = 0; |
| 25 | |
| 26 | // InstancePrivate. |
| 27 | virtual PP_Var GetWindowObject(PP_Instance instance) = 0; |
| 28 | virtual PP_Var GetOwnerElementObject(PP_Instance instance) = 0; |
| 29 | virtual PP_Var ExecuteScript(PP_Instance instance, |
| 30 | PP_Var script, |
| 31 | PP_Var* exception) = 0; |
| 32 | |
[email protected] | 8d770e49 | 2011-10-11 04:54:31 | [diff] [blame^] | 33 | // CharSet. |
| 34 | virtual PP_Var GetDefaultCharSet(PP_Instance instance) = 0; |
| 35 | |
[email protected] | 5c96602 | 2011-09-13 18:09:37 | [diff] [blame] | 36 | // Console. |
| 37 | virtual void Log(PP_Instance instance, |
| 38 | int log_level, |
| 39 | PP_Var value) = 0; |
| 40 | virtual void LogWithSource(PP_Instance instance, |
| 41 | int log_level, |
| 42 | PP_Var source, |
| 43 | PP_Var value) = 0; |
| 44 | |
[email protected] | 59cf702 | 2011-09-14 22:44:19 | [diff] [blame] | 45 | // Find. |
| 46 | virtual void NumberOfFindResultsChanged(PP_Instance instance, |
| 47 | int32_t total, |
| 48 | PP_Bool final_result) = 0; |
| 49 | virtual void SelectedFindResultChanged(PP_Instance instance, |
| 50 | int32_t index) = 0; |
| 51 | |
[email protected] | 557730a | 2011-10-05 18:03:38 | [diff] [blame] | 52 | // Fullscreen. |
[email protected] | 06e0a34 | 2011-09-27 04:24:30 | [diff] [blame] | 53 | virtual PP_Bool IsFullscreen(PP_Instance instance) = 0; |
| 54 | virtual PP_Bool SetFullscreen(PP_Instance instance, |
| 55 | PP_Bool fullscreen) = 0; |
| 56 | virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) = 0; |
| 57 | |
| 58 | // FlashFullscreen. |
[email protected] | dafab75 | 2011-09-20 20:08:40 | [diff] [blame] | 59 | virtual PP_Bool FlashIsFullscreen(PP_Instance instance) = 0; |
| 60 | virtual PP_Bool FlashSetFullscreen(PP_Instance instance, |
| 61 | PP_Bool fullscreen) = 0; |
| 62 | virtual PP_Bool FlashGetScreenSize(PP_Instance instance, PP_Size* size) = 0; |
[email protected] | cb4fdad | 2011-06-27 22:25:29 | [diff] [blame] | 63 | |
[email protected] | 493d1421 | 2011-07-07 15:38:48 | [diff] [blame] | 64 | // InputEvent. |
| 65 | virtual int32_t RequestInputEvents(PP_Instance instance, |
| 66 | uint32_t event_classes) = 0; |
| 67 | virtual int32_t RequestFilteringInputEvents(PP_Instance instance, |
| 68 | uint32_t event_classes) = 0; |
| 69 | virtual void ClearInputEventRequest(PP_Instance instance, |
| 70 | uint32_t event_classes) = 0; |
| 71 | |
[email protected] | 55a5a52 | 2011-07-06 22:52:40 | [diff] [blame] | 72 | // Messaging. |
| 73 | virtual void PostMessage(PP_Instance instance, PP_Var message) = 0; |
| 74 | |
[email protected] | 18d871f | 2011-09-08 16:56:34 | [diff] [blame] | 75 | // MouseLock. |
| 76 | virtual int32_t LockMouse(PP_Instance instance, |
| 77 | PP_CompletionCallback callback) = 0; |
| 78 | virtual void UnlockMouse(PP_Instance instance) = 0; |
| 79 | |
[email protected] | 1523794 | 2011-07-30 04:24:19 | [diff] [blame] | 80 | // Zoom. |
[email protected] | 55a5a52 | 2011-07-06 22:52:40 | [diff] [blame] | 81 | virtual void ZoomChanged(PP_Instance instance, double factor) = 0; |
| 82 | virtual void ZoomLimitsChanged(PP_Instance instance, |
| 83 | double minimum_factor, |
| 84 | double maximium_factor) = 0; |
| 85 | |
[email protected] | 1523794 | 2011-07-30 04:24:19 | [diff] [blame] | 86 | // QueryPolicy. |
| 87 | virtual void SubscribeToPolicyUpdates(PP_Instance instance) = 0; |
| 88 | |
[email protected] | 0346023 | 2011-10-10 17:23:57 | [diff] [blame] | 89 | // URLUtil. |
| 90 | virtual PP_Var ResolveRelativeToDocument( |
| 91 | PP_Instance instance, |
| 92 | PP_Var relative, |
| 93 | PP_URLComponents_Dev* components) = 0; |
| 94 | virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) = 0; |
| 95 | virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance, |
| 96 | PP_Instance target) = 0; |
| 97 | virtual PP_Var GetDocumentURL(PP_Instance instance, |
| 98 | PP_URLComponents_Dev* components) = 0; |
| 99 | virtual PP_Var GetPluginInstanceURL(PP_Instance instance, |
| 100 | PP_URLComponents_Dev* components) = 0; |
| 101 | |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 102 | static const proxy::InterfaceID interface_id = |
| 103 | proxy::INTERFACE_ID_PPB_INSTANCE; |
[email protected] | ceadc39 | 2011-06-15 23:04:24 | [diff] [blame] | 104 | }; |
| 105 | |
| 106 | } // namespace thunk |
| 107 | } // namespace ppapi |
| 108 | |
| 109 | #endif // PPAPI_THUNK_INSTANCE_API_H_ |