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 "core/fxcrt/fx_system.h" 11 #include "core/fxge/fx_dib.h" 12 #include "xfa/fxfa/fxfa_basic.h" 13 #include "xfa/fxfa/parser/cxfa_data.h" 14 15 enum StrokeSameStyle { 16 XFA_STROKE_SAMESTYLE_NoPresence = 1, 17 XFA_STROKE_SAMESTYLE_Corner = 2 18 }; 19 20 class CXFA_Node; 21 22 class CXFA_Stroke : public CXFA_Data { 23 public: CXFA_Stroke()24 CXFA_Stroke() : CXFA_Stroke(nullptr) {} CXFA_Stroke(CXFA_Node * pNode)25 explicit CXFA_Stroke(CXFA_Node* pNode) : CXFA_Data(pNode) {} 26 IsCorner()27 bool IsCorner() const { return GetElementType() == XFA_Element::Corner; } IsEdge()28 bool IsEdge() const { return GetElementType() == XFA_Element::Edge; } IsVisible()29 bool IsVisible() const { return GetPresence() == XFA_ATTRIBUTEENUM_Visible; } 30 int32_t GetPresence() const; 31 int32_t GetCapType() const; 32 int32_t GetStrokeType() const; 33 FX_FLOAT GetThickness() const; 34 CXFA_Measurement GetMSThickness() const; 35 void SetMSThickness(CXFA_Measurement msThinkness); 36 FX_ARGB GetColor() const; 37 void SetColor(FX_ARGB argb); 38 int32_t GetJoinType() const; 39 bool IsInverted() const; 40 FX_FLOAT GetRadius() const; 41 bool SameStyles(CXFA_Stroke stroke, uint32_t dwFlags = 0) const; 42 }; 43 44 #endif // XFA_FXFA_PARSER_CXFA_STROKE_H_ 45