Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_contentmarkitem.cpp
Go to the documentation of this file.
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#include "core/fpdfapi/page/cpdf_contentmarkitem.h"
8
9#include <utility>
10
11#include "core/fpdfapi/parser/cpdf_dictionary.h"
12
13CPDF_ContentMarkItem::CPDF_ContentMarkItem(ByteString name)
14 : m_MarkName(std::move(name)) {}
15
16CPDF_ContentMarkItem::~CPDF_ContentMarkItem() = default;
17
18RetainPtr<const CPDF_Dictionary> CPDF_ContentMarkItem::GetParam() const {
19 switch (m_ParamType) {
20 case kPropertiesDict:
21 return m_pPropertiesHolder->GetDictFor(m_PropertyName);
22 case kDirectDict:
23 return m_pDirectDict;
24 case kNone:
25 return nullptr;
26 }
27}
28
29RetainPtr<CPDF_Dictionary> CPDF_ContentMarkItem::GetParam() {
30 return pdfium::WrapRetain(
31 const_cast<CPDF_Dictionary*>(std::as_const(*this).GetParam().Get()));
32}
33
34void CPDF_ContentMarkItem::SetDirectDict(RetainPtr<CPDF_Dictionary> pDict) {
35 m_ParamType = kDirectDict;
36 m_pDirectDict = std::move(pDict);
37}
38
39void CPDF_ContentMarkItem::SetPropertiesHolder(
40 RetainPtr<CPDF_Dictionary> pHolder,
41 const ByteString& property_name) {
42 m_ParamType = kPropertiesDict;
43 m_pPropertiesHolder = std::move(pHolder);
44 m_PropertyName = property_name;
45}
void SetPropertiesHolder(RetainPtr< CPDF_Dictionary > pHolder, const ByteString &property_name)
~CPDF_ContentMarkItem() override
RetainPtr< CPDF_Dictionary > GetParam()
RetainPtr< const CPDF_Dictionary > GetParam() const
void SetDirectDict(RetainPtr< CPDF_Dictionary > pDict)