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 "KDChartGlobal.h"
00033
00034 #include <QRectF>
00035 #include <QObject>
00036 #include <QVector>
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:
00101 enum GranularitySequence {
00102 GranularitySequence_10_20,
00103 GranularitySequence_10_50,
00104 GranularitySequence_25_50,
00105 GranularitySequence_125_25,
00106 GranularitySequenceIrregular };
00107
00115 static QString granularitySequenceToString( GranularitySequence sequence ) {
00116 switch( sequence ) {
00117 case GranularitySequence_10_20:
00118 return QString::fromLatin1("GranularitySequence_10_20");
00119 case GranularitySequence_10_50:
00120 return QString::fromLatin1("GranularitySequence_10_50");
00121 case GranularitySequence_25_50:
00122 return QString::fromLatin1("GranularitySequence_25_50");
00123 case GranularitySequence_125_25:
00124 return QString::fromLatin1("GranularitySequence_125_25");
00125 case GranularitySequenceIrregular:
00126 return QString::fromLatin1("GranularitySequenceIrregular");
00127 default:
00128 qDebug( "Unknown granularity sequence" );
00129 return QString::fromLatin1("GranularitySequence_10_20");
00130 }
00131 }
00132
00133
00140 static GranularitySequence stringToGranularitySequence( const QString& string ) {
00141 if( string == QString::fromLatin1("GranularitySequence_10_20") )
00142 return GranularitySequence_10_20;
00143 if( string == QString::fromLatin1("GranularitySequence_10_50") )
00144 return GranularitySequence_10_50;
00145 if( string == QString::fromLatin1("GranularitySequence_25_50") )
00146 return GranularitySequence_25_50;
00147 if( string == QString::fromLatin1("GranularitySequence_125") )
00148 return GranularitySequence_125_25;
00149 if( string == QString::fromLatin1("GranularitySequenceIrregular") )
00150 return GranularitySequenceIrregular;
00151
00152 return GranularitySequence_10_20;
00153 }
00154
00155
00168 enum TextLayoutPolicy { LayoutJustOverwrite,
00169 LayoutPolicyRotate,
00170 LayoutPolicyShiftVertically,
00171 LayoutPolicyShiftHorizontally,
00172 LayoutPolicyShrinkFontSize };
00173
00181 static QString layoutPolicyToString( TextLayoutPolicy type );
00182
00183
00190 static TextLayoutPolicy stringToLayoutPolicy( const QString& string );
00191
00192
00199 enum PositionValue {
00200 PositionUnknown = 0,
00201 PositionCenter = 1,
00202 PositionNorthWest = 2,
00203 PositionNorth = 3,
00204 PositionNorthEast = 4,
00205 PositionEast = 5,
00206 PositionSouthEast = 6,
00207 PositionSouth = 7,
00208 PositionSouthWest = 8,
00209 PositionWest = 9,
00210 PositionFloating =10
00211 };
00212
00213
00229 enum MeasureCalculationMode { MeasureCalculationModeAbsolute,
00230 MeasureCalculationModeRelative,
00231 MeasureCalculationModeAuto,
00232 MeasureCalculationModeAutoArea,
00233 MeasureCalculationModeAutoOrientation };
00234
00242 static QString measureCalculationModeToString( MeasureCalculationMode mode ) {
00243 switch( mode ) {
00244 case MeasureCalculationModeAbsolute:
00245 return QString::fromLatin1("MeasureCalculationModeAbsolute");
00246 case MeasureCalculationModeAuto:
00247 return QString::fromLatin1("MeasureCalculationModeAuto");
00248 case MeasureCalculationModeAutoArea:
00249 return QString::fromLatin1("MeasureCalculationModeAutoArea");
00250 case MeasureCalculationModeAutoOrientation:
00251 return QString::fromLatin1("MeasureCalculationModeAutoOrientation");
00252 case MeasureCalculationModeRelative:
00253 return QString::fromLatin1("MeasureCalculationModeRelative");
00254 default:
00255 qDebug( "Unknown measure calculation mode" );
00256 return QString::fromLatin1("MeasureCalculationModeAuto");
00257 }
00258 }
00259
00260
00267 static MeasureCalculationMode stringToMeasureCalculationMode( const QString& string ) {
00268 if( string == QString::fromLatin1("MeasureCalculationModeAbsolute") )
00269 return MeasureCalculationModeAbsolute;
00270 if( string == QString::fromLatin1("MeasureCalculationModeAuto") )
00271 return MeasureCalculationModeAuto;
00272 if( string == QString::fromLatin1("MeasureCalculationModeAutoArea") )
00273 return MeasureCalculationModeAutoArea;
00274 if( string == QString::fromLatin1("MeasureCalculationModeAutoOrientation") )
00275 return MeasureCalculationModeAutoOrientation;
00276 if( string == QString::fromLatin1("MeasureCalculationModeRelative") )
00277 return MeasureCalculationModeRelative;
00278
00279 return MeasureCalculationModeAuto;
00280 }
00281
00298 enum MeasureOrientation { MeasureOrientationAuto,
00299 MeasureOrientationHorizontal,
00300 MeasureOrientationVertical,
00301 MeasureOrientationMinimum,
00302 MeasureOrientationMaximum };
00303
00311 static QString measureOrientationToString( MeasureOrientation mode ) {
00312 switch( mode ) {
00313 case MeasureOrientationAuto:
00314 return QString::fromLatin1("MeasureOrientationAuto");
00315 case MeasureOrientationHorizontal:
00316 return QString::fromLatin1("MeasureOrientationHorizontal");
00317 case MeasureOrientationVertical:
00318 return QString::fromLatin1("MeasureOrientationVertical");
00319 case MeasureOrientationMinimum:
00320 return QString::fromLatin1("MeasureOrientationMinimum");
00321 case MeasureOrientationMaximum:
00322 return QString::fromLatin1("MeasureOrientationMaximum");
00323 default:
00324 qDebug( "Unknown measure orientation mode" );
00325 return QString::fromLatin1("MeasureOrientationAuto");
00326 }
00327 }
00328
00329
00336 static MeasureOrientation stringToMeasureOrientation( const QString& string ) {
00337 if( string == QString::fromLatin1("MeasureOrientationAuto") )
00338 return MeasureOrientationAuto;
00339 if( string == QString::fromLatin1("MeasureOrientationHorizontal") )
00340 return MeasureOrientationHorizontal;
00341 if( string == QString::fromLatin1("MeasureOrientationVertical") )
00342 return MeasureOrientationVertical;
00343 if( string == QString::fromLatin1("MeasureOrientationMinimum") )
00344 return MeasureOrientationMinimum;
00345 if( string == QString::fromLatin1("MeasureOrientationMaximum") )
00346 return MeasureOrientationMaximum;
00347
00348 return MeasureOrientationAuto;
00349 }
00350
00351
00352 };
00353
00354
00355 #endif