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_formobject.cpp
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#include "core/fpdfapi/page/cpdf_formobject.h"
8
9#include <utility>
10
11#include "core/fpdfapi/page/cpdf_form.h"
12
13CPDF_FormObject::CPDF_FormObject(int32_t content_stream,
14 std::unique_ptr<CPDF_Form> pForm,
15 const CFX_Matrix& matrix)
16 : CPDF_PageObject(content_stream),
18 m_FormMatrix(matrix) {}
19
20CPDF_FormObject::~CPDF_FormObject() = default;
21
22void CPDF_FormObject::Transform(const CFX_Matrix& matrix) {
23 m_FormMatrix.Concat(matrix);
25 SetDirty(true);
26}
27
28bool CPDF_FormObject::IsForm() const {
29 return true;
30}
31
32CPDF_FormObject* CPDF_FormObject::AsForm() {
33 return this;
34}
35
36const CPDF_FormObject* CPDF_FormObject::AsForm() const {
37 return this;
38}
39
40CPDF_PageObject::Type CPDF_FormObject::GetType() const {
41 return Type::kForm;
42}
43
44void CPDF_FormObject::CalcBoundingBox() {
45 SetRect(m_FormMatrix.TransformRect(m_pForm->CalcBoundingBox()));
46}
47
48void CPDF_FormObject::SetFormMatrix(const CFX_Matrix& matrix) {
49 m_FormMatrix = matrix;
51}
CFX_Matrix & operator=(const CFX_Matrix &other)=default
void Concat(const CFX_Matrix &right)
CFX_Matrix(const CFX_Matrix &other)=default
bool IsForm() const override
Type GetType() const override
void Transform(const CFX_Matrix &matrix) override
CPDF_FormObject(int32_t content_stream, std::unique_ptr< CPDF_Form > pForm, const CFX_Matrix &matrix)
~CPDF_FormObject() override
void SetFormMatrix(const CFX_Matrix &matrix)
CPDF_FormObject * AsForm() override
const CPDF_FormObject * AsForm() const override
void SetDirty(bool value)
CPDF_PageObject(int32_t content_stream)