• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "core/fpdfdoc/cpdf_defaultappearance.h"
11 #include "core/fxcrt/fx_coordinates.h"
12 #include "core/fxcrt/fx_string.h"
13 #include "core/fxcrt/fx_system.h"
14 #include "core/fxge/fx_dib.h"
15 
16 enum class BorderStyle { SOLID, DASH, BEVELED, INSET, UNDERLINE };
17 enum class PaintOperation { STROKE, FILL };
18 
19 class CPDF_DefaultAppearance {
20  public:
CPDF_DefaultAppearance()21   CPDF_DefaultAppearance() {}
CPDF_DefaultAppearance(const ByteString & csDA)22   explicit CPDF_DefaultAppearance(const ByteString& csDA) : m_csDA(csDA) {}
23 
CPDF_DefaultAppearance(const CPDF_DefaultAppearance & cDA)24   CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) {
25     m_csDA = cDA.GetStr();
26   }
27 
GetStr()28   ByteString GetStr() const { return m_csDA; }
29 
30   bool HasFont();
31   ByteString GetFontString();
32   ByteString GetFont(float* fFontSize);
33 
34   bool HasColor(PaintOperation nOperation = PaintOperation::FILL);
35   ByteString GetColorString(PaintOperation nOperation = PaintOperation::FILL);
36   void GetColor(int& iColorType,
37                 float fc[4],
38                 PaintOperation nOperation = PaintOperation::FILL);
39   void GetColor(FX_ARGB& color,
40                 int& iColorType,
41                 PaintOperation nOperation = PaintOperation::FILL);
42 
43   bool HasTextMatrix();
44   ByteString GetTextMatrixString();
45   CFX_Matrix GetTextMatrix();
46 
47  private:
48   ByteString m_csDA;
49 };
50 
51 #endif  // CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_
52