• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef PPAPI_CPP_PRIVATE_PDF_H_
6 #define PPAPI_CPP_PRIVATE_PDF_H_
7 
8 #include <string>
9 
10 #include "ppapi/c/private/ppb_pdf.h"
11 
12 struct PP_BrowserFont_Trusted_Description;
13 
14 namespace pp {
15 
16 class ImageData;
17 class InstanceHandle;
18 class Var;
19 
20 class PDF {
21  public:
22   // Returns true if the required interface is available.
23   static bool IsAvailable();
24 
25   static Var GetLocalizedString(const InstanceHandle& instance,
26                                 PP_ResourceString string_id);
27   static ImageData GetResourceImage(const InstanceHandle& instance,
28                                     PP_ResourceImage image_id);
29   static PP_Resource GetFontFileWithFallback(
30       const InstanceHandle& instance,
31       const PP_BrowserFont_Trusted_Description* description,
32       PP_PrivateFontCharset charset);
33   static bool GetFontTableForPrivateFontFile(PP_Resource font_file,
34                                              uint32_t table,
35                                              void* output,
36                                              uint32_t* output_length);
37   static void SearchString(const InstanceHandle& instance,
38                            const unsigned short* string,
39                            const unsigned short* term,
40                            bool case_sensitive,
41                            PP_PrivateFindResult** results,
42                            int* count);
43   static void DidStartLoading(const InstanceHandle& instance);
44   static void DidStopLoading(const InstanceHandle& instance);
45   static void SetContentRestriction(const InstanceHandle& instance,
46                                     int restrictions);
47   static void HistogramPDFPageCount(const InstanceHandle& instance,
48                                     int count);
49   static void UserMetricsRecordAction(const InstanceHandle& instance,
50                                       const Var& action);
51   static void HasUnsupportedFeature(const InstanceHandle& instance);
52   static void SaveAs(const InstanceHandle& instance);
53   static void Print(const InstanceHandle& instance);
54   static bool IsFeatureEnabled(const InstanceHandle& instance,
55                                PP_PDFFeature feature);
56   static ImageData GetResourceImageForScale(const InstanceHandle& instance,
57                                             PP_ResourceImage image_id,
58                                             float scale);
59   static Var ModalPromptForPassword(const InstanceHandle& instance,
60                                     Var message);
61   static bool IsOutOfProcess(const InstanceHandle& instance);
62   static void SetSelectedText(const InstanceHandle& instance,
63                               const char* selected_text);
64   static void SetLinkUnderCursor(const InstanceHandle& instance,
65                                  const char* url);
66 };
67 
68 }  // namespace pp
69 
70 #endif  // PPAPI_CPP_PRIVATE_PDF_H_
71