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 <optional> 11 12 #include "core/fxcrt/bytestring.h" 13 #include "core/fxge/cfx_color.h" 14 15 class CPDF_SimpleParser; 16 17 class CPDF_DefaultAppearance { 18 public: 19 explicit CPDF_DefaultAppearance(const ByteString& csDA); 20 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA); 21 ~CPDF_DefaultAppearance(); 22 23 std::optional<ByteString> GetFont(float* fFontSize) const; 24 25 std::optional<CFX_Color> GetColor() const; 26 std::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