From 39628b04bc86461426f2dcf5a568f5e9e70ad997 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 3 Jan 2018 12:01:24 -0500 Subject: Change CXFA_BoxData to CXFA_Box This CL renames CXFA_BoxData to CXFA_Box and sets it to inhert from CXFA_Node instead of CXFA_DataData. The CXFA_BoxData subclasses, CXFA_RectangleData, CXFA_BorderData and CXFA_ArcData classes are removed and the nodes now inherit from CXFA_Box. Change-Id: Ia0df7d56535b5d90be29f040180a5d5fc55a64e0 Reviewed-on: https://pdfium-review.googlesource.com/22091 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_box.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 xfa/fxfa/parser/cxfa_box.h (limited to 'xfa/fxfa/parser/cxfa_box.h') diff --git a/xfa/fxfa/parser/cxfa_box.h b/xfa/fxfa/parser/cxfa_box.h new file mode 100644 index 0000000000..5d9ee4c6fd --- /dev/null +++ b/xfa/fxfa/parser/cxfa_box.h @@ -0,0 +1,57 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_PARSER_CXFA_BOX_H_ +#define XFA_FXFA_PARSER_CXFA_BOX_H_ + +#include +#include +#include + +#include "xfa/fxfa/parser/cxfa_datadata.h" +#include "xfa/fxfa/parser/cxfa_edgedata.h" +#include "xfa/fxfa/parser/cxfa_filldata.h" +#include "xfa/fxfa/parser/cxfa_node.h" + +class CXFA_Margin; + +class CXFA_Box : public CXFA_Node { + public: + ~CXFA_Box() override; + + bool IsArc() const { return GetElementType() == XFA_Element::Arc; } + bool IsCircular(); + + XFA_AttributeEnum GetHand(); + XFA_AttributeEnum GetPresence(); + std::tuple Get3DStyle(); + + int32_t CountEdges(); + CXFA_EdgeData GetEdgeData(int32_t nIndex); + CXFA_FillData GetFillData(bool bModified); + CXFA_Margin* GetMargin(); + + std::vector GetStrokes(); + + pdfium::Optional GetStartAngle(); + pdfium::Optional GetSweepAngle(); + + protected: + CXFA_Box(CXFA_Document* pDoc, + XFA_PacketType ePacket, + uint32_t validPackets, + XFA_ObjectType oType, + XFA_Element eType, + const PropertyData* properties, + const AttributeData* attributes, + const WideStringView& elementName, + std::unique_ptr js_node); + + private: + std::vector GetStrokesInternal(bool bNull); +}; + +#endif // XFA_FXFA_PARSER_CXFA_BOX_H_ -- cgit v1.2.3