Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: fpdfsdk/include/fpdfdoc.h

Issue 453133004: clang-format all code (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef _FPDFDOC_H_ 7 #ifndef _FPDFDOC_H_
8 #define _FPDFDOC_H_ 8 #define _FPDFDOC_H_
9 9
10 #include "fpdfview.h" 10 #include "fpdfview.h"
11 11
12 // Exported Functions 12 // Exported Functions
13 #ifdef __cplusplus 13 #ifdef __cplusplus
14 extern "C" { 14 extern "C" {
15 #endif 15 #endif
16 16
17 // Function: FPDFBookmark_Find 17 // Function: FPDFBookmark_Find
18 //» » » Find a bookmark in the document, using the bookmark titl e. 18 //» » » Find a bookmark in the document, using the bookmark
19 // Parameters: 19 //title.
20 //» » » document» -» Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument. 20 // Parameters:
21 //» » » title» » -» The UTF-16LE encoded Unicode str ing for the bookmark title to be searched. Can't be NULL. 21 //» » » document» -» Handle to the document. Returned by
22 //FPDF_LoadDocument or FPDF_LoadMemDocument.
23 //» » » title» » -» The UTF-16LE encoded Unicode str ing
24 //for the bookmark title to be searched. Can't be NULL.
22 // Return value: 25 // Return value:
23 //» » » Handle to the found bookmark item. NULL if the title can 't be found. 26 //» » » Handle to the found bookmark item. NULL if the title can 't
27 //be found.
24 // Comments: 28 // Comments:
25 //» » » It always returns the first found bookmark if more than one bookmarks have the same title. 29 //» » » It always returns the first found bookmark if more than one
30 //bookmarks have the same title.
26 // 31 //
27 DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_W IDESTRING title); 32 DLLEXPORT FPDF_BOOKMARK STDCALL
33 FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title);
28 34
29 // Function: FPDFBookmark_GetDest 35 // Function: FPDFBookmark_GetDest
30 // Get the destination associated with a bookmark item. 36 // Get the destination associated with a bookmark item.
31 // Parameters: 37 // Parameters:
32 // document - Handle to the document. 38 // document - Handle to the document.
33 // bookmark - Handle to the bookmark. 39 // bookmark - Handle to the bookmark.
34 // Return value: 40 // Return value:
35 //» » » Handle to the destination data. NULL if no destination i s associated with this bookmark. 41 //» » » Handle to the destination data. NULL if no destination i s
42 //associated with this bookmark.
36 // 43 //
37 DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BO OKMARK bookmark); 44 DLLEXPORT FPDF_DEST STDCALL
45 FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
38 46
39 // Function: FPDFBookmark_GetAction 47 // Function: FPDFBookmark_GetAction
40 // Get the action associated with a bookmark item. 48 // Get the action associated with a bookmark item.
41 // Parameters: 49 // Parameters:
42 // bookmark - Handle to the bookmark. 50 // bookmark - Handle to the bookmark.
43 // Return value: 51 // Return value:
44 //» » » Handle to the action data. NULL if no action is associat ed with this bookmark. In this case, the 52 //» » » Handle to the action data. NULL if no action is associat ed
53 //with this bookmark. In this case, the
45 // application should try FPDFBookmark_GetDest. 54 // application should try FPDFBookmark_GetDest.
46 // 55 //
47 DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark); 56 DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark);
48 57
49 #define PDFACTION_UNSUPPORTED» » 0» » // Unsupported action ty pe. 58 #define PDFACTION_UNSUPPORTED 0 // Unsupported action type.
50 #define PDFACTION_GOTO» » » » 1» » // Go to a desti nation within current document. 59 #define PDFACTION_GOTO 1 // Go to a destination within current document.
51 #define PDFACTION_REMOTEGOTO» » 2» » // Go to a destination w ithin another document. 60 #define PDFACTION_REMOTEGOTO 2 // Go to a destination within another document.
52 #define PDFACTION_URI» » » » 3» » // Universal Res ource Identifier, including web pages and 61 #define PDFACTION_URI \
53 » » » » » » » » » » » // other Internet based resources. 62 3 // Universal Resource Identifier, including web pages and
54 #define PDFACTION_LAUNCH» » » 4» » // Launch an app lication or open a file. 63 // other Internet based resources.
64 #define PDFACTION_LAUNCH 4 // Launch an application or open a file.
55 65
56 // Function: FPDFAction_GetType 66 // Function: FPDFAction_GetType
57 // Get type of an action. 67 // Get type of an action.
58 // Parameters: 68 // Parameters:
59 // action - Handle to the action. 69 // action - Handle to the action.
60 // Return value: 70 // Return value:
61 // A type number as defined above. 71 // A type number as defined above.
62 // 72 //
63 DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action); 73 DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action);
64 74
65 // Function: FPDFAction_GetDest 75 // Function: FPDFAction_GetDest
66 // Get destination of an action. 76 // Get destination of an action.
67 // Parameters: 77 // Parameters:
68 // document - Handle to the document. 78 // document - Handle to the document.
69 //» » » action» » -» Handle to the action. It must be a GOTO or REMOTEGOTO action. 79 //» » » action» » -» Handle to the action. It must be a
80 //GOTO or REMOTEGOTO action.
70 // Return value: 81 // Return value:
71 // Handle to the destination data. 82 // Handle to the destination data.
72 // Comments: 83 // Comments:
73 //» » » In case of remote goto action, the application should fi rst use FPDFAction_GetFilePath to 84 //» » » In case of remote goto action, the application should fi rst
74 //» » » get file path, then load that particular document, and u se its document handle to call this 85 //use FPDFAction_GetFilePath to
86 //» » » get file path, then load that particular document, and u se
87 //its document handle to call this
75 // function. 88 // function.
76 // 89 //
77 DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTI ON action); 90 DLLEXPORT FPDF_DEST STDCALL
91 FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION action);
78 92
79 // Function: FPDFAction_GetURIPath 93 // Function: FPDFAction_GetURIPath
80 // Get URI path of a URI action. 94 // Get URI path of a URI action.
81 // Parameters: 95 // Parameters:
82 // document - Handle to the document. 96 // document - Handle to the document.
83 //» » » action» » -» Handle to the action. Must be a URI action. 97 //» » » action» » -» Handle to the action. Must be a URI
84 //» » » buffer» » -» A buffer for output the path str ing. Can be NULL. 98 //action.
85 //» » » buflen» » -» The length of the buffer, number of bytes. Can be 0. 99 //» » » buffer» » -» A buffer for output the path
100 //string. Can be NULL.
101 //» » » buflen» » -» The length of the buffer, number of
102 //bytes. Can be 0.
86 // Return value: 103 // Return value:
87 //» » » Number of bytes the URI path consumes, including trailin g zeros. 104 //» » » Number of bytes the URI path consumes, including trailin g
105 //zeros.
88 // Comments: 106 // Comments:
89 // The URI path is always encoded in 7-bit ASCII. 107 // The URI path is always encoded in 7-bit ASCII.
90 // 108 //
91 //» » » The return value always indicated number of bytes requir ed for the buffer, even when there is 109 //» » » The return value always indicated number of bytes requir ed
92 //» » » no buffer specified, or the buffer size is less then req uired. In this case, the buffer will not 110 //for the buffer, even when there is
111 //» » » no buffer specified, or the buffer size is less then
112 //required. In this case, the buffer will not
93 // be modified. 113 // be modified.
94 // 114 //
95 DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FP DF_ACTION action, 115 DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document,
96 » » » » » » » » » » » » » void* buffer, unsigned long buflen); 116 FPDF_ACTION action,
117 void* buffer,
118 unsigned long buflen);
97 119
98 // Function: FPDFDest_GetPageIndex 120 // Function: FPDFDest_GetPageIndex
99 // Get page index of a destination. 121 // Get page index of a destination.
100 // Parameters: 122 // Parameters:
101 // document - Handle to the document. 123 // document - Handle to the document.
102 // dest - Handle to the destination. 124 // dest - Handle to the destination.
103 // Return value: 125 // Return value:
104 // The page index. Starting from 0 for the first page. 126 // The page index. Starting from 0 for the first page.
105 // 127 //
106 DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FP DF_DEST dest); 128 DLLEXPORT unsigned long STDCALL
129 FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest);
107 130
108 // Function: FPDFLink_GetLinkAtPoint 131 // Function: FPDFLink_GetLinkAtPoint
109 // Find a link at specified point on a document page. 132 // Find a link at specified point on a document page.
110 // Parameters: 133 // Parameters:
111 // page - Handle to the document page. 134 // page - Handle to the document page.
112 //» » » x» » » -» The x coordinate of the point, specified in page coordinate system. 135 //» » » x» » » -» The x coordinate of the point,
113 //» » » y» » » -» The y coordinate of the point, specified in page coordinate system. 136 //specified in page coordinate system.
137 //» » » y» » » -» The y coordinate of the point,
138 //specified in page coordinate system.
114 // Return value: 139 // Return value:
115 // Handle to the link. NULL if no link found at that point. 140 // Handle to the link. NULL if no link found at that point.
116 // Comments: 141 // Comments:
117 //» » » The point coordinates are specified in page coordinate s ystem. You can convert coordinates 142 //» » » The point coordinates are specified in page coordinate
118 //» » » from screen system to page system using FPDF_DeviceToPag e functions. 143 //system. You can convert coordinates
144 //» » » from screen system to page system using FPDF_DeviceToPag e
145 //functions.
119 // 146 //
120 DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, do uble y); 147 DLLEXPORT FPDF_LINK STDCALL
148 FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y);
121 149
122 // Function: FPDFLink_GetDest 150 // Function: FPDFLink_GetDest
123 // Get destination info of a link. 151 // Get destination info of a link.
124 // Parameters: 152 // Parameters:
125 // document - Handle to the document. 153 // document - Handle to the document.
126 //» » » link» » -» Handle to the link. Returned by FPDFLink_GetLinkAtPoint. 154 //» » » link» » -» Handle to the link. Returned by
155 //FPDFLink_GetLinkAtPoint.
127 // Return value: 156 // Return value:
128 //» » » Handle to the destination. NULL if there is no destinati on associated with the link, in this case 157 //» » » Handle to the destination. NULL if there is no destinati on
158 //associated with the link, in this case
129 // the application should try FPDFLink_GetAction. 159 // the application should try FPDFLink_GetAction.
130 // 160 //
131 DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK l ink); 161 DLLEXPORT FPDF_DEST STDCALL
162 FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK link);
132 163
133 // Function: FPDFLink_GetAction 164 // Function: FPDFLink_GetAction
134 // Get action info of a link. 165 // Get action info of a link.
135 // Parameters: 166 // Parameters:
136 // link - Handle to the link. 167 // link - Handle to the link.
137 // Return value: 168 // Return value:
138 //» » » Handle to the action. NULL if there is no action associa ted with the link. 169 //» » » Handle to the action. NULL if there is no action associa ted
170 //with the link.
139 // 171 //
140 DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link); 172 DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link);
141 173
142 // Function: FPDFLink_Enumerate 174 // Function: FPDFLink_Enumerate
143 //» » » This function would enumerate all the link annotations i n a single PDF page. 175 //» » » This function would enumerate all the link annotations i n a
176 //single PDF page.
144 // Parameters: 177 // Parameters:
145 //» » » page[in]» » » -» Handle to the pa ge. 178 //» » » page[in]» » » -» Handle to the
146 //» » » startPos[in,out]» -» The start position to en umerate the link annotations, which should be specified to start from 179 //page.
147 //» » » » » » » » -» 0 for th e first call, and would receive the next position for enumerating to start from. 180 //» » » startPos[in,out]» -» The start position to en umerate
181 //the link annotations, which should be specified to start from
182 //» » » » » » » » -» 0 for th e first call,
183 //and would receive the next position for enumerating to start from.
148 // linkAnnot[out] - Receive the link handle. 184 // linkAnnot[out] - Receive the link handle.
149 // Return value: 185 // Return value:
150 // TRUE if succceed, else False; 186 // TRUE if succceed, else False;
151 // 187 //
152 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FP DF_LINK* linkAnnot); 188 DLLEXPORT FPDF_BOOL STDCALL
189 FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot);
153 190
154 // Function: FPDFLink_GetAnnotRect 191 // Function: FPDFLink_GetAnnotRect
155 //» » » Get the annotation rectangle. (Specified by the ¡°Rect¡± entry of annotation dictionary). 192 //» » » Get the annotation rectangle. (Specified by the ¡°Rect¡±
193 //entry of annotation dictionary).
156 // Parameters: 194 // Parameters:
157 //» » » linkAnnot[in]» » -» Handle to the link annot ation. 195 //» » » linkAnnot[in]» » -» Handle to the link
158 //» » » rect[out]» » » -» The annotation r ect. 196 //annotation.
197 //» » » rect[out]» » » -» The annotation
198 //rect.
159 // Return value: 199 // Return value:
160 // TRUE if succceed, else False; 200 // TRUE if succceed, else False;
161 // 201 //
162 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect); 202 DLLEXPORT FPDF_BOOL STDCALL
203 FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect);
163 204
164 // Function: FPDFLink_CountQuadPoints 205 // Function: FPDFLink_CountQuadPoints
165 //» » » Get the count of quadrilateral points to the link annota tion. 206 //» » » Get the count of quadrilateral points to the link
207 //annotation.
166 // Parameters: 208 // Parameters:
167 //» » » linkAnnot[in]» » -» Handle to the link annot ation. 209 //» » » linkAnnot[in]» » -» Handle to the link
210 //annotation.
168 // Return value: 211 // Return value:
169 // The count of quadrilateral points. 212 // The count of quadrilateral points.
170 // 213 //
171 DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot); 214 DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot);
172 215
173 /* _FS_DEF_STRUCTURE_QUADPOINTSF_ */ 216 /* _FS_DEF_STRUCTURE_QUADPOINTSF_ */
174 #ifndef _FS_DEF_STRUCTURE_QUADPOINTSF_ 217 #ifndef _FS_DEF_STRUCTURE_QUADPOINTSF_
175 #define _FS_DEF_STRUCTURE_QUADPOINTSF_ 218 #define _FS_DEF_STRUCTURE_QUADPOINTSF_
176 typedef struct _FS_QUADPOINTSF 219 typedef struct _FS_QUADPOINTSF {
177 { 220 FS_FLOAT x1;
178 » FS_FLOAT x1; 221 FS_FLOAT y1;
179 » FS_FLOAT y1; 222 FS_FLOAT x2;
180 » FS_FLOAT x2; 223 FS_FLOAT y2;
181 » FS_FLOAT y2; 224 FS_FLOAT x3;
182 » FS_FLOAT x3; 225 FS_FLOAT y3;
183 » FS_FLOAT y3; 226 FS_FLOAT x4;
184 » FS_FLOAT x4; 227 FS_FLOAT y4;
185 » FS_FLOAT y4;
186 } FS_QUADPOINTSF; 228 } FS_QUADPOINTSF;
187 #endif /* _FS_DEF_STRUCTURE_QUADPOINTSF_ */ 229 #endif /* _FS_DEF_STRUCTURE_QUADPOINTSF_ */
188 230
189 // Function: FPDFLink_GetQuadPoints 231 // Function: FPDFLink_GetQuadPoints
190 //» » » Get the quadrilateral points for the specified index in the link annotation. 232 //» » » Get the quadrilateral points for the specified index in the
233 //link annotation.
191 // Parameters: 234 // Parameters:
192 //» » » linkAnnot[in]» » -» Handle to the link annot ation. 235 //» » » linkAnnot[in]» » -» Handle to the link
193 //» » » quadIndex[in]» » -» The specified quad point s index. 236 //annotation.
194 //» » » quadPoints[out]»» -» Receive the quadrilatera l points. 237 //» » » quadIndex[in]» » -» The specified quad point s
238 //index.
239 //» » » quadPoints[out]»» -» Receive the quadrilatera l
240 //points.
195 // Return value: 241 // Return value:
196 // True if succeed, else False. 242 // True if succeed, else False.
197 // 243 //
198 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quad Index, FS_QUADPOINTSF* quadPoints); 244 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot,
245 int quadIndex,
246 FS_QUADPOINTSF* quadPoints);
199 247
200 // Function: FPDF_GetMetaText 248 // Function: FPDF_GetMetaText
201 //» » » Get a text from meta data of the document. Result is enc oded in UTF-16LE. 249 //» » » Get a text from meta data of the document. Result is enc oded
250 //in UTF-16LE.
202 // Parameters: 251 // Parameters:
203 // doc - Handle to a document 252 // doc - Handle to a document
204 //» » » tag» » » -» The tag for the meta dat a. Currently, It can be "Title", "Author", 253 //» » » tag» » » -» The tag for the meta dat a.
205 //» » » » » » » "Subject", "Keywords", " Creator", "Producer", "CreationDate", or "ModDate". 254 //Currently, It can be "Title", "Author",
206 //» » » » » » » For detailed explanation of these tags and their respective values, 255 //» » » » » » » "Subject", "Keywords", " Creator",
207 //» » » » » » » please refer to PDF Refe rence 1.6, section 10.2.1, "Document Information Dictionary". 256 //"Producer", "CreationDate", or "ModDate".
208 //» » » buffer» » -» A buffer for output the title. C an be NULL. 257 //» » » » » » » For detailed explanation of these
209 //» » » buflen» » -» The length of the buffer, number of bytes. Can be 0. 258 //tags and their respective values,
259 //» » » » » » » please refer to PDF Refe rence 1.6,
260 //section 10.2.1, "Document Information Dictionary".
261 //» » » buffer» » -» A buffer for output the title. C an
262 //be NULL.
263 //» » » buflen» » -» The length of the buffer, number of
264 //bytes. Can be 0.
210 // Return value: 265 // Return value:
211 //» » » Number of bytes the title consumes, including trailing z eros. 266 //» » » Number of bytes the title consumes, including trailing
267 //zeros.
212 // Comments: 268 // Comments:
213 //» » » No matter on what platform, the title is always output i n UTF-16LE encoding, which means the buffer 269 //» » » No matter on what platform, the title is always output i n
214 //» » » can be regarded as an array of WORD (on Intel and compat ible CPUs), each WORD represent the Unicode of 270 //UTF-16LE encoding, which means the buffer
215 //» » » a character (some special Unicode may take 2 WORDs). The string is followed by two bytes of zero 271 //» » » can be regarded as an array of WORD (on Intel and compat ible
272 //CPUs), each WORD represent the Unicode of
273 //» » » a character (some special Unicode may take 2 WORDs). The
274 //string is followed by two bytes of zero
216 // indicating end of the string. 275 // indicating end of the string.
217 // 276 //
218 //» » » The return value always indicated number of bytes requir ed for the buffer, even when there is 277 //» » » The return value always indicated number of bytes requir ed
219 //» » » no buffer specified, or the buffer size is less then req uired. In this case, the buffer will not 278 //for the buffer, even when there is
279 //» » » no buffer specified, or the buffer size is less then
280 //required. In this case, the buffer will not
220 // be modified. 281 // be modified.
221 // 282 //
222 DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, FPDF_BYTESTR ING tag, 283 DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc,
223 » » » » » » » » » » » » void* buffer, unsigned long buflen); 284 FPDF_BYTESTRING tag,
224 285 void* buffer,
286 unsigned long buflen);
225 287
226 #ifdef __cplusplus 288 #ifdef __cplusplus
227 }; 289 };
228 #endif 290 #endif
229 291
230 #endif» // _FPDFDOC_H_ 292 #endif // _FPDFDOC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698