OLD | NEW |
| (Empty) |
1 // Copyright 2016 PDFium Authors. All rights reserved. | |
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_FPDF_PAGE_CPDF_PAGEOBJECT_H_ | |
8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEOBJECT_H_ | |
9 | |
10 #include "core/fpdfapi/fpdf_page/cpdf_contentmark.h" | |
11 #include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" | |
12 #include "core/fxcrt/fx_coordinates.h" | |
13 #include "core/fxcrt/fx_system.h" | |
14 | |
15 class CPDF_TextObject; | |
16 class CPDF_PathObject; | |
17 class CPDF_ImageObject; | |
18 class CPDF_ShadingObject; | |
19 class CPDF_FormObject; | |
20 | |
21 class CPDF_PageObject : public CPDF_GraphicStates { | |
22 public: | |
23 enum Type { | |
24 TEXT = 1, | |
25 PATH, | |
26 IMAGE, | |
27 SHADING, | |
28 FORM, | |
29 }; | |
30 | |
31 CPDF_PageObject(); | |
32 ~CPDF_PageObject() override; | |
33 | |
34 virtual CPDF_PageObject* Clone() const = 0; | |
35 virtual Type GetType() const = 0; | |
36 virtual void Transform(const CFX_Matrix& matrix) = 0; | |
37 virtual bool IsText() const; | |
38 virtual bool IsPath() const; | |
39 virtual bool IsImage() const; | |
40 virtual bool IsShading() const; | |
41 virtual bool IsForm() const; | |
42 virtual CPDF_TextObject* AsText(); | |
43 virtual const CPDF_TextObject* AsText() const; | |
44 virtual CPDF_PathObject* AsPath(); | |
45 virtual const CPDF_PathObject* AsPath() const; | |
46 virtual CPDF_ImageObject* AsImage(); | |
47 virtual const CPDF_ImageObject* AsImage() const; | |
48 virtual CPDF_ShadingObject* AsShading(); | |
49 virtual const CPDF_ShadingObject* AsShading() const; | |
50 virtual CPDF_FormObject* AsForm(); | |
51 virtual const CPDF_FormObject* AsForm() const; | |
52 | |
53 void TransformClipPath(CFX_Matrix& matrix); | |
54 void TransformGeneralState(CFX_Matrix& matrix); | |
55 FX_RECT GetBBox(const CFX_Matrix* pMatrix) const; | |
56 | |
57 FX_FLOAT m_Left; | |
58 FX_FLOAT m_Right; | |
59 FX_FLOAT m_Top; | |
60 FX_FLOAT m_Bottom; | |
61 CPDF_ContentMark m_ContentMark; | |
62 | |
63 protected: | |
64 void CopyData(const CPDF_PageObject* pSrcObject); | |
65 | |
66 private: | |
67 CPDF_PageObject(const CPDF_PageObject& src) = delete; | |
68 void operator=(const CPDF_PageObject& src) = delete; | |
69 }; | |
70 | |
71 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_PAGEOBJECT_H_ | |
OLD | NEW |