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 "xfa/fgas/layout/cfgas_break.h"
17
18class CFGAS_TextPiece;
19class CFGAS_TextUserData;
20class TextCharPos;
21
22class CFGAS_RTFBreak final : public CFGAS_Break {
23 public:
24 enum class LineAlignment : uint8_t {
25 Left = 0,
26 Center,
27 Right,
30 };
31
32 explicit CFGAS_RTFBreak(Mask<LayoutStyle> dwLayoutStyles);
33 ~CFGAS_RTFBreak() override;
34
35 void SetLineStartPos(float fLinePos);
36
37 void SetAlignment(LineAlignment align) { m_iAlignment = align; }
38 void SetUserData(const RetainPtr<CFGAS_TextUserData>& pUserData);
39
40 void AddPositionedTab(float fTabPos);
41
43
45 std::vector<TextCharPos>* pCharPos) const;
46
47 CFGAS_Char::BreakType AppendChar(wchar_t wch);
48
49 private:
50 void AppendChar_Combination(CFGAS_Char* pCurChar);
51 void AppendChar_Tab(CFGAS_Char* pCurChar);
52 CFGAS_Char::BreakType AppendChar_Control(CFGAS_Char* pCurChar);
53 CFGAS_Char::BreakType AppendChar_Arabic(CFGAS_Char* pCurChar);
54 CFGAS_Char::BreakType AppendChar_Others(CFGAS_Char* pCurChar);
55 bool GetPositionedTab(int32_t* iTabPos) const;
56
57 int32_t GetBreakPos(std::vector<CFGAS_Char>& tca,
58 bool bAllChars,
59 bool bOnlyBrk,
60 int32_t* pEndPos);
61 void SplitTextLine(CFGAS_BreakLine* pCurLine,
62 CFGAS_BreakLine* pNextLine,
63 bool bAllChars);
64 bool EndBreakSplitLine(CFGAS_BreakLine* pNextLine,
65 bool bAllChars,
66 CFGAS_Char::BreakType dwStatus);
67 std::deque<TPO> EndBreakBidiLine(CFGAS_Char::BreakType dwStatus);
68 void EndBreakAlignment(const std::deque<TPO>& tpos,
69 bool bAllChars,
70 CFGAS_Char::BreakType dwStatus);
71
72 bool m_bPagination = false;
74 std::vector<int32_t> m_PositionedTabs;
75 RetainPtr<CFGAS_TextUserData> m_pUserData;
76};
77
78#endif // XFA_FGAS_LAYOUT_CFGAS_RTFBREAK_H_
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:83
int32_t m_iHorizontalScale
Definition cfgas_break.h:84
CFGAS_Char * GetLastChar(int32_t index, bool bOmitChar, bool bRichText) const
uint32_t m_dwIdentity
Definition cfgas_break.h:78
int32_t m_iCharSpace
Definition cfgas_break.h:87
wchar_t m_wParagraphBreakChar
Definition cfgas_break.h:81
bool HasLine() const
Definition cfgas_break.h:70
int32_t m_iFontSize
Definition cfgas_break.h:82
int32_t m_iLineStart
Definition cfgas_break.h:79
static const float kConversionFactor
Definition cfgas_break.h:65
int32_t m_iLineWidth
Definition cfgas_break.h:80
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)
size_t GetDisplayPos(const CFGAS_TextPiece *pPiece, std::vector< TextCharPos > *pCharPos) const
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)
void AddPositionedTab(float fTabPos)
CFX_RectF(const CFX_RectF &other)=default
float right() const
uint32_t m_GlyphIndex
float m_AdjustMatrix[4]
bool m_bGlyphAdjust
FX_LINEBREAKTYPE
#define FX_IsOdd(a)
int FXSYS_roundf(float f)
Definition fx_system.cpp:92
wchar_t GetFormChar(const CFGAS_Char *cur, const CFGAS_Char *prev, const CFGAS_Char *next)
wchar_t GetFormChar(wchar_t wch, wchar_t prev, wchar_t next)
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