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 
362  bool Activate();
363 
369  bool Deactivate();
370 
380  void StartEditing(int page_index, const PointF& start_point, const PointF& end_point);
381 
389  void ExitEditing(bool is_end_directly = false);
390 
398  bool InsertText(const WString& text);
399 
410  bool Render(const Int32Array page_index_array, const common::Renderer& renderer);
411 
419  bool OnChar(uint32 char_code);
420 
429  bool OnKeyDown(uint32 key_code);
430 
439  bool OnKeyUp(uint32 key_code);
440 
449  bool OnLButtonDown(int page_index, const PointF& point);
450 
459  bool OnLButtonUp(int page_index, const PointF& point);
460 
469  bool OnLButtonDoubleClick(int page_index, const PointF& point);
470 
479  bool OnMouseMove(int page_index, const PointF& point);
480 
491  bool OnMouseWheel(int page_index, const PointF& point, int32 delta);
492 
498  bool CanSelectAll();
499 
505  bool SelectAll();
506 
512  bool CanDelete();
513 
519  bool DeleteSelected();
520 
526  bool CanCopy();
527 
533  bool CopySelected();
534 
540  bool CanCut();
541 
547  bool CutSelected();
548 
554  bool CanPaste();
555 
561  bool PasteSelected();
562 
568  bool CanDeselectAll();
569 
575  bool DeselectAll();
576 
584  void SetFontName(const WString& font_name);
585 
593  void SetFontSize(float font_size);
594 
602  void SetTextColor(RGB text_color);
603 
611  void SetBold(bool is_bold);
612 
620  void SetItalic(bool is_italic);
621 
630  void SetAlignment(foxit::common::Alignment alignment);
631 
639  void SetCharSpace(float char_space);
640 
648  void SetCharHorizontalScale(int scale);
649 
657  void SetLineSpace(float line_space);
658 
666  void SetUnderline(bool is_underline);
667 
675  void SetStrikethrough(bool is_striketrough);
676 
684  void SetSuperscript(bool is_superscript);
685 
693  void SetSubscript(bool is_subscript);
694 
702  void SetParagraphSpacing(float paragraph_space);
703 
709  void Indent();
710 
716  void Dedent();
717 
728  void SetBulletedList(BulletType bullet_type);
729 
738  void SetNumberedList(NumberingType numbering_type);
739 };
740 
746 class JoinSplit FS_FINAL : public Base {
747  public:
753  typedef enum _JoinSplitOperationType {
767 
768 
770  ~JoinSplit();
771 
777  JoinSplit(const JoinSplit& other);
778 
779  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
780  explicit JoinSplit(FS_HANDLE handle);
781 
789  JoinSplit& operator=(const JoinSplit& other);
790 
799  bool operator==(const JoinSplit& other) const;
800 
809  bool operator!=(const JoinSplit& other) const;
810 
818  bool IsEmpty() const;
819 
825  bool Activate();
826 
832  bool Deactivate();
833 
839  void ExitJoinEditing();
840 
851  bool Render(Int32Array page_index_array, const common::Renderer& renderer);
852 
861  bool OnLButtonDown(int page_index, const PointF& point);
862 
871  bool OnLButtonUp(int page_index, const PointF& point);
872 
881  bool OnMouseMove(int page_index, const PointF& point);
882 
889 
895  void JoinBoxes();
896 
902  void SplitBoxes();
903 
909  void LinkBoxes();
910 
916  void UnlinkBoxes();
917 
923  void SelectNone();
924 };
925 
935 class ParagraphEditingMgr FS_FINAL : public Base{
936  public:
943  explicit ParagraphEditingMgr(ParagraphEditingProviderCallback* callback, const pdf::PDFDoc& document);
944 
947 
954 
955  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
956  explicit ParagraphEditingMgr(FS_HANDLE handle = NULL);
957 
966 
974  bool operator==(const ParagraphEditingMgr& other) const;
975 
983  bool operator!=(const ParagraphEditingMgr& other) const;
984 
992  bool IsEmpty() const;
993 
1000 
1007 
1016  void SetSystemDPI(float horizontal_dpi, float vertical_dpi);
1017 };
1018 } // namespace pageeditor
1019 } // namespace addon
1020 } // namespace foxit
1021 #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:746
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:211
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:759
Definition: fs_pdfdoc.h:776
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:765
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:195
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
Header file for common definitions and classes.
Join spilt operation type: Spilt.
Definition: fs_paragraphediting.h:757
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:193
Definition: fs_basictypes.h:451
Join spilt operation type: Join.
Definition: fs_paragraphediting.h:755
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:935
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:763
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:753
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:761
Definition: fx_coordinates.h:771
JoinSplit GetJoinSplit()
Get the join split object.
void SetNumberedList(NumberingType numbering_type)
Set the look of numbering for text.