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_allstates.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_FPDFAPI_PAGE_CPDF_ALLSTATES_H_
8#define CORE_FPDFAPI_PAGE_CPDF_ALLSTATES_H_
9
10#include "core/fpdfapi/page/cpdf_graphicstates.h"
11#include "core/fxcrt/fx_coordinates.h"
12
13class CPDF_Array;
14class CPDF_Dictionary;
16
18 public:
23
24 void SetDefaultStates();
25
26 void ProcessExtGS(const CPDF_Dictionary* pGS,
28 void SetLineDash(const CPDF_Array* pArray, float phase, float scale);
29
30 CFX_PointF GetTransformedTextPosition() const;
31 void ResetTextPosition();
32 void MoveTextPoint(const CFX_PointF& point);
33 void MoveTextToNextLine();
34 void IncrementTextPositionX(float value);
35 void IncrementTextPositionY(float value);
36
37 const CFX_Matrix& text_matrix() const { return m_TextMatrix; }
38 void set_text_matrix(const CFX_Matrix& matrix) { m_TextMatrix = matrix; }
39
40 const CFX_Matrix& current_transformation_matrix() const { return m_CTM; }
42 m_CTM = matrix;
43 }
45 m_CTM = matrix * m_CTM;
46 }
47
48 const CFX_Matrix& parent_matrix() const { return m_ParentMatrix; }
49 void set_parent_matrix(const CFX_Matrix& matrix) { m_ParentMatrix = matrix; }
50
51 void set_text_leading(float value) { m_TextLeading = value; }
52
53 void set_text_rise(float value) { m_TextRise = value; }
54
55 float text_horz_scale() const { return m_TextHorzScale; }
56 void set_text_horz_scale(float value) { m_TextHorzScale = value; }
57
58 const CPDF_ClipPath& clip_path() const { return m_GraphicStates.clip_path(); }
60 return m_GraphicStates.mutable_clip_path();
61 }
62
63 const CFX_GraphState& graph_state() const {
64 return m_GraphicStates.graph_state();
65 }
67 return m_GraphicStates.mutable_graph_state();
68 }
69
71 return m_GraphicStates.color_state();
72 }
74 return m_GraphicStates.mutable_color_state();
75 }
76
77 const CPDF_TextState& text_state() const {
78 return m_GraphicStates.text_state();
79 }
81 return m_GraphicStates.mutable_text_state();
82 }
83
85 return m_GraphicStates.general_state();
86 }
88 return m_GraphicStates.mutable_general_state();
89 }
90
91 const CPDF_GraphicStates& graphic_states() const { return m_GraphicStates; }
92
93 private:
94 CPDF_GraphicStates m_GraphicStates;
95 CFX_Matrix m_TextMatrix;
96 CFX_Matrix m_CTM;
97 CFX_Matrix m_ParentMatrix;
98 CFX_PointF m_TextPos;
99 CFX_PointF m_TextLinePos;
100 float m_TextLeading = 0.0f;
101 float m_TextRise = 0.0f;
102 float m_TextHorzScale = 1.0f;
103};
104
105#endif // CORE_FPDFAPI_PAGE_CPDF_ALLSTATES_H_
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_Matrix operator*(const CFX_Matrix &right) const
CPDF_TextState & mutable_text_state()
void IncrementTextPositionX(float value)
void set_current_transformation_matrix(const CFX_Matrix &matrix)
CFX_GraphState & mutable_graph_state()
void set_text_leading(float value)
const CFX_Matrix & text_matrix() const
void set_text_horz_scale(float value)
CPDF_ColorState & mutable_color_state()
void prepend_to_current_transformation_matrix(const CFX_Matrix &matrix)
void set_text_rise(float value)
void MoveTextPoint(const CFX_PointF &point)
void IncrementTextPositionY(float value)
void set_text_matrix(const CFX_Matrix &matrix)
float text_horz_scale() const
CFX_PointF GetTransformedTextPosition() const
const CPDF_GeneralState & general_state() const
CPDF_GeneralState & mutable_general_state()
CPDF_AllStates & operator=(const CPDF_AllStates &that)
const CFX_Matrix & parent_matrix() const
const CPDF_ClipPath & clip_path() const
void SetLineDash(const CPDF_Array *pArray, float phase, float scale)
CPDF_ClipPath & mutable_clip_path()
void set_parent_matrix(const CFX_Matrix &matrix)
const CPDF_ColorState & color_state() const
void ProcessExtGS(const CPDF_Dictionary *pGS, CPDF_StreamContentParser *pParser)
const CFX_GraphState & graph_state() const
const CPDF_TextState & text_state() const
const CPDF_GraphicStates & graphic_states() const
CPDF_AllStates(const CPDF_AllStates &that)
const CFX_Matrix & current_transformation_matrix() const
CPDF_DictionaryLocker(const CPDF_Dictionary *pDictionary)
void SetMatrix(const CFX_Matrix &matrix)