All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PDFViewCtrl.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2024 by Apryse Software Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFPDFViewCtrl
6 #define PDFTRON_H_CPPPDFPDFViewCtrl
7 
8 #include <PDF/PDFDoc.h>
9 #include <PDF/PDFRasterizer.h>
10 #include <PDF/Highlights.h>
11 #include <PDF/LinkInfo.h>
12 #include <PDF/OCG/Context.h>
13 #include <PDF/Selection.h>
14 #include <SDF/ObjSet.h>
15 #include <C/PDF/TRN_PDFViewCtrl.h>
16 #include <vector>
17 #include <PDF/ActionParameter.h>
18 
19 namespace pdftron {
20  namespace PDF {
21 
66 {
67 public:
68 
79  PDFViewCtrl(void* parent_hwnd, void* hinstance, bool compatibility = false);
80  ~PDFViewCtrl();
81 
90  bool SetDoc(PDFDoc& doc, const char* password = 0);
91 
96  void CloseDoc();
97 
101  PDFDoc* GetDoc();
102 
107  void DocLock(bool cancel_threads);
108 
112  void DocUnlock();
113 
119  bool DocTryLock( int milliseconds = 0 );
120 
132  void DocLockRead();
133 
137  void DocUnlockRead();
138 
144  bool DocTryLockRead( int milliseconds = 0 );
145 
150  enum WindowID {
161  };
162 
184  };
185 
186 
191  struct MouseEvent {
192  int m_x;
193  int m_y;
204 
205  // identifies the type of event
207  // identifies which window emitted the event
209  // if TRUE, this event was emitted after PDFViewCtrl has processed it
211  };
212 
217  struct KeyEvent {
218  int m_x;
219  int m_y;
220  long int m_keyCode;
226  // identifies the type of event
228  // this helps you identify which window emitted the event
230  // if TRUE, this event was emitted after PDFViewCtrl has processed it
232  };
233 
238  struct PaintEvent {
239  // platform-dependent device context pointer
240  void* m_hdc;
241  enum TRN_PDFViewCtrlWindowID m_event_window;
243  };
244 
245  struct SizeEvent {
246  int m_width;
247  int m_height;
250  // this helps you identify which window emitted the event
252  };
253 
258  struct WindowEvent {
259  // identifies the type of event
261  // this helps you identify which window emitted the event
263  };
264 
269  bool m_found;
272 
274  : m_event_type(tp),
275  m_event_window(id),
276  m_found(found)
277  {}
278  };
279 
284  TRN_Annot m_annot;
285  // identifies the type of event
287  // this helps you identify which window emitted the event
289 
291  : m_annot(annot),
292  m_event_type(tp),
293  m_event_window(id)
294  {}
295  };
296 
297  // handlers for generic event signals emitted by PDFViewCtrl;
298  // they return boolean, return value of true means no PDFViewCtrl processing should take place
299  typedef UInt8 (*MouseEventHandler) ( struct MouseEvent* evt, void* custom_data );
300  typedef UInt8 (*KeyEventHandler) ( struct KeyEvent* evt, void* custom_data );
301  typedef UInt8 (*PaintEventHandler) ( struct PaintEvent* evt, void* custom_data );
302  typedef UInt8 (*SizeEventHandler) ( struct SizeEvent* evt, void* custom_data );
303  typedef UInt8 (*WindowEventHandler)( struct WindowEvent* evt, void* custom_data);
304  typedef UInt8 (*TextFindDoneHandler)(struct TextFindDoneEvent* evt, void* custom_data);
305  typedef UInt8 (*AnnotationEditPermissionHandler)(struct AnnotationEditPermissionEvent* evt, void* custom_data);
306 
312  {
335 
336  void* custom_data;
337 
338  EventHandlers();
339  };
340 
345  void SetCustomEventHandlers( EventHandlers* handlers );
346 
354  typedef UInt8 (*ActionHandler) ( TRN_Action action, void* custom_data );
355 
360  void SetActionHandler( ActionHandler action_callback, void* custom_data );
361 
367  void ExecuteAction(ActionParameter action_param );
368 
377  typedef void (*CurrentPageHandler) (int current_page, int num_pages, void* data);
378 
387  void SetCurrentPageHandler(CurrentPageHandler curr_pagenum_proc, void* data);
388 
396  typedef void (*CurrentZoomHandler) (double current_zoom, void* data);
397 
406  void SetCurrentZoomHandler(CurrentZoomHandler curr_zoom_proc, void* data);
407 
408  typedef void (*ErrorReportHandler) (const char* message, void* data);
409 
417  void SetErrorReportHandler(ErrorReportHandler error_proc, void* data);
418 
429  void OnSize(int x, int y, int width, int height);
430 
435  void Find();
436 
440  void Copy();
441 
445  void SelectAll();
446 
458  void SetProgressiveRendering(bool progressive=true);
459 
464  void ShowNavPanel(bool show);
465 
469  bool IsNavPanelVisible() const;
470 
475  void EnableScrollbar( bool show );
476 
481  void ShowToolbar( bool show);
482 
487  void ShowStatusBar( bool show);
488 
493  void ShowNavToolbar( bool show);
494 
499  void ShowMenuBar( bool show );
500 
505  void EnableInteractiveForms(bool on);
506 
512  void ShowDialogs(bool show);
513 
514  static const UInt32 e_none=0x00;
515  static const UInt32 e_bookmarks=0x01;
516  static const UInt32 e_layers=0x02;
517  static const UInt32 e_thumbview=0x04;
518  static const UInt32 e_all=0x07;
519  typedef UInt32 PanelType;
520 
525  void SetEnabledPanels(UInt32 panels);
526 
532  UInt32 GetEnabledPanels() const ;
533 
538  void SetSelectedPanel(PanelType panel);
539 
544  PanelType GetSelectedPanel() const ;
545 
550  void SetSplitPosition(int pos);
551 
556  int GetSplitPosition() const ;
557 
563  void Print();
564 
576  void Print(int first_page, int last_page, Page::Rotate rotation,
577  int copies, const char* printer_name);
578 
579 
591  void Print(int first_page, int last_page, Page::Rotate rotation,
592  int copies, const UString& printer_name);
593 
594 
598  void Refresh();
599 
600 
612  void RequestRendering();
613 
614 
618  void CaptureMouse();
619 
623  void ReleaseMouse();
624 
628  bool HasCapture() const;
629 
634  void EnableLinkActivation(bool enable);
635 
641  void LoadCurrentConfiguration( const UString & path );
642 
648  void SaveCurrentConfiguration( const UString & path, Common::ProgressMonitor* progress = 0 );
649 
662  Annot GetDefaultAnnotation( const char* type );
663 
667  void SetWindowBackgroundColor( WindowID winid, const ColorPt& color );
668 #ifdef WIN32
669  void SetWindowCursor( PDFViewCtrl::WindowID winid, HCURSOR cursor );
670 #endif
671 
675  void SetFocus();
676 
677  /* dialogs creation API */
678 
683  void DocProperties();
684 
689  void DeletePages();
690 
695  void InsertPages(const UString& src_name);
696 
701  void InsertBlankPages();
702 
708  void ReplacePages(const UString& src_name = UString());
709 
714  void RotatePages();
715 
719  void ExtractPages();
720 
726  void CropPages();
727 
732  void AddWatermark();
733 
734  /* end of dialogs creation API */
735 
749  {
754  };
755 
762  void SetPageViewMode(PageViewMode mode);
763 
767  PageViewMode GetPageViewMode() const ;
768 
773  {
774  e_single_page = 1, //<<< Display one page at a time.
775  e_single_continuous, //<<< Display the pages in one column.
776  e_facing, //<<< Display the pages two at a time, with odd-numbered pages on the left.
777  e_facing_continuous, //<<< Display the pages in two columns, with odd-numbered pages on the left.
778  e_facing_cover, //<<< Display the pages two at a time, with odd-numbered pages on the right.
779  e_facing_continuous_cover //<<< Display the pages in two columns, with odd-numbered pages on the right.
780  };
781 
789 
794 
805 
810 
814  int GetCurrentPage() const ;
815 
819  int GetPageCount() const ;
820 
826  std::vector<int> GetVisiblePages() const ;
827 
833  bool GotoFirstPage();
834 
840  bool GotoLastPage();
841 
847  bool GotoNextPage();
848 
854  bool GotoPreviousPage();
855 
861  bool SetCurrentPage(int page_num);
862 
870  bool ShowRect( int page_num, const Rect& rect );
871 
877  double GetZoom() const ;
878 
886  bool SetZoom(double zoom);
887 
915  bool SetZoom(int x, int y, double zoom);
916 
933  bool SmartZoom(int x, int y);
934 
938  void RotateClockwise();
939 
943  void RotateCounterClockwise();
944 
948  Page::Rotate GetRotation() const ;
949 
954  int GetPageNumberFromScreenPt(double x, double y) const ;
955 
959  void ConvScreenPtToCanvasPt(double& x, double& y) const ;
960 
964  void ConvCanvasPtToScreenPt(double& x, double& y) const;
965 
973  void ConvCanvasPtToPagePt(double& x, double& y, int page_num = -1) const;
974 
982  void ConvPagePtToCanvasPt(double& x, double& y, int page_num = -1) const;
983 
991  void ConvScreenPtToPagePt(double& x, double& y, int page_num = -1) const;
992 
1000  void ConvPagePtToScreenPt(double& x, double& y, int page_num = -1) const;
1001 
1006  void SnapToNearestInDoc(double& screen_x, double& screen_y);
1007 
1014  void SetSnappingMode(UInt32 mode_flags);
1015 
1031  Common::Matrix2D GetDeviceTransform(int page_num = -1) const;
1032 
1036  double GetCanvasWidth() const;
1037 
1041  double GetCanvasHeight() const;
1042 
1046  double GetHScrollPos() const;
1047 
1051  double GetVScrollPos() const;
1052 
1053 
1060  void OnScroll(int pix_dx, int pix_dy);
1061 
1068  void SetHScrollPos(double pos);
1069 
1092  void SetVScrollPos(double pos);
1093 
1105  bool IsFinishedRendering(bool visible_region_only) const;
1106 
1111  void CancelRendering();
1112 
1118  void Update(bool all = false);
1119 
1124  void Update(const Rect& update);
1125 
1131  void Update(const Annot& annot, int page_num);
1132 
1137  void Update(const Field& field);
1138 
1145  void UpdatePageLayout();
1146 
1151  void HideAnnotation(const Annot& annot);
1152 
1157  void ShowAnnotation(const Annot& annot);
1158 
1163  int GetViewWidth() const;
1164 
1169  int GetViewHeight() const;
1170 
1171 
1178  void SetDrawAnnotations(bool render_annots);
1179 
1192  void SetUrlExtraction(bool enabled);
1193 
1206  LinkInfo GetLinkAt(int x, int y);
1207 
1213  void SetHighlightFields(bool highlight_fields);
1214 
1223  void SetRequiredFieldBorderColor(const ColorPt& new_border_color);
1224 
1234  void SetAntiAliasing(bool enable_aa);
1235 
1244  void SetPathHinting(bool enable_hinting);
1245 
1256  void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust);
1257 
1271  void SetImageSmoothing(bool smoothing_enabled = true);
1272 
1280  void SetCaching(bool enabled);
1281 
1291 
1304  void SetGamma(double exp);
1305 
1316 
1332  void SetOCGContext(const OCG::Context& ctx);
1333 
1342 
1347  enum ToolMode
1348  {
1349  e_custom, // Custom tool
1350  e_pan, // Pan tool
1351  e_text_rect_select, // Rectangular text selection tool
1352  e_text_struct_select, // HTML Style text selection tool
1353  e_zoom_in, // Zoom in tool
1354  e_zoom_out, // Zoom out tool
1355  e_annot_edit, // Annotation editing tool
1356  e_line_create, // Line creation tool
1357  e_arrow_create, // Arrow creation tool
1358  e_rect_create, // Rectangle creation tool
1359  e_oval_create, // Oval/Ellipse creation tool
1360  e_ink_create, // Freehand drawing tool
1361  e_text_annot_create, // Text annotation creation tool
1362  e_stamp_create, // Stamp Annotation creation tool
1363  e_highlight_create, // highlight text tool
1364  e_underline_create, // underline text tool
1365  e_strikeout_create, // cross out text tool
1366  e_squiggly_create, // squiggly underline tool
1367  e_text_box_create, // free text creation tool
1368  e_calloutbox_create, // free text with a callout tool
1369  e_polygon_create, // polygon creation tool
1370  e_polyline_create, // polyline creation tool
1371  e_file_attachment, // file attachment creation
1372  e_sound_attachment, // sound annotation creation
1373  e_movie_attachment, // movie annotation creation
1374  e_caret_create, // caret placement tool
1375  e_redaction_create, // redaction placement tool
1376  e_text_field_create, // interactive text field creation
1377  e_check_box_create, // interactive check box creation tool
1378  e_radio_button_create, // interactive radio button tool
1379  e_list_box_create, // interactive list box creation tool
1380  e_combo_box_create, // interactive combo box creation tool
1381  e_button_create, // interactive button creation tool
1382  e_link_create, // create a link annotation
1384  };
1385 
1390  void SetToolMode(ToolMode mode);
1391 
1395  ToolMode GetToolMode() const;
1396 
1408  };
1409 
1415 
1423  bool Select(double x1, double y1, double x2, double y2);
1424 
1433  bool SelectWithSnapping(double x1, double y1, double x2, double y2, bool snap_to_start, bool snap_to_end);
1434 
1442  bool SelectWithSmartSnapping(double x1, double y1, double x2, double y2);
1443 
1451  bool Select(double x1, double y1, int page1, double x2, double y2, int page2);
1452 
1461  bool SelectWithSnapping(double x1, double y1, int page1, double x2, double y2, int page2, bool snap_to_start, bool snap_to_end);
1462 
1470  bool SelectWithSmartSnapping(double x1, double y1, int page1, double x2, double y2, int page2);
1471 
1478  bool Select(const Highlights& highlights);
1479 
1480 
1487  bool Select(const Selection& select);
1488 
1492  bool HasSelection() const;
1493 
1497  void ClearSelection();
1498 
1504  Selection GetSelection( int page = -1 ) const;
1505 
1510  int GetSelectionBeginPage() const ;
1511 
1516  int GetSelectionEndPage() const;
1517 
1522  bool HasSelectionOnPage( int ipage ) const;
1523 
1530  void PrepareWords(int page_num);
1531 
1536  bool WereWordsPrepared(int page_num) const;
1537 
1542  bool IsThereTextInRect(double x1, double y1, double x2, double y2) const;
1543 
1554  void PrepareAnnotsForMouse(int page_num, double distance_threshold, double minimum_line_weight);
1555 
1560  bool WereAnnotsForMousePrepared(int page_num) const;
1561 
1567  Annot::Type GetAnnotTypeUnder(double x, double y);
1568 
1573  void SetPageBorderVisibility(bool border_visible);
1574 
1580  void SetPageTransparencyGrid(bool trans_grid_visible);
1581 
1586  void SetDefaultPageColor(UInt8 r, UInt8 g, UInt8 b);
1587 
1592  void SetBackgroundColor(UInt8 r, UInt8 g, UInt8 b);
1593 
1603  void SetHorizontalAlign(int align);
1604 
1614  void SetVerticalAlign(int align);
1615 
1629  void SetPageSpacing(int horiz_col_space, int vert_col_space, int horiz_pad, int vert_pad);
1630 
1639  Rect GetScreenRectForAnnot(Annot annot, int page_num = -1);
1640 
1649  Annot GetAnnotationAt(int x, int y);
1650 
1658  void SetDownloadReportHandler(DownloadReportHandler download_proc, void* data);
1659 
1679  void OpenURLAsync(const char* url, UString cache_pdf="", const char* password = 0, const class HTTPRequestOptions* options = 0);
1680 
1691  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);
1692 
1696  void ClearThumbCache();
1697 
1709  typedef void (*ThumbAsyncHandler) (int page_num, bool was_thumb_found, const char* thumb_buf, int thumb_width, int thumb_height, void* custom_data);
1710 
1719  void GetThumbAsync(int page_num, ThumbAsyncHandler proc, void* custom_data);
1720 
1721  /*
1722  * Cancel all pending GetThumbAsync requests. Your callback function will still be called
1723  * for each canceled request, but 'was_thumb_found' will be set to 'false'.
1724  */
1725  void CancelAllThumbRequests();
1726 
1732  typedef void (*RequestRenderInWorkerThreadProc) (void* custom_data);
1733 
1742 #ifdef SWIG
1743  void SetRequestRenderInWorkerThreadProc(Callback* instance);
1744 #else
1746 #endif
1747 
1748 #ifdef SWIG
1749 
1755  void SetFindTextHandler(Callback * instance);
1756 #else
1757 
1762  typedef void (*FindTextAsyncHandler) (bool success, Selection& select, void * custom_data);
1763 
1771  void SetFindTextHandler(FindTextAsyncHandler proc, void * custom_data);
1772 #endif
1773 
1783  void FindTextAsync(const UString& search_str, bool match_case, bool match_whole_word,
1784  bool search_up, bool reg_exp);
1785 
1786 
1787 // @cond PRIVATE_DOC
1788 private:
1789  TRN_PDFViewCtrl mp_view;
1790  TRN_PDFDoc temp_doc;
1791 
1792  // PDFViewCtrl should not be copied
1793  PDFViewCtrl(const PDFViewCtrl& other);
1794  PDFViewCtrl& operator= (const PDFViewCtrl&);
1795 
1796  //For FindTextAsync callback landing pad
1797  FindTextAsyncHandler m_findtext_proc;
1798  void * m_findtext_data;
1799  static void NativeFindTextHandler(unsigned char success, TRN_PDFViewSelection select, void * custom_data);
1800  // @endcond
1801 };
1802 
1807 {
1808 public:
1818  void AddHeader(const UString& header, const UString& val);
1819 protected:
1820  TRN_Obj m_obj;
1821  friend class PDF::PDFViewCtrl;
1823 };
1824 
1825 #include <Impl/PDFViewCtrl.inl>
1826 
1827  } // namespace PDF
1828 } // namespace pdftron
1829 
1830 #endif // PDFTRON_H_CPPPDFPDFViewCtrl
void SetFindTextHandler(FindTextAsyncHandler proc, void *custom_data)
void ShowAnnotation(const Annot &annot)
void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust)
bool SelectWithSnapping(double x1, double y1, double x2, double y2, bool snap_to_start, bool snap_to_end)
bool WereAnnotsForMousePrepared(int page_num) const
void SetWindowBackgroundColor(WindowID winid, const ColorPt &color)
void SetCurrentPageHandler(CurrentPageHandler curr_pagenum_proc, void *data)
bool HasSelectionOnPage(int ipage) const
void SetPagePresentationMode(PagePresentationMode mode)
void SetDownloadReportHandler(DownloadReportHandler download_proc, void *data)
void SetHorizontalAlign(int align)
Page::Rotate GetRotation() const
void ConvPagePtToCanvasPt(double &x, double &y, int page_num=-1) const
PagePresentationMode GetPagePresentationMode() const
void ShowMenuBar(bool show)
void SetSnappingMode(UInt32 mode_flags)
void ReplacePages(const UString &src_name=UString())
int GetSelectionBeginPage() const
void ShowNavPanel(bool show)
std::vector< int > GetVisiblePages() const
void InsertPages(const UString &src_name)
void PrepareAnnotsForMouse(int page_num, double distance_threshold, double minimum_line_weight)
enum ControlEventType m_event_type
Definition: PDFViewCtrl.h:206
void SetOverprint(PDFRasterizer::OverprintPreviewMode op)
enum ControlEventType m_event_type
Definition: PDFViewCtrl.h:260
bool IsThereTextInRect(double x1, double y1, double x2, double y2) const
double GetCanvasHeight() const
UInt8(* TextFindDoneHandler)(struct TextFindDoneEvent *evt, void *custom_data)
Definition: PDFViewCtrl.h:304
bool DocTryLock(int milliseconds=0)
void(* CurrentZoomHandler)(double current_zoom, void *data)
Definition: PDFViewCtrl.h:396
bool ShowRect(int page_num, const Rect &rect)
TRN_UInt8 UInt8
Definition: BasicTypes.h:15
void ShowToolbar(bool show)
bool WereWordsPrepared(int page_num) const
void(* ThumbAsyncHandler)(int page_num, bool was_thumb_found, const char *thumb_buf, int thumb_width, int thumb_height, void *custom_data)
Definition: PDFViewCtrl.h:1709
ToolMode GetToolMode() const
void SetHScrollPos(double pos)
int GetPageNumberFromScreenPt(double x, double y) const
void SetPageBorderVisibility(bool border_visible)
void SetCaching(bool enabled)
bool SetCurrentPage(int page_num)
void SetRequiredFieldBorderColor(const ColorPt &new_border_color)
void PrepareWords(int page_num)
void SetPathHinting(bool enable_hinting)
void(* RequestRenderInWorkerThreadProc)(void *custom_data)
Definition: PDFViewCtrl.h:1732
void GetThumbAsync(int page_num, ThumbAsyncHandler proc, void *custom_data)
void EnableScrollbar(bool show)
Annot GetAnnotationAt(int x, int y)
void SetImageSmoothing(bool smoothing_enabled=true)
bool SetDoc(PDFDoc &doc, const char *password=0)
void ExecuteAction(ActionParameter action_param)
LinkInfo GetLinkAt(int x, int y)
enum ControlEventType m_event_type
Definition: PDFViewCtrl.h:227
void SetToolMode(ToolMode mode)
UInt8(* AnnotationEditPermissionHandler)(struct AnnotationEditPermissionEvent *evt, void *custom_data)
Definition: PDFViewCtrl.h:305
Annot::Type GetAnnotTypeUnder(double x, double y)
UInt8(* KeyEventHandler)(struct KeyEvent *evt, void *custom_data)
Definition: PDFViewCtrl.h:300
void SetGamma(double exp)
Selection GetSelection(int page=-1) const
void SetProgressiveRendering(bool progressive=true)
int GetSelectionEndPage() const
double GetCanvasWidth() const
bool IsNavPanelVisible() const
TRN_Unicode Unicode
Definition: BasicTypes.h:22
double GetVScrollPos() const
bool SmartZoom(int x, int y)
void SetRasterizerType(PDFRasterizer::Type type)
void SetDrawAnnotations(bool render_annots)
static const UInt32 e_thumbview
Definition: PDFViewCtrl.h:517
bool SetZoom(double zoom)
void LoadCurrentConfiguration(const UString &path)
UInt8(* SizeEventHandler)(struct SizeEvent *evt, void *custom_data)
Definition: PDFViewCtrl.h:302
void EnableInteractiveForms(bool on)
UInt8(* ActionHandler)(TRN_Action action, void *custom_data)
Definition: PDFViewCtrl.h:354
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)
void SetDefaultPageColor(UInt8 r, UInt8 g, UInt8 b)
bool SelectWithSmartSnapping(double x1, double y1, double x2, double y2)
void OnSize(int x, int y, int width, int height)
TRN_UInt32 UInt32
Definition: BasicTypes.h:13
UInt8(* PaintEventHandler)(struct PaintEvent *evt, void *custom_data)
Definition: PDFViewCtrl.h:301
void ConvScreenPtToPagePt(double &x, double &y, int page_num=-1) const
void SetCurrentZoomHandler(CurrentZoomHandler curr_zoom_proc, void *data)
void Update(bool all=false)
void SetColorPostProcessMode(PDFRasterizer::ColorPostProcessMode mode)
PanelType GetSelectedPanel() const
void SetPageTransparencyGrid(bool trans_grid_visible)
void HideAnnotation(const Annot &annot)
void(* ErrorReportHandler)(const char *message, void *data)
Definition: PDFViewCtrl.h:408
void ConvCanvasPtToPagePt(double &x, double &y, int page_num=-1) const
void SetVScrollPos(double pos)
void SetErrorReportHandler(ErrorReportHandler error_proc, void *data)
void SetSplitPosition(int pos)
void SetUrlExtraction(bool enabled)
Annot GetDefaultAnnotation(const char *type)
bool Select(double x1, double y1, double x2, double y2)
void EnableLinkActivation(bool enable)
bool IsFinishedRendering(bool visible_region_only) const
AnnotationEditPermissionHandler on_edit_annotation
Definition: PDFViewCtrl.h:334
bool HasSelection() const
void(* CurrentPageHandler)(int current_page, int num_pages, void *data)
Definition: PDFViewCtrl.h:377
void SetPageSpacing(int horiz_col_space, int vert_col_space, int horiz_pad, int vert_pad)
void SetBackgroundColor(UInt8 r, UInt8 g, UInt8 b)
void SetHighlightFields(bool highlight_fields)
void(* DownloadReportHandler)(DownloadedType type, PDFDoc *doc, int page_num, int obj_num, const char *message, void *data)
Definition: PDFRasterizer.h:44
void(* FindTextAsyncHandler)(bool success, Selection &select, void *custom_data)
Definition: PDFViewCtrl.h:1762
void SetEnabledPanels(UInt32 panels)
void ShowDialogs(bool show)
Rect GetScreenRectForAnnot(Annot annot, int page_num=-1)
void OnScroll(int pix_dx, int pix_dy)
void SetActionHandler(ActionHandler action_callback, void *custom_data)
static const UInt32 e_bookmarks
Definition: PDFViewCtrl.h:515
PageViewMode GetPageViewMode() const
UInt8(* MouseEventHandler)(struct MouseEvent *evt, void *custom_data)
Definition: PDFViewCtrl.h:299
void ConvScreenPtToCanvasPt(double &x, double &y) const
Common::Matrix2D GetDeviceTransform(int page_num=-1) const
static const UInt32 e_layers
Definition: PDFViewCtrl.h:516
enum TRN_PDFViewCtrlWindowID m_event_window
Definition: PDFViewCtrl.h:241
bool DocTryLockRead(int milliseconds=0)
void SnapToNearestInDoc(double &screen_x, double &screen_y)
void SetOCGContext(const OCG::Context &ctx)
UInt8(* WindowEventHandler)(struct WindowEvent *evt, void *custom_data)
Definition: PDFViewCtrl.h:303
void SetTextSelectionMode(TextSelectionMode tm)
void ShowStatusBar(bool show)
TextFindDoneEvent(PDFViewCtrl::WindowID id, ControlEventType tp, bool found)
Definition: PDFViewCtrl.h:273
double GetHScrollPos() const
int GetSplitPosition() const
static const UInt32 e_none
Definition: PDFViewCtrl.h:514
UInt32 GetEnabledPanels() const
void ShowNavToolbar(bool show)
void SetRequestRenderInWorkerThreadProc(RequestRenderInWorkerThreadProc proc, void *custom_data)
PDFRasterizer::ColorPostProcessMode GetColorPostProcessMode() const
void SetCustomEventHandlers(EventHandlers *handlers)
void SaveCurrentConfiguration(const UString &path, Common::ProgressMonitor *progress=0)
void DocLock(bool cancel_threads)
void SetVerticalAlign(int align)
void SetAntiAliasing(bool enable_aa)
AnnotationEditPermissionEvent(PDFViewCtrl::WindowID id, ControlEventType tp, TRN_Annot annot)
Definition: PDFViewCtrl.h:290
void AddHeader(const UString &header, const UString &val)
static const UInt32 e_all
Definition: PDFViewCtrl.h:518
void ConvPagePtToScreenPt(double &x, double &y, int page_num=-1) const
OCG::Context GetOCGContext()
PDFViewCtrl(void *parent_hwnd, void *hinstance, bool compatibility=false)
void ConvCanvasPtToScreenPt(double &x, double &y) const
void FindTextAsync(const UString &search_str, bool match_case, bool match_whole_word, bool search_up, bool reg_exp)
void SetSelectedPanel(PanelType panel)
double GetZoom() const
void SetPageViewMode(PageViewMode mode)
void OpenURLAsync(const char *url, UString cache_pdf="", const char *password=0, const class HTTPRequestOptions *options=0)