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

« back to all changes in this revision

Viewing changes to qwt-5.1.0/src/qwt_compass.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_COMPASS_H
11
 
#define QWT_COMPASS_H 1
12
 
 
13
 
#include <qstring.h>
14
 
#include <qmap.h>
15
 
#include "qwt_dial.h"
16
 
 
17
 
#if defined(QWT_TEMPLATEDLL)
18
 
 
19
 
#if defined(QT_NO_STL) || QT_VERSION < 0x040000 || QT_VERSION > 0x040001
20
 
/*
21
 
  Unfortunately Qt 4.0.0/Qt 4.0.1 contains uncompilable 
22
 
  code in the STL adaptors of qmap.h. The declaration below 
23
 
  instantiates this code resulting in compiler errors. 
24
 
  If you really need the map to be exported, remove the condition above
25
 
  and fix the qmap.h
26
 
*/
27
 
// MOC_SKIP_BEGIN
28
 
template class QWT_EXPORT QMap<double, QString>;
29
 
// MOC_SKIP_END
30
 
#endif
31
 
 
32
 
#endif
33
 
 
34
 
 
35
 
class QwtCompassRose;
36
 
 
37
 
/*!
38
 
  \brief A Compass Widget
39
 
 
40
 
  QwtCompass is a widget to display and enter directions. It consists
41
 
  of a scale, an optional needle and rose. 
42
 
 
43
 
  \image html dials1.png 
44
 
 
45
 
  \note The examples/dials example shows how to use QwtCompass.
46
 
*/
47
 
 
48
 
class QWT_EXPORT QwtCompass: public QwtDial 
49
 
{
50
 
    Q_OBJECT
51
 
 
52
 
public:
53
 
    explicit QwtCompass( QWidget* parent = NULL);
54
 
#if QT_VERSION < 0x040000
55
 
    explicit QwtCompass(QWidget* parent, const char *name);
56
 
#endif
57
 
    virtual ~QwtCompass();
58
 
 
59
 
    void setRose(QwtCompassRose *rose);
60
 
    const QwtCompassRose *rose() const;
61
 
    QwtCompassRose *rose();
62
 
 
63
 
    const QMap<double, QString> &labelMap() const;
64
 
    QMap<double, QString> &labelMap();
65
 
    void setLabelMap(const QMap<double, QString> &map);
66
 
 
67
 
protected:
68
 
    virtual QwtText scaleLabel(double value) const;
69
 
 
70
 
    virtual void drawRose(QPainter *, const QPoint &center,
71
 
        int radius, double north, QPalette::ColorGroup) const;
72
 
 
73
 
    virtual void drawScaleContents(QPainter *, 
74
 
        const QPoint &center, int radius) const; 
75
 
 
76
 
    virtual void keyPressEvent(QKeyEvent *);
77
 
 
78
 
private:
79
 
    void initCompass();
80
 
 
81
 
    class PrivateData;
82
 
    PrivateData *d_data;
83
 
};
84
 
 
85
 
#endif