1 // Copyright 2014 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 _FDE_GRAPHOBJS_IMP
8 #define _FDE_GRAPHOBJS_IMP
9 #ifndef _FDEPLUS
10 #include "xfa/src/foxitlib.h"
11 class CFDE_GEFontMgr;
12 class CFDE_Path : public IFDE_Path, public CFX_Target {
13  public:
Release()14   virtual void Release() { delete this; }
15 
16   virtual FX_BOOL StartFigure();
17   virtual FX_BOOL CloseFigure();
18 
19   virtual void AddBezier(const CFX_PointsF& points);
20   virtual void AddBeziers(const CFX_PointsF& points);
21   virtual void AddCurve(const CFX_PointsF& points,
22                         FX_BOOL bClosed,
23                         FX_FLOAT fTension = 0.5f);
24   virtual void AddEllipse(const CFX_RectF& rect);
25   virtual void AddLines(const CFX_PointsF& points);
26   virtual void AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2);
27   virtual void AddPath(const IFDE_Path* pSrc, FX_BOOL bConnect);
28   virtual void AddPolygon(const CFX_PointsF& points);
29   virtual void AddRectangle(const CFX_RectF& rect);
30   virtual void GetBBox(CFX_RectF& bbox) const;
31   virtual void GetBBox(CFX_RectF& bbox,
32                        FX_FLOAT fLineWidth,
33                        FX_FLOAT fMiterLimit) const;
34   FX_PATHPOINT* AddPoints(int32_t iCount);
35   FX_PATHPOINT* GetLastPoint(int32_t iCount = 1) const;
36   FX_BOOL FigureClosed() const;
37   void MoveTo(FX_FLOAT fx, FX_FLOAT fy);
38   void LineTo(FX_FLOAT fx, FX_FLOAT fy);
39   void BezierTo(const CFX_PointF& p1,
40                 const CFX_PointF& p2,
41                 const CFX_PointF& p3);
42   void ArcTo(FX_BOOL bStart,
43              const CFX_RectF& rect,
44              FX_FLOAT startAngle,
45              FX_FLOAT endAngle);
MoveTo(const CFX_PointF & p0)46   void MoveTo(const CFX_PointF& p0) { MoveTo(p0.x, p0.y); }
LineTo(const CFX_PointF & p1)47   void LineTo(const CFX_PointF& p1) { LineTo(p1.x, p1.y); }
48   void GetCurveTangents(const CFX_PointsF& points,
49                         CFX_PointsF& tangents,
50                         FX_BOOL bClosed,
51                         FX_FLOAT fTension) const;
52   CFX_PathData m_Path;
53 };
54 #endif
55 #endif
56