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 __KDDRAWTEXT_H__
00030 #define __KDDRAWTEXT_H__
00031
00032 #include <qpainter.h>
00033 #ifdef linux
00034 #include <values.h>
00035 #endif
00036 #include "KDChartGlobal.h"
00037
00038
00039 struct KDDrawTextRegionAndTrueRect
00040 {
00041 QRegion region;
00042 QPoint pos;
00043 int x,y,width,height;
00044 };
00045
00046
00047 class KDDrawText
00048 {
00049 public:
00050 static void drawRotatedText( QPainter* painter,
00051 float degrees,
00052 QPoint anchor,
00053 const QString& text,
00054 const QFont* font = 0,
00055 int align = Qt::AlignLeft | Qt::AlignTop,
00056
00057 bool showAnchor = false,
00058 const QFontMetrics* fontMet = 0,
00059 bool noFirstrotate = false,
00060 bool noBackrotate = false,
00061 KDDrawTextRegionAndTrueRect* infos = 0,
00062 bool optimizeOutputForScreen = false );
00063
00064 static KDDrawTextRegionAndTrueRect measureRotatedText(
00065 QPainter* painter,
00066 float degrees,
00067 QPoint anchor,
00068 const QString& text,
00069 const QFont* font,
00070 int align,
00071 const QFontMetrics* fontMet,
00072 bool noFirstrotate,
00073 bool noBackrotate,
00074 int addPercentOfHeightToRegion );
00075
00076 private:
00077 static void drawRotatedTxt( QPainter* painter,
00078 bool optimizeOutputForScreen,
00079 float degrees,
00080 QPoint anchor,
00081 const QString& text,
00082 const QFont* font = 0,
00083 int align = Qt::AlignLeft | Qt::AlignTop,
00084
00085 bool showAnchor = false,
00086
00087
00088
00089 int txtWidth = INT_MAX,
00090 int txtHeight = INT_MAX,
00091 const QFontMetrics* fontMet = 0,
00092
00093 bool calculateOnly = false,
00094 bool doNotCalculate= false,
00095 bool noFirstrotate = false,
00096 bool noBackrotate = false,
00097 KDDrawTextRegionAndTrueRect* infos = 0,
00098 int addPercentOfHeightToRegion = 0 );
00099
00100 };
00101
00102 #endif