# qwt_plot_layout.h

    00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
    00002  * Qwt Widget Library
    00003  * Copyright (C) 1997   Josef Wilgen
    00004  * Copyright (C) 2002   Uwe Rathmann
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the Qwt License, Version 1.0
    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 QRect &rect, int options = 0);
    00080
    00081     virtual void invalidate();
    00082
    00083     const QRect &titleRect() const;
    00084     const QRect &legendRect() const;
    00085     const QRect &scaleRect(int axis) const;
    00086     const QRect &canvasRect() const;
    00087
    00088     class LayoutData;
    00089
    00090 protected:
    00091
    00092     QRect layoutLegend(int options, const QRect &) const;
    00093     QRect alignLegend(const QRect &canvasRect,
    00094         const QRect &legendRect) const;
    00095
    00096     void expandLineBreaks(int options, const QRect &rect,
    00097         int &dimTitle, int dimAxes[QwtPlot::axisCnt]) const;
    00098
    00099     void alignScales(int options, QRect &canvasRect,
    00100         QRect scaleRect[QwtPlot::axisCnt]) const;
    00101
    00102 private:
    00103     class PrivateData;
    00104
    00105     PrivateData *d_data;
    00106 };
    00107
    00108 #endif