5 #ifndef PDFTRON_H_CPPPDFPDFViewCtrl
6 #define PDFTRON_H_CPPPDFPDFViewCtrl
15 #include <C/PDF/TRN_PDFViewCtrl.h>
79 PDFViewCtrl(
void* parent_hwnd,
void* hinstance,
bool compatibility =
false);
107 void DocLock(
bool cancel_threads);
429 void OnSize(
int x,
int y,
int width,
int height);
577 int copies,
const char* printer_name);
592 int copies,
const UString& printer_name);
915 bool SetZoom(
int x,
int y,
double zoom);
1060 void OnScroll(
int pix_dx,
int pix_dy);
1118 void Update(
bool all =
false);
1423 bool Select(
double x1,
double y1,
double x2,
double y2);
1433 bool SelectWithSnapping(
double x1,
double y1,
double x2,
double y2,
bool snap_to_start,
bool snap_to_end);
1451 bool Select(
double x1,
double y1,
int page1,
double x2,
double y2,
int page2);
1461 bool SelectWithSnapping(
double x1,
double y1,
int page1,
double x2,
double y2,
int page2,
bool snap_to_start,
bool snap_to_end);
1629 void SetPageSpacing(
int horiz_col_space,
int vert_col_space,
int horiz_pad,
int vert_pad);
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);
1709 typedef void (*
ThumbAsyncHandler) (
int page_num,
bool was_thumb_found,
const char* thumb_buf,
int thumb_width,
int thumb_height,
void* custom_data);
1784 bool search_up,
bool reg_exp);
1789 TRN_PDFViewCtrl mp_view;
1790 TRN_PDFDoc temp_doc;
1798 void * m_findtext_data;
1799 static void NativeFindTextHandler(
unsigned char success, TRN_PDFViewSelection select,
void * custom_data);
1825 #include <Impl/PDFViewCtrl.inl>
1830 #endif // PDFTRON_H_CPPPDFPDFViewCtrl
MouseEventHandler mouse_middle_down
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)
MouseEventHandler mouse_middle_dclick
WindowEventHandler on_window_event
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)
enum WindowID m_event_window
void SetSnappingMode(UInt32 mode_flags)
TRN_Bool m_pdfviewctrl_processed
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)
UInt8 m_pdfviewctrl_processed
enum ControlEventType m_event_type
void SetOverprint(PDFRasterizer::OverprintPreviewMode op)
enum ControlEventType m_event_type
bool IsThereTextInRect(double x1, double y1, double x2, double y2) const
double GetCanvasHeight() const
UInt8(* TextFindDoneHandler)(struct TextFindDoneEvent *evt, void *custom_data)
bool DocTryLock(int milliseconds=0)
void(* CurrentZoomHandler)(double current_zoom, void *data)
bool ShowRect(int page_num, const Rect &rect)
void ShowToolbar(bool show)
MouseEventHandler mouse_right_up
bool WereWordsPrepared(int page_num) const
MouseEventHandler mouse_right_down
void(* ThumbAsyncHandler)(int page_num, bool was_thumb_found, const char *thumb_buf, int thumb_width, int thumb_height, void *custom_data)
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)
TextFindDoneHandler on_find_text_done
void GetThumbAsync(int page_num, ThumbAsyncHandler proc, void *custom_data)
enum WindowID m_event_window
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)
int GetCurrentPage() const
UInt8 m_pdfviewctrl_processed
enum ControlEventType m_event_type
void SetToolMode(ToolMode mode)
UInt8(* AnnotationEditPermissionHandler)(struct AnnotationEditPermissionEvent *evt, void *custom_data)
Annot::Type GetAnnotTypeUnder(double x, double y)
UInt8(* KeyEventHandler)(struct KeyEvent *evt, void *custom_data)
void SetGamma(double exp)
enum ControlEventType m_event_type
Selection GetSelection(int page=-1) const
void SetProgressiveRendering(bool progressive=true)
int GetSelectionEndPage() const
double GetCanvasWidth() const
enum WindowID m_event_window
bool IsNavPanelVisible() const
double GetVScrollPos() const
bool SmartZoom(int x, int y)
void SetRasterizerType(PDFRasterizer::Type type)
void SetDrawAnnotations(bool render_annots)
static const UInt32 e_thumbview
bool SetZoom(double zoom)
void LoadCurrentConfiguration(const UString &path)
UInt8(* SizeEventHandler)(struct SizeEvent *evt, void *custom_data)
void EnableInteractiveForms(bool on)
UInt8(* ActionHandler)(TRN_Action action, void *custom_data)
MouseEventHandler mouse_move
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)
enum ControlEventType m_event_type
void SetDefaultPageColor(UInt8 r, UInt8 g, UInt8 b)
PaintEventHandler on_paint
bool SelectWithSmartSnapping(double x1, double y1, double x2, double y2)
void OnSize(int x, int y, int width, int height)
MouseEventHandler mouse_enter
UInt8(* PaintEventHandler)(struct PaintEvent *evt, void *custom_data)
int GetViewHeight() const
void ConvScreenPtToPagePt(double &x, double &y, int page_num=-1) const
enum WindowID m_event_window
enum WindowID m_event_window
KeyEventHandler character_entered
void SetCurrentZoomHandler(CurrentZoomHandler curr_zoom_proc, void *data)
void Update(bool all=false)
void SetColorPostProcessMode(PDFRasterizer::ColorPostProcessMode mode)
PanelType GetSelectedPanel() const
MouseEventHandler mouse_left_down
void SetPageTransparencyGrid(bool trans_grid_visible)
void HideAnnotation(const Annot &annot)
void(* ErrorReportHandler)(const char *message, void *data)
enum WindowID m_event_window
void ConvCanvasPtToPagePt(double &x, double &y, int page_num=-1) const
MouseEventHandler on_context_menu
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
bool HasSelection() const
void(* CurrentPageHandler)(int current_page, int num_pages, void *data)
void SetPageSpacing(int horiz_col_space, int vert_col_space, int horiz_pad, int vert_pad)
MouseEventHandler mouse_right_dclick
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)
void(* FindTextAsyncHandler)(bool success, Selection &select, void *custom_data)
void SetEnabledPanels(UInt32 panels)
void ShowDialogs(bool show)
void RotateCounterClockwise()
MouseEventHandler mouse_leave
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
PageViewMode GetPageViewMode() const
UInt8(* MouseEventHandler)(struct MouseEvent *evt, void *custom_data)
void ConvScreenPtToCanvasPt(double &x, double &y) const
Common::Matrix2D GetDeviceTransform(int page_num=-1) const
static const UInt32 e_layers
enum TRN_PDFViewCtrlWindowID m_event_window
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)
void SetTextSelectionMode(TextSelectionMode tm)
void ShowStatusBar(bool show)
TextFindDoneEvent(PDFViewCtrl::WindowID id, ControlEventType tp, bool found)
double GetHScrollPos() const
MouseEventHandler on_mousewheel
int GetSplitPosition() const
static const UInt32 e_none
UInt32 GetEnabledPanels() const
void ShowNavToolbar(bool show)
void SetRequestRenderInWorkerThreadProc(RequestRenderInWorkerThreadProc proc, void *custom_data)
PDFRasterizer::ColorPostProcessMode GetColorPostProcessMode() const
MouseEventHandler mouse_middle_up
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)
void CancelAllThumbRequests()
void AddHeader(const UString &header, const UString &val)
static const UInt32 e_all
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)
MouseEventHandler mouse_left_up
void SetPageViewMode(PageViewMode mode)
void OpenURLAsync(const char *url, UString cache_pdf="", const char *password=0, const class HTTPRequestOptions *options=0)
MouseEventHandler mouse_left_dclick