diff options
author | tsepez <tsepez@chromium.org> | 2016-11-22 10:45:59 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-22 10:45:59 -0800 |
commit | 1aff265f7a210738fc817675c4391f8fe240b81d (patch) | |
tree | 38a9cd7ea6e6faca866211ebe28c636a0c104e48 /core/fpdfapi/page/cpdf_contentparser.h | |
parent | e50184c087ee6f90568ad1166a55f5d25be4d09e (diff) | |
download | pdfium-1aff265f7a210738fc817675c4391f8fe240b81d.tar.xz |
Continue splitting pageint.h into per-class files
Add cpdf_streamparser.h and cpdf_contentparser.h since there are
already corresponding .cpp files with the same name.
Review-Url: https://codereview.chromium.org/2521123003
Diffstat (limited to 'core/fpdfapi/page/cpdf_contentparser.h')
-rw-r--r-- | core/fpdfapi/page/cpdf_contentparser.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_contentparser.h b/core/fpdfapi/page/cpdf_contentparser.h new file mode 100644 index 0000000000..5fd11f6c0b --- /dev/null +++ b/core/fpdfapi/page/cpdf_contentparser.h @@ -0,0 +1,59 @@ +// Copyright 2016 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 CORE_FPDFAPI_PAGE_CPDF_CONTENTPARSER_H_ +#define CORE_FPDFAPI_PAGE_CPDF_CONTENTPARSER_H_ + +#include <memory> +#include <vector> + +#include "core/fpdfapi/page/cpdf_pageobjectholder.h" +#include "core/fpdfapi/page/cpdf_streamcontentparser.h" + +class CPDF_AllStates; +class CPDF_Form; +class CPDF_Page; +class CPDF_StreamAcc; +class CPDF_Type3Char; + +class CPDF_ContentParser { + public: + enum ParseStatus { Ready, ToBeContinued, Done }; + + CPDF_ContentParser(); + ~CPDF_ContentParser(); + + ParseStatus GetStatus() const { return m_Status; } + void Start(CPDF_Page* pPage); + void Start(CPDF_Form* pForm, + CPDF_AllStates* pGraphicStates, + const CFX_Matrix* pParentMatrix, + CPDF_Type3Char* pType3Char, + int level); + void Continue(IFX_Pause* pPause); + + private: + enum InternalStage { + STAGE_GETCONTENT = 1, + STAGE_PARSE, + STAGE_CHECKCLIP, + }; + + ParseStatus m_Status; + InternalStage m_InternalStage; + CPDF_PageObjectHolder* m_pObjectHolder; + bool m_bForm; + CPDF_Type3Char* m_pType3Char; + uint32_t m_nStreams; + std::unique_ptr<CPDF_StreamAcc> m_pSingleStream; + std::vector<std::unique_ptr<CPDF_StreamAcc>> m_StreamArray; + uint8_t* m_pData; + uint32_t m_Size; + uint32_t m_CurrentOffset; + std::unique_ptr<CPDF_StreamContentParser> m_pParser; +}; + +#endif // CORE_FPDFAPI_PAGE_CPDF_CONTENTPARSER_H_ |