Home | History | Annotate | Download | only in page
      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 #include "core/fxcrt/unowned_ptr.h"
     16 
     17 class CPDF_Dictionary;
     18 
     19 class CPDF_ContentMarkItem {
     20  public:
     21   enum ParamType { None, PropertiesDict, DirectDict };
     22 
     23   CPDF_ContentMarkItem();
     24   CPDF_ContentMarkItem(const CPDF_ContentMarkItem& that);
     25   ~CPDF_ContentMarkItem();
     26 
     27   CPDF_ContentMarkItem& operator=(CPDF_ContentMarkItem&& other) = default;
     28 
     29   ByteString GetName() const { return m_MarkName; }
     30   ParamType GetParamType() const { return m_ParamType; }
     31   CPDF_Dictionary* GetParam() const;
     32   bool HasMCID() const;
     33 
     34   void SetName(const ByteString& name) { m_MarkName = name; }
     35   void SetDirectDict(std::unique_ptr<CPDF_Dictionary> pDict);
     36   void SetPropertiesDict(CPDF_Dictionary* pDict);
     37 
     38  private:
     39   ByteString m_MarkName;
     40   ParamType m_ParamType;
     41   UnownedPtr<CPDF_Dictionary> m_pPropertiesDict;
     42   std::unique_ptr<CPDF_Dictionary> m_pDirectDict;
     43 };
     44 
     45 #endif  // CORE_FPDFAPI_PAGE_CPDF_CONTENTMARKITEM_H_
     46