xref: /aosp_15_r20/external/pdfium/core/fpdfapi/page/cpdf_contentmarkitem.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2016 The PDFium Authors
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 "core/fxcrt/bytestring.h"
11 #include "core/fxcrt/retain_ptr.h"
12 
13 class CPDF_Dictionary;
14 
15 class CPDF_ContentMarkItem final : public Retainable {
16  public:
17   enum ParamType { kNone, kPropertiesDict, kDirectDict };
18 
19   CONSTRUCT_VIA_MAKE_RETAIN;
20 
GetName()21   const ByteString& GetName() const { return m_MarkName; }
GetParamType()22   ParamType GetParamType() const { return m_ParamType; }
23   RetainPtr<const CPDF_Dictionary> GetParam() const;
24   RetainPtr<CPDF_Dictionary> GetParam();
GetPropertyName()25   const ByteString& GetPropertyName() const { return m_PropertyName; }
26 
27   void SetDirectDict(RetainPtr<CPDF_Dictionary> pDict);
28   void SetPropertiesHolder(RetainPtr<CPDF_Dictionary> pHolder,
29                            const ByteString& property_name);
30 
31  private:
32   explicit CPDF_ContentMarkItem(ByteString name);
33   ~CPDF_ContentMarkItem() override;
34 
35   ParamType m_ParamType = kNone;
36   ByteString m_MarkName;
37   ByteString m_PropertyName;
38   RetainPtr<CPDF_Dictionary> m_pPropertiesHolder;
39   RetainPtr<CPDF_Dictionary> m_pDirectDict;
40 };
41 
42 #endif  // CORE_FPDFAPI_PAGE_CPDF_CONTENTMARKITEM_H_
43