OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_FPDFAPI_PAGE_CPDF_TEXTOBJECT_H_ | 7 #ifndef CORE_FPDFAPI_PAGE_CPDF_TEXTOBJECT_H_ |
8 #define CORE_FPDFAPI_PAGE_CPDF_TEXTOBJECT_H_ | 8 #define CORE_FPDFAPI_PAGE_CPDF_TEXTOBJECT_H_ |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "core/fpdfapi/page/cpdf_pageobject.h" | 12 #include "core/fpdfapi/page/cpdf_pageobject.h" |
11 #include "core/fxcrt/fx_string.h" | 13 #include "core/fxcrt/fx_string.h" |
12 #include "core/fxcrt/fx_system.h" | 14 #include "core/fxcrt/fx_system.h" |
13 | 15 |
14 struct CPDF_TextObjectItem { | 16 struct CPDF_TextObjectItem { |
15 uint32_t m_CharCode; | 17 uint32_t m_CharCode; |
16 FX_FLOAT m_OriginX; | 18 FX_FLOAT m_OriginX; |
17 FX_FLOAT m_OriginY; | 19 FX_FLOAT m_OriginY; |
18 }; | 20 }; |
19 | 21 |
20 class CPDF_TextObject : public CPDF_PageObject { | 22 class CPDF_TextObject : public CPDF_PageObject { |
21 public: | 23 public: |
22 CPDF_TextObject(); | 24 CPDF_TextObject(); |
23 ~CPDF_TextObject() override; | 25 ~CPDF_TextObject() override; |
24 | 26 |
25 // CPDF_PageObject | 27 // CPDF_PageObject |
26 CPDF_TextObject* Clone() const override; | |
27 Type GetType() const override; | 28 Type GetType() const override; |
28 void Transform(const CFX_Matrix& matrix) override; | 29 void Transform(const CFX_Matrix& matrix) override; |
29 bool IsText() const override; | 30 bool IsText() const override; |
30 CPDF_TextObject* AsText() override; | 31 CPDF_TextObject* AsText() override; |
31 const CPDF_TextObject* AsText() const override; | 32 const CPDF_TextObject* AsText() const override; |
32 | 33 |
| 34 std::unique_ptr<CPDF_TextObject> Clone() const; |
33 int CountItems() const; | 35 int CountItems() const; |
34 void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const; | 36 void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const; |
35 int CountChars() const; | 37 int CountChars() const; |
36 void GetCharInfo(int index, uint32_t& charcode, FX_FLOAT& kerning) const; | 38 void GetCharInfo(int index, uint32_t& charcode, FX_FLOAT& kerning) const; |
37 void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const; | 39 void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const; |
38 FX_FLOAT GetCharWidth(uint32_t charcode) const; | 40 FX_FLOAT GetCharWidth(uint32_t charcode) const; |
39 FX_FLOAT GetPosX() const; | 41 FX_FLOAT GetPosX() const; |
40 FX_FLOAT GetPosY() const; | 42 FX_FLOAT GetPosY() const; |
41 void GetTextMatrix(CFX_Matrix* pMatrix) const; | 43 void GetTextMatrix(CFX_Matrix* pMatrix) const; |
42 CPDF_Font* GetFont() const; | 44 CPDF_Font* GetFont() const; |
(...skipping 16 matching lines...) Expand all Loading... |
59 FX_FLOAT horz_scale); | 61 FX_FLOAT horz_scale); |
60 | 62 |
61 FX_FLOAT m_PosX; | 63 FX_FLOAT m_PosX; |
62 FX_FLOAT m_PosY; | 64 FX_FLOAT m_PosY; |
63 int m_nChars; | 65 int m_nChars; |
64 uint32_t* m_pCharCodes; | 66 uint32_t* m_pCharCodes; |
65 FX_FLOAT* m_pCharPos; | 67 FX_FLOAT* m_pCharPos; |
66 }; | 68 }; |
67 | 69 |
68 #endif // CORE_FPDFAPI_PAGE_CPDF_TEXTOBJECT_H_ | 70 #endif // CORE_FPDFAPI_PAGE_CPDF_TEXTOBJECT_H_ |
OLD | NEW |