00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PLOT_LAYOUT_H
00011 #define QWT_PLOT_LAYOUT_H
00012
00013 #include "qwt_global.h"
00014 #include "qwt_plot.h"
00015
00024 class QWT_EXPORT QwtPlotLayout
00025 {
00026 public:
00045 enum Options
00046 {
00047 AlignScales = 1,
00048 IgnoreScrollbars = 2,
00049 IgnoreFrames = 4,
00050 IgnoreMargin = 8,
00051 IgnoreLegend = 16
00052 };
00053
00054 explicit QwtPlotLayout();
00055 virtual ~QwtPlotLayout();
00056
00057 void setMargin( int );
00058 int margin() const;
00059
00060 void setCanvasMargin( int margin, int axis = -1 );
00061 int canvasMargin( int axis ) const;
00062
00063 void setAlignCanvasToScales( bool );
00064 bool alignCanvasToScales() const;
00065
00066 void setSpacing( int );
00067 int spacing() const;
00068
00069 void setLegendPosition( QwtPlot::LegendPosition pos, double ratio );
00070 void setLegendPosition( QwtPlot::LegendPosition pos );
00071 QwtPlot::LegendPosition legendPosition() const;
00072
00073 void setLegendRatio( double ratio );
00074 double legendRatio() const;
00075
00076 virtual QSize minimumSizeHint( const QwtPlot * ) const;
00077
00078 virtual void activate( const QwtPlot *,
00079 const QRectF &rect, int options = 0 );
00080
00081 virtual void invalidate();
00082
00083 const QRectF &titleRect() const;
00084 const QRectF &legendRect() const;
00085 const QRectF &scaleRect( int axis ) const;
00086 const QRectF &canvasRect() const;
00087
00088 class LayoutData;
00089
00090 protected:
00091
00092 QRectF layoutLegend( int options, const QRectF & ) const;
00093 QRectF alignLegend( const QRectF &canvasRect,
00094 const QRectF &legendRect ) const;
00095
00096 void expandLineBreaks( int options, const QRectF &rect,
00097 int &dimTitle, int dimAxes[QwtPlot::axisCnt] ) const;
00098
00099 void alignScales( int options, QRectF &canvasRect,
00100 QRectF scaleRect[QwtPlot::axisCnt] ) const;
00101
00102 private:
00103 class PrivateData;
00104
00105 PrivateData *d_data;
00106 };
00107
00108 #endif