1 // Copyright 2016 PDFium Authors. All rights reserved. 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 <utility> 11 12 #include "core/fpdfapi/parser/cpdf_simple_parser.h" 13 #include "core/fxcrt/fx_string.h" 14 #include "core/fxcrt/fx_system.h" 15 #include "core/fxge/cfx_color.h" 16 #include "core/fxge/fx_dib.h" 17 18 class CPDF_DefaultAppearance { 19 public: CPDF_DefaultAppearance()20 CPDF_DefaultAppearance() {} CPDF_DefaultAppearance(const ByteString & csDA)21 explicit CPDF_DefaultAppearance(const ByteString& csDA) : m_csDA(csDA) {} CPDF_DefaultAppearance(const CPDF_DefaultAppearance & cDA)22 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) 23 : m_csDA(cDA.m_csDA) {} 24 25 Optional<ByteString> GetFont(float* fFontSize); 26 27 Optional<CFX_Color::Type> GetColor(float fc[4]); 28 std::pair<Optional<CFX_Color::Type>, FX_ARGB> GetColor(); 29 30 bool FindTagParamFromStartForTesting(CPDF_SimpleParser* parser, 31 ByteStringView token, 32 int nParams); 33 34 private: 35 ByteString m_csDA; 36 }; 37 38 #endif // CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ 39