Home | History | Annotate | Download | only in parser
      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_BOX_H_
      8 #define XFA_FXFA_PARSER_CXFA_BOX_H_
      9 
     10 #include <vector>
     11 
     12 #include "core/fxcrt/fx_system.h"
     13 #include "xfa/fxfa/parser/cxfa_data.h"
     14 #include "xfa/fxfa/parser/cxfa_edge.h"
     15 #include "xfa/fxfa/parser/cxfa_fill.h"
     16 #include "xfa/fxfa/parser/cxfa_margin.h"
     17 
     18 class CXFA_Node;
     19 
     20 class CXFA_Box : public CXFA_Data {
     21  public:
     22   explicit CXFA_Box(CXFA_Node* pNode) : CXFA_Data(pNode) {}
     23 
     24   bool IsArc() const { return GetElementType() == XFA_Element::Arc; }
     25   bool IsBorder() const { return GetElementType() == XFA_Element::Border; }
     26   bool IsRectangle() const {
     27     return GetElementType() == XFA_Element::Rectangle;
     28   }
     29   int32_t GetHand() const;
     30   int32_t GetPresence() const;
     31   int32_t CountEdges() const;
     32   CXFA_Edge GetEdge(int32_t nIndex = 0) const;
     33   void GetStrokes(std::vector<CXFA_Stroke>* strokes) const;
     34   bool IsCircular() const;
     35   bool GetStartAngle(FX_FLOAT& fStartAngle) const;
     36   FX_FLOAT GetStartAngle() const {
     37     FX_FLOAT fStartAngle;
     38     GetStartAngle(fStartAngle);
     39     return fStartAngle;
     40   }
     41 
     42   bool GetSweepAngle(FX_FLOAT& fSweepAngle) const;
     43   FX_FLOAT GetSweepAngle() const {
     44     FX_FLOAT fSweepAngle;
     45     GetSweepAngle(fSweepAngle);
     46     return fSweepAngle;
     47   }
     48 
     49   CXFA_Fill GetFill(bool bModified = false) const;
     50   CXFA_Margin GetMargin() const;
     51   int32_t Get3DStyle(bool& bVisible, FX_FLOAT& fThickness) const;
     52 };
     53 
     54 #endif  // XFA_FXFA_PARSER_CXFA_BOX_H_
     55