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 _REFLOW_ENGINE_H | 7 #ifndef _REFLOW_ENGINE_H |
8 #define _REFLOW_ENGINE_H | 8 #define _REFLOW_ENGINE_H |
9 #include "../fpdfapi/fpdf_render.h" | 9 #include "../fpdfapi/fpdf_render.h" |
10 #include "../fpdftext/fpdf_text.h" | 10 #include "../fpdftext/fpdf_text.h" |
11 #include "fpdf_layout.h" | 11 #include "fpdf_layout.h" |
12 #include "../fpdfapi/fpdf_pageobj.h" | 12 #include "../fpdfapi/fpdf_pageobj.h" |
13 #include "../fpdfdoc/fpdf_tagged.h" | 13 #include "../fpdfdoc/fpdf_tagged.h" |
14 class IPDF_ReflowedPage | 14 class IPDF_ReflowedPage { |
15 { | 15 public: |
16 public: | 16 static IPDF_ReflowedPage* Create(); |
17 static IPDF_ReflowedPage* Create(); | |
18 | 17 |
19 virtual ~IPDF_ReflowedPage() {} | 18 virtual ~IPDF_ReflowedPage() {} |
20 virtual CFX_PrivateData*» GetPrivateDataCtrl() = 0; | 19 virtual CFX_PrivateData* GetPrivateDataCtrl() = 0; |
21 | 20 |
22 | 21 virtual void GetDisplayMatrix(CFX_AffineMatrix& matrix, |
23 virtual void» » GetDisplayMatrix(CFX_AffineMatrix& matrix, FX_IN
T32 xPos, FX_INT32 yPos, FX_INT32 xSize, FX_INT32 ySize, FX_INT32 iRotate, const
CFX_AffineMatrix* pPageMatrix) = 0; | 22 FX_INT32 xPos, |
24 virtual FX_FLOAT» GetPageHeight() = 0; | 23 FX_INT32 yPos, |
25 virtual FX_FLOAT» GetPageWidth() = 0; | 24 FX_INT32 xSize, |
26 virtual void» » FocusGetData(const CFX_AffineMatrix matrix, FX_I
NT32 x, FX_INT32 y, CFX_ByteString& str) = 0; | 25 FX_INT32 ySize, |
27 virtual FX_BOOL» » FocusGetPosition(const CFX_AffineMatrix matrix,
CFX_ByteString str, FX_INT32& x, FX_INT32& y) = 0; | 26 FX_INT32 iRotate, |
| 27 const CFX_AffineMatrix* pPageMatrix) = 0; |
| 28 virtual FX_FLOAT GetPageHeight() = 0; |
| 29 virtual FX_FLOAT GetPageWidth() = 0; |
| 30 virtual void FocusGetData(const CFX_AffineMatrix matrix, |
| 31 FX_INT32 x, |
| 32 FX_INT32 y, |
| 33 CFX_ByteString& str) = 0; |
| 34 virtual FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, |
| 35 CFX_ByteString str, |
| 36 FX_INT32& x, |
| 37 FX_INT32& y) = 0; |
28 }; | 38 }; |
29 typedef struct _RF_ParseStyle { | 39 typedef struct _RF_ParseStyle { |
30 _RF_ParseStyle() | 40 _RF_ParseStyle() { m_LineSpace = 0; }; |
31 { | 41 FX_FLOAT m_LineSpace; |
32 m_LineSpace = 0; | |
33 }; | |
34 FX_FLOAT m_LineSpace; | |
35 } RF_ParseStyle; | 42 } RF_ParseStyle; |
36 class IPDF_ProgressiveReflowPageParser | 43 class IPDF_ProgressiveReflowPageParser { |
37 { | 44 public: |
38 public: | 45 static IPDF_ProgressiveReflowPageParser* Create(); |
39 static IPDF_ProgressiveReflowPageParser* Create(); | 46 static FX_BOOL IsTaggedPage(CPDF_PageObjects* pPage); |
40 static FX_BOOL» IsTaggedPage(CPDF_PageObjects*pPage); | |
41 | 47 |
42 virtual ~IPDF_ProgressiveReflowPageParser() {} | 48 virtual ~IPDF_ProgressiveReflowPageParser() {} |
43 typedef enum { Ready, ToBeContinued, Done, Failed } ParseStatus; | 49 typedef enum { Ready, ToBeContinued, Done, Failed } ParseStatus; |
44 | 50 |
45 virtual ParseStatus»» GetStatus() = 0; | 51 virtual ParseStatus GetStatus() = 0; |
46 virtual void» » » SetParserStyle(RF_ParseStyle style) = 0; | 52 virtual void SetParserStyle(RF_ParseStyle style) = 0; |
47 virtual void» » » Start(IPDF_ReflowedPage* pReflowPage, CP
DF_Page* pPage, FX_FLOAT TopIndent, FX_FLOAT fWidth, FX_FLOAT fHeight, IFX_Pause
* pPause, int flags) = 0; | 53 virtual void Start(IPDF_ReflowedPage* pReflowPage, |
48 virtual void» » » Continue(IFX_Pause* pPause) = 0; | 54 CPDF_Page* pPage, |
| 55 FX_FLOAT TopIndent, |
| 56 FX_FLOAT fWidth, |
| 57 FX_FLOAT fHeight, |
| 58 IFX_Pause* pPause, |
| 59 int flags) = 0; |
| 60 virtual void Continue(IFX_Pause* pPause) = 0; |
49 | 61 |
50 virtual int»» » » GetPosition() = 0; | 62 virtual int GetPosition() = 0; |
51 | 63 |
| 64 virtual void Clear() = 0; |
| 65 }; |
| 66 class IPDF_ProgressiveReflowPageRender { |
| 67 public: |
| 68 static IPDF_ProgressiveReflowPageRender* Create(); |
52 | 69 |
53 virtual void» » » Clear() = 0; | 70 virtual ~IPDF_ProgressiveReflowPageRender() {} |
54 }; | 71 typedef enum { Ready, ToBeContinued, Waiting, Done, Failed } RenderStatus; |
55 class IPDF_ProgressiveReflowPageRender | |
56 { | |
57 public: | |
58 static IPDF_ProgressiveReflowPageRender* Create(); | |
59 | 72 |
60 virtual ~IPDF_ProgressiveReflowPageRender() {} | 73 virtual RenderStatus GetStatus() = 0; |
61 typedef enum { Ready, ToBeContinued, Waiting, Done, Failed } RenderStatus; | |
62 | 74 |
63 virtual RenderStatus» GetStatus() = 0; | 75 virtual void Start(IPDF_ReflowedPage* pReflowPage, |
| 76 CFX_RenderDevice* pDevice, |
| 77 const CFX_AffineMatrix* pMatrix, |
| 78 IFX_Pause* pPause, |
| 79 int DitherBits) = 0; |
| 80 virtual void Continue(IFX_Pause* pPause) = 0; |
| 81 virtual int GetPosition() = 0; |
64 | 82 |
65 | 83 virtual void Clear() = 0; |
66 virtual void» » Start(IPDF_ReflowedPage* pReflowPage, CFX_Render
Device* pDevice, const CFX_AffineMatrix* pMatrix, IFX_Pause* pPause, int DitherB
its ) = 0; | |
67 virtual void» » Continue(IFX_Pause* pPause) = 0; | |
68 virtual int»» » GetPosition() = 0; | |
69 | |
70 | |
71 virtual void» » » » Clear() = 0; | |
72 }; | 84 }; |
73 IPDF_ReflowedPage* Create_ReflowPage(); | 85 IPDF_ReflowedPage* Create_ReflowPage(); |
74 IPDF_ProgressiveReflowPageParser* Create_ReflowPageParser(); | 86 IPDF_ProgressiveReflowPageParser* Create_ReflowPageParser(); |
75 IPDF_ProgressiveReflowPageRender* Create_ReflowPageRender(); | 87 IPDF_ProgressiveReflowPageRender* Create_ReflowPageRender(); |
76 #endif | 88 #endif |
OLD | NEW |