1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef PUBLIC_FPDF_EXT_H_ 8 #define PUBLIC_FPDF_EXT_H_ 9 10 #include <time.h> 11 12 // NOLINTNEXTLINE(build/include) 13 #include "fpdfview.h" 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif // __cplusplus 18 19 // Unsupported XFA form. 20 #define FPDF_UNSP_DOC_XFAFORM 1 21 // Unsupported portable collection. 22 #define FPDF_UNSP_DOC_PORTABLECOLLECTION 2 23 // Unsupported attachment. 24 #define FPDF_UNSP_DOC_ATTACHMENT 3 25 // Unsupported security. 26 #define FPDF_UNSP_DOC_SECURITY 4 27 // Unsupported shared review. 28 #define FPDF_UNSP_DOC_SHAREDREVIEW 5 29 // Unsupported shared form, acrobat. 30 #define FPDF_UNSP_DOC_SHAREDFORM_ACROBAT 6 31 // Unsupported shared form, filesystem. 32 #define FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM 7 33 // Unsupported shared form, email. 34 #define FPDF_UNSP_DOC_SHAREDFORM_EMAIL 8 35 // Unsupported 3D annotation. 36 #define FPDF_UNSP_ANNOT_3DANNOT 11 37 // Unsupported movie annotation. 38 #define FPDF_UNSP_ANNOT_MOVIE 12 39 // Unsupported sound annotation. 40 #define FPDF_UNSP_ANNOT_SOUND 13 41 // Unsupported screen media annotation. 42 #define FPDF_UNSP_ANNOT_SCREEN_MEDIA 14 43 // Unsupported screen rich media annotation. 44 #define FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA 15 45 // Unsupported attachment annotation. 46 #define FPDF_UNSP_ANNOT_ATTACHMENT 16 47 // Unsupported signature annotation. 48 #define FPDF_UNSP_ANNOT_SIG 17 49 50 // Interface for unsupported feature notifications. 51 typedef struct _UNSUPPORT_INFO { 52 // Version number of the interface. Must be 1. 53 int version; 54 55 // Unsupported object notification function. 56 // Interface Version: 1 57 // Implementation Required: Yes 58 // 59 // pThis - pointer to the interface structure. 60 // nType - the type of unsupported object. One of the |FPDF_UNSP_*| entries. 61 void (*FSDK_UnSupport_Handler)(struct _UNSUPPORT_INFO* pThis, int nType); 62 } UNSUPPORT_INFO; 63 64 // Setup an unsupported object handler. 65 // 66 // unsp_info - Pointer to an UNSUPPORT_INFO structure. 67 // 68 // Returns TRUE on success. 69 FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 70 FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info); 71 72 // Set replacement function for calls to time(). 73 // 74 // This API is intended to be used only for testing, thus may cause PDFium to 75 // behave poorly in production environments. 76 // 77 // func - Function pointer to alternate implementation of time(), or 78 // NULL to restore to actual time() call itself. 79 FPDF_EXPORT void FPDF_CALLCONV FSDK_SetTimeFunction(time_t (*func)()); 80 81 // Set replacement function for calls to localtime(). 82 // 83 // This API is intended to be used only for testing, thus may cause PDFium to 84 // behave poorly in production environments. 85 // 86 // func - Function pointer to alternate implementation of localtime(), or 87 // NULL to restore to actual localtime() call itself. 88 FPDF_EXPORT void FPDF_CALLCONV 89 FSDK_SetLocaltimeFunction(struct tm* (*func)(const time_t*)); 90 91 // Unknown page mode. 92 #define PAGEMODE_UNKNOWN -1 93 // Document outline, and thumbnails hidden. 94 #define PAGEMODE_USENONE 0 95 // Document outline visible. 96 #define PAGEMODE_USEOUTLINES 1 97 // Thumbnail images visible. 98 #define PAGEMODE_USETHUMBS 2 99 // Full-screen mode, no menu bar, window controls, or other decorations visible. 100 #define PAGEMODE_FULLSCREEN 3 101 // Optional content group panel visible. 102 #define PAGEMODE_USEOC 4 103 // Attachments panel visible. 104 #define PAGEMODE_USEATTACHMENTS 5 105 106 // Get the document's PageMode. 107 // 108 // doc - Handle to document. 109 // 110 // Returns one of the |PAGEMODE_*| flags defined above. 111 // 112 // The page mode defines how the document should be initially displayed. 113 FPDF_EXPORT int FPDF_CALLCONV FPDFDoc_GetPageMode(FPDF_DOCUMENT document); 114 115 #ifdef __cplusplus 116 } // extern "C" 117 #endif // __cplusplus 118 119 #endif // PUBLIC_FPDF_EXT_H_ 120