00001 /* libwpg 00002 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org) 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Library General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this library; if not, write to the 00016 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02111-1301 USA 00018 * 00019 * For further information visit http://libwpg.sourceforge.net 00020 */ 00021 00022 /* "This product is not manufactured, approved, or supported by 00023 * Corel Corporation or Corel Corporation Limited." 00024 */ 00025 00026 #ifndef __WPGPATH_H__ 00027 #define __WPGPATH_H__ 00028 00029 #include "WPGPoint.h" 00030 00031 namespace libwpg 00032 { 00033 00034 class WPGPathElement 00035 { 00036 public: 00037 typedef enum 00038 { 00039 NullElement, 00040 MoveToElement, 00041 LineToElement, 00042 CurveToElement 00043 } Type; 00044 00045 Type type; 00046 WPGPoint point; 00047 WPGPoint extra1; 00048 WPGPoint extra2; 00049 00050 WPGPathElement(); 00051 }; 00052 00053 class WPGPathPrivate; 00054 00055 class WPGPath 00056 { 00057 public: 00058 00059 bool closed; 00060 00061 WPGPath(); 00062 00063 ~WPGPath(); 00064 00065 WPGPath(const WPGPath&); 00066 00067 WPGPath& operator=(const WPGPath&); 00068 00069 unsigned count() const; 00070 00071 WPGPathElement element(unsigned index) const; 00072 00073 void moveTo(const WPGPoint& point); 00074 00075 void lineTo(const WPGPoint& point); 00076 00077 void curveTo(const WPGPoint& c1, const WPGPoint& c2, const WPGPoint& endPoint); 00078 00079 void addElement(const WPGPathElement& elem); 00080 00081 void append(const WPGPath& path); 00082 00083 private: 00084 WPGPathPrivate *d; 00085 }; 00086 00087 } // namespace libwpg 00088 00089 #endif // __WPGPATH_H__