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
cfgas_rtfbreak.h
Go to the documentation of this file.
1// Copyright 2014 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 XFA_FGAS_LAYOUT_CFGAS_RTFBREAK_H_
8#define XFA_FGAS_LAYOUT_CFGAS_RTFBREAK_H_
9
10#include <deque>
11#include <vector>
12
13#include "core/fxcrt/fx_coordinates.h"
14#include "core/fxcrt/fx_unicode.h"
15#include "core/fxcrt/retain_ptr.h"
16#include "core/fxcrt/span.h"
17#include "xfa/fgas/layout/cfgas_break.h"
18
19class CFGAS_TextPiece;
20class CFGAS_TextUserData;
21class TextCharPos;
22
23class CFGAS_RTFBreak final : public CFGAS_Break {
24 public:
32
33 explicit CFGAS_RTFBreak(Mask<LayoutStyle> dwLayoutStyles);
34 ~CFGAS_RTFBreak() override;
35
36 void SetLineStartPos(float fLinePos);
37
38 void SetAlignment(LineAlignment align) { m_iAlignment = align; }
39 void SetUserData(const RetainPtr<CFGAS_TextUserData>& pUserData);
40
41 void AddPositionedTab(float fTabPos);
42
44
46 pdfium::span<TextCharPos> pCharPos) const;
47
48 CFGAS_Char::BreakType AppendChar(wchar_t wch);
49
50 private:
51 void AppendChar_Combination(CFGAS_Char* pCurChar);
52 void AppendChar_Tab(CFGAS_Char* pCurChar);
53 CFGAS_Char::BreakType AppendChar_Control(CFGAS_Char* pCurChar);
54 CFGAS_Char::BreakType AppendChar_Arabic(CFGAS_Char* pCurChar);
55 CFGAS_Char::BreakType AppendChar_Others(CFGAS_Char* pCurChar);
56 bool GetPositionedTab(int32_t* iTabPos) const;
57
58 int32_t GetBreakPos(std::vector<CFGAS_Char>& tca,
59 bool bAllChars,
60 bool bOnlyBrk,
61 int32_t* pEndPos);
62 void SplitTextLine(CFGAS_BreakLine* pCurLine,
63 CFGAS_BreakLine* pNextLine,
64 bool bAllChars);
65 bool EndBreakSplitLine(CFGAS_BreakLine* pNextLine,
66 bool bAllChars,
67 CFGAS_Char::BreakType dwStatus);
68 std::deque<TPO> EndBreakBidiLine(CFGAS_Char::BreakType dwStatus);
69 void EndBreakAlignment(const std::deque<TPO>& tpos,
70 bool bAllChars,
71 CFGAS_Char::BreakType dwStatus);
72
73 bool m_bPagination = false;
75 std::vector<int32_t> m_PositionedTabs;
76 RetainPtr<CFGAS_TextUserData> m_pUserData;
77};
78
79#endif // XFA_FGAS_LAYOUT_CFGAS_RTFBREAK_H_
#define DCHECK
Definition check.h:33
int32_t GetLineEnd() const
void IncrementArabicCharCount()
void DecrementArabicCharCount()
int32_t GetStartChar() const
void SetVerticalScale(int32_t scale)
void SetStatus(CFGAS_Char::BreakType status)
void SetBidiLevel(int32_t level)
void SetCharCount(int32_t count)
void SetStartChar(int32_t pos)
int32_t GetBidiPos() const
void IncrementWidth(int32_t width)
void IncrementStartPos(int32_t count)
void SetBidiPos(int32_t pos)
void SetFontSize(int32_t font_size)
void SetHorizontalScale(int32_t scale)
void SetWidth(int32_t width)
void SetUserData(const RetainPtr< CFGAS_TextUserData > &user_data)
int32_t GetWidth() const
void SetBreakStatus()
int32_t m_iTabWidth
Definition cfgas_break.h:85
int32_t m_iHorizontalScale
Definition cfgas_break.h:86
CFGAS_Char * GetLastChar(int32_t index, bool bOmitChar, bool bRichText) const
uint32_t m_dwIdentity
Definition cfgas_break.h:80
int32_t m_iCharSpace
Definition cfgas_break.h:89
wchar_t m_wParagraphBreakChar
Definition cfgas_break.h:83
bool HasLine() const
Definition cfgas_break.h:72
int32_t m_iFontSize
Definition cfgas_break.h:84
int32_t m_iLineStart
Definition cfgas_break.h:81
static const float kConversionFactor
Definition cfgas_break.h:67
int32_t m_iLineWidth
Definition cfgas_break.h:82
int32_t m_iFontSize
Definition cfgas_char.h:51
uint32_t m_dwIdentity
Definition cfgas_char.h:52
int32_t m_iCharWidth
Definition cfgas_char.h:47
uint16_t m_iBidiOrder
Definition cfgas_char.h:50
uint16_t m_iBidiPos
Definition cfgas_char.h:49
BreakType m_dwStatus
Definition cfgas_char.h:43
int16_t vertical_scale() const
Definition cfgas_char.h:41
uint16_t m_iBidiLevel
Definition cfgas_char.h:48
int16_t horizonal_scale() const
Definition cfgas_char.h:40
FX_LINEBREAKTYPE m_eLineBreakType
Definition cfgas_char.h:45
uint16_t char_code() const
Definition cfgas_char.h:39
void SetUserData(const RetainPtr< CFGAS_TextUserData > &pUserData)
void SetAlignment(LineAlignment align)
CFGAS_Char::BreakType AppendChar(wchar_t wch)
CFGAS_RTFBreak(Mask< LayoutStyle > dwLayoutStyles)
~CFGAS_RTFBreak() override
CFGAS_Char::BreakType EndBreak(CFGAS_Char::BreakType dwStatus)
void SetLineStartPos(float fLinePos)
size_t GetDisplayPos(const CFGAS_TextPiece *pPiece, pdfium::span< TextCharPos > pCharPos) const
void AddPositionedTab(float fTabPos)
CFX_RectF(const CFX_RectF &other)=default
float right() const
uint32_t m_GlyphIndex
bool m_bGlyphAdjust
#define UNSAFE_TODO(...)
FX_LINEBREAKTYPE
#define FX_IsOdd(a)
pdfium::CheckedNumeric< int32_t > FX_SAFE_INT32
int FXSYS_roundf(float f)
wchar_t GetMirrorChar(wchar_t wch)
constexpr wchar_t kZeroWidthNoBreakSpace
Definition fx_unicode.h:103
constexpr wchar_t kLineSeparator
Definition fx_unicode.h:100
constexpr wchar_t kParagraphSeparator
Definition fx_unicode.h:101
wchar_t GetArabicFormChar(const CFGAS_Char *cur, const CFGAS_Char *prev, const CFGAS_Char *next)
wchar_t GetArabicFormChar(wchar_t wch, wchar_t prev, wchar_t next)