blob: 21187c44ef3b0f02de6b2d738a8e1d3d45d6be5a [file] [log] [blame]
[email protected]ceadc392011-06-15 23:04:241// 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]03460232011-10-10 17:23:578#include "ppapi/c/dev/ppb_url_util_dev.h"
[email protected]18d871f2011-09-08 16:56:349#include "ppapi/c/pp_completion_callback.h"
[email protected]ceadc392011-06-15 23:04:2410#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"
[email protected]ac4b54d2011-10-20 23:09:2814#include "ppapi/shared_impl/api_id.h"
[email protected]ceadc392011-06-15 23:04:2415
[email protected]0f41c012011-10-21 19:49:2016// Windows headers interfere with this file.
17#ifdef PostMessage
18#undef PostMessage
19#endif
20
[email protected]ceadc392011-06-15 23:04:2421namespace ppapi {
22namespace thunk {
23
24class PPB_Instance_FunctionAPI {
25 public:
[email protected]cb4fdad2011-06-27 22:25:2926 virtual ~PPB_Instance_FunctionAPI() {}
[email protected]ceadc392011-06-15 23:04:2427
28 virtual PP_Bool BindGraphics(PP_Instance instance, PP_Resource device) = 0;
29 virtual PP_Bool IsFullFrame(PP_Instance instance) = 0;
30
31 // InstancePrivate.
32 virtual PP_Var GetWindowObject(PP_Instance instance) = 0;
33 virtual PP_Var GetOwnerElementObject(PP_Instance instance) = 0;
34 virtual PP_Var ExecuteScript(PP_Instance instance,
35 PP_Var script,
36 PP_Var* exception) = 0;
37
[email protected]8d770e492011-10-11 04:54:3138 // CharSet.
39 virtual PP_Var GetDefaultCharSet(PP_Instance instance) = 0;
40
[email protected]5c966022011-09-13 18:09:3741 // Console.
42 virtual void Log(PP_Instance instance,
43 int log_level,
44 PP_Var value) = 0;
45 virtual void LogWithSource(PP_Instance instance,
46 int log_level,
47 PP_Var source,
48 PP_Var value) = 0;
49
[email protected]59cf7022011-09-14 22:44:1950 // Find.
51 virtual void NumberOfFindResultsChanged(PP_Instance instance,
52 int32_t total,
53 PP_Bool final_result) = 0;
54 virtual void SelectedFindResultChanged(PP_Instance instance,
55 int32_t index) = 0;
56
[email protected]557730a2011-10-05 18:03:3857 // Fullscreen.
[email protected]06e0a342011-09-27 04:24:3058 virtual PP_Bool IsFullscreen(PP_Instance instance) = 0;
59 virtual PP_Bool SetFullscreen(PP_Instance instance,
60 PP_Bool fullscreen) = 0;
61 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) = 0;
62
63 // FlashFullscreen.
[email protected]dafab752011-09-20 20:08:4064 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) = 0;
65 virtual PP_Bool FlashSetFullscreen(PP_Instance instance,
66 PP_Bool fullscreen) = 0;
67 virtual PP_Bool FlashGetScreenSize(PP_Instance instance, PP_Size* size) = 0;
[email protected]cb4fdad2011-06-27 22:25:2968
[email protected]493d14212011-07-07 15:38:4869 // InputEvent.
70 virtual int32_t RequestInputEvents(PP_Instance instance,
71 uint32_t event_classes) = 0;
72 virtual int32_t RequestFilteringInputEvents(PP_Instance instance,
73 uint32_t event_classes) = 0;
74 virtual void ClearInputEventRequest(PP_Instance instance,
75 uint32_t event_classes) = 0;
76
[email protected]55a5a522011-07-06 22:52:4077 // Messaging.
78 virtual void PostMessage(PP_Instance instance, PP_Var message) = 0;
79
[email protected]18d871f2011-09-08 16:56:3480 // MouseLock.
81 virtual int32_t LockMouse(PP_Instance instance,
82 PP_CompletionCallback callback) = 0;
83 virtual void UnlockMouse(PP_Instance instance) = 0;
84
[email protected]15237942011-07-30 04:24:1985 // Zoom.
[email protected]55a5a522011-07-06 22:52:4086 virtual void ZoomChanged(PP_Instance instance, double factor) = 0;
87 virtual void ZoomLimitsChanged(PP_Instance instance,
88 double minimum_factor,
89 double maximium_factor) = 0;
90
[email protected]03460232011-10-10 17:23:5791 // URLUtil.
92 virtual PP_Var ResolveRelativeToDocument(
93 PP_Instance instance,
94 PP_Var relative,
95 PP_URLComponents_Dev* components) = 0;
96 virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) = 0;
97 virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance,
98 PP_Instance target) = 0;
99 virtual PP_Var GetDocumentURL(PP_Instance instance,
100 PP_URLComponents_Dev* components) = 0;
101 virtual PP_Var GetPluginInstanceURL(PP_Instance instance,
102 PP_URLComponents_Dev* components) = 0;
103
[email protected]ac4b54d2011-10-20 23:09:28104 static const ApiID kApiID = API_ID_PPB_INSTANCE;
[email protected]ceadc392011-06-15 23:04:24105};
106
107} // namespace thunk
108} // namespace ppapi
109
110#endif // PPAPI_THUNK_INSTANCE_API_H_