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
cpvt_word.h
Go to the documentation of this file.
1// Copyright 2016 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FPDFDOC_CPVT_WORD_H_
8#define CORE_FPDFDOC_CPVT_WORD_H_
9
10#include <stdint.h>
11
12#include "core/fpdfdoc/cpvt_wordplace.h"
13#include "core/fxcrt/fx_codepage.h"
14
15class CPVT_Word {
16 public:
17 CPVT_Word();
18
19 uint16_t Word;
22 CFX_PointF ptWord;
23 float fAscent;
24 float fDescent;
25 float fWidth;
26 int32_t nFontIndex;
27 float fFontSize;
28};
29
31 : Word(0),
33 fAscent(0.0f),
34 fDescent(0.0f),
35 fWidth(0.0f),
36 nFontIndex(-1),
37 fFontSize(0.0f) {}
38
39#endif // CORE_FPDFDOC_CPVT_WORD_H_
BorderStyle
constexpr CFX_FloatRect(float l, float b, float r, float t)
float Width() const
bool IsEmpty() const
void Inflate(float x, float y)
CFX_FloatRect & operator=(const CFX_FloatRect &that)=default
void Deflate(float x, float y)
float Height() const
static const char kDefaultAnsiFontName[]
Definition cfx_font.h:58
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
CFX_Matrix()=default
static CFX_FloatRect BoundingRectFromQuadPoints(const CPDF_Dictionary *pAnnotDict)
CPDF_DefaultAppearance(const ByteString &csDA)
bool KeyExist(const ByteString &key) const
float GetFloatFor(const ByteString &key) const
WideString GetUnicodeTextFor(const ByteString &key) const
void SetRectFor(const ByteString &key, const CFX_FloatRect &rect)
RetainPtr< const CPDF_Array > GetArrayFor(const ByteString &key) const
CFX_FloatRect GetRectFor(const ByteString &key) const
static CPDF_DocPageData * FromDocument(const CPDF_Document *pDoc)
static constexpr uint32_t kInvalidCharCode
Definition cpdf_font.h:63
static bool GenerateAnnotAP(CPDF_Document *pDoc, CPDF_Dictionary *pAnnotDict, CPDF_Annot::Subtype subtype)
static void GenerateEmptyAP(CPDF_Document *pDoc, CPDF_Dictionary *pAnnotDict)
static void GenerateFormAP(CPDF_Document *pDoc, CPDF_Dictionary *pAnnotDict, FormType type)
CPVT_FloatRect(float other_left, float other_top, float other_right, float other_bottom)
float Height() const
CPVT_FloatRect(const CFX_FloatRect &rect)
CPVT_FloatRect()=default
ByteString GetPDFFontAlias(int32_t nFontIndex) override
RetainPtr< CPDF_Font > GetPDFFont(int32_t nFontIndex) override
int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override
CPVT_FontMap(CPDF_Document *pDoc, RetainPtr< CPDF_Dictionary > pResDict, RetainPtr< CPDF_Font > pDefFont, const ByteString &sDefFontAlias)
int32_t GetWordFontIndex(uint16_t word, FX_Charset charset, int32_t nFontIndex) override
FX_Charset CharSetFromUnicode(uint16_t word, FX_Charset nOldCharset) override
~CPVT_FontMap() override
CPVT_WordPlace lineplace
Definition cpvt_line.h:17
float fLineWidth
Definition cpvt_line.h:20
CFX_PointF ptLine
Definition cpvt_line.h:19
CPVT_WordPlace lineEnd
Definition cpvt_line.h:18
float fLineAscent
Definition cpvt_line.h:21
float fLineDescent
Definition cpvt_line.h:22
void SetAt(int32_t nWordIndex)
bool GetWord(CPVT_Word &word) const
bool GetLine(CPVT_Line &line) const
Iterator(CPVT_VariableText *pVT)
const CPVT_WordPlace & GetWordPlace() const
void SetAt(const CPVT_WordPlace &place)
virtual int32_t GetTypeDescent(int32_t nFontIndex)
virtual int GetCharWidth(int32_t nFontIndex, uint16_t word)
virtual int32_t GetWordFontIndex(uint16_t word, FX_Charset charset, int32_t nFontIndex)
Provider(IPVT_FontMap *pFontMap)
virtual int32_t GetTypeAscent(int32_t nFontIndex)
virtual int32_t GetDefaultFontIndex()
float GetPlateHeight() const
void SetPlateRect(const CFX_FloatRect &rect)
CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace &place) const
CPVT_WordPlace NextLineHeaderPlace(const CPVT_WordPlace &place) const
CPVT_WordPlace PrevLineHeaderPlace(const CPVT_WordPlace &place) const
CFX_PointF GetBTPoint() const
int32_t GetLimitChar() const
CPVT_WordPlace GetBeginWordPlace() const
CPVT_WordPlace GetEndWordPlace() const
CPVT_WordPlace InsertSection(const CPVT_WordPlace &place)
int32_t WordPlaceToWordIndex(const CPVT_WordPlace &place) const
CFX_PointF GetETPoint() const
CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace &place) const
float GetFontAscent(int32_t nFontIndex, float fFontSize) const
int32_t GetAlignment() const
uint16_t GetPasswordChar() const
float GetWordWidth(const CPVT_WordInfo &WordInfo) const
float GetWordWidth(int32_t nFontIndex, uint16_t Word, uint16_t SubWord, float fFontSize, float fWordTail) const
float GetWordDescent(const CPVT_WordInfo &WordInfo) const
void SetLimitChar(int32_t nLimitChar)
CFX_FloatRect GetContentRect() const
float GetFontDescent(int32_t nFontIndex, float fFontSize) const
CPVT_WordPlace InsertWord(const CPVT_WordPlace &place, uint16_t word, FX_Charset charset)
CFX_PointF OutToIn(const CFX_PointF &point) const
CPVT_VariableText(Provider *Provider)
CFX_PointF InToOut(const CFX_PointF &point) const
void SetText(const WideString &text)
int32_t GetCharArray() const
void SetProvider(Provider *pProvider)
float GetWordAscent(const CPVT_WordInfo &WordInfo, float fFontSize) const
CPVT_VariableText::Iterator * GetIterator()
const CFX_FloatRect & GetPlateRect() const
void SetCharArray(int32_t nCharArray)
float GetPlateWidth() const
CPVT_WordPlace WordIndexToWordPlace(int32_t index) const
CPVT_WordPlace DeleteWords(const CPVT_WordRange &PlaceRange)
CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace &place, const CFX_PointF &point) const
CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace &place) const
CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace &place) const
CPVT_WordPlace SearchWordPlace(const CFX_PointF &point) const
CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace &place) const
CFX_FloatRect InToOut(const CPVT_FloatRect &rect) const
CPVT_WordPlace DeleteWord(const CPVT_WordPlace &place)
bool IsAutoReturn() const
float GetWordDescent(const CPVT_WordInfo &WordInfo, float fFontSize) const
void UpdateWordPlace(CPVT_WordPlace &place) const
void SetAlignment(int32_t nFormat)
void SetMultiLine(bool bMultiLine)
void RearrangePart(const CPVT_WordRange &PlaceRange)
float GetFontSize() const
CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace &place)
float GetWordAscent(const CPVT_WordInfo &WordInfo) const
void SetAutoFontSize(bool bAuto)
int32_t GetTotalWords() const
uint16_t GetSubWord() const
void SetFontSize(float fFontSize)
CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace &place, const CFX_PointF &point) const
CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace &place) const
void SetAutoReturn(bool bAuto)
void SetPasswordChar(uint16_t wSubWord)
float fAscent
Definition cpvt_word.h:23
uint16_t Word
Definition cpvt_word.h:19
CFX_PointF ptWord
Definition cpvt_word.h:22
CPVT_WordPlace WordPlace
Definition cpvt_word.h:21
float fDescent
Definition cpvt_word.h:24
int32_t nFontIndex
Definition cpvt_word.h:26
float fWidth
Definition cpvt_word.h:25
float fFontSize
Definition cpvt_word.h:27
FX_Charset nCharset
Definition cpvt_word.h:20
virtual ByteString GetPDFFontAlias(int32_t nFontIndex)=0
static ByteString Format(const char *pFormat,...)
ByteString & operator+=(const ByteString &str)
ByteString & operator=(ByteString &&that) noexcept
bool IsEmpty() const
Definition bytestring.h:119
WideString & operator+=(const WideString &str)
WideString & operator+=(wchar_t ch)
FX_Charset
Definition fx_codepage.h:70
#define FXSYS_IsFloatBigger(fa, fb)
Definition fx_system.h:36
#define FXSYS_IsFloatZero(f)
Definition fx_system.h:35
#define FXSYS_IsFloatSmaller(fa, fb)
Definition fx_system.h:38
CFX_Color CFXColorFromArray(const CPDF_Array &array)
CFX_Color CFXColorFromString(const ByteString &str)
const char kBG[]
const char kR[]
float fColor4
Definition cfx_color.h:58
float fColor3
Definition cfx_color.h:57
Type nColorType
Definition cfx_color.h:54
CFX_Color & operator=(const CFX_Color &that)=default
constexpr CFX_Color(Type type=CFX_Color::Type::kTransparent, float color1=0.0f, float color2=0.0f, float color3=0.0f, float color4=0.0f)
Definition cfx_color.h:27
float fColor2
Definition cfx_color.h:56
float fColor1
Definition cfx_color.h:55
int32_t nBeginWordIndex
int32_t nEndWordIndex
int32_t nTotalWord
int32_t LineCmp(const CPVT_WordPlace &wp) const
bool operator<=(const CPVT_WordPlace &wp) const
bool operator!=(const CPVT_WordPlace &wp) const
bool operator>(const CPVT_WordPlace &wp) const
CPVT_WordPlace(int32_t other_nSecIndex, int32_t other_nLineIndex, int32_t other_nWordIndex)
bool operator<(const CPVT_WordPlace &wp) const
bool operator==(const CPVT_WordPlace &wp) const
bool operator>=(const CPVT_WordPlace &wp) const
CPVT_WordPlace()=default
CPVT_WordRange(const CPVT_WordPlace &begin, const CPVT_WordPlace &end)
bool operator==(const CPVT_WordRange &wr) const
bool operator!=(const CPVT_WordRange &wr) const
bool IsEmpty() const
CPVT_WordRange()=default
CPVT_WordPlace BeginPos
CPVT_WordPlace EndPos