Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
CPDF_TextObject Class Referencefinal

#include <cpdf_textobject.h>

+ Inheritance diagram for CPDF_TextObject:
+ Collaboration diagram for CPDF_TextObject:

Classes

struct  Item
 

Public Member Functions

 CPDF_TextObject (int32_t content_stream)
 
 CPDF_TextObject ()
 
 ~CPDF_TextObject () override
 
Type GetType () const override
 
void Transform (const CFX_Matrix &matrix) override
 
bool IsText () const override
 
CPDF_TextObjectAsText () override
 
const CPDF_TextObjectAsText () const override
 
std::unique_ptr< CPDF_TextObjectClone () const
 
size_t CountItems () const
 
Item GetItemInfo (size_t index) const
 
size_t CountChars () const
 
uint32_t GetCharCode (size_t index) const
 
Item GetCharInfo (size_t index) const
 
float GetCharWidth (uint32_t charcode) const
 
int CountWords () const
 
WideString GetWordString (int nWordIndex) const
 
CFX_PointF GetPos () const
 
CFX_Matrix GetTextMatrix () const
 
RetainPtr< CPDF_FontGetFont () const
 
float GetFontSize () const
 
TextRenderingMode GetTextRenderMode () const
 
void SetTextRenderMode (TextRenderingMode mode)
 
void SetText (const ByteString &str)
 
void SetPosition (const CFX_PointF &pos)
 
const std::vector< uint32_t > & GetCharCodes () const
 
const std::vector< float > & GetCharPositions () const
 
void SetTextMatrix (const CFX_Matrix &matrix)
 
void SetSegments (const ByteString *pStrs, const std::vector< float > &kernings, size_t nSegs)
 
CFX_PointF CalcPositionData (float horz_scale)
 
- Public Member Functions inherited from CPDF_PageObject
 CPDF_PageObject (int32_t content_stream)
 
 CPDF_PageObject (const CPDF_PageObject &src)=delete
 
CPDF_PageObjectoperator= (const CPDF_PageObject &src)=delete
 
virtual ~CPDF_PageObject ()
 
virtual bool IsPath () const
 
virtual bool IsImage () const
 
virtual bool IsShading () const
 
virtual bool IsForm () const
 
virtual CPDF_PathObjectAsPath ()
 
virtual const CPDF_PathObjectAsPath () const
 
virtual CPDF_ImageObjectAsImage ()
 
virtual const CPDF_ImageObjectAsImage () const
 
virtual CPDF_ShadingObjectAsShading ()
 
virtual const CPDF_ShadingObjectAsShading () const
 
virtual CPDF_FormObjectAsForm ()
 
virtual const CPDF_FormObjectAsForm () const
 
void SetDirty (bool value)
 
bool IsDirty () const
 
void TransformClipPath (const CFX_Matrix &matrix)
 
void TransformGeneralState (const CFX_Matrix &matrix)
 
void SetOriginalRect (const CFX_FloatRect &rect)
 
const CFX_FloatRectGetOriginalRect () const
 
void SetRect (const CFX_FloatRect &rect)
 
const CFX_FloatRectGetRect () const
 
FX_RECT GetBBox () const
 
FX_RECT GetTransformedBBox (const CFX_Matrix &matrix) const
 
CPDF_ContentMarksGetContentMarks ()
 
const CPDF_ContentMarksGetContentMarks () const
 
void SetContentMarks (const CPDF_ContentMarks &marks)
 
int32_t GetContentStream () const
 
void SetContentStream (int32_t new_content_stream)
 
const ByteStringGetResourceName () const
 
void SetResourceName (const ByteString &resource_name)
 
pdfium::span< const ByteStringGetGraphicsResourceNames () const
 
const CPDF_ClipPathclip_path () const
 
CPDF_ClipPathmutable_clip_path ()
 
const CFX_GraphStategraph_state () const
 
CFX_GraphStatemutable_graph_state ()
 
const CPDF_ColorStatecolor_state () const
 
CPDF_ColorStatemutable_color_state ()
 
const CPDF_TextStatetext_state () const
 
CPDF_TextStatemutable_text_state ()
 
const CPDF_GeneralStategeneral_state () const
 
CPDF_GeneralStatemutable_general_state ()
 
const CPDF_GraphicStatesgraphic_states () const
 
void SetDefaultStates ()
 

Additional Inherited Members

- Public Types inherited from CPDF_PageObject
enum class  Type {
  kText = 1 , kPath , kImage , kShading ,
  kForm
}
 
- Static Public Attributes inherited from CPDF_PageObject
static constexpr int32_t kNoContentStream = -1
 
- Protected Member Functions inherited from CPDF_PageObject
void CopyData (const CPDF_PageObject *pSrcObject)
 

Detailed Description

Definition at line 21 of file cpdf_textobject.h.

Constructor & Destructor Documentation

◆ CPDF_TextObject() [1/2]

CPDF_TextObject::CPDF_TextObject ( int32_t content_stream)
explicit

Definition at line 33 of file cpdf_textobject.cpp.

References CPDF_PageObject::CPDF_PageObject().

Referenced by CPDF_TextObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CPDF_TextObject() [2/2]

CPDF_TextObject::CPDF_TextObject ( )

Definition at line 36 of file cpdf_textobject.cpp.

References CPDF_TextObject(), and CPDF_PageObject::kNoContentStream.

+ Here is the call graph for this function:

◆ ~CPDF_TextObject()

CPDF_TextObject::~CPDF_TextObject ( )
overridedefault

Member Function Documentation

◆ AsText() [1/2]

const CPDF_TextObject * CPDF_TextObject::AsText ( ) const
overridevirtual

Reimplemented from CPDF_PageObject.

Definition at line 176 of file cpdf_textobject.cpp.

◆ AsText() [2/2]

CPDF_TextObject * CPDF_TextObject::AsText ( )
overridevirtual

Reimplemented from CPDF_PageObject.

Definition at line 172 of file cpdf_textobject.cpp.

◆ CalcPositionData()

CFX_PointF CPDF_TextObject::CalcPositionData ( float horz_scale)

Definition at line 259 of file cpdf_textobject.cpp.

◆ Clone()

std::unique_ptr< CPDF_TextObject > CPDF_TextObject::Clone ( ) const

Definition at line 150 of file cpdf_textobject.cpp.

◆ CountChars()

size_t CPDF_TextObject::CountChars ( ) const

Definition at line 68 of file cpdf_textobject.cpp.

◆ CountItems()

size_t CPDF_TextObject::CountItems ( ) const

Definition at line 40 of file cpdf_textobject.cpp.

◆ CountWords()

int CPDF_TextObject::CountWords ( ) const

Definition at line 101 of file cpdf_textobject.cpp.

◆ GetCharCode()

uint32_t CPDF_TextObject::GetCharCode ( size_t index) const

Definition at line 77 of file cpdf_textobject.cpp.

References CPDF_Font::kInvalidCharCode.

◆ GetCharCodes()

const std::vector< uint32_t > & CPDF_TextObject::GetCharCodes ( ) const
inline

Definition at line 67 of file cpdf_textobject.h.

◆ GetCharInfo()

CPDF_TextObject::Item CPDF_TextObject::GetCharInfo ( size_t index) const

Definition at line 89 of file cpdf_textobject.cpp.

References CPDF_TextObject::Item::Item(), and CPDF_Font::kInvalidCharCode.

+ Here is the call graph for this function:

◆ GetCharPositions()

const std::vector< float > & CPDF_TextObject::GetCharPositions ( ) const
inline

Definition at line 68 of file cpdf_textobject.h.

◆ GetCharWidth()

float CPDF_TextObject::GetCharWidth ( uint32_t charcode) const

Definition at line 231 of file cpdf_textobject.cpp.

References CPDF_CIDFont::CIDFromCharCode(), GetFontSize(), and CPDF_CIDFont::GetVertWidth().

+ Here is the call graph for this function:

◆ GetFont()

RetainPtr< CPDF_Font > CPDF_TextObject::GetFont ( ) const

Definition at line 242 of file cpdf_textobject.cpp.

References CPDF_PageObject::text_state().

Referenced by FPDFTextObj_GetFont(), SetText(), and SetTextMatrix().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetFontSize()

float CPDF_TextObject::GetFontSize ( ) const

Definition at line 246 of file cpdf_textobject.cpp.

References CPDF_PageObject::text_state().

Referenced by FPDFTextObj_GetFontSize(), GetCharWidth(), and GetItemInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetItemInfo()

CPDF_TextObject::Item CPDF_TextObject::GetItemInfo ( size_t index) const

Definition at line 44 of file cpdf_textobject.cpp.

References CPDF_CIDFont::CIDFromCharCode(), GetFontSize(), CPDF_Font::kInvalidCharCode, and CPDF_TextObject::Item::m_CharCode.

+ Here is the call graph for this function:

◆ GetPos()

CFX_PointF CPDF_TextObject::GetPos ( ) const
inline

Definition at line 55 of file cpdf_textobject.h.

◆ GetTextMatrix()

CFX_Matrix CPDF_TextObject::GetTextMatrix ( ) const

Definition at line 180 of file cpdf_textobject.cpp.

Referenced by FPDFPageObj_GetMatrix(), FPDFPageObj_GetRotatedBounds(), and Transform().

+ Here is the caller graph for this function:

◆ GetTextRenderMode()

TextRenderingMode CPDF_TextObject::GetTextRenderMode ( ) const

Definition at line 250 of file cpdf_textobject.cpp.

References CPDF_PageObject::text_state().

Referenced by FPDFTextObj_GetTextRenderMode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetType()

CPDF_PageObject::Type CPDF_TextObject::GetType ( ) const
overridevirtual

Implements CPDF_PageObject.

Definition at line 159 of file cpdf_textobject.cpp.

References CPDF_PageObject::kText.

◆ GetWordString()

WideString CPDF_TextObject::GetWordString ( int nWordIndex) const

Definition at line 125 of file cpdf_textobject.cpp.

◆ IsText()

bool CPDF_TextObject::IsText ( ) const
overridevirtual

Reimplemented from CPDF_PageObject.

Definition at line 168 of file cpdf_textobject.cpp.

◆ SetPosition()

void CPDF_TextObject::SetPosition ( const CFX_PointF & pos)
inline

Definition at line 65 of file cpdf_textobject.h.

◆ SetSegments()

void CPDF_TextObject::SetSegments ( const ByteString * pStrs,
const std::vector< float > & kernings,
size_t nSegs )

Definition at line 196 of file cpdf_textobject.cpp.

◆ SetText()

void CPDF_TextObject::SetText ( const ByteString & str)

Definition at line 225 of file cpdf_textobject.cpp.

References GetFont(), and CPDF_PageObject::SetDirty().

Referenced by FPDFText_SetCharcodes(), and FPDFText_SetText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTextMatrix()

void CPDF_TextObject::SetTextMatrix ( const CFX_Matrix & matrix)

Definition at line 186 of file cpdf_textobject.cpp.

References CFX_Matrix::a, CFX_Matrix::b, CFX_Matrix::c, CFX_Matrix::d, and GetFont().

Referenced by FPDFPageObj_SetMatrix(), and Transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTextRenderMode()

void CPDF_TextObject::SetTextRenderMode ( TextRenderingMode mode)

Definition at line 254 of file cpdf_textobject.cpp.

References CPDF_PageObject::mutable_text_state(), and CPDF_PageObject::SetDirty().

Referenced by FPDFTextObj_SetTextRenderMode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Transform()

void CPDF_TextObject::Transform ( const CFX_Matrix & matrix)
overridevirtual

Implements CPDF_PageObject.

Definition at line 163 of file cpdf_textobject.cpp.

References GetTextMatrix(), CFX_Matrix::operator*(), CPDF_PageObject::SetDirty(), and SetTextMatrix().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: