karbon

vstar.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001, 2002, 2003 The Karbon Developers
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 License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __VSTAR_H__
00021 #define __VSTAR_H__
00022 
00023 #include "vcomposite.h"
00024 #include <koffice_export.h>
00047 class KARBONBASE_EXPORT VStar : public VPath
00048 {
00049 public:
00050     enum VStarType
00051     {
00052         star_outline,
00053         spoke,
00054         wheel,
00055         polygon,
00056         framed_star,
00057         star,
00058         gear
00059     };
00060     VStar( VObject* parent, VState state = edit );
00061     VStar( VObject* parent,
00062         const KoPoint& center, double outerRadius, double innerRadius,
00063         uint edges, double angle = 0.0, uint innerAngle = 0,
00064         double roundness = 0.0, VStarType type = star_outline );
00065 
00066     static double getOptimalInnerRadius( uint edges, double outerRadius, uint innerAngle );
00067 
00068     virtual QString name() const;
00069 
00070 
00071     virtual void save( QDomElement& element ) const;
00072     virtual void load( const QDomElement& element );
00073 
00074     virtual VPath* clone() const;
00075 
00076 protected:
00077     void init();
00078 
00079 private:
00080     KoPoint m_center;
00081     double m_outerRadius;
00082     double m_innerRadius;
00083     uint   m_edges;
00084     double m_angle;
00085     double m_innerAngle;
00086     double m_roundness;
00087     VStarType m_type;
00088 };
00089 
00090 #endif
00091 
KDE Home | KDE Accessibility Home | Description of Access Keys