Pepper_56_C_interfaces
Pepper_56_C_interfaces
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
ppb_pdf.h
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_C_PRIVATE_PPB_PDF_H_
6 #define PPAPI_C_PRIVATE_PPB_PDF_H_
7 
8 #include "ppapi/c/dev/ppb_font_dev.h"
9 #include "ppapi/c/pp_bool.h"
10 #include "ppapi/c/pp_instance.h"
11 #include "ppapi/c/pp_resource.h"
12 #include "ppapi/c/pp_var.h"
14 
15 #define PPB_PDF_INTERFACE "PPB_PDF;1"
16 
17 // From the public PPB_Font_Dev file.
18 struct PP_FontDescription_Dev;
19 
20 typedef enum {
21  PP_PDFFEATURE_HIDPI = 0,
22  PP_PDFFEATURE_PRINTING = 1
23 } PP_PDFFeature;
24 
26  const char* face;
27  uint32_t weight;
28  bool italic;
29 };
30 
32  int start_index;
33  int length;
34 };
35 
36 struct PPB_PDF {
37  // Returns a resource identifying a font file corresponding to the given font
38  // request after applying the browser-specific fallback.
39  //
40  // Currently Linux-only.
41  PP_Resource (*GetFontFileWithFallback)(
42  PP_Instance instance,
43  const struct PP_BrowserFont_Trusted_Description* description,
44  PP_PrivateFontCharset charset);
45 
46  // Given a resource previously returned by GetFontFileWithFallback, returns
47  // a pointer to the requested font table. Linux only.
48  bool (*GetFontTableForPrivateFontFile)(PP_Resource font_file,
49  uint32_t table,
50  void* output,
51  uint32_t* output_length);
52 
53  // Search the given string using ICU. Use PPB_Core's MemFree on results when
54  // done.
55  void (*SearchString)(
56  PP_Instance instance,
57  const unsigned short* string,
58  const unsigned short* term,
59  bool case_sensitive,
60  struct PP_PrivateFindResult** results,
61  int* count);
62 
63  // Since WebFrame doesn't know about PPAPI requests, it'll think the page has
64  // finished loading even if there are outstanding requests by the plugin.
65  // Take this out once WebFrame knows about requests by PPAPI plugins.
66  void (*DidStartLoading)(PP_Instance instance);
67  void (*DidStopLoading)(PP_Instance instance);
68 
69  // Sets content restriction for a full-page plugin (i.e. can't copy/print).
70  // The value is a bitfield of ContentRestriction enums.
71  void (*SetContentRestriction)(PP_Instance instance, int restrictions);
72 
73  // Notifies the browser that the given action has been performed.
74  void (*UserMetricsRecordAction)(PP_Instance instance, struct PP_Var action);
75 
76  // Notifies the browser that the PDF has an unsupported feature.
77  void (*HasUnsupportedFeature)(PP_Instance instance);
78 
79  // Invoke SaveAs... dialog, similar to the right-click or wrench menu.
80  void (*SaveAs)(PP_Instance instance);
81 
82  // Invoke Print dialog for plugin.
83  void (*Print)(PP_Instance instance);
84 
85  PP_Bool(*IsFeatureEnabled)(PP_Instance instance, PP_PDFFeature feature);
86 
87  // Sets the selected text of the plugin.
88  void(*SetSelectedText)(PP_Instance instance, const char* selected_text);
89 
90  // Sets the link currently under the cursor.
91  void (*SetLinkUnderCursor)(PP_Instance instance, const char* url);
92 
93  // Gets pointers to both the mmap'd V8 snapshot files and their sizes.
94  // This is needed when loading V8's initial snapshot from external files.
95  void (*GetV8ExternalSnapshotData)(PP_Instance instance,
96  const char** natives_data_out,
97  int* natives_size_out,
98  const char** snapshot_data_out,
99  int* snapshot_size_out);
100 };
101 
102 #endif // PPAPI_C_PRIVATE_PPB_PDF_H_
Definition: ppb_pdf.h:25
Definition: ppb_pdf.h:36
int32_t PP_Resource
Definition: pp_resource.h:40
Definition: ppb_browser_font_trusted.h:77
Definition: ppb_pdf.h:31
Definition: pp_var.h:166
int32_t PP_Instance
Definition: pp_instance.h:34
PP_Bool
Definition: pp_bool.h:30