#ifndef PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_
#define PPAPI_PROXY_TRUETYPE_FONT_SINGLETON_RESOURCE_H_
#include <string>
#include <vector>
#include "ppapi/proxy/connection.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/thunk/ppb_truetype_font_singleton_api.h"
namespace ppapi {
class TrackedCallback;
namespace proxy {
struct SerializedTrueTypeFontDesc;
class TrueTypeFontSingletonResource
: public PluginResource,
public thunk::PPB_TrueTypeFont_Singleton_API {
public:
TrueTypeFontSingletonResource(Connection connection, PP_Instance instance);
virtual ~TrueTypeFontSingletonResource();
virtual thunk::PPB_TrueTypeFont_Singleton_API*
AsPPB_TrueTypeFont_Singleton_API() OVERRIDE;
virtual int32_t GetFontFamilies(
PP_Instance instance,
const PP_ArrayOutput& output,
const scoped_refptr<TrackedCallback>& callback) OVERRIDE;
virtual int32_t GetFontsInFamily(
PP_Instance instance,
PP_Var family,
const PP_ArrayOutput& output,
const scoped_refptr<TrackedCallback>& callback) OVERRIDE;
private:
void OnPluginMsgGetFontFamiliesComplete(
scoped_refptr<TrackedCallback> callback,
PP_ArrayOutput array_output,
const ResourceMessageReplyParams& params,
const std::vector<std::string>& data);
void OnPluginMsgGetFontsInFamilyComplete(
scoped_refptr<TrackedCallback> callback,
PP_ArrayOutput array_output,
const ResourceMessageReplyParams& params,
const std::vector<SerializedTrueTypeFontDesc>& fonts);
DISALLOW_COPY_AND_ASSIGN(TrueTypeFontSingletonResource);
};
}
}
#endif