• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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 LayoutProvider_TaggedPDF_H
8 #define LayoutProvider_TaggedPDF_H
9 #include "../../include/reflow/reflowengine.h"
10 class CPDF_LayoutElement : public IPDF_LayoutElement, public CFX_Object
11 {
12 public:
13     CPDF_LayoutElement();
14     ~CPDF_LayoutElement();
15 
16     LayoutType	GetType();
GetRect(CFX_FloatRect & rcRect)17     void	GetRect(CFX_FloatRect& rcRect) {};
18 
19     int		CountAttrValues(LayoutAttr attr_type);
20 
21     LayoutEnum	GetEnumAttr(LayoutAttr attr_type, int index);
22     FX_FLOAT	GetNumberAttr(LayoutAttr attr_type, int index);
23     FX_COLORREF	GetColorAttr(LayoutAttr attr_type, int index);
24 
25     int		CountChildren();
26 
27     IPDF_LayoutElement* GetChild(int index);
28 
29     IPDF_LayoutElement* GetParent();
30 
31     int	CountObjects();
32     CPDF_PageObject*	GetObject(int index);
33     FX_BOOL AddObject(CPDF_PageObject* pObj);
34     CPDF_StructElement* m_pTaggedElement;
35     CPDF_LayoutElement* m_pParentElement;
36     CFX_PtrArray	m_ChildArray;
37     LayoutType ConvertLayoutType(FX_BSTR name);
38     CFX_ByteStringC ConvertLayoutType(LayoutType type);
39     CFX_ByteStringC ConvertLayoutAttr(LayoutAttr attr);
40     LayoutEnum ConvertLayoutEnum(CFX_ByteStringC Enum);
41 
42 protected:
43     FX_BOOL		IsInheritable(LayoutAttr attr_type);
44     CFX_ByteStringC GetAttrOwner(LayoutAttr attr_type);
45     CFX_ByteStringC GetDefaultNameValue(LayoutAttr attr_type);
46     FX_FLOAT		GetDefaultFloatValue(LayoutAttr attr_type);
47     FX_COLORREF		GetDefaultColorValue(LayoutAttr attr_type);
48     CFX_PtrArray	m_ObjArray;
49 };
50 class CPDF_LayoutProvider_TaggedPDF : public IPDF_LayoutProvider, public CFX_Object
51 {
52 public:
53     CPDF_LayoutProvider_TaggedPDF();
54     ~CPDF_LayoutProvider_TaggedPDF();
SetLayoutProviderStyle(LAYOUTPROVIDER_STYLE style)55     void			SetLayoutProviderStyle(LAYOUTPROVIDER_STYLE style) {};
56 
Init(CPDF_PageObjects * pPage)57     void	Init(CPDF_PageObjects* pPage)
58     {
59         m_pPage = pPage;
60         m_Status = LayoutReady;
61     };
62 
63     LayoutStatus	StartLoad(IFX_Pause* pPause = NULL);
64     LayoutStatus	Continue();
65     int		 		GetPosition();
66 
GetRoot()67     IPDF_LayoutElement* GetRoot()
68     {
69         return m_pRoot;
70     };
71 
72 protected:
73     void ProcessElement(CPDF_LayoutElement*pParent, CPDF_StructElement* pTaggedElement);
74     LayoutStatus	m_Status;
75     CPDF_StructElement* m_pCurTaggedElement;
76     CPDF_LayoutElement* m_pRoot;
77     IFX_Pause*			m_pPause;
78     CPDF_PageObjects*	m_pPage;
79     CPDF_StructTree*	m_pPageTree;
80     int					m_TopElementIndex;
81 };
82 #endif
83