1 // Copyright (c) 2013 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.
5 #ifndef PPAPI_PROXY_TRUETYPE_FONT_RESOURCE_H_
6 #define PPAPI_PROXY_TRUETYPE_FONT_RESOURCE_H_
10 #include "ppapi/proxy/connection.h"
11 #include "ppapi/proxy/plugin_resource.h"
12 #include "ppapi/proxy/ppapi_proxy_export.h"
13 #include "ppapi/shared_impl/var.h"
14 #include "ppapi/thunk/ppb_truetype_font_api.h"
18 class TrackedCallback
;
22 struct SerializedTrueTypeFontDesc
;
24 class PPAPI_PROXY_EXPORT TrueTypeFontResource
25 : public PluginResource
,
26 public thunk::PPB_TrueTypeFont_API
{
28 TrueTypeFontResource(Connection connection
,
30 const PP_TrueTypeFontDesc_Dev
& desc
);
31 virtual ~TrueTypeFontResource();
33 // Resource overrides.
34 virtual thunk::PPB_TrueTypeFont_API
* AsPPB_TrueTypeFont_API() OVERRIDE
;
36 // PPB_TrueTypeFont_API implementation.
37 virtual int32_t Describe(
38 PP_TrueTypeFontDesc_Dev
* desc
,
39 scoped_refptr
<TrackedCallback
> callback
) OVERRIDE
;
40 virtual int32_t GetTableTags(
41 const PP_ArrayOutput
& output
,
42 scoped_refptr
<TrackedCallback
> callback
) OVERRIDE
;
43 virtual int32_t GetTable(
46 int32_t max_data_length
,
47 const PP_ArrayOutput
& output
,
48 scoped_refptr
<TrackedCallback
> callback
) OVERRIDE
;
51 void OnPluginMsgDescribeComplete(
52 scoped_refptr
<TrackedCallback
> callback
,
53 PP_TrueTypeFontDesc_Dev
* pp_desc
,
54 const ResourceMessageReplyParams
& params
,
55 const ppapi::proxy::SerializedTrueTypeFontDesc
& desc
);
56 void OnPluginMsgGetTableTagsComplete(
57 scoped_refptr
<TrackedCallback
> callback
,
58 PP_ArrayOutput array_output
,
59 const ResourceMessageReplyParams
& params
,
60 const std::vector
<uint32_t>& data
);
61 void OnPluginMsgGetTableComplete(
62 scoped_refptr
<TrackedCallback
> callback
,
63 PP_ArrayOutput array_output
,
64 const ResourceMessageReplyParams
& params
,
65 const std::string
& data
);
67 DISALLOW_COPY_AND_ASSIGN(TrueTypeFontResource
);
73 #endif // PPAPI_PROXY_TRUETYPE_FONT_RESOURCE_H_