• 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 XFA_FXFA_PARSER_CXFA_STROKE_H_
8 #define XFA_FXFA_PARSER_CXFA_STROKE_H_
9 
10 #include <memory>
11 
12 #include "core/fxge/fx_dib.h"
13 #include "xfa/fxfa/fxfa_basic.h"
14 #include "xfa/fxfa/parser/cxfa_node.h"
15 
16 enum StrokeSameStyle {
17   XFA_STROKE_SAMESTYLE_NoPresence = 1,
18   XFA_STROKE_SAMESTYLE_Corner = 2
19 };
20 
21 class CXFA_GEPath;
22 class CXFA_Graphics;
23 class CXFA_Node;
24 
25 void XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics,
26                                XFA_AttributeEnum iStrokeType,
27                                XFA_AttributeEnum iCapType);
28 
29 class CXFA_Stroke : public CXFA_Node {
30  public:
31   ~CXFA_Stroke() override;
32 
IsCorner()33   bool IsCorner() const { return GetElementType() == XFA_Element::Corner; }
34   bool IsVisible();
35   bool IsInverted();
36 
37   XFA_AttributeEnum GetCapType();
38   XFA_AttributeEnum GetStrokeType();
39   XFA_AttributeEnum GetJoinType();
40   float GetRadius() const;
41   float GetThickness() const;
42 
43   CXFA_Measurement GetMSThickness() const;
44   void SetMSThickness(CXFA_Measurement msThinkness);
45 
46   FX_ARGB GetColor();
47   void SetColor(FX_ARGB argb);
48 
49   bool SameStyles(CXFA_Stroke* stroke, uint32_t dwFlags);
50 
51   void Stroke(CXFA_GEPath* pPath, CXFA_Graphics* pGS, const CFX_Matrix& matrix);
52 
53  protected:
54   CXFA_Stroke(CXFA_Document* pDoc,
55               XFA_PacketType ePacket,
56               uint32_t validPackets,
57               XFA_ObjectType oType,
58               XFA_Element eType,
59               const PropertyData* properties,
60               const AttributeData* attributes,
61               const WideStringView& elementName,
62               std::unique_ptr<CJX_Object> js_node);
63 };
64 
65 #endif  // XFA_FXFA_PARSER_CXFA_STROKE_H_
66