xref: /aosp_15_r20/external/pdfium/xfa/fxfa/parser/cxfa_pattern.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2017 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 XFA_FXFA_PARSER_CXFA_PATTERN_H_
8 #define XFA_FXFA_PARSER_CXFA_PATTERN_H_
9 
10 #include "core/fxcrt/fx_coordinates.h"
11 #include "xfa/fgas/graphics/cfgas_gepath.h"
12 #include "xfa/fxfa/parser/cxfa_node.h"
13 
14 class CFGAS_GEGraphics;
15 class CXFA_Color;
16 
17 class CXFA_Pattern final : public CXFA_Node {
18  public:
19   static constexpr XFA_AttributeValue kDefaultType =
20       XFA_AttributeValue::Unknown;
21 
22   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
23   ~CXFA_Pattern() override;
24 
25   void Draw(CFGAS_GEGraphics* pGS,
26             const CFGAS_GEPath& fillPath,
27             FX_ARGB crStart,
28             const CFX_RectF& rtFill,
29             const CFX_Matrix& matrix);
30 
31  private:
32   CXFA_Pattern(CXFA_Document* doc, XFA_PacketType packet);
33 
34   XFA_AttributeValue GetType();
35   CXFA_Color* GetColorIfExists();
36 };
37 
38 #endif  // XFA_FXFA_PARSER_CXFA_PATTERN_H_
39