Dan Sinclair | 455a419 | 2016-03-16 09:48:56 -0400 | [diff] [blame] | 1 | // Copyright 2016 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 | |
dsinclair | 41872fa | 2016-10-04 11:29:35 -0700 | [diff] [blame^] | 7 | #ifndef CORE_FPDFAPI_PAGE_CPDF_PAGEOBJECTHOLDER_H_ |
| 8 | #define CORE_FPDFAPI_PAGE_CPDF_PAGEOBJECTHOLDER_H_ |
Dan Sinclair | 455a419 | 2016-03-16 09:48:56 -0400 | [diff] [blame] | 9 | |
dsinclair | 41872fa | 2016-10-04 11:29:35 -0700 | [diff] [blame^] | 10 | #include "core/fpdfapi/page/cpdf_pageobjectlist.h" |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 11 | #include "core/fxcrt/fx_coordinates.h" |
| 12 | #include "core/fxcrt/fx_system.h" |
Dan Sinclair | 455a419 | 2016-03-16 09:48:56 -0400 | [diff] [blame] | 13 | |
| 14 | class IFX_Pause; |
| 15 | class CPDF_Dictionary; |
| 16 | class CPDF_Stream; |
| 17 | class CPDF_Document; |
| 18 | class CPDF_ContentParser; |
| 19 | |
| 20 | #define PDFTRANS_GROUP 0x0100 |
| 21 | #define PDFTRANS_ISOLATED 0x0200 |
| 22 | #define PDFTRANS_KNOCKOUT 0x0400 |
| 23 | |
| 24 | class CPDF_PageObjectHolder { |
| 25 | public: |
| 26 | CPDF_PageObjectHolder(); |
weili | 868150b | 2016-06-13 14:57:29 -0700 | [diff] [blame] | 27 | virtual ~CPDF_PageObjectHolder(); |
Dan Sinclair | 455a419 | 2016-03-16 09:48:56 -0400 | [diff] [blame] | 28 | |
| 29 | void ContinueParse(IFX_Pause* pPause); |
| 30 | bool IsParsed() const { return m_ParseState == CONTENT_PARSED; } |
| 31 | |
| 32 | CPDF_PageObjectList* GetPageObjectList() { return &m_PageObjectList; } |
| 33 | const CPDF_PageObjectList* GetPageObjectList() const { |
| 34 | return &m_PageObjectList; |
| 35 | } |
| 36 | |
| 37 | FX_BOOL BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; } |
| 38 | void SetBackgroundAlphaNeeded(FX_BOOL needed) { |
| 39 | m_bBackgroundAlphaNeeded = needed; |
| 40 | } |
| 41 | |
| 42 | FX_BOOL HasImageMask() const { return m_bHasImageMask; } |
| 43 | void SetHasImageMask(FX_BOOL value) { m_bHasImageMask = value; } |
| 44 | |
| 45 | void Transform(const CFX_Matrix& matrix); |
| 46 | CFX_FloatRect CalcBoundingBox() const; |
| 47 | |
| 48 | CPDF_Dictionary* m_pFormDict; |
| 49 | CPDF_Stream* m_pFormStream; |
| 50 | CPDF_Document* m_pDocument; |
| 51 | CPDF_Dictionary* m_pPageResources; |
| 52 | CPDF_Dictionary* m_pResources; |
| 53 | CFX_FloatRect m_BBox; |
| 54 | int m_Transparency; |
| 55 | |
| 56 | protected: |
| 57 | enum ParseState { CONTENT_NOT_PARSED, CONTENT_PARSING, CONTENT_PARSED }; |
| 58 | |
| 59 | void LoadTransInfo(); |
| 60 | |
| 61 | FX_BOOL m_bBackgroundAlphaNeeded; |
| 62 | FX_BOOL m_bHasImageMask; |
| 63 | ParseState m_ParseState; |
| 64 | std::unique_ptr<CPDF_ContentParser> m_pParser; |
| 65 | CPDF_PageObjectList m_PageObjectList; |
| 66 | }; |
| 67 | |
dsinclair | 41872fa | 2016-10-04 11:29:35 -0700 | [diff] [blame^] | 68 | #endif // CORE_FPDFAPI_PAGE_CPDF_PAGEOBJECTHOLDER_H_ |