| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_SRC_FPDFTEXT_TXTPROC_H_ | 7 #ifndef CORE_SRC_FPDFTEXT_TXTPROC_H_ |
| 8 #define CORE_SRC_FPDFTEXT_TXTPROC_H_ | 8 #define CORE_SRC_FPDFTEXT_TXTPROC_H_ |
| 9 | 9 |
| 10 class CTextColumn | 10 class CTextColumn { |
| 11 { | 11 public: |
| 12 public: | 12 FX_FLOAT m_AvgPos; |
| 13 FX_FLOAT» m_AvgPos; | 13 int m_Count; |
| 14 int»» m_Count; | 14 int m_TextPos; |
| 15 int»» m_TextPos; | |
| 16 }; | 15 }; |
| 17 class CTextBox | 16 class CTextBox { |
| 18 { | 17 public: |
| 19 public: | 18 CFX_WideString m_Text; |
| 20 CFX_WideString» m_Text; | 19 FX_FLOAT m_Left; |
| 21 FX_FLOAT» m_Left; | 20 FX_FLOAT m_Right; |
| 22 FX_FLOAT» m_Right; | 21 FX_FLOAT m_SpaceWidth; |
| 23 FX_FLOAT» m_SpaceWidth; | 22 FX_FLOAT m_Top; |
| 24 FX_FLOAT» m_Top; | 23 FX_FLOAT m_Bottom; |
| 25 FX_FLOAT» m_Bottom; | 24 FX_FLOAT m_FontSizeV; |
| 26 FX_FLOAT» m_FontSizeV; | 25 CTextColumn* m_pColumn; |
| 27 CTextColumn* m_pColumn; | |
| 28 }; | 26 }; |
| 29 class CTextBaseLine | 27 class CTextBaseLine { |
| 30 { | 28 public: |
| 31 public: | 29 CTextBaseLine(); |
| 32 CTextBaseLine(); | 30 ~CTextBaseLine(); |
| 33 ~CTextBaseLine(); | 31 void InsertTextBox(FX_FLOAT leftx, |
| 34 void» InsertTextBox(FX_FLOAT leftx, FX_FLOAT rightx, FX_FLOAT topy, FX
_FLOAT bottomy, | 32 FX_FLOAT rightx, |
| 35 FX_FLOAT spacew, FX_FLOAT fontsize_v, const CFX_WideSt
ring& str); | 33 FX_FLOAT topy, |
| 36 FX_BOOL» GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx); | 34 FX_FLOAT bottomy, |
| 37 FX_BOOL» CanMerge(CTextBaseLine* pOther); | 35 FX_FLOAT spacew, |
| 38 void» Merge(CTextBaseLine* pOther); | 36 FX_FLOAT fontsize_v, |
| 39 void» MergeBoxes(); | 37 const CFX_WideString& str); |
| 40 void» CountChars(int& count, FX_FLOAT& width, int& minchars); | 38 FX_BOOL GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx); |
| 41 void» WriteOutput(CFX_WideString& str, FX_FLOAT leftx, FX_FLOAT width,
int iWidth); | 39 FX_BOOL CanMerge(CTextBaseLine* pOther); |
| 42 FX_FLOAT» m_BaseLine; | 40 void Merge(CTextBaseLine* pOther); |
| 43 FX_FLOAT» m_Top; | 41 void MergeBoxes(); |
| 44 FX_FLOAT» m_Bottom; | 42 void CountChars(int& count, FX_FLOAT& width, int& minchars); |
| 45 FX_FLOAT» m_MaxFontSizeV; | 43 void WriteOutput(CFX_WideString& str, |
| 46 CFX_PtrArray» » m_TextList; | 44 FX_FLOAT leftx, |
| 45 FX_FLOAT width, |
| 46 int iWidth); |
| 47 FX_FLOAT m_BaseLine; |
| 48 FX_FLOAT m_Top; |
| 49 FX_FLOAT m_Bottom; |
| 50 FX_FLOAT m_MaxFontSizeV; |
| 51 CFX_PtrArray m_TextList; |
| 47 }; | 52 }; |
| 48 class CPDF_PageObject; | 53 class CPDF_PageObject; |
| 49 class CPDF_TextObject; | 54 class CPDF_TextObject; |
| 50 class CTextPage | 55 class CTextPage { |
| 51 { | 56 public: |
| 52 public: | 57 CTextPage(); |
| 53 CTextPage(); | 58 ~CTextPage(); |
| 54 ~CTextPage(); | 59 void ProcessObject(CPDF_PageObject* pObj); |
| 55 void» ProcessObject(CPDF_PageObject* pObj); | 60 CTextBaseLine* InsertTextBox(CTextBaseLine* pBaseLine, |
| 56 CTextBaseLine* InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey, FX_FL
OAT leftx, | 61 FX_FLOAT basey, |
| 57 FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottom
y, FX_FLOAT spacew, FX_FLOAT fontsize_v, | 62 FX_FLOAT leftx, |
| 58 CFX_ByteString& str, CPDF_Font* pFont); | 63 FX_FLOAT rightx, |
| 59 void» WriteOutput(CFX_WideStringArray& lines, int iMinWidth); | 64 FX_FLOAT topy, |
| 60 FX_BOOL» m_bAutoWidth; | 65 FX_FLOAT bottomy, |
| 61 FX_BOOL» m_bKeepColumn; | 66 FX_FLOAT spacew, |
| 62 FX_BOOL» m_bBreakSpace; | 67 FX_FLOAT fontsize_v, |
| 68 CFX_ByteString& str, |
| 69 CPDF_Font* pFont); |
| 70 void WriteOutput(CFX_WideStringArray& lines, int iMinWidth); |
| 71 FX_BOOL m_bAutoWidth; |
| 72 FX_BOOL m_bKeepColumn; |
| 73 FX_BOOL m_bBreakSpace; |
| 63 | 74 |
| 64 private: | 75 private: |
| 65 CFX_PtrArray» m_BaseLines; | 76 CFX_PtrArray m_BaseLines; |
| 66 CFX_PtrArray» m_TextColumns; | 77 CFX_PtrArray m_TextColumns; |
| 67 void» FindColumns(); | 78 void FindColumns(); |
| 68 CTextColumn*» FindColumn(FX_FLOAT xpos); | 79 CTextColumn* FindColumn(FX_FLOAT xpos); |
| 69 void» BreakSpace(CPDF_TextObject* pTextObj); | 80 void BreakSpace(CPDF_TextObject* pTextObj); |
| 70 }; | 81 }; |
| 71 | 82 |
| 72 #endif // CORE_SRC_FPDFTEXT_TXTPROC_H_ | 83 #endif // CORE_SRC_FPDFTEXT_TXTPROC_H_ |
| OLD | NEW |