~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.1/src/qwt_plot_layout.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-05-26 10:26:31 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526102631-bp95mfccnrb957nx
Tags: 5.1.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 
2
 * Qwt Widget Library
 
3
 * Copyright (C) 1997   Josef Wilgen
 
4
 * Copyright (C) 2002   Uwe Rathmann
 
5
 * 
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the Qwt License, Version 1.0
 
8
 *****************************************************************************/
 
9
 
 
10
#ifndef QWT_PLOT_LAYOUT_H
 
11
#define QWT_PLOT_LAYOUT_H
 
12
 
 
13
#include "qwt_global.h"
 
14
#include "qwt_plot.h"
 
15
 
 
16
/*!
 
17
  \brief Layout class for QwtPlot.
 
18
 
 
19
  Organizes the geometry for the different QwtPlot components.
 
20
*/
 
21
 
 
22
class QWT_EXPORT QwtPlotLayout
 
23
{
 
24
public:
 
25
    enum Options
 
26
    {
 
27
        AlignScales = 1,
 
28
        IgnoreScrollbars = 2,
 
29
        IgnoreFrames = 4,
 
30
        IgnoreMargin = 8,
 
31
        IgnoreLegend = 16
 
32
    };
 
33
 
 
34
    explicit QwtPlotLayout();
 
35
    virtual ~QwtPlotLayout();
 
36
 
 
37
    void setMargin(int);
 
38
    int margin() const;
 
39
 
 
40
    void setCanvasMargin(int margin, int axis = -1);
 
41
    int canvasMargin(int axis) const;
 
42
 
 
43
    void setAlignCanvasToScales(bool);
 
44
    bool alignCanvasToScales() const;
 
45
 
 
46
    void setSpacing(int);
 
47
    int spacing() const;
 
48
 
 
49
    void setLegendPosition(QwtPlot::LegendPosition pos, double ratio);
 
50
    void setLegendPosition(QwtPlot::LegendPosition pos);
 
51
    QwtPlot::LegendPosition legendPosition() const;
 
52
 
 
53
    void setLegendRatio(double ratio);
 
54
    double legendRatio() const;
 
55
 
 
56
    virtual QSize minimumSizeHint(const QwtPlot *) const;    
 
57
 
 
58
    virtual void activate(const QwtPlot *, 
 
59
        const QRect &rect, int options = 0);
 
60
 
 
61
    virtual void invalidate();
 
62
 
 
63
    const QRect &titleRect() const;
 
64
    const QRect &legendRect() const;
 
65
    const QRect &scaleRect(int axis) const;
 
66
    const QRect &canvasRect() const;
 
67
 
 
68
    class LayoutData;
 
69
 
 
70
protected:
 
71
 
 
72
    QRect layoutLegend(int options, const QRect &) const;
 
73
    QRect alignLegend(const QRect &canvasRect, 
 
74
        const QRect &legendRect) const;
 
75
 
 
76
    void expandLineBreaks(int options, const QRect &rect, 
 
77
        int &dimTitle, int dimAxes[QwtPlot::axisCnt]) const;
 
78
 
 
79
    void alignScales(int options, QRect &canvasRect,
 
80
        QRect scaleRect[QwtPlot::axisCnt]) const;
 
81
 
 
82
private:
 
83
    class PrivateData;
 
84
 
 
85
    PrivateData *d_data;
 
86
};
 
87
 
 
88
#endif