KHTML
SVGAngle.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SVGAngle_h
00024 #define SVGAngle_h
00025
00026 #if ENABLE(SVG)
00027
00028 #include "wtf/RefCounted.h"
00029 #include "SVGNames.h"
00030
00031 namespace WebCore {
00032
00033 class SVGStyledElement;
00034
00035 class SVGAngle : public RefCounted<SVGAngle> {
00036 public:
00037 SVGAngle();
00038 virtual ~SVGAngle();
00039
00040 enum SVGAngleType {
00041 SVG_ANGLETYPE_UNKNOWN = 0,
00042 SVG_ANGLETYPE_UNSPECIFIED = 1,
00043 SVG_ANGLETYPE_DEG = 2,
00044 SVG_ANGLETYPE_RAD = 3,
00045 SVG_ANGLETYPE_GRAD = 4
00046 };
00047
00048 SVGAngleType unitType() const;
00049
00050 void setValue(float);
00051 float value() const;
00052
00053 void setValueInSpecifiedUnits(float valueInSpecifiedUnits);
00054 float valueInSpecifiedUnits() const;
00055
00056 void setValueAsString(const String&);
00057 String valueAsString() const;
00058
00059 void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
00060 void convertToSpecifiedUnits(unsigned short unitType);
00061
00062
00063 static double todeg(double rad);
00064 static double torad(double deg);
00065
00066
00067 static double shortestArcBisector(double angle1, double angle2);
00068
00069
00070 const QualifiedName& associatedAttributeName() const { return SVGNames::orientAttr; }
00071
00072 private:
00073 SVGAngleType m_unitType;
00074 float m_value;
00075 float m_valueInSpecifiedUnits;
00076 mutable String m_valueAsString;
00077
00078 void calculate();
00079 };
00080
00081 }
00082
00083 #endif // ENABLE(SVG)
00084 #endif // SVGAngle_h