From 5110c4743751145c4ae1934cd1d83bc6c55bb43f Mon Sep 17 00:00:00 2001 From: John Abd-El-Malek Date: Sat, 17 May 2014 22:33:34 -0700 Subject: Initial commit. --- core/src/reflow/reflowedtextpage.h | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 core/src/reflow/reflowedtextpage.h (limited to 'core/src/reflow/reflowedtextpage.h') diff --git a/core/src/reflow/reflowedtextpage.h b/core/src/reflow/reflowedtextpage.h new file mode 100644 index 0000000000..397428d178 --- /dev/null +++ b/core/src/reflow/reflowedtextpage.h @@ -0,0 +1,71 @@ +// Copyright 2014 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 _REFLOWED_TEXT_PAGE_H +#define _REFLOWED_TEXT_PAGE_H +#include "../../include/reflow/reflowengine.h" +#include "../../src/reflow/reflowedpage.h" +typedef CFX_SegmentedArray CRF_CharDataPtrArray; +typedef CFX_SegmentedArray CFX_CountBSINT32Array; +class CRF_TextPage : public IPDF_TextPage +{ +public: + CRF_TextPage(IPDF_ReflowedPage* pRefPage); + + virtual ~CRF_TextPage() ; + FX_BOOL ParseTextPage(); + void NormalizeObjects(FX_BOOL bNormalize) + { + return; + }; + + FX_BOOL IsParsered() const; +public: + + int CharIndexFromTextIndex(int TextIndex) const; + + int TextIndexFromCharIndex(int CharIndex) const; + + + int CountChars() const; + + virtual void GetCharInfo(int index, FPDF_CHAR_INFO & info) const; + + void GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const; + + + int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const; + + int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const; + + virtual int GetOrderByDirection(int index, int direction) const; + + CFX_WideString GetTextByRect(CFX_FloatRect rect) const; + + void GetRectsArrayByRect(CFX_FloatRect rect, CFX_RectArray& resRectArray) const; + + + int CountRects(int start, int nCount); + + virtual void GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const; + virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate); + virtual FX_BOOL GetBaselineRotate(CFX_FloatRect rect, int& Rotate); + + virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE); + + virtual void GetBoundedSegment(int index, int& start, int& count) const; + + + int GetWordBreak(int index, int direction) const; + + CFX_WideString GetPageText(int start, int nCount = -1 ) const; +private: + CPDF_ReflowedPage* m_pRefPage; + CRF_CharDataPtrArray* m_pDataList; + CFX_RectArray m_rectArray; + CFX_CountBSINT32Array* m_CountBSArray; +}; +#endif -- cgit v1.2.3