Foxit PDF SDK
fs_paragraphediting.h
1 
15 #ifndef FS_PARAGRAPHEDITING_H_
16 #define FS_PARAGRAPHEDITING_H_
17 
18 #include "common/fs_common.h"
19 #include "common/fs_render.h"
20 #include "pdf/fs_pdfdoc.h"
21 #include "pdf/fs_pdfpage.h"
22 
28 namespace foxit {
32 namespace addon {
36 namespace pageeditor {
37 // forward declaration
38 class ParagraphEditing;
40 
46  public:
52  virtual void Release() = 0;
53 
61  virtual Matrix GetRenderMatrix(const pdf::PDFDoc& document, int page_index) = 0;
62 
70  virtual void* GetPageViewHandle(const pdf::PDFDoc& document, int page_index) = 0;
71 
77  virtual RectF GetClientRect(const pdf::PDFDoc& document) = 0;
78 
86  virtual float GetScale(const pdf::PDFDoc& document, int page_index) = 0;
87 
97  virtual bool GotoPageView(const pdf::PDFDoc& document, int page_index, float left, float top) = 0;
98 
104  virtual Int32Array GetVisiblePageIndexArray(const pdf::PDFDoc& document) = 0;
105 
113  virtual RectF GetPageVisibleRect(const pdf::PDFDoc& document, int page_index) = 0;
114 
122  virtual foxit::RectF GetPageRect(const pdf::PDFDoc& document, int page_index) = 0;
123 
129  virtual int GetCurrentPageIndex(const pdf::PDFDoc& document) = 0;
130 
138  virtual common::Rotation GetRotation(const pdf::PDFDoc& document, int page_index) = 0;
139 
148  virtual void InvalidateRect(const pdf::PDFDoc& document, int page_index, const RectFArray& invalid_rects) = 0;
149 
157  virtual void AddUndoItem(const ParagraphEditingUndoItem& undo_item) = 0;
158 
166  virtual void SetDocChangeMark(const pdf::PDFDoc& document) = 0;
167 
175  virtual void NotifyTextInputReachLimit(const pdf::PDFDoc& document, int page_index) = 0;
176 
177  protected:
180 };
181 
185 class ParagraphEditingUndoItem FS_FINAL : public Base {
186  public:
193 
196 
197  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
198  explicit ParagraphEditingUndoItem(FS_HANDLE handle);
199 
208 
216  bool operator==(const ParagraphEditingUndoItem& other) const;
217 
225  bool operator!=(const ParagraphEditingUndoItem& other) const;
226 
234  bool IsEmpty() const;
235 
241  void Undo();
242 
248  void Redo();
249 };
250 
257 class ParagraphEditing FS_FINAL : public Base {
258  public:
264  typedef enum _BulletType {
283  } BulletType;
284 
290  typedef enum _NumberingType {
303  } NumberingType;
304 
305 
308 
314  ParagraphEditing(const ParagraphEditing& other);
315 
316  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
317  explicit ParagraphEditing(FS_HANDLE handle);
318 
327 
336  bool operator==(const ParagraphEditing& other) const;
337 
346  bool operator!=(const ParagraphEditing& other) const;
347 
355  bool IsEmpty() const;
356 
361  bool Activate();
362 
368  bool Deactivate();
369 
379  void StartEditing(int page_index, const PointF& start_point, const PointF& end_point);
380 
388  void ExitEditing(bool is_end_directly = false);
389 
397  bool InsertText(const WString& text);
398 
409  bool Render(const Int32Array page_index_array, const common::Renderer& renderer);
410 
418  bool OnChar(uint32 char_code);
419 
428  bool OnKeyDown(uint32 key_code);
429 
438  bool OnKeyUp(uint32 key_code);
439 
448  bool OnLButtonDown(int page_index, const PointF& point);
449 
458  bool OnLButtonUp(int page_index, const PointF& point);
459 
468  bool OnLButtonDoubleClick(int page_index, const PointF& point);
469 
478  bool OnMouseMove(int page_index, const PointF& point);
479 
490  bool OnMouseWheel(int page_index, const PointF& point, int32 delta);
491 
497  bool CanSelectAll();
498 
504  bool SelectAll();
505 
511  bool CanDelete();
512 
518  bool DeleteSelected();
519 
525  bool CanCopy();
526 
532  bool CopySelected();
533 
539  bool CanCut();
540 
546  bool CutSelected();
547 
553  bool CanPaste();
554 
560  bool PasteSelected();
561 
567  bool CanDeselectAll();
568 
574  bool DeselectAll();
575 
583  void SetFontName(const WString& font_name);
584 
592  void SetFontSize(float font_size);
593 
601  void SetTextColor(RGB text_color);
602 
610  void SetBold(bool is_bold);
611 
619  void SetItalic(bool is_italic);
620 
629  void SetAlignment(foxit::common::Alignment alignment);
630 
638  void SetCharSpace(float char_space);
639 
647  void SetCharHorizontalScale(int scale);
648 
656  void SetLineSpace(float line_space);
657 
665  void SetUnderline(bool is_underline);
666 
674  void SetStrikethrough(bool is_striketrough);
675 
683  void SetSuperscript(bool is_superscript);
684 
692  void SetSubscript(bool is_subscript);
693 
701  void SetParagraphSpacing(float paragraph_space);
702 
708  void Indent();
709 
715  void Dedent();
716 
727  void SetBulletedList(BulletType bullet_type);
728 
737  void SetNumberedList(NumberingType numbering_type);
738 };
739 
745 class JoinSplit FS_FINAL : public Base {
746  public:
752  typedef enum _JoinSplitOperationType {
766 
767 
769  ~JoinSplit();
770 
776  JoinSplit(const JoinSplit& other);
777 
778  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
779  explicit JoinSplit(FS_HANDLE handle);
780 
788  JoinSplit& operator=(const JoinSplit& other);
789 
798  bool operator==(const JoinSplit& other) const;
799 
808  bool operator!=(const JoinSplit& other) const;
809 
817  bool IsEmpty() const;
818 
824  bool Activate();
825 
831  bool Deactivate();
832 
838  void ExitJoinEditing();
839 
850  bool Render(Int32Array page_index_array, const common::Renderer& renderer);
851 
860  bool OnLButtonDown(int page_index, const PointF& point);
861 
870  bool OnLButtonUp(int page_index, const PointF& point);
871 
880  bool OnMouseMove(int page_index, const PointF& point);
881 
888 
894  void JoinBoxes();
895 
901  void SplitBoxes();
902 
908  void LinkBoxes();
909 
915  void UnlinkBoxes();
916 
922  void SelectNone();
923 };
924 
934 class ParagraphEditingMgr FS_FINAL : public Base{
935  public:
942  explicit ParagraphEditingMgr(ParagraphEditingProviderCallback* callback, const pdf::PDFDoc& document);
943 
946 
953 
954  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
955  explicit ParagraphEditingMgr(FS_HANDLE handle = NULL);
956 
965 
973  bool operator==(const ParagraphEditingMgr& other) const;
974 
982  bool operator!=(const ParagraphEditingMgr& other) const;
983 
991  bool IsEmpty() const;
992 
999 
1006 
1015  void SetSystemDPI(float horizontal_dpi, float vertical_dpi);
1016 };
1017 } // namespace pageeditor
1018 } // namespace addon
1019 } // namespace foxit
1020 #endif // FS_PARAGRAPHEDIT_H_
void SetSuperscript(bool is_superscript)
Set the word property of superscript type for text.
bool OnLButtonDown(int page_index, const PointF &point)
Call this function when left mouse button is down.
JoinSplit(const JoinSplit &other)
Constructor, with another join split object.
virtual foxit::RectF GetPageRect(const pdf::PDFDoc &document, int page_index)=0
A callback function used to get page rectangle in device coordinate system.
bool operator==(const JoinSplit &other) const
Equal operator.
void SetUnderline(bool is_underline)
Set underline for text.
void UnlinkBoxes()
Call this function to unlink text.
bool operator!=(const ParagraphEditingMgr &other) const
Not equal operator.
bool OnMouseMove(int page_index, const PointF &point)
Call this function when mouse moves.
Bullet type: none.
Definition: fs_paragraphediting.h:266
Definition: fs_paragraphediting.h:745
Bullet type: diagonal up right arrow.
Definition: fs_paragraphediting.h:280
Bullet type: solid diamond.
Definition: fs_paragraphediting.h:272
bool Deactivate()
Deactivate join split editing.
bool CutSelected()
Cut the selected text.
virtual bool GotoPageView(const pdf::PDFDoc &document, int page_index, float left, float top)=0
A callback function to go to page view.
NumberingType
Enumeration for numbering type.
Definition: fs_paragraphediting.h:290
virtual ~ParagraphEditingProviderCallback()
Destructor.
Definition: fs_paragraphediting.h:179
Bullet type: solid circle.
Definition: fs_paragraphediting.h:268
Numbering type: 1) 2) 3)
Definition: fs_paragraphediting.h:296
bool OnKeyDown(uint32 key_code)
Call this function when key on the keyboard is down.
bool operator!=(const ParagraphEditingUndoItem &other) const
Not equal operator.
bool CanPaste()
Check whether can paste text.
Header file for PDF document related definitions and classes.
Bullet type: black diamond minus white.
Definition: fs_paragraphediting.h:282
virtual RectF GetClientRect(const pdf::PDFDoc &document)=0
A callback function to get the client rectangle in device coordinate system.
void StartEditing(int page_index, const PointF &start_point, const PointF &end_point)
Start paragraph editing.
uint32 RGB
RGB color type, 24 bits, ((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:212
Definition: fx_coordinates.h:30
bool OnLButtonDown(int page_index, const PointF &point)
Call this function when left mouse button is down.
Numbering type: a. b. c.
Definition: fs_paragraphediting.h:302
Definition: fs_paragraphediting.h:257
bool IsEmpty() const
Check whether current object is empty or not.
bool IsEmpty() const
Check whether current object is empty or not.
bool CopySelected()
Copy the selected text.
WIDE STRING CLASS.
Definition: fx_string.h:1461
bool Render(Int32Array page_index_array, const common::Renderer &renderer)
Draw the currently join split operation state on the rendering.
void SetBulletedList(BulletType bullet_type)
Set bullet list for text.
virtual int GetCurrentPageIndex(const pdf::PDFDoc &document)=0
A callback function used to get current page index.
void SetSystemDPI(float horizontal_dpi, float vertical_dpi)
Set the dpi for the paragraph editing provider used.
bool Deactivate()
Deactivate paragraph editing.
virtual Int32Array GetVisiblePageIndexArray(const pdf::PDFDoc &document)=0
A callback function used to get visible page indexes.
Join spilt operation type: Link.
Definition: fs_paragraphediting.h:758
Definition: fs_pdfdoc.h:648
void SelectNone()
Call this function to clear all selected text.
bool GetEnableStatus(JoinSplit::JoinSplitOperationType type)
Get join split editing operation state.
bool operator==(const ParagraphEditingMgr &other) const
Equal operator.
void Indent()
Increase indent for text.
bool operator==(const ParagraphEditingUndoItem &other) const
Equal operator.
void SetFontName(const WString &font_name)
Set font name for text.
Join spilt operation type: Close.
Definition: fs_paragraphediting.h:764
bool Render(const Int32Array page_index_array, const common::Renderer &renderer)
Draw the current paragraph editing operation status on the rendering.
Numbering type: a) b) c)
Definition: fs_paragraphediting.h:300
Definition: fs_render.h:197
ParagraphEditingMgr(ParagraphEditingProviderCallback *callback, const pdf::PDFDoc &document)
Constructor.
bool IsEmpty() const
Check whether current object is empty or not.
bool operator!=(const JoinSplit &other) const
Not equal operator.
void ExitEditing(bool is_end_directly=false)
Exit paragraph editing.
Bullet type: check.
Definition: fs_paragraphediting.h:274
bool DeleteSelected()
Delete the selected text.
bool OnKeyUp(uint32 key_code)
Call this function when key on the keyboard is up.
Definition: fs_paragraphediting.h:185
void SetStrikethrough(bool is_striketrough)
Set strikeout word style for text.
JoinSplit & operator=(const JoinSplit &other)
Assign operator.
bool InsertText(const WString &text)
Call this function when insert text into the page.
ParagraphEditingUndoItem(const ParagraphEditingUndoItem &other)
Constructor, with another undo item object.
bool OnChar(uint32 char_code)
Call this function when a character code is being input.
Bullet type: right arrow (upper white and lower black).
Definition: fs_paragraphediting.h:276
virtual Matrix GetRenderMatrix(const pdf::PDFDoc &document, int page_index)=0
A callback function to get the render matrix.
bool OnLButtonUp(int page_index, const PointF &point)
Call this function when left mouse button is up.
virtual void NotifyTextInputReachLimit(const pdf::PDFDoc &document, int page_index)=0
A callback function used to notify text input reach limit.
Bullet type: inverse tangent circle.
Definition: fs_paragraphediting.h:278
virtual void Release()=0
A callback function used to release current callback object itself.
Numbering type: none.
Definition: fs_paragraphediting.h:292
ParagraphEditing(const ParagraphEditing &other)
Constructor, with another paragraph edit object.
Bullet type: solid rectangle.
Definition: fs_paragraphediting.h:270
virtual void AddUndoItem(const ParagraphEditingUndoItem &undo_item)=0
A callback function used to notify the page to add undo operation.
void SetTextColor(RGB text_color)
Set text color for text.
bool OnMouseWheel(int page_index, const PointF &point, int32 delta)
Call this function when scrolling the mouse wheel.
bool operator==(const ParagraphEditing &other) const
Equal operator.
void ExitJoinEditing()
Exit join split editing.
BulletType
Enumeration for bullet type.
Definition: fs_paragraphediting.h:264
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:196
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
Header file for common definitions and classes.
Join spilt operation type: Spilt.
Definition: fs_paragraphediting.h:756
ParagraphEditing GetParagraphEditing()
Get the paragraph edit object.
Numbering type: 1. 2. 3.
Definition: fs_paragraphediting.h:294
bool operator!=(const ParagraphEditing &other) const
Not equal operator.
virtual float GetScale(const pdf::PDFDoc &document, int page_index)=0
A callback function to get the scale of page.
Alignment
Enumeration for alignment (horizontal).
Definition: fs_common.h:94
bool IsEmpty() const
Check whether current object is empty or not.
bool CanCut()
Check whether can cut text.
void SetParagraphSpacing(float paragraph_space)
Set paragraph spacing for text.
FX_INT32 int32
32-bit signed integer.
Definition: fs_basictypes.h:194
Definition: fs_basictypes.h:443
Join spilt operation type: Join.
Definition: fs_paragraphediting.h:754
virtual void InvalidateRect(const pdf::PDFDoc &document, int page_index, const RectFArray &invalid_rects)=0
A callback function used to invalidate page rectangle.
Header file for PDF page related definitions and classes.
bool CanDelete()
Check whether can delete text.
void LinkBoxes()
Call this function to link text.
Definition: fs_paragraphediting.h:934
void SetLineSpace(float line_space)
Set line space for text.
ParagraphEditing & operator=(const ParagraphEditing &other)
Assign operator.
Rotation
Enumeration for rotation.
Definition: fs_common.h:57
Foxit namespace.
Definition: fs_taggedpdf.h:27
Join spilt operation type: SelectNone.
Definition: fs_paragraphediting.h:762
void SplitBoxes()
Call this function to split text.
bool Activate()
Activate join split editing.
virtual void * GetPageViewHandle(const pdf::PDFDoc &document, int page_index)=0
A callback function to get the page view window handle.
bool CanCopy()
Check whether can copy text.
void Dedent()
Decrease indent for text.
virtual RectF GetPageVisibleRect(const pdf::PDFDoc &document, int page_index)=0
A callback function used to get visible page rectangle in device coordinate system.
virtual common::Rotation GetRotation(const pdf::PDFDoc &document, int page_index)=0
A callback function used to get the page view rotate.
void SetCharHorizontalScale(int scale)
Set char horizontal scale for text.
virtual void SetDocChangeMark(const pdf::PDFDoc &document)=0
A callback function used to notify the document have changed.
bool Activate()
Activate paragraph editing.
void SetBold(bool is_bold)
Set bold status for text.
void SetSubscript(bool is_subscript)
Set the word property of subscript type for text.
#define NULL
The null-pointer value.
Definition: fx_system.h:792
Definition: fx_coordinates.h:1076
JoinSplitOperationType
Enumeration for join spilt operation type.
Definition: fs_paragraphediting.h:752
bool PasteSelected()
Paste the copied text.
void SetFontSize(float font_size)
Set the font size for text.
void JoinBoxes()
Call this function to join text.
bool OnLButtonDoubleClick(int page_index, const PointF &point)
Call this function when left mouse button is double clicked.
ParagraphEditingMgr & operator=(const ParagraphEditingMgr &other)
Assign operator.
void SetAlignment(foxit::common::Alignment alignment)
Set text alignment for text.
void SetItalic(bool is_italic)
Set italic status for text.
bool CanDeselectAll()
Check whether can deselect all text.
Header file for rendering related definitions and classes.
void SetCharSpace(float char_space)
Set char space for text.
Numbering type: A. B. C.
Definition: fs_paragraphediting.h:298
ParagraphEditingUndoItem & operator=(const ParagraphEditingUndoItem &other)
Assign operator.
bool OnMouseMove(int page_index, const PointF &point)
Call this function when mouse moves.
bool CanSelectAll()
Check whether can select all text.
bool OnLButtonUp(int page_index, const PointF &point)
Call this function when left mouse button is up.
Join spilt operation type: Unlink.
Definition: fs_paragraphediting.h:760
Definition: fx_coordinates.h:771
JoinSplit GetJoinSplit()
Get the join split object.
void SetNumberedList(NumberingType numbering_type)
Set the look of numbering for text.