• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
7 #ifndef CORE_FPDFAPI_PAGE_CPDF_CONTENTMARKITEM_H_
8 #define CORE_FPDFAPI_PAGE_CPDF_CONTENTMARKITEM_H_
9 
10 #include <memory>
11 
12 #include "core/fxcrt/fx_memory.h"
13 #include "core/fxcrt/fx_string.h"
14 #include "core/fxcrt/fx_system.h"
15 
16 class CPDF_Dictionary;
17 
18 class CPDF_ContentMarkItem {
19  public:
20   enum ParamType { None, PropertiesDict, DirectDict };
21 
22   CPDF_ContentMarkItem();
23   CPDF_ContentMarkItem(const CPDF_ContentMarkItem& that);
24   ~CPDF_ContentMarkItem();
25 
26   CPDF_ContentMarkItem& operator=(CPDF_ContentMarkItem&& other) = default;
27 
GetName()28   CFX_ByteString GetName() const { return m_MarkName; }
GetParamType()29   ParamType GetParamType() const { return m_ParamType; }
30   CPDF_Dictionary* GetParam() const;
31   bool HasMCID() const;
32 
SetName(const CFX_ByteString & name)33   void SetName(const CFX_ByteString& name) { m_MarkName = name; }
34   void SetDirectDict(std::unique_ptr<CPDF_Dictionary> pDict);
35   void SetPropertiesDict(CPDF_Dictionary* pDict);
36 
37  private:
38   CFX_ByteString m_MarkName;
39   ParamType m_ParamType;
40   CPDF_Dictionary* m_pPropertiesDict;  // not owned.
41   std::unique_ptr<CPDF_Dictionary> m_pDirectDict;
42 };
43 
44 #endif  // CORE_FPDFAPI_PAGE_CPDF_CONTENTMARKITEM_H_
45