Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cpdf_pagecontentgenerator.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_EDIT_CPDF_PAGECONTENTGENERATOR_H_
8
#
define
CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_
9
10
#
include
<
stdint
.
h
>
11
12
#
include
<
map
>
13
#
include
<
vector
>
14
15
#
include
"core/fxcrt/bytestring.h"
16
#
include
"core/fxcrt/fx_string_wrappers.h"
17
#
include
"core/fxcrt/unowned_ptr.h"
18
19
class
CPDF_ContentMarks
;
20
class
CPDF_Document
;
21
class
CPDF_FormObject;
22
class
CPDF_ImageObject;
23
class
CPDF_Object
;
24
class
CPDF_PageObject
;
25
class
CPDF_PageObjectHolder
;
26
class
CPDF_Path
;
27
class
CPDF_PathObject;
28
class
CPDF_TextObject;
29
30
class
CPDF_PageContentGenerator
{
31
public
:
32
explicit
CPDF_PageContentGenerator
(
CPDF_PageObjectHolder
* pObjHolder);
33
~
CPDF_PageContentGenerator
();
34
35
void
GenerateContent
();
36
bool
ProcessPageObjects
(fxcrt::ostringstream* buf);
37
38
private
:
39
friend
class
CPDFPageContentGeneratorTest
;
40
41
void
ProcessPageObject(fxcrt::ostringstream* buf,
CPDF_PageObject
* pPageObj);
42
void
ProcessPathPoints(fxcrt::ostringstream* buf,
CPDF_Path
* pPath);
43
void
ProcessPath(fxcrt::ostringstream* buf, CPDF_PathObject* pPathObj);
44
void
ProcessForm(fxcrt::ostringstream* buf, CPDF_FormObject* pFormObj);
45
void
ProcessImage(fxcrt::ostringstream* buf, CPDF_ImageObject* pImageObj);
46
void
ProcessGraphics(fxcrt::ostringstream* buf,
CPDF_PageObject
* pPageObj);
47
void
ProcessDefaultGraphics(fxcrt::ostringstream* buf);
48
void
ProcessText(fxcrt::ostringstream* buf, CPDF_TextObject* pTextObj);
49
ByteString
GetOrCreateDefaultGraphics()
const
;
50
ByteString
RealizeResource(
const
CPDF_Object
* pResource,
51
const
ByteString
& bsType)
const
;
52
const
CPDF_ContentMarks
* ProcessContentMarks(fxcrt::ostringstream* buf,
53
const
CPDF_PageObject
* pPageObj,
54
const
CPDF_ContentMarks
* pPrev);
55
void
FinishMarks(fxcrt::ostringstream* buf,
56
const
CPDF_ContentMarks
* pContentMarks);
57
58
// Returns a map from content stream index to new stream data. Unmodified
59
// streams are not touched.
60
std::map<int32_t, fxcrt::ostringstream> GenerateModifiedStreams();
61
62
// For each entry in `new_stream_data`, adds the string buffer to the page's
63
// content stream.
64
void
UpdateContentStreams(
65
std::map<int32_t, fxcrt::ostringstream>&& new_stream_data);
66
67
// Sets the stream index of all page objects with stream index ==
68
// |CPDF_PageObject::kNoContentStream|. These are new objects that had not
69
// been parsed from or written to any content stream yet.
70
void
UpdateStreamlessPageObjects(
int
new_content_stream_index);
71
72
// Updates the resource dictionary for `m_pObjHolder` to account for all the
73
// changes.
74
void
UpdateResourcesDict();
75
76
UnownedPtr
<
CPDF_PageObjectHolder
>
const
m_pObjHolder;
77
UnownedPtr
<
CPDF_Document
>
const
m_pDocument;
78
std::vector<UnownedPtr<CPDF_PageObject>> m_pageObjects;
79
ByteString
m_DefaultGraphicsName;
80
};
81
82
#
endif
// CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_
ByteString
fxcrt::ByteString ByteString
Definition
bytestring.h:180
DCHECK
#define DCHECK
Definition
check.h:33
CHECK_EQ
#define CHECK_EQ(x, y)
Definition
check_op.h:10
CFX_GraphStateData
Definition
cfx_graphstatedata.h:16
CFX_GraphStateData::LineCap
LineCap
Definition
cfx_graphstatedata.h:18
CFX_GraphStateData::LineCap::kButt
@ kButt
Definition
cfx_graphstatedata.h:18
CFX_GraphStateData::LineJoin
LineJoin
Definition
cfx_graphstatedata.h:20
CFX_GraphStateData::LineJoin::kMiter
@ kMiter
Definition
cfx_graphstatedata.h:20
CFX_GraphState::GetLineDashPhase
float GetLineDashPhase() const
Definition
cfx_graphstate.cpp:49
CFX_GraphState::GetLineWidth
float GetLineWidth() const
Definition
cfx_graphstate.cpp:53
CFX_GraphState::GetLineCap
CFX_GraphStateData::LineCap GetLineCap() const
Definition
cfx_graphstate.cpp:61
CFX_GraphState::GetLineJoin
CFX_GraphStateData::LineJoin GetLineJoin() const
Definition
cfx_graphstate.cpp:69
CFX_Matrix
Definition
fx_coordinates.h:440
CFX_Matrix::d
float d
Definition
fx_coordinates.h:510
CFX_Matrix::a
float a
Definition
fx_coordinates.h:507
CFX_Matrix::c
float c
Definition
fx_coordinates.h:509
CFX_Matrix::IsIdentity
bool IsIdentity() const
Definition
fx_coordinates.h:473
CFX_Matrix::b
float b
Definition
fx_coordinates.h:508
CFX_Path::Point
Definition
cfx_path.h:20
CFX_Path::Point::Type
Type
Definition
cfx_path.h:22
CFX_Path::Point::Type::kBezier
@ kBezier
Definition
cfx_path.h:22
CFX_Path::Point::Type::kMove
@ kMove
Definition
cfx_path.h:22
CFX_Path::Point::Type::kLine
@ kLine
Definition
cfx_path.h:22
CFX_Path
Definition
cfx_path.h:18
CPDFPageContentGeneratorTest
Definition
cpdf_pagecontentgenerator_unittest.cpp:31
CPDF_ClipPath
Definition
cpdf_clippath.h:22
CPDF_ClipPath::HasRef
bool HasRef() const
Definition
cpdf_clippath.h:32
CPDF_ColorState::GetStrokeColor
const CPDF_Color * GetStrokeColor() const
Definition
cpdf_colorstate.cpp:65
CPDF_ColorState::GetFillColor
const CPDF_Color * GetFillColor() const
Definition
cpdf_colorstate.cpp:51
CPDF_Color
Definition
cpdf_color.h:25
CPDF_Color::IsColorSpaceGray
bool IsColorSpaceGray() const
Definition
cpdf_color.cpp:97
CPDF_Color::IsColorSpaceRGB
bool IsColorSpaceRGB() const
Definition
cpdf_color.cpp:92
CPDF_ContentMarkItem::kDirectDict
@ kDirectDict
Definition
cpdf_contentmarkitem.h:17
CPDF_ContentMarkItem::kNone
@ kNone
Definition
cpdf_contentmarkitem.h:17
CPDF_ContentMarkItem::kPropertiesDict
@ kPropertiesDict
Definition
cpdf_contentmarkitem.h:17
CPDF_ContentMarkItem::GetName
const ByteString & GetName() const
Definition
cpdf_contentmarkitem.h:21
CPDF_ContentMarkItem::GetPropertyName
const ByteString & GetPropertyName() const
Definition
cpdf_contentmarkitem.h:25
CPDF_ContentMarkItem::GetParamType
ParamType GetParamType() const
Definition
cpdf_contentmarkitem.h:22
CPDF_ContentMarks
Definition
cpdf_contentmarks.h:20
CPDF_DictionaryLocker
Definition
cpdf_dictionary.h:157
CPDF_Dictionary::DictMap
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
Definition
cpdf_dictionary.h:31
CPDF_DocPageData::FromDocument
static CPDF_DocPageData * FromDocument(const CPDF_Document *pDoc)
Definition
cpdf_docpagedata.cpp:166
CPDF_Document
Definition
cpdf_document.h:29
CPDF_FontEncoding
Definition
cpdf_fontencoding.h:43
CPDF_Font
Definition
cpdf_font.h:37
CPDF_Font::GetStockFont
static RetainPtr< CPDF_Font > GetStockFont(CPDF_Document *pDoc, ByteStringView fontname)
Definition
cpdf_font.cpp:271
CPDF_FormObject::form_matrix
const CFX_Matrix & form_matrix() const
Definition
cpdf_formobject.h:33
CPDF_GeneralState::GetStrokeAlpha
float GetStrokeAlpha() const
Definition
cpdf_generalstate.cpp:142
CPDF_GeneralState::GetFillAlpha
float GetFillAlpha() const
Definition
cpdf_generalstate.cpp:131
CPDF_GeneralState::GetBlendType
BlendMode GetBlendType() const
Definition
cpdf_generalstate.cpp:120
CPDF_GeneralState::GetBlendMode
ByteString GetBlendMode() const
Definition
cpdf_generalstate.cpp:82
CPDF_ImageObject::SetImage
void SetImage(RetainPtr< CPDF_Image > pImage)
Definition
cpdf_imageobject.cpp:55
CPDF_ImageObject::matrix
const CFX_Matrix & matrix() const
Definition
cpdf_imageobject.h:36
CPDF_Object
Definition
cpdf_object.h:50
CPDF_Object::GetObjNum
uint32_t GetObjNum() const
Definition
cpdf_object.h:65
CPDF_PageContentGenerator
Definition
cpdf_pagecontentgenerator.h:30
CPDF_PageContentGenerator::ProcessPageObjects
bool ProcessPageObjects(fxcrt::ostringstream *buf)
Definition
cpdf_pagecontentgenerator.cpp:340
CPDF_PageContentGenerator::CPDF_PageContentGenerator
CPDF_PageContentGenerator(CPDF_PageObjectHolder *pObjHolder)
Definition
cpdf_pagecontentgenerator.cpp:136
CPDF_PageContentGenerator::~CPDF_PageContentGenerator
~CPDF_PageContentGenerator()
CPDF_PageContentGenerator::GenerateContent
void GenerateContent()
Definition
cpdf_pagecontentgenerator.cpp:146
CPDF_PageContentManager
Definition
cpdf_pagecontentmanager.h:22
CPDF_PageObjectHolder
Definition
cpdf_pageobjectholder.h:51
CPDF_PageObject
Definition
cpdf_pageobject.h:27
CPDF_PageObject::color_state
const CPDF_ColorState & color_state() const
Definition
cpdf_pageobject.h:111
CPDF_PageObject::SetDirty
void SetDirty(bool value)
Definition
cpdf_pageobject.h:63
CPDF_PageObject::general_state
const CPDF_GeneralState & general_state() const
Definition
cpdf_pageobject.h:125
CPDF_PageObject::Type
Type
Definition
cpdf_pageobject.h:30
CPDF_PageObject::Type::kPath
@ kPath
Definition
cpdf_pageobject.h:32
CPDF_PageObject::Type::kText
@ kText
Definition
cpdf_pageobject.h:31
CPDF_PageObject::Type::kImage
@ kImage
Definition
cpdf_pageobject.h:33
CPDF_PageObject::Type::kForm
@ kForm
Definition
cpdf_pageobject.h:35
CPDF_PageObject::Type::kShading
@ kShading
Definition
cpdf_pageobject.h:34
CPDF_PageObject::GetResourceName
const ByteString & GetResourceName() const
Definition
cpdf_pageobject.h:92
CPDF_PageObject::clip_path
const CPDF_ClipPath & clip_path() const
Definition
cpdf_pageobject.h:99
CPDF_PageObject::GetType
virtual Type GetType() const =0
CPDF_PageObject::mutable_general_state
CPDF_GeneralState & mutable_general_state()
Definition
cpdf_pageobject.h:128
CPDF_PageObject::GetContentMarks
const CPDF_ContentMarks * GetContentMarks() const
Definition
cpdf_pageobject.h:75
CPDF_PageObject::SetResourceName
void SetResourceName(const ByteString &resource_name)
Definition
cpdf_pageobject.h:93
CPDF_PageObject::graph_state
const CFX_GraphState & graph_state() const
Definition
cpdf_pageobject.h:104
CPDF_PathObject::has_winding_filltype
bool has_winding_filltype() const
Definition
cpdf_pathobject.h:39
CPDF_PathObject::stroke
bool stroke() const
Definition
cpdf_pathobject.h:32
CPDF_PathObject::matrix
const CFX_Matrix & matrix() const
Definition
cpdf_pathobject.h:63
CPDF_PathObject::has_alternate_filltype
bool has_alternate_filltype() const
Definition
cpdf_pathobject.h:42
CPDF_PathObject::has_no_filltype
bool has_no_filltype() const
Definition
cpdf_pathobject.h:36
CPDF_Path
Definition
cpdf_path.h:15
CPDF_Path::IsRect
bool IsRect() const
Definition
cpdf_path.cpp:37
CPDF_TextObject::GetTextMatrix
CFX_Matrix GetTextMatrix() const
Definition
cpdf_textobject.cpp:181
CPDF_TextObject::GetFontSize
float GetFontSize() const
Definition
cpdf_textobject.cpp:247
CPDF_TextObject::GetTextRenderMode
TextRenderingMode GetTextRenderMode() const
Definition
cpdf_textobject.cpp:251
fxcrt::ByteString::Format
static ByteString Format(const char *pFormat,...)
Definition
bytestring.cpp:79
fxcrt::RetainPtr
Definition
retain_ptr.h:28
fxcrt::UnownedPtr
Definition
unowned_ptr.h:76
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
PDF_NameEncode
ByteString PDF_NameEncode(const ByteString &orig)
Definition
fpdf_parser_utility.cpp:112
CFX_PointF
CFX_PTemplate< float > CFX_PointF
Definition
fx_coordinates.h:51
BlendMode
BlendMode
Definition
fx_dib.h:119
BlendMode::kNormal
@ kNormal
Definition
fx_dib.h:120
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
NOTREACHED_NORETURN
#define NOTREACHED_NORETURN()
Definition
notreached.h:22
CHECK
#define CHECK(cvref)
Definition
q23utility.cpp:15
CFX_FillRenderOptions
Definition
cfx_fillrenderoptions.h:11
CFX_FillRenderOptions::FillType
FillType
Definition
cfx_fillrenderoptions.h:13
CFX_FillRenderOptions::FillType::kWinding
@ kWinding
Definition
cfx_fillrenderoptions.h:23
CFX_FillRenderOptions::FillType::kEvenOdd
@ kEvenOdd
Definition
cfx_fillrenderoptions.h:19
CFX_FillRenderOptions::FillType::kNoFill
@ kNoFill
Definition
cfx_fillrenderoptions.h:15
FX_RGB_STRUCT
Definition
fx_dib.h:46
FontData
Definition
cpdf_pageobjectholder.h:44
GraphicsData
Definition
cpdf_pageobjectholder.h:36
GraphicsData::blendType
BlendMode blendType
Definition
cpdf_pageobjectholder.h:39
GraphicsData::strokeAlpha
float strokeAlpha
Definition
cpdf_pageobjectholder.h:38
GraphicsData::fillAlpha
float fillAlpha
Definition
cpdf_pageobjectholder.h:37
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfapi
edit
cpdf_pagecontentgenerator.h
Generated on
for Qt by
1.18.0