xref: /aosp_15_r20/external/pdfium/core/fpdfdoc/cpdf_defaultappearance.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_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_
8 #define CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_
9 
10 #include "core/fxcrt/bytestring.h"
11 #include "core/fxge/cfx_color.h"
12 #include "third_party/abseil-cpp/absl/types/optional.h"
13 
14 class CPDF_SimpleParser;
15 
16 class CPDF_DefaultAppearance {
17  public:
18   CPDF_DefaultAppearance();
19   explicit CPDF_DefaultAppearance(const ByteString& csDA);
20   CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA);
21   ~CPDF_DefaultAppearance();
22 
23   absl::optional<ByteString> GetFont(float* fFontSize) const;
24 
25   absl::optional<CFX_Color> GetColor() const;
26   absl::optional<CFX_Color::TypeAndARGB> GetColorARGB() const;
27 
28   static bool FindTagParamFromStartForTesting(CPDF_SimpleParser* parser,
29                                               ByteStringView token,
30                                               int nParams);
31 
32  private:
33   const ByteString m_csDA;
34 };
35 
36 #endif  // CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_
37