K. Moon | 832a694 | 2022-10-31 20:11:31 +0000 | [diff] [blame] | 1 | // Copyright 2016 The PDFium Authors |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 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 | |
dsinclair | 1727aee | 2016-09-29 13:12:56 -0700 | [diff] [blame] | 7 | #ifndef CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ |
| 8 | #define CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 9 | |
Lei Zhang | 24c6be6 | 2024-02-08 20:06:48 +0000 | [diff] [blame] | 10 | #include <optional> |
| 11 | |
Tom Sepez | 1e151c6 | 2021-11-22 23:46:09 +0000 | [diff] [blame] | 12 | #include "core/fxcrt/bytestring.h" |
Dan Sinclair | a17a0e2 | 2018-03-28 21:10:35 +0000 | [diff] [blame] | 13 | #include "core/fxge/cfx_color.h" |
Tom Sepez | 78e069b | 2021-07-27 00:13:22 +0000 | [diff] [blame] | 14 | |
| 15 | class CPDF_SimpleParser; |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 16 | |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 17 | class CPDF_DefaultAppearance { |
| 18 | public: |
Tom Sepez | 33baa9f | 2021-05-18 19:02:49 +0000 | [diff] [blame] | 19 | explicit CPDF_DefaultAppearance(const ByteString& csDA); |
| 20 | CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA); |
| 21 | ~CPDF_DefaultAppearance(); |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 22 | |
Lei Zhang | 24c6be6 | 2024-02-08 20:06:48 +0000 | [diff] [blame] | 23 | std::optional<ByteString> GetFont(float* fFontSize) const; |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 24 | |
Lei Zhang | 24c6be6 | 2024-02-08 20:06:48 +0000 | [diff] [blame] | 25 | std::optional<CFX_Color> GetColor() const; |
| 26 | std::optional<CFX_Color::TypeAndARGB> GetColorARGB() const; |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 27 | |
Lei Zhang | 3483c52 | 2022-08-05 01:12:41 +0000 | [diff] [blame] | 28 | static bool FindTagParamFromStartForTesting(CPDF_SimpleParser* parser, |
| 29 | ByteStringView token, |
| 30 | int nParams); |
Dan Sinclair | 53a8093 | 2018-03-28 20:00:35 +0000 | [diff] [blame] | 31 | |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 32 | private: |
Lei Zhang | 3483c52 | 2022-08-05 01:12:41 +0000 | [diff] [blame] | 33 | const ByteString m_csDA; |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 34 | }; |
| 35 | |
dsinclair | 1727aee | 2016-09-29 13:12:56 -0700 | [diff] [blame] | 36 | #endif // CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_ |