Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: core/fpdfapi/fpdf_page/include/cpdf_textobject.h

Issue 2379033002: Move core/fpdfapi/fpdf_page/include to core/fpdfapi/fpdf_page (Closed)
Patch Set: Header sort Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_INCLUDE_CPDF_TEXTOBJECT_H_
8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_TEXTOBJECT_H_
9
10 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h"
11 #include "core/fxcrt/include/fx_string.h"
12 #include "core/fxcrt/include/fx_system.h"
13
14 struct CPDF_TextObjectItem {
15 uint32_t m_CharCode;
16 FX_FLOAT m_OriginX;
17 FX_FLOAT m_OriginY;
18 };
19
20 class CPDF_TextObject : public CPDF_PageObject {
21 public:
22 CPDF_TextObject();
23 ~CPDF_TextObject() override;
24
25 // CPDF_PageObject
26 CPDF_TextObject* Clone() const override;
27 Type GetType() const override;
28 void Transform(const CFX_Matrix& matrix) override;
29 bool IsText() const override;
30 CPDF_TextObject* AsText() override;
31 const CPDF_TextObject* AsText() const override;
32
33 int CountItems() const;
34 void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const;
35 int CountChars() const;
36 void GetCharInfo(int index, uint32_t& charcode, FX_FLOAT& kerning) const;
37 void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const;
38 FX_FLOAT GetCharWidth(uint32_t charcode) const;
39 FX_FLOAT GetPosX() const;
40 FX_FLOAT GetPosY() const;
41 void GetTextMatrix(CFX_Matrix* pMatrix) const;
42 CPDF_Font* GetFont() const;
43 FX_FLOAT GetFontSize() const;
44
45 void SetText(const CFX_ByteString& text);
46 void SetPosition(FX_FLOAT x, FX_FLOAT y);
47
48 void RecalcPositionData();
49
50 protected:
51 friend class CPDF_RenderStatus;
52 friend class CPDF_StreamContentParser;
53 friend class CPDF_TextRenderer;
54
55 void SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs);
56
57 void CalcPositionData(FX_FLOAT* pTextAdvanceX,
58 FX_FLOAT* pTextAdvanceY,
59 FX_FLOAT horz_scale,
60 int level = 0);
61
62 FX_FLOAT m_PosX;
63 FX_FLOAT m_PosY;
64 int m_nChars;
65 uint32_t* m_pCharCodes;
66 FX_FLOAT* m_pCharPos;
67 };
68
69 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_TEXTOBJECT_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h ('k') | core/fpdfapi/fpdf_page/include/cpdf_textstate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698