# 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
    00022 class QWT_EXPORT QwtPlotLayout
    00023 {
    00024 public:
    00025     enum Options
    00026     {
    00027         AlignScales = 1,
    00028         IgnoreScrollbars = 2,
    00029         IgnoreFrames = 4,
    00030         IgnoreMargin = 8,
    00031         IgnoreLegend = 16
    00032     };
    00033
    00034     explicit QwtPlotLayout();
    00035     virtual ~QwtPlotLayout();
    00036
    00037     void setMargin(int);
    00038     int margin() const;
    00039
    00040     void setCanvasMargin(int margin, int axis = -1);
    00041     int canvasMargin(int axis) const;
    00042
    00043     void setAlignCanvasToScales(bool);
    00044     bool alignCanvasToScales() const;
    00045
    00046     void setSpacing(int);
    00047     int spacing() const;
    00048
    00049     void setLegendPosition(QwtPlot::LegendPosition pos, double ratio);
    00050     void setLegendPosition(QwtPlot::LegendPosition pos);
    00051     QwtPlot::LegendPosition legendPosition() const;
    00052
    00053     void setLegendRatio(double ratio);
    00054     double legendRatio() const;
    00055
    00056     virtual QSize minimumSizeHint(const QwtPlot *) const;
    00057
    00058     virtual void activate(const QwtPlot *,
    00059         const QRect &rect, int options = 0);
    00060
    00061     virtual void invalidate();
    00062
    00063     const QRect &titleRect() const;
    00064     const QRect &legendRect() const;
    00065     const QRect &scaleRect(int axis) const;
    00066     const QRect &canvasRect() const;
    00067
    00068     class LayoutData;
    00069
    00070 protected:
    00071
    00072     QRect layoutLegend(int options, const QRect &) const;
    00073     QRect alignLegend(const QRect &canvasRect,
    00074         const QRect &legendRect) const;
    00075
    00076     void expandLineBreaks(int options, const QRect &rect,
    00077         int &dimTitle, int dimAxes[QwtPlot::axisCnt]) const;
    00078
    00079     void alignScales(int options, QRect &canvasRect,
    00080         QRect scaleRect[QwtPlot::axisCnt]) const;
    00081
    00082 private:
    00083     class PrivateData;
    00084
    00085     PrivateData *d_data;
    00086 };
    00087
    00088 #endif