kchart
KDChartEnums.hGo 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
00024
00025
00026
00027
00028
00029 #ifndef __KDCHARTENUMS_H__
00030 #define __KDCHARTENUMS_H__
00031
00032 #include <qrect.h>
00033 #include <qpointarray.h>
00034
00035 #include "KDChartGlobal.h"
00036 #include <qobject.h>
00037
00046 class KDCHART_EXPORT KDChartEnums :public QObject
00047 {
00048 Q_OBJECT
00049 Q_ENUMS( TextLayoutPolicy )
00050 Q_ENUMS( AreaName )
00051 Q_ENUMS( PositionFlag )
00052
00053 public:
00066 enum TextLayoutPolicy { LayoutJustOverwrite,
00067 LayoutPolicyRotate,
00068 LayoutPolicyShiftVertically,
00069 LayoutPolicyShiftHorizontally,
00070 LayoutPolicyShrinkFontSize };
00071
00079 static QString layoutPolicyToString( TextLayoutPolicy type ) {
00080 switch( type ) {
00081 case LayoutJustOverwrite:
00082 return "JustOverwrite";
00083 case LayoutPolicyRotate:
00084 return "Rotate";
00085 case LayoutPolicyShiftVertically:
00086 return "ShiftVertically";
00087 case LayoutPolicyShiftHorizontally:
00088 return "ShiftHorizontally";
00089 case LayoutPolicyShrinkFontSize:
00090 return "ShrinkFontSize";
00091 default:
00092 qDebug( "Unknown text layout policy" );
00093 return "JustOverwrite";
00094 }
00095 }
00096
00097
00104 static TextLayoutPolicy stringToLayoutPolicy( const QString& string ) {
00105 if( string == "JustOverwrite" )
00106 return LayoutJustOverwrite;
00107 else if( string == "Rotate" )
00108 return LayoutPolicyRotate;
00109 else if( string == "ShiftVertically" )
00110 return LayoutPolicyShiftVertically;
00111 else if( string == "ShiftHorizontally" )
00112 return LayoutPolicyShiftHorizontally;
00113 else if( string == "ShrinkFontSize" )
00114 return LayoutPolicyShrinkFontSize;
00115 else
00116 return LayoutJustOverwrite;
00117 }
00118
00119
00161 enum AreaName { AreaUNKNOWN = 0x0000,
00162 AreaData = 0x0001,
00163 AreaAxes = 0x0002,
00164 AreaDataAxes = 0x0003,
00165 AreaLegend = 0x0004,
00166 AreaDataAxesLegend = 0x0005,
00167 AreaHeaders = 0x0006,
00168 AreaFooters = 0x0007,
00169 AreaDataAxesLegendHeadersFooters = 0x0008,
00170 AreaInnermost = 0x0009,
00171 AreaOutermost = 0x000a,
00172 AreaChartDataRegion = 0x000b,
00173 AreasCustomBoxes = 0x000d,
00174 AreaAxisBASE = 0x1000,
00175 AreaHdFtBASE = 0x2000,
00176 AreaCustomBoxesBASE = 0x4000,
00177 AreaBASEMask = 0xF000 };
00178
00179
00206 enum PositionFlag { PosTopLeft =0, PosTopCenter =1, PosTopRight =2,
00207 PosCenterLeft=3, PosCenter =4, PosCenterRight=5,
00208 PosBottomLeft=6, PosBottomCenter=7, PosBottomRight=8 };
00209
00210
00214 static QPoint positionFlagToPoint( const QRect& rect,
00215 PositionFlag pos );
00216
00223 static QPoint positionFlagToPoint( const QPointArray& points,
00224 PositionFlag pos )
00225 {
00226 QPoint pt;
00227 if( 9 <= points.size() )
00228 pt = points[ pos ];
00229 return pt;
00230 }
00231
00232
00240 static QString positionFlagToString( PositionFlag type );
00241
00242
00249 static PositionFlag stringToPositionFlag( const QString& string );
00250 };
00251
00252
00253 #endif
|