blob: 78180ad21614ff40e1c7e1ef3220f0eca0ca761f [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2016 The PDFium Authors
dsinclaircac704d2016-07-28 12:59:09 -07002// 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
dsinclair1727aee2016-09-29 13:12:56 -07007#ifndef CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_
8#define CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_
dsinclaircac704d2016-07-28 12:59:09 -07009
Lei Zhang24c6be62024-02-08 20:06:48 +000010#include <optional>
11
Tom Sepez1e151c62021-11-22 23:46:09 +000012#include "core/fxcrt/bytestring.h"
Dan Sinclaira17a0e22018-03-28 21:10:35 +000013#include "core/fxge/cfx_color.h"
Tom Sepez78e069b2021-07-27 00:13:22 +000014
15class CPDF_SimpleParser;
dsinclaircac704d2016-07-28 12:59:09 -070016
dsinclaircac704d2016-07-28 12:59:09 -070017class CPDF_DefaultAppearance {
18 public:
Tom Sepez33baa9f2021-05-18 19:02:49 +000019 explicit CPDF_DefaultAppearance(const ByteString& csDA);
20 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA);
21 ~CPDF_DefaultAppearance();
dsinclaircac704d2016-07-28 12:59:09 -070022
Lei Zhang24c6be62024-02-08 20:06:48 +000023 std::optional<ByteString> GetFont(float* fFontSize) const;
dsinclaircac704d2016-07-28 12:59:09 -070024
Lei Zhang24c6be62024-02-08 20:06:48 +000025 std::optional<CFX_Color> GetColor() const;
26 std::optional<CFX_Color::TypeAndARGB> GetColorARGB() const;
dsinclaircac704d2016-07-28 12:59:09 -070027
Lei Zhang3483c522022-08-05 01:12:41 +000028 static bool FindTagParamFromStartForTesting(CPDF_SimpleParser* parser,
29 ByteStringView token,
30 int nParams);
Dan Sinclair53a80932018-03-28 20:00:35 +000031
dsinclaircac704d2016-07-28 12:59:09 -070032 private:
Lei Zhang3483c522022-08-05 01:12:41 +000033 const ByteString m_csDA;
dsinclaircac704d2016-07-28 12:59:09 -070034};
35
dsinclair1727aee2016-09-29 13:12:56 -070036#endif // CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_