5 #ifndef PDFTRON_H_CPPPDFPDFView
6 #define PDFTRON_H_CPPPDFPDFView
15 #include <C/PDF/TRN_PDFView.h>
114 void DocLock(
bool cancel_threads);
338 bool SetZoom(
int x,
int y,
double zoom);
601 void OnScroll(
int pix_dx,
int pix_dy);
642 void OnSize(
int width,
int height);
663 void Update(
bool all =
false);
698 std::vector<unsigned char>
GetBuffer()
const;
1041 bool Select(
double x1,
double y1,
double x2,
double y2);
1051 bool SelectWithSnapping(
double x1,
double y1,
double x2,
double y2,
bool snap_to_start,
bool snap_to_end);
1069 bool Select(
double x1,
double y1,
int page1,
double x2,
double y2,
int page2);
1079 bool SelectWithSnapping(
double x1,
double y1,
int page1,
double x2,
double y2,
int page2,
1080 bool snap_to_start,
bool snap_to_end);
1256 void SetPageSpacing(
int horiz_col_space,
int vert_col_space,
int horiz_pad,
int vert_pad);
1376 void SetupThumbnails(
bool use_embedded,
bool generate_at_runtime,
bool use_disk_cache,
int thumb_max_side_length,
size_t max_abs_cache_size,
double max_perc_cache_size);
1394 typedef void (*
ThumbAsyncHandler) (
int page_num,
bool was_thumb_found,
const char* thumb_buf,
int thumb_width,
int thumb_height,
void* custom_data);
1496 void FindTextAsync(
const UString& search_str,
bool match_case,
bool match_whole_word,
bool search_up,
bool reg_exp);
1537 TRN_PDFView mp_view;
1538 TRN_PDFDoc temp_doc;
1545 void* mp_findtextdata;
1547 static void StaticTRNPDFViewFindTextHandler(TRN_Bool success, TRN_PDFViewSelection selection,
void* custom_data);
1550 #if defined(__iOS__)
1552 #include <Impl/PDFView.internal>
1553 #endif // defined(__iOS__)
1557 #include <Impl/PDFView.inl>
1562 #endif // PDFTRON_H_CPPPDFPDFView
bool DocTryLock(int milliseconds=0)
void SetPageSpacing(int horiz_col_space, int vert_col_space, int horiz_pad, int vert_pad)
void(* JavaScriptEventProc)(const char *event_type, const char *json, void *data)
void SetBackgroundColor(UInt8 r, UInt8 g, UInt8 b, UInt8 a=255)
Point SnapToNearestInDoc(const Point &screen_pt)
void SetVScrollPos(double pos)
void SetRasterizerType(PDFRasterizer::Type type)
void SetHScrollPos(double pos)
PagePresentationMode GetPagePresentationMode() const
bool SelectWithSmartSnapping(double x1, double y1, double x2, double y2)
std::vector< Annot > GetAnnotationsOnPage(int page_num)
void OnScroll(int pix_dx, int pix_dy)
bool WereWordsPrepared(int page_num) const
void SetPageRefViewMode(PageViewMode mode)
bool DocTryLockRead(int milliseconds=0)
void PrepareWords(int page_num)
void HideAnnotation(Annot annot)
void SetRequestRenderInWorkerThreadProc(RequestRenderInWorkerThreadProc proc, void *custom_data)
void(* RenderFinishEventProc)(void *data, bool canceled)
bool IsFinishedRendering(bool visible_region_only) const
void SetVerticalAlign(int align)
void(* RenderBeginEventProc)(void *data)
void SetOCGContext(const OCG::Context &ctx)
void SetUrlExtraction(bool enabled)
size_t GetThumbInCacheSize(int page_num)
Annot GetAnnotationAt(int x, int y, double distanceThreshold, double minimumLineWeight)
OCG::Context GetOCGContext()
void SetColorPostProcessMapFile(Filters::Filter image_file_contents)
void SetFindTextHandler(PDFView::FindTextHandler proc, void *custom_data)
int GetPageNumberFromScreenPt(double x, double y) const
Point ConvPagePtToScreenPt(const Point &pt, int page_num=-1) const
void SetPagePresentationMode(PagePresentationMode mode)
void(* CurrentZoomProc)(double curr_zoom_proc, void *data)
Point ConvCanvasPtToPagePt(const Point &pt, int page_num=-1) const
Selection GetSelection(int pagenum=-1) const
Page::Rotate GetRotation() const
bool SelectWithSnapping(double x1, double y1, double x2, double y2, bool snap_to_start, bool snap_to_end)
void SetupThumbnails(bool use_embedded, bool generate_at_runtime, bool use_disk_cache, int thumb_max_side_length, size_t max_abs_cache_size, double max_perc_cache_size)
bool HasSelectionOnPage(int ipage) const
int GetBufferStride() const
void SetCurrentZoomProc(CurrentZoomProc curr_zoom_proc, void *data)
void FindTextAsync(const UString &search_str, bool match_case, bool match_whole_word, bool search_up, bool reg_exp)
void SetAntiAliasing(bool enable_aa)
void(* RequestRenderInWorkerThreadProc)(void *custom_data)
void SetOverprint(PDFRasterizer::OverprintPreviewMode op)
Point ConvScreenPtToCanvasPt(const Point &pt) const
void Update(bool all=false)
void PrepareAnnotsForMouse(int page_num, double distance_threshold, double minimum_line_weight)
bool SetZoom(double zoom)
void SetGamma(double exp)
Point ConvCanvasPtToScreenPt(const Point &pt) const
void SetPathHinting(bool enable_hinting)
ExternalAnnotManager GetExternalAnnotManager(const UString &author, ExternalAnnotManager::Mode mode=ExternalAnnotManager::e_admin_undo_own)
bool SetCurrentPage(int page_num)
void SetImageSmoothing(bool smoothing_enabled=true)
void(* ErrorReportProc)(const char *message, void *data)
Point ConvPagePtToCanvasPt(const Point &pt, int page_num=-1) const
UString GetNextRedoInfo()
void SetDefaultPageColor(UInt8 r, UInt8 g, UInt8 b)
double GetHScrollPos() const
void SetColorPostProcessMode(PDFRasterizer::ColorPostProcessMode mode)
void TakeSnapshot(const UString &meta_info)
void(* FindTextHandler)(bool success, PDF::Selection selection, void *custom_data)
const char * GetBuffer() const
PageViewMode GetPageRefViewMode() const
void(* ThumbAsyncHandler)(int page_num, bool was_thumb_found, const char *thumb_buf, int thumb_width, int thumb_height, void *custom_data)
void SetErrorReportProc(PDFRasterizer::ErrorReportProc error_proc, void *data)
void GetThumbAsync(int page_num, ThumbAsyncHandler proc, void *custom_data)
std::vector< Annot > GetAnnotationListAt(int x1, int y1, int x2, int y2)
ColorPt GetPostProcessedColor(const ColorPt &color) const
Point ConvScreenPtToPagePt(const Point &pt, int page_num=-1) const
void SetSignatureHighlightColor(const ColorPt &new_signature_highlight_color)
void SetSnappingMode(UInt32 mode_flags)
void SetDrawAnnotations(bool render_annots)
double GetVScrollPos() const
double GetCanvasHeight() const
void SetRequiredFieldBorderColor(const ColorPt &new_border_color)
void DocLock(bool cancel_threads)
void SetPageTransparencyGrid(bool trans_grid_visible)
std::vector< int > GetVisiblePages() const
bool Select(double x1, double y1, double x2, double y2)
void SetRenderFinishProc(RenderFinishEventProc proc, void *data)
void RefreshAndUpdate(const ViewChangeCollection &view_change)
void SetJavaScriptEventCallBack(JavaScriptEventProc js_proc, void *data)
void SetHorizontalAlign(int align)
int GetSelectionEndPage() const
bool ShowRect(int page_num, const Rect &rect)
void ExecuteAction(Action &action)
bool WereAnnotsForMousePrepared(int page_num) const
void SetRenderBeginProc(RenderBeginEventProc proc, void *data)
Annot::Type GetAnnotTypeUnder(double x, double y)
TextSelectionMode GetTextSelectionMode() const
bool IsThereTextInRect(double x1, double y1, double x2, double y2) const
void SetPageBorderVisibility(bool border_visible)
void SetCurrentPageProc(CurrentPageProc curr_pagenum_proc, void *data)
UString GetNextUndoInfo()
int GetSelectionBeginPage() const
bool GetThumbInCache(int page_num, UChar *buf, UInt32 &out_width, UInt32 &out_height)
bool HasSelection() const
int GetBufferWidth() const
void OnSize(int width, int height)
void SetHighlightFields(bool highlight_fields)
PDFRasterizer::ColorPostProcessMode GetColorPostProcessMode() const
void SetPageViewMode(PageViewMode mode)
LinkInfo GetLinkAt(int x, int y)
void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust)
void SetColorPostProcessColors(unsigned int white_color, unsigned int black_color)
Rect GetScreenRectForAnnot(Annot annot, int page_num=-1)
static void SetViewerCache(SDF::SDFDoc &document, size_t max_cache_size, bool on_disk)
void CancelAllThumbRequests()
Common::Matrix2D GetDeviceTransform(int page_num=-1) const
void ShowAnnotation(Annot annot)
void RotateCounterClockwise()
void(* CurrentPageProc)(int current_page, int num_pages, void *data)
int GetCurrentPage() const
bool SmartZoom(int x, int y)
PageViewMode GetPageViewMode() const
void OpenUniversalDoc(DocumentConversion &conversion)
void SetFieldHighlightColor(const ColorPt &new_field_highlight_color)
void SetCaching(bool enabled)
void SetTextSelectionMode(TextSelectionMode tm)
double GetCanvasWidth() const
void SetDevicePixelDensity(double dpi, double scale_factor)
int GetBufferHeight() const