Foxit PDF SDK
foxit::addon::pageeditor::ParagraphEditing Class Reference
Inheritance diagram for foxit::addon::pageeditor::ParagraphEditing:
foxit::Base

Public Types

enum  BulletType {
  e_BulletTypeNone = 0, e_BulletTypeSolidCircle = 1, e_BulletTypeSolidRectangle = 2, e_BulletTypeSolidDiamond = 3,
  e_BulletTypeCheck = 4, e_BulletTypeRightArrow = 5, e_BulletTypeInverseTangentCircle = 6, e_BulletTypeDiagonalUpRightArrow = 7,
  e_BulletTypeBlackDiamondMinusWhite = 8
}
 Enumeration for bullet type. More...
 
enum  NumberingType {
  e_NumberingTypeNone = 0, e_NumberingTypeDecimalDot = 1, e_NumberingTypeDecimalRParen = 2, e_NumberingTypeUpperLatinDot = 3,
  e_NumberingTypeLowerLatinRParen = 4, e_NumberingTypeLowerLatinDot = 5
}
 Enumeration for numbering type. More...
 

Public Member Functions

 ParagraphEditing (const ParagraphEditing &other)
 Constructor, with another paragraph edit object. More...
 
 ~ParagraphEditing ()
 Destructor.
 
bool Activate ()
 Activate paragraph editing. More...
 
bool CanCopy ()
 Check whether can copy text. More...
 
bool CanCut ()
 Check whether can cut text. More...
 
bool CanDelete ()
 Check whether can delete text. More...
 
bool CanDeselectAll ()
 Check whether can deselect all text. More...
 
bool CanPaste ()
 Check whether can paste text. More...
 
bool CanSelectAll ()
 Check whether can select all text. More...
 
bool CopySelected ()
 Copy the selected text. More...
 
bool CutSelected ()
 Cut the selected text. More...
 
bool Deactivate ()
 Deactivate paragraph editing. More...
 
void Dedent ()
 Decrease indent for text. More...
 
bool DeleteSelected ()
 Delete the selected text. More...
 
bool DeselectAll ()
 Deselect all text. More...
 
void ExitEditing (bool is_end_directly=false)
 Exit paragraph editing. More...
 
void Indent ()
 Increase indent for text. More...
 
bool InsertText (const WString &text)
 Call this function when insert text into the page. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool OnChar (uint32 char_code)
 Call this function when a character code is being input. More...
 
bool OnKeyDown (uint32 key_code)
 Call this function when key on the keyboard is down. More...
 
bool OnKeyUp (uint32 key_code)
 Call this function when key on the keyboard is up. More...
 
bool OnLButtonDoubleClick (int page_index, const PointF &point)
 Call this function when left mouse button is double clicked. More...
 
bool OnLButtonDown (int page_index, const PointF &point)
 Call this function when left mouse button is down. More...
 
bool OnLButtonUp (int page_index, const PointF &point)
 Call this function when left mouse button is up. More...
 
bool OnMouseMove (int page_index, const PointF &point)
 Call this function when mouse moves. More...
 
bool OnMouseWheel (int page_index, const PointF &point, int32 delta)
 Call this function when scrolling the mouse wheel. More...
 
bool operator!= (const ParagraphEditing &other) const
 Not equal operator. More...
 
ParagraphEditingoperator= (const ParagraphEditing &other)
 Assign operator. More...
 
bool operator== (const ParagraphEditing &other) const
 Equal operator. More...
 
bool PasteSelected ()
 Paste the copied text. More...
 
bool Render (const Int32Array page_index_array, const common::Renderer &renderer)
 Draw the current paragraph editing operation status on the rendering. More...
 
bool SelectAll ()
 Select all text. More...
 
void SetAlignment (foxit::common::Alignment alignment)
 Set text alignment for text. More...
 
void SetBold (bool is_bold)
 Set bold status for text. More...
 
void SetBulletedList (BulletType bullet_type)
 Set bullet list for text. More...
 
void SetCharHorizontalScale (int scale)
 Set char horizontal scale for text. More...
 
void SetCharSpace (float char_space)
 Set char space for text. More...
 
void SetFontName (const WString &font_name)
 Set font name for text. More...
 
void SetFontSize (float font_size)
 Set the font size for text. More...
 
void SetItalic (bool is_italic)
 Set italic status for text. More...
 
void SetLineSpace (float line_space)
 Set line space for text. More...
 
void SetNumberedList (NumberingType numbering_type)
 Set the look of numbering for text. More...
 
void SetParagraphSpacing (float paragraph_space)
 Set paragraph spacing for text. More...
 
void SetStrikethrough (bool is_striketrough)
 Set strikeout word style for text. More...
 
void SetSubscript (bool is_subscript)
 Set the word property of subscript type for text. More...
 
void SetSuperscript (bool is_superscript)
 Set the word property of superscript type for text. More...
 
void SetTextColor (RGB text_color)
 Set text color for text. More...
 
void SetUnderline (bool is_underline)
 Set underline for text. More...
 
void StartEditing (int page_index, const PointF &start_point, const PointF &end_point)
 Start paragraph editing. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Detailed Description

This class represents a paragraph edit operation. Before use any methods of paragraph edit function, please ensure the function ParagraphEditing::Activate has been called. Please call the function ParagraphEditing::Deactivate to deactivate when no need to use any paragraph edit function.

Member Enumeration Documentation

◆ BulletType

Enumeration for bullet type.

Values of this enumeration should be used alone.

Enumerator
e_BulletTypeNone 

Bullet type: none.

e_BulletTypeSolidCircle 

Bullet type: solid circle.

e_BulletTypeSolidRectangle 

Bullet type: solid rectangle.

e_BulletTypeSolidDiamond 

Bullet type: solid diamond.

e_BulletTypeCheck 

Bullet type: check.

e_BulletTypeRightArrow 

Bullet type: right arrow (upper white and lower black).

e_BulletTypeInverseTangentCircle 

Bullet type: inverse tangent circle.

e_BulletTypeDiagonalUpRightArrow 

Bullet type: diagonal up right arrow.

e_BulletTypeBlackDiamondMinusWhite 

Bullet type: black diamond minus white.

◆ NumberingType

Enumeration for numbering type.

Values of this enumeration should be used alone.

Enumerator
e_NumberingTypeNone 

Numbering type: none.

e_NumberingTypeDecimalDot 

Numbering type: 1. 2. 3.

e_NumberingTypeDecimalRParen 

Numbering type: 1) 2) 3)

e_NumberingTypeUpperLatinDot 

Numbering type: A. B. C.

e_NumberingTypeLowerLatinRParen 

Numbering type: a) b) c)

e_NumberingTypeLowerLatinDot 

Numbering type: a. b. c.

Constructor & Destructor Documentation

◆ ParagraphEditing()

foxit::addon::pageeditor::ParagraphEditing::ParagraphEditing ( const ParagraphEditing other)

Constructor, with another paragraph edit object.

Parameters
[in]otherAnother paragraph edit object.

Member Function Documentation

◆ Activate()

bool foxit::addon::pageeditor::ParagraphEditing::Activate ( )

Activate paragraph editing.

Returns
true means succeful, while false means not.

◆ CanCopy()

bool foxit::addon::pageeditor::ParagraphEditing::CanCopy ( )

Check whether can copy text.

Returns
true means current selected text object can be copied, while false means not.

◆ CanCut()

bool foxit::addon::pageeditor::ParagraphEditing::CanCut ( )

Check whether can cut text.

Returns
true means current selected text can be cut, while false means not.

◆ CanDelete()

bool foxit::addon::pageeditor::ParagraphEditing::CanDelete ( )

Check whether can delete text.

Returns
true means current selected text can be deleted, while false means not.

◆ CanDeselectAll()

bool foxit::addon::pageeditor::ParagraphEditing::CanDeselectAll ( )

Check whether can deselect all text.

Returns
true means current selected text can be deselected, while false means not.

◆ CanPaste()

bool foxit::addon::pageeditor::ParagraphEditing::CanPaste ( )

Check whether can paste text.

Returns
true means current selected text can be pasted, while false means not.

◆ CanSelectAll()

bool foxit::addon::pageeditor::ParagraphEditing::CanSelectAll ( )

Check whether can select all text.

Returns
true means current all text can be selected, while false means not.

◆ CopySelected()

bool foxit::addon::pageeditor::ParagraphEditing::CopySelected ( )

Copy the selected text.

Returns
true means success, while false means failure.

◆ CutSelected()

bool foxit::addon::pageeditor::ParagraphEditing::CutSelected ( )

Cut the selected text.

Returns
true means success, while false means failure.

◆ Deactivate()

bool foxit::addon::pageeditor::ParagraphEditing::Deactivate ( )

Deactivate paragraph editing.

Returns
true means success, while false means failure.

◆ Dedent()

void foxit::addon::pageeditor::ParagraphEditing::Dedent ( )

Decrease indent for text.

Returns
None.

◆ DeleteSelected()

bool foxit::addon::pageeditor::ParagraphEditing::DeleteSelected ( )

Delete the selected text.

Returns
true means success, while false means failure.

◆ DeselectAll()

bool foxit::addon::pageeditor::ParagraphEditing::DeselectAll ( )

Deselect all text.

Returns
true means success, while false means failure.

◆ ExitEditing()

void foxit::addon::pageeditor::ParagraphEditing::ExitEditing ( bool  is_end_directly = false)

Exit paragraph editing.

Parameters
[in]is_end_directlyWhether to end editing directly.
Returns
None.

◆ Indent()

void foxit::addon::pageeditor::ParagraphEditing::Indent ( )

Increase indent for text.

Returns
None.

◆ InsertText()

bool foxit::addon::pageeditor::ParagraphEditing::InsertText ( const WString text)

Call this function when insert text into the page.

Parameters
[in]textThe text to be inserted.
Returns
true means success, while false means failure.

◆ IsEmpty()

bool foxit::addon::pageeditor::ParagraphEditing::IsEmpty ( ) const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ OnChar()

bool foxit::addon::pageeditor::ParagraphEditing::OnChar ( uint32  char_code)

Call this function when a character code is being input.

Parameters
[in]char_codeA character code, in UTF16-LE encoding.
Returns
true means success, while false means failure.

◆ OnKeyDown()

bool foxit::addon::pageeditor::ParagraphEditing::OnKeyDown ( uint32  key_code)

Call this function when key on the keyboard is down.

Parameters
[in]key_codeThe key code. Please refer to values starting from pdf::interform::Filler::e_VkeyUnknown and this should be one of these values.
Returns
true means success, while false means failure.

◆ OnKeyUp()

bool foxit::addon::pageeditor::ParagraphEditing::OnKeyUp ( uint32  key_code)

Call this function when key on the keyboard is up.

Parameters
[in]key_codeThe key code. Please refer to values starting from pdf::interform::Filler::e_VkeyUnknown and this should be one of these values.
Returns
true means success, while false means failure.

◆ OnLButtonDoubleClick()

bool foxit::addon::pageeditor::ParagraphEditing::OnLButtonDoubleClick ( int  page_index,
const PointF point 
)

Call this function when left mouse button is double clicked.

Parameters
[in]page_indexThe page index.
[in]pointA point where left mouse button is double-clicked in the page, in device coordinate system.
Returns
true means success, while false means failure.

◆ OnLButtonDown()

bool foxit::addon::pageeditor::ParagraphEditing::OnLButtonDown ( int  page_index,
const PointF point 
)

Call this function when left mouse button is down.

Parameters
[in]page_indexThe page index.
[in]pointA point where left mouse button is down in the page, in device coordinate system.
Returns
true means success, while false means failure.

◆ OnLButtonUp()

bool foxit::addon::pageeditor::ParagraphEditing::OnLButtonUp ( int  page_index,
const PointF point 
)

Call this function when left mouse button is up.

Parameters
[in]page_indexThe page index.
[in]pointA point where left mouse button is up in the page, in device coordinate system.
Returns
true means success, while false means failure.

◆ OnMouseMove()

bool foxit::addon::pageeditor::ParagraphEditing::OnMouseMove ( int  page_index,
const PointF point 
)

Call this function when mouse moves.

Parameters
[in]page_indexThe page index.
[in]pointA point where the mouse in the page, in device coordinate system.
Returns
true means success, while false means failure.

◆ OnMouseWheel()

bool foxit::addon::pageeditor::ParagraphEditing::OnMouseWheel ( int  page_index,
const PointF point,
int32  delta 
)

Call this function when scrolling the mouse wheel.

Parameters
[in]page_indexThe page index.
[in]pointA point where the mouse in the page, in device coordinate system.
[in]deltaIndicates the amount the mouse wheel has been moved. A positive value means to be moved forward, and a negative value means to be moved backward.
Returns
true means success, while false means failure.

◆ operator!=()

bool foxit::addon::pageeditor::ParagraphEditing::operator!= ( const ParagraphEditing other) const

Not equal operator.

Parameters
[in]otherAnother paragraph edit object. This function will check if current object is not equal to this one.
Returns
true means not equal, while false means equal.

◆ operator=()

ParagraphEditing& foxit::addon::pageeditor::ParagraphEditing::operator= ( const ParagraphEditing other)

Assign operator.

Parameters
[in]otherAnother paragraph edit object, whose value would be assigned to current object.
Returns
Reference to current object itself.

◆ operator==()

bool foxit::addon::pageeditor::ParagraphEditing::operator== ( const ParagraphEditing other) const

Equal operator.

Parameters
[in]otherAnother paragraph edit object. This function will check if current object is equal to this one.
Returns
true means equal, while false means not equal.

◆ PasteSelected()

bool foxit::addon::pageeditor::ParagraphEditing::PasteSelected ( )

Paste the copied text.

Returns
true means success, while false means failure.

◆ Render()

bool foxit::addon::pageeditor::ParagraphEditing::Render ( const Int32Array  page_index_array,
const common::Renderer renderer 
)

Draw the current paragraph editing operation status on the rendering.

The matrix used in the rendering process is returned by ParagraphEditingProviderCallback::GetRenderMatrix.

Parameters
[in]page_index_arrayThe page index array to render.
[in]rendererA valid renderer object for rendering.
Returns
true means success, while false means failure.

◆ SelectAll()

bool foxit::addon::pageeditor::ParagraphEditing::SelectAll ( )

Select all text.

Returns
true means success, while false means failure.

◆ SetAlignment()

void foxit::addon::pageeditor::ParagraphEditing::SetAlignment ( foxit::common::Alignment  alignment)

Set text alignment for text.

Parameters
[in]alignmentAlignment value.Please refer to values starting from common::e_AlignmentLeft and this should be one of these values.
Returns
None.

◆ SetBold()

void foxit::addon::pageeditor::ParagraphEditing::SetBold ( bool  is_bold)

Set bold status for text.

Parameters
[in]is_boldWhether to set selected text as bold. true means current selected text will be set as bold, while false means not.
Returns
None.

◆ SetBulletedList()

void foxit::addon::pageeditor::ParagraphEditing::SetBulletedList ( BulletType  bullet_type)

Set bullet list for text.

Before setting a bullet list, ensure the "wingding.ttf" font has been installed.

Parameters
[in]bullet_typeThe type of bullet. Please refer to values starting from foxit::addon::pageeditor::e_BulletTypeNone and this should be one of these values.
Returns
None.

◆ SetCharHorizontalScale()

void foxit::addon::pageeditor::ParagraphEditing::SetCharHorizontalScale ( int  scale)

Set char horizontal scale for text.

Parameters
[in]scaleThe scale. It should be bigger than 0.
Returns
None.

◆ SetCharSpace()

void foxit::addon::pageeditor::ParagraphEditing::SetCharSpace ( float  char_space)

Set char space for text.

Parameters
[in]char_spaceThe char space (unit is 1/72 inch).
Returns
None.

◆ SetFontName()

void foxit::addon::pageeditor::ParagraphEditing::SetFontName ( const WString font_name)

Set font name for text.

Parameters
[in]font_nameThe font name.
Returns
None.

◆ SetFontSize()

void foxit::addon::pageeditor::ParagraphEditing::SetFontSize ( float  font_size)

Set the font size for text.

Parameters
[in]font_sizeThe font size.
Returns
None.

◆ SetItalic()

void foxit::addon::pageeditor::ParagraphEditing::SetItalic ( bool  is_italic)

Set italic status for text.

Parameters
[in]is_italicWhether to set selected text as italic. true means current selected text will be set as italic, while false means not.
Returns
None.

◆ SetLineSpace()

void foxit::addon::pageeditor::ParagraphEditing::SetLineSpace ( float  line_space)

Set line space for text.

Parameters
[in]line_spaceThe line space (unit is 1/72 inch).
Returns
None.

◆ SetNumberedList()

void foxit::addon::pageeditor::ParagraphEditing::SetNumberedList ( NumberingType  numbering_type)

Set the look of numbering for text.

Parameters
[in]numbering_typeThe type of numbering. Please refer to values starting from foxit::addon::pageeditor::e_NumberingTypeNone and this should be one of these values.
Returns
None.

◆ SetParagraphSpacing()

void foxit::addon::pageeditor::ParagraphEditing::SetParagraphSpacing ( float  paragraph_space)

Set paragraph spacing for text.

Parameters
[in]paragraph_spaceThe paragraph spacing.
Returns
None.

◆ SetStrikethrough()

void foxit::addon::pageeditor::ParagraphEditing::SetStrikethrough ( bool  is_striketrough)

Set strikeout word style for text.

Parameters
[in]is_striketroughtrue means to set the strikeout word style, while false means not.
Returns
None.

◆ SetSubscript()

void foxit::addon::pageeditor::ParagraphEditing::SetSubscript ( bool  is_subscript)

Set the word property of subscript type for text.

Parameters
[in]is_sub_scripttrue means to set the word property of subscript type, while false means not.
Returns
None.

◆ SetSuperscript()

void foxit::addon::pageeditor::ParagraphEditing::SetSuperscript ( bool  is_superscript)

Set the word property of superscript type for text.

Parameters
[in]is_super_settrue means to set the word property of superscript type, while false means not.
Returns
None.

◆ SetTextColor()

void foxit::addon::pageeditor::ParagraphEditing::SetTextColor ( RGB  text_color)

Set text color for text.

Parameters
[in]text_colorThe text color.
Returns
None.

◆ SetUnderline()

void foxit::addon::pageeditor::ParagraphEditing::SetUnderline ( bool  is_underline)

Set underline for text.

Parameters
[in]is_underlinetrue means to underline text, while false means not.
Returns
None.

◆ StartEditing()

void foxit::addon::pageeditor::ParagraphEditing::StartEditing ( int  page_index,
const PointF start_point,
const PointF end_point 
)

Start paragraph editing.

Parameters
[in]page_indexThe page index.
[in]start_pointA point to start editing on the page, in the device coordinate system.
[in]end_pointA point to end editing on the page, in the device coordinate system.
Returns
None.