1*3ac0a46fSAndroid Build Coastguard Worker // Copyright 2016 The PDFium Authors 2*3ac0a46fSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be 3*3ac0a46fSAndroid Build Coastguard Worker // found in the LICENSE file. 4*3ac0a46fSAndroid Build Coastguard Worker 5*3ac0a46fSAndroid Build Coastguard Worker // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6*3ac0a46fSAndroid Build Coastguard Worker 7*3ac0a46fSAndroid Build Coastguard Worker #ifndef PUBLIC_FPDF_STRUCTTREE_H_ 8*3ac0a46fSAndroid Build Coastguard Worker #define PUBLIC_FPDF_STRUCTTREE_H_ 9*3ac0a46fSAndroid Build Coastguard Worker 10*3ac0a46fSAndroid Build Coastguard Worker // clang-format off 11*3ac0a46fSAndroid Build Coastguard Worker // NOLINTNEXTLINE(build/include) 12*3ac0a46fSAndroid Build Coastguard Worker #include "fpdfview.h" 13*3ac0a46fSAndroid Build Coastguard Worker 14*3ac0a46fSAndroid Build Coastguard Worker #ifdef __cplusplus 15*3ac0a46fSAndroid Build Coastguard Worker extern "C" { 16*3ac0a46fSAndroid Build Coastguard Worker #endif 17*3ac0a46fSAndroid Build Coastguard Worker 18*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructTree_GetForPage 19*3ac0a46fSAndroid Build Coastguard Worker // Get the structure tree for a page. 20*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 21*3ac0a46fSAndroid Build Coastguard Worker // page - Handle to the page, as returned by FPDF_LoadPage(). 22*3ac0a46fSAndroid Build Coastguard Worker // Return value: 23*3ac0a46fSAndroid Build Coastguard Worker // A handle to the structure tree or NULL on error. 24*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_STRUCTTREE FPDF_CALLCONV 25*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructTree_GetForPage(FPDF_PAGE page); 26*3ac0a46fSAndroid Build Coastguard Worker 27*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructTree_Close 28*3ac0a46fSAndroid Build Coastguard Worker // Release a resource allocated by FPDF_StructTree_GetForPage(). 29*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 30*3ac0a46fSAndroid Build Coastguard Worker // struct_tree - Handle to the structure tree, as returned by 31*3ac0a46fSAndroid Build Coastguard Worker // FPDF_StructTree_LoadPage(). 32*3ac0a46fSAndroid Build Coastguard Worker // Return value: 33*3ac0a46fSAndroid Build Coastguard Worker // None. 34*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT void FPDF_CALLCONV 35*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree); 36*3ac0a46fSAndroid Build Coastguard Worker 37*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructTree_CountChildren 38*3ac0a46fSAndroid Build Coastguard Worker // Count the number of children for the structure tree. 39*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 40*3ac0a46fSAndroid Build Coastguard Worker // struct_tree - Handle to the structure tree, as returned by 41*3ac0a46fSAndroid Build Coastguard Worker // FPDF_StructTree_LoadPage(). 42*3ac0a46fSAndroid Build Coastguard Worker // Return value: 43*3ac0a46fSAndroid Build Coastguard Worker // The number of children, or -1 on error. 44*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV 45*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructTree_CountChildren(FPDF_STRUCTTREE struct_tree); 46*3ac0a46fSAndroid Build Coastguard Worker 47*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructTree_GetChildAtIndex 48*3ac0a46fSAndroid Build Coastguard Worker // Get a child in the structure tree. 49*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 50*3ac0a46fSAndroid Build Coastguard Worker // struct_tree - Handle to the structure tree, as returned by 51*3ac0a46fSAndroid Build Coastguard Worker // FPDF_StructTree_LoadPage(). 52*3ac0a46fSAndroid Build Coastguard Worker // index - The index for the child, 0-based. 53*3ac0a46fSAndroid Build Coastguard Worker // Return value: 54*3ac0a46fSAndroid Build Coastguard Worker // The child at the n-th index or NULL on error. 55*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV 56*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index); 57*3ac0a46fSAndroid Build Coastguard Worker 58*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetAltText 59*3ac0a46fSAndroid Build Coastguard Worker // Get the alt text for a given element. 60*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 61*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 62*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output the alt text. May be NULL. 63*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer, in bytes. May be 0. 64*3ac0a46fSAndroid Build Coastguard Worker // Return value: 65*3ac0a46fSAndroid Build Coastguard Worker // The number of bytes in the alt text, including the terminating NUL 66*3ac0a46fSAndroid Build Coastguard Worker // character. The number of bytes is returned regardless of the 67*3ac0a46fSAndroid Build Coastguard Worker // |buffer| and |buflen| parameters. 68*3ac0a46fSAndroid Build Coastguard Worker // Comments: 69*3ac0a46fSAndroid Build Coastguard Worker // Regardless of the platform, the |buffer| is always in UTF-16LE 70*3ac0a46fSAndroid Build Coastguard Worker // encoding. The string is terminated by a UTF16 NUL character. If 71*3ac0a46fSAndroid Build Coastguard Worker // |buflen| is less than the required length, or |buffer| is NULL, 72*3ac0a46fSAndroid Build Coastguard Worker // |buffer| will not be modified. 73*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV 74*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element, 75*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 76*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen); 77*3ac0a46fSAndroid Build Coastguard Worker 78*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 79*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetActualText 80*3ac0a46fSAndroid Build Coastguard Worker // Get the actual text for a given element. 81*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 82*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 83*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output the actual text. May be NULL. 84*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer, in bytes. May be 0. 85*3ac0a46fSAndroid Build Coastguard Worker // Return value: 86*3ac0a46fSAndroid Build Coastguard Worker // The number of bytes in the actual text, including the terminating 87*3ac0a46fSAndroid Build Coastguard Worker // NUL character. The number of bytes is returned regardless of the 88*3ac0a46fSAndroid Build Coastguard Worker // |buffer| and |buflen| parameters. 89*3ac0a46fSAndroid Build Coastguard Worker // Comments: 90*3ac0a46fSAndroid Build Coastguard Worker // Regardless of the platform, the |buffer| is always in UTF-16LE 91*3ac0a46fSAndroid Build Coastguard Worker // encoding. The string is terminated by a UTF16 NUL character. If 92*3ac0a46fSAndroid Build Coastguard Worker // |buflen| is less than the required length, or |buffer| is NULL, 93*3ac0a46fSAndroid Build Coastguard Worker // |buffer| will not be modified. 94*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV 95*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetActualText(FPDF_STRUCTELEMENT struct_element, 96*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 97*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen); 98*3ac0a46fSAndroid Build Coastguard Worker 99*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetID 100*3ac0a46fSAndroid Build Coastguard Worker // Get the ID for a given element. 101*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 102*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 103*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output the ID string. May be NULL. 104*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer, in bytes. May be 0. 105*3ac0a46fSAndroid Build Coastguard Worker // Return value: 106*3ac0a46fSAndroid Build Coastguard Worker // The number of bytes in the ID string, including the terminating NUL 107*3ac0a46fSAndroid Build Coastguard Worker // character. The number of bytes is returned regardless of the 108*3ac0a46fSAndroid Build Coastguard Worker // |buffer| and |buflen| parameters. 109*3ac0a46fSAndroid Build Coastguard Worker // Comments: 110*3ac0a46fSAndroid Build Coastguard Worker // Regardless of the platform, the |buffer| is always in UTF-16LE 111*3ac0a46fSAndroid Build Coastguard Worker // encoding. The string is terminated by a UTF16 NUL character. If 112*3ac0a46fSAndroid Build Coastguard Worker // |buflen| is less than the required length, or |buffer| is NULL, 113*3ac0a46fSAndroid Build Coastguard Worker // |buffer| will not be modified. 114*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV 115*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetID(FPDF_STRUCTELEMENT struct_element, 116*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 117*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen); 118*3ac0a46fSAndroid Build Coastguard Worker 119*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 120*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetLang 121*3ac0a46fSAndroid Build Coastguard Worker // Get the case-insensitive IETF BCP 47 language code for an element. 122*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 123*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 124*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output the lang string. May be NULL. 125*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer, in bytes. May be 0. 126*3ac0a46fSAndroid Build Coastguard Worker // Return value: 127*3ac0a46fSAndroid Build Coastguard Worker // The number of bytes in the ID string, including the terminating NUL 128*3ac0a46fSAndroid Build Coastguard Worker // character. The number of bytes is returned regardless of the 129*3ac0a46fSAndroid Build Coastguard Worker // |buffer| and |buflen| parameters. 130*3ac0a46fSAndroid Build Coastguard Worker // Comments: 131*3ac0a46fSAndroid Build Coastguard Worker // Regardless of the platform, the |buffer| is always in UTF-16LE 132*3ac0a46fSAndroid Build Coastguard Worker // encoding. The string is terminated by a UTF16 NUL character. If 133*3ac0a46fSAndroid Build Coastguard Worker // |buflen| is less than the required length, or |buffer| is NULL, 134*3ac0a46fSAndroid Build Coastguard Worker // |buffer| will not be modified. 135*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV 136*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetLang(FPDF_STRUCTELEMENT struct_element, 137*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 138*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen); 139*3ac0a46fSAndroid Build Coastguard Worker 140*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 141*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetStringAttribute 142*3ac0a46fSAndroid Build Coastguard Worker // Get a struct element attribute of type "name" or "string". 143*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 144*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 145*3ac0a46fSAndroid Build Coastguard Worker // attr_name - The name of the attribute to retrieve. 146*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output. May be NULL. 147*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer, in bytes. May be 0. 148*3ac0a46fSAndroid Build Coastguard Worker // Return value: 149*3ac0a46fSAndroid Build Coastguard Worker // The number of bytes in the attribute value, including the 150*3ac0a46fSAndroid Build Coastguard Worker // terminating NUL character. The number of bytes is returned 151*3ac0a46fSAndroid Build Coastguard Worker // regardless of the |buffer| and |buflen| parameters. 152*3ac0a46fSAndroid Build Coastguard Worker // Comments: 153*3ac0a46fSAndroid Build Coastguard Worker // Regardless of the platform, the |buffer| is always in UTF-16LE 154*3ac0a46fSAndroid Build Coastguard Worker // encoding. The string is terminated by a UTF16 NUL character. If 155*3ac0a46fSAndroid Build Coastguard Worker // |buflen| is less than the required length, or |buffer| is NULL, 156*3ac0a46fSAndroid Build Coastguard Worker // |buffer| will not be modified. 157*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV 158*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetStringAttribute(FPDF_STRUCTELEMENT struct_element, 159*3ac0a46fSAndroid Build Coastguard Worker FPDF_BYTESTRING attr_name, 160*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 161*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen); 162*3ac0a46fSAndroid Build Coastguard Worker 163*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetMarkedContentID 164*3ac0a46fSAndroid Build Coastguard Worker // Get the marked content ID for a given element. 165*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 166*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 167*3ac0a46fSAndroid Build Coastguard Worker // Return value: 168*3ac0a46fSAndroid Build Coastguard Worker // The marked content ID of the element. If no ID exists, returns 169*3ac0a46fSAndroid Build Coastguard Worker // -1. 170*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV 171*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetMarkedContentID(FPDF_STRUCTELEMENT struct_element); 172*3ac0a46fSAndroid Build Coastguard Worker 173*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetType 174*3ac0a46fSAndroid Build Coastguard Worker // Get the type (/S) for a given element. 175*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 176*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 177*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output. May be NULL. 178*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer, in bytes. May be 0. 179*3ac0a46fSAndroid Build Coastguard Worker // Return value: 180*3ac0a46fSAndroid Build Coastguard Worker // The number of bytes in the type, including the terminating NUL 181*3ac0a46fSAndroid Build Coastguard Worker // character. The number of bytes is returned regardless of the 182*3ac0a46fSAndroid Build Coastguard Worker // |buffer| and |buflen| parameters. 183*3ac0a46fSAndroid Build Coastguard Worker // Comments: 184*3ac0a46fSAndroid Build Coastguard Worker // Regardless of the platform, the |buffer| is always in UTF-16LE 185*3ac0a46fSAndroid Build Coastguard Worker // encoding. The string is terminated by a UTF16 NUL character. If 186*3ac0a46fSAndroid Build Coastguard Worker // |buflen| is less than the required length, or |buffer| is NULL, 187*3ac0a46fSAndroid Build Coastguard Worker // |buffer| will not be modified. 188*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV 189*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element, 190*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 191*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen); 192*3ac0a46fSAndroid Build Coastguard Worker 193*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 194*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetObjType 195*3ac0a46fSAndroid Build Coastguard Worker // Get the object type (/Type) for a given element. 196*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 197*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 198*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output. May be NULL. 199*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer, in bytes. May be 0. 200*3ac0a46fSAndroid Build Coastguard Worker // Return value: 201*3ac0a46fSAndroid Build Coastguard Worker // The number of bytes in the object type, including the terminating 202*3ac0a46fSAndroid Build Coastguard Worker // NUL character. The number of bytes is returned regardless of the 203*3ac0a46fSAndroid Build Coastguard Worker // |buffer| and |buflen| parameters. 204*3ac0a46fSAndroid Build Coastguard Worker // Comments: 205*3ac0a46fSAndroid Build Coastguard Worker // Regardless of the platform, the |buffer| is always in UTF-16LE 206*3ac0a46fSAndroid Build Coastguard Worker // encoding. The string is terminated by a UTF16 NUL character. If 207*3ac0a46fSAndroid Build Coastguard Worker // |buflen| is less than the required length, or |buffer| is NULL, 208*3ac0a46fSAndroid Build Coastguard Worker // |buffer| will not be modified. 209*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV 210*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetObjType(FPDF_STRUCTELEMENT struct_element, 211*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 212*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen); 213*3ac0a46fSAndroid Build Coastguard Worker 214*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetTitle 215*3ac0a46fSAndroid Build Coastguard Worker // Get the title (/T) for a given element. 216*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 217*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 218*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output. May be NULL. 219*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer, in bytes. May be 0. 220*3ac0a46fSAndroid Build Coastguard Worker // Return value: 221*3ac0a46fSAndroid Build Coastguard Worker // The number of bytes in the title, including the terminating NUL 222*3ac0a46fSAndroid Build Coastguard Worker // character. The number of bytes is returned regardless of the 223*3ac0a46fSAndroid Build Coastguard Worker // |buffer| and |buflen| parameters. 224*3ac0a46fSAndroid Build Coastguard Worker // Comments: 225*3ac0a46fSAndroid Build Coastguard Worker // Regardless of the platform, the |buffer| is always in UTF-16LE 226*3ac0a46fSAndroid Build Coastguard Worker // encoding. The string is terminated by a UTF16 NUL character. If 227*3ac0a46fSAndroid Build Coastguard Worker // |buflen| is less than the required length, or |buffer| is NULL, 228*3ac0a46fSAndroid Build Coastguard Worker // |buffer| will not be modified. 229*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV 230*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element, 231*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 232*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen); 233*3ac0a46fSAndroid Build Coastguard Worker 234*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_CountChildren 235*3ac0a46fSAndroid Build Coastguard Worker // Count the number of children for the structure element. 236*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 237*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 238*3ac0a46fSAndroid Build Coastguard Worker // Return value: 239*3ac0a46fSAndroid Build Coastguard Worker // The number of children, or -1 on error. 240*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV 241*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element); 242*3ac0a46fSAndroid Build Coastguard Worker 243*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetChildAtIndex 244*3ac0a46fSAndroid Build Coastguard Worker // Get a child in the structure element. 245*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 246*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 247*3ac0a46fSAndroid Build Coastguard Worker // index - The index for the child, 0-based. 248*3ac0a46fSAndroid Build Coastguard Worker // Return value: 249*3ac0a46fSAndroid Build Coastguard Worker // The child at the n-th index or NULL on error. 250*3ac0a46fSAndroid Build Coastguard Worker // Comments: 251*3ac0a46fSAndroid Build Coastguard Worker // If the child exists but is not an element, then this function will 252*3ac0a46fSAndroid Build Coastguard Worker // return NULL. This will also return NULL for out of bounds indices. 253*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV 254*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetChildAtIndex(FPDF_STRUCTELEMENT struct_element, 255*3ac0a46fSAndroid Build Coastguard Worker int index); 256*3ac0a46fSAndroid Build Coastguard Worker 257*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 258*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetParent 259*3ac0a46fSAndroid Build Coastguard Worker // Get the parent of the structure element. 260*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 261*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 262*3ac0a46fSAndroid Build Coastguard Worker // Return value: 263*3ac0a46fSAndroid Build Coastguard Worker // The parent structure element or NULL on error. 264*3ac0a46fSAndroid Build Coastguard Worker // Comments: 265*3ac0a46fSAndroid Build Coastguard Worker // If structure element is StructTreeRoot, then this function will 266*3ac0a46fSAndroid Build Coastguard Worker // return NULL. 267*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV 268*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetParent(FPDF_STRUCTELEMENT struct_element); 269*3ac0a46fSAndroid Build Coastguard Worker 270*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetAttributeCount 271*3ac0a46fSAndroid Build Coastguard Worker // Count the number of attributes for the structure element. 272*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 273*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 274*3ac0a46fSAndroid Build Coastguard Worker // Return value: 275*3ac0a46fSAndroid Build Coastguard Worker // The number of attributes, or -1 on error. 276*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV 277*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetAttributeCount(FPDF_STRUCTELEMENT struct_element); 278*3ac0a46fSAndroid Build Coastguard Worker 279*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 280*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetAttributeAtIndex 281*3ac0a46fSAndroid Build Coastguard Worker // Get an attribute object in the structure element. 282*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 283*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 284*3ac0a46fSAndroid Build Coastguard Worker // index - The index for the attribute object, 0-based. 285*3ac0a46fSAndroid Build Coastguard Worker // Return value: 286*3ac0a46fSAndroid Build Coastguard Worker // The attribute object at the n-th index or NULL on error. 287*3ac0a46fSAndroid Build Coastguard Worker // Comments: 288*3ac0a46fSAndroid Build Coastguard Worker // If the attribute object exists but is not a dict, then this 289*3ac0a46fSAndroid Build Coastguard Worker // function will return NULL. This will also return NULL for out of 290*3ac0a46fSAndroid Build Coastguard Worker // bounds indices. 291*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_STRUCTELEMENT_ATTR FPDF_CALLCONV 292*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetAttributeAtIndex(FPDF_STRUCTELEMENT struct_element, int index); 293*3ac0a46fSAndroid Build Coastguard Worker 294*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 295*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_Attr_GetCount 296*3ac0a46fSAndroid Build Coastguard Worker // Count the number of attributes in a structure element attribute map. 297*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 298*3ac0a46fSAndroid Build Coastguard Worker // struct_attribute - Handle to the struct element attribute. 299*3ac0a46fSAndroid Build Coastguard Worker // Return value: 300*3ac0a46fSAndroid Build Coastguard Worker // The number of attributes, or -1 on error. 301*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV 302*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_Attr_GetCount(FPDF_STRUCTELEMENT_ATTR struct_attribute); 303*3ac0a46fSAndroid Build Coastguard Worker 304*3ac0a46fSAndroid Build Coastguard Worker 305*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 306*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_Attr_GetName 307*3ac0a46fSAndroid Build Coastguard Worker // Get the name of an attribute in a structure element attribute map. 308*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 309*3ac0a46fSAndroid Build Coastguard Worker // struct_attribute - Handle to the struct element attribute. 310*3ac0a46fSAndroid Build Coastguard Worker // index - The index of attribute in the map. 311*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for output. May be NULL. This is only 312*3ac0a46fSAndroid Build Coastguard Worker // modified if |buflen| is longer than the length 313*3ac0a46fSAndroid Build Coastguard Worker // of the key. Optional, pass null to just 314*3ac0a46fSAndroid Build Coastguard Worker // retrieve the size of the buffer needed. 315*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer. 316*3ac0a46fSAndroid Build Coastguard Worker // out_buflen - A pointer to variable that will receive the 317*3ac0a46fSAndroid Build Coastguard Worker // minimum buffer size to contain the key. Not 318*3ac0a46fSAndroid Build Coastguard Worker // filled if FALSE is returned. 319*3ac0a46fSAndroid Build Coastguard Worker // Return value: 320*3ac0a46fSAndroid Build Coastguard Worker // TRUE if the operation was successful, FALSE otherwise. 321*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 322*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_Attr_GetName(FPDF_STRUCTELEMENT_ATTR struct_attribute, 323*3ac0a46fSAndroid Build Coastguard Worker int index, 324*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 325*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen, 326*3ac0a46fSAndroid Build Coastguard Worker unsigned long* out_buflen); 327*3ac0a46fSAndroid Build Coastguard Worker 328*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 329*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_Attr_GetType 330*3ac0a46fSAndroid Build Coastguard Worker // Get the type of an attribute in a structure element attribute map. 331*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 332*3ac0a46fSAndroid Build Coastguard Worker // struct_attribute - Handle to the struct element attribute. 333*3ac0a46fSAndroid Build Coastguard Worker // name - The attribute name. 334*3ac0a46fSAndroid Build Coastguard Worker // Return value: 335*3ac0a46fSAndroid Build Coastguard Worker // Returns the type of the value, or FPDF_OBJECT_UNKNOWN in case of 336*3ac0a46fSAndroid Build Coastguard Worker // failure. 337*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV 338*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_Attr_GetType(FPDF_STRUCTELEMENT_ATTR struct_attribute, 339*3ac0a46fSAndroid Build Coastguard Worker FPDF_BYTESTRING name); 340*3ac0a46fSAndroid Build Coastguard Worker 341*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 342*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_Attr_GetBooleanValue 343*3ac0a46fSAndroid Build Coastguard Worker // Get the value of a boolean attribute in an attribute map by name as 344*3ac0a46fSAndroid Build Coastguard Worker // FPDF_BOOL. FPDF_StructElement_Attr_GetType() should have returned 345*3ac0a46fSAndroid Build Coastguard Worker // FPDF_OBJECT_BOOLEAN for this property. 346*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 347*3ac0a46fSAndroid Build Coastguard Worker // struct_attribute - Handle to the struct element attribute. 348*3ac0a46fSAndroid Build Coastguard Worker // name - The attribute name. 349*3ac0a46fSAndroid Build Coastguard Worker // out_value - A pointer to variable that will receive the 350*3ac0a46fSAndroid Build Coastguard Worker // value. Not filled if false is returned. 351*3ac0a46fSAndroid Build Coastguard Worker // Return value: 352*3ac0a46fSAndroid Build Coastguard Worker // Returns TRUE if the name maps to a boolean value, FALSE otherwise. 353*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 354*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_Attr_GetBooleanValue( 355*3ac0a46fSAndroid Build Coastguard Worker FPDF_STRUCTELEMENT_ATTR struct_attribute, 356*3ac0a46fSAndroid Build Coastguard Worker FPDF_BYTESTRING name, 357*3ac0a46fSAndroid Build Coastguard Worker FPDF_BOOL* out_value); 358*3ac0a46fSAndroid Build Coastguard Worker 359*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 360*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_Attr_GetNumberValue 361*3ac0a46fSAndroid Build Coastguard Worker // Get the value of a number attribute in an attribute map by name as 362*3ac0a46fSAndroid Build Coastguard Worker // float. FPDF_StructElement_Attr_GetType() should have returned 363*3ac0a46fSAndroid Build Coastguard Worker // FPDF_OBJECT_NUMBER for this property. 364*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 365*3ac0a46fSAndroid Build Coastguard Worker // struct_attribute - Handle to the struct element attribute. 366*3ac0a46fSAndroid Build Coastguard Worker // name - The attribute name. 367*3ac0a46fSAndroid Build Coastguard Worker // out_value - A pointer to variable that will receive the 368*3ac0a46fSAndroid Build Coastguard Worker // value. Not filled if false is returned. 369*3ac0a46fSAndroid Build Coastguard Worker // Return value: 370*3ac0a46fSAndroid Build Coastguard Worker // Returns TRUE if the name maps to a number value, FALSE otherwise. 371*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 372*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_Attr_GetNumberValue(FPDF_STRUCTELEMENT_ATTR struct_attribute, 373*3ac0a46fSAndroid Build Coastguard Worker FPDF_BYTESTRING name, 374*3ac0a46fSAndroid Build Coastguard Worker float* out_value); 375*3ac0a46fSAndroid Build Coastguard Worker 376*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 377*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_Attr_GetStringValue 378*3ac0a46fSAndroid Build Coastguard Worker // Get the value of a string attribute in an attribute map by name as 379*3ac0a46fSAndroid Build Coastguard Worker // string. FPDF_StructElement_Attr_GetType() should have returned 380*3ac0a46fSAndroid Build Coastguard Worker // FPDF_OBJECT_STRING or FPDF_OBJECT_NAME for this property. 381*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 382*3ac0a46fSAndroid Build Coastguard Worker // struct_attribute - Handle to the struct element attribute. 383*3ac0a46fSAndroid Build Coastguard Worker // name - The attribute name. 384*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for holding the returned key in 385*3ac0a46fSAndroid Build Coastguard Worker // UTF-16LE. This is only modified if |buflen| is 386*3ac0a46fSAndroid Build Coastguard Worker // longer than the length of the key. Optional, 387*3ac0a46fSAndroid Build Coastguard Worker // pass null to just retrieve the size of the 388*3ac0a46fSAndroid Build Coastguard Worker // buffer needed. 389*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer. 390*3ac0a46fSAndroid Build Coastguard Worker // out_buflen - A pointer to variable that will receive the 391*3ac0a46fSAndroid Build Coastguard Worker // minimum buffer size to contain the key. Not 392*3ac0a46fSAndroid Build Coastguard Worker // filled if FALSE is returned. 393*3ac0a46fSAndroid Build Coastguard Worker // Return value: 394*3ac0a46fSAndroid Build Coastguard Worker // Returns TRUE if the name maps to a string value, FALSE otherwise. 395*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 396*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_Attr_GetStringValue(FPDF_STRUCTELEMENT_ATTR struct_attribute, 397*3ac0a46fSAndroid Build Coastguard Worker FPDF_BYTESTRING name, 398*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 399*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen, 400*3ac0a46fSAndroid Build Coastguard Worker unsigned long* out_buflen); 401*3ac0a46fSAndroid Build Coastguard Worker 402*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 403*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_Attr_GetBlobValue 404*3ac0a46fSAndroid Build Coastguard Worker // Get the value of a blob attribute in an attribute map by name as 405*3ac0a46fSAndroid Build Coastguard Worker // string. 406*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 407*3ac0a46fSAndroid Build Coastguard Worker // struct_attribute - Handle to the struct element attribute. 408*3ac0a46fSAndroid Build Coastguard Worker // name - The attribute name. 409*3ac0a46fSAndroid Build Coastguard Worker // buffer - A buffer for holding the returned value. This 410*3ac0a46fSAndroid Build Coastguard Worker // is only modified if |buflen| is at least as 411*3ac0a46fSAndroid Build Coastguard Worker // long as the length of the value. Optional, pass 412*3ac0a46fSAndroid Build Coastguard Worker // null to just retrieve the size of the buffer 413*3ac0a46fSAndroid Build Coastguard Worker // needed. 414*3ac0a46fSAndroid Build Coastguard Worker // buflen - The length of the buffer. 415*3ac0a46fSAndroid Build Coastguard Worker // out_buflen - A pointer to variable that will receive the 416*3ac0a46fSAndroid Build Coastguard Worker // minimum buffer size to contain the key. Not 417*3ac0a46fSAndroid Build Coastguard Worker // filled if FALSE is returned. 418*3ac0a46fSAndroid Build Coastguard Worker // Return value: 419*3ac0a46fSAndroid Build Coastguard Worker // Returns TRUE if the name maps to a string value, FALSE otherwise. 420*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 421*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_Attr_GetBlobValue(FPDF_STRUCTELEMENT_ATTR struct_attribute, 422*3ac0a46fSAndroid Build Coastguard Worker FPDF_BYTESTRING name, 423*3ac0a46fSAndroid Build Coastguard Worker void* buffer, 424*3ac0a46fSAndroid Build Coastguard Worker unsigned long buflen, 425*3ac0a46fSAndroid Build Coastguard Worker unsigned long* out_buflen); 426*3ac0a46fSAndroid Build Coastguard Worker 427*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 428*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetMarkedContentIdCount 429*3ac0a46fSAndroid Build Coastguard Worker // Get the count of marked content ids for a given element. 430*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 431*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 432*3ac0a46fSAndroid Build Coastguard Worker // Return value: 433*3ac0a46fSAndroid Build Coastguard Worker // The count of marked content ids or -1 if none exists. 434*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV 435*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetMarkedContentIdCount(FPDF_STRUCTELEMENT struct_element); 436*3ac0a46fSAndroid Build Coastguard Worker 437*3ac0a46fSAndroid Build Coastguard Worker // Experimental API. 438*3ac0a46fSAndroid Build Coastguard Worker // Function: FPDF_StructElement_GetMarkedContentIdAtIndex 439*3ac0a46fSAndroid Build Coastguard Worker // Get the marked content id at a given index for a given element. 440*3ac0a46fSAndroid Build Coastguard Worker // Parameters: 441*3ac0a46fSAndroid Build Coastguard Worker // struct_element - Handle to the struct element. 442*3ac0a46fSAndroid Build Coastguard Worker // index - The index of the marked content id, 0-based. 443*3ac0a46fSAndroid Build Coastguard Worker // Return value: 444*3ac0a46fSAndroid Build Coastguard Worker // The marked content ID of the element. If no ID exists, returns 445*3ac0a46fSAndroid Build Coastguard Worker // -1. 446*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV 447*3ac0a46fSAndroid Build Coastguard Worker FPDF_StructElement_GetMarkedContentIdAtIndex(FPDF_STRUCTELEMENT struct_element, 448*3ac0a46fSAndroid Build Coastguard Worker int index); 449*3ac0a46fSAndroid Build Coastguard Worker 450*3ac0a46fSAndroid Build Coastguard Worker #ifdef __cplusplus 451*3ac0a46fSAndroid Build Coastguard Worker } // extern "C" 452*3ac0a46fSAndroid Build Coastguard Worker #endif 453*3ac0a46fSAndroid Build Coastguard Worker 454*3ac0a46fSAndroid Build Coastguard Worker #endif // PUBLIC_FPDF_STRUCTTREE_H_ 455