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_PPB_BROWSER_FONT_TRUSTED_API_H_ 6 #define PPAPI_THUNK_PPB_BROWSER_FONT_TRUSTED_API_H_ 7 8 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" 9 #include "ppapi/thunk/ppapi_thunk_export.h" 10 11 namespace ppapi { 12 namespace thunk { 13 14 // API for font resources. 15 class PPAPI_THUNK_EXPORT PPB_BrowserFont_Trusted_API { 16 public: ~PPB_BrowserFont_Trusted_API()17 virtual ~PPB_BrowserFont_Trusted_API() {} 18 19 virtual PP_Bool Describe(PP_BrowserFont_Trusted_Description* description, 20 PP_BrowserFont_Trusted_Metrics* metrics) = 0; 21 virtual PP_Bool DrawTextAt(PP_Resource image_data, 22 const PP_BrowserFont_Trusted_TextRun* text, 23 const PP_Point* position, 24 uint32_t color, 25 const PP_Rect* clip, 26 PP_Bool image_data_is_opaque) = 0; 27 virtual int32_t MeasureText(const PP_BrowserFont_Trusted_TextRun* text) = 0; 28 virtual uint32_t CharacterOffsetForPixel( 29 const PP_BrowserFont_Trusted_TextRun* text, 30 int32_t pixel_position) = 0; 31 virtual int32_t PixelOffsetForCharacter( 32 const PP_BrowserFont_Trusted_TextRun* text, 33 uint32_t char_offset) = 0; 34 }; 35 36 } // namespace thunk 37 } // namespace ppapi 38 39 #endif // PPAPI_THUNK_PPB_BROWSER_FONT_TRUSTED_API_H_ 40