summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/cfx_breakpiece.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-13 15:32:07 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 14:13:24 +0000
commit893822aa5b6254591f8e80fbffcbb4fa6ad849aa (patch)
tree74e20ab6378d515c12a1ec9b9fc70d8e309b361b /xfa/fgas/layout/cfx_breakpiece.h
parent80e370c7d8b6541f59d98b6cbfbaae51f7e139da (diff)
downloadpdfium-893822aa5b6254591f8e80fbffcbb4fa6ad849aa.tar.xz
Merge text breaking helper classes.
This Cl merges the CFX_TxtPiece and CFX_RTFPiece classes into CFX_BreakPiece. CFX_TxtLine and CFX_RTFLine into CFX_BreakLine and CFX_TxtChar and CFX_RTFChar into CFX_Char. Change-Id: I95421bdf4cafd5e394db9238dea3603ccb8349c3 Reviewed-on: https://pdfium-review.googlesource.com/2966 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/cfx_breakpiece.h')
-rw-r--r--xfa/fgas/layout/cfx_breakpiece.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/xfa/fgas/layout/cfx_breakpiece.h b/xfa/fgas/layout/cfx_breakpiece.h
new file mode 100644
index 0000000000..64622b25c1
--- /dev/null
+++ b/xfa/fgas/layout/cfx_breakpiece.h
@@ -0,0 +1,46 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_FGAS_LAYOUT_CFX_BREAKPIECE_H_
+#define XFA_FGAS_LAYOUT_CFX_BREAKPIECE_H_
+
+#include <vector>
+
+#include "core/fxcrt/cfx_char.h"
+#include "core/fxcrt/cfx_retain_ptr.h"
+#include "core/fxcrt/fx_string.h"
+
+class CFX_BreakPiece {
+ public:
+ CFX_BreakPiece();
+ CFX_BreakPiece(const CFX_BreakPiece& other);
+ ~CFX_BreakPiece();
+
+ int32_t GetEndPos() const;
+ int32_t GetLength() const { return m_iChars; }
+
+ CFX_Char* GetChar(int32_t index) const;
+ CFX_WideString GetString() const;
+ std::vector<int32_t> GetWidths() const;
+
+ CFX_BreakType m_dwStatus;
+ int32_t m_iStartPos;
+ int32_t m_iWidth;
+ int32_t m_iStartChar;
+ int32_t m_iChars;
+ int32_t m_iBidiLevel;
+ int32_t m_iBidiPos;
+ int32_t m_iFontSize;
+ int32_t m_iFontHeight;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVerticalScale;
+ uint32_t m_dwIdentity;
+ uint32_t m_dwCharStyles;
+ std::vector<CFX_Char>* m_pChars; // not owned.
+ CFX_RetainPtr<CFX_Retainable> m_pUserData;
+};
+
+#endif // XFA_FGAS_LAYOUT_CFX_BREAKPIECE_H_