~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to kchart/kdchart/src/KDChartCartesianAxis.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C++ -*-
2
 
   KDChart - a multi-platform charting engine
3
 
*/
4
 
 
5
 
/****************************************************************************
6
 
 ** Copyright (C) 2005-2007 Klarälvdalens Datakonsult AB.  All rights reserved.
7
 
 **
8
 
 ** This file is part of the KD Chart library.
9
 
 **
10
 
 ** This file may be used under the terms of the GNU General Public
11
 
 ** License versions 2.0 or 3.0 as published by the Free Software
12
 
 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
13
 
 ** included in the packaging of this file.  Alternatively you may (at
14
 
 ** your option) use any later version of the GNU General Public
15
 
 ** License if such license has been publicly approved by
16
 
 ** Klarälvdalens Datakonsult AB (or its successors, if any).
17
 
 ** 
18
 
 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
19
 
 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
20
 
 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
21
 
 ** not expressly granted herein.
22
 
 ** 
23
 
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24
 
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25
 
 **
26
 
 **********************************************************************/
27
 
#ifndef KDCHARTCARTESIANAXIS_H
28
 
#define KDCHARTCARTESIANAXIS_H
29
 
 
30
 
#include <QList>
31
 
 
32
 
#include "KDChartAbstractAxis.h"
33
 
 
34
 
namespace KDChart {
35
 
 
36
 
    class AbstractCartesianDiagram;
37
 
 
38
 
    /**
39
 
      * The class for cartesian axes.
40
 
      *
41
 
      * For being useful, axes need to be assigned to a diagram, see
42
 
      * AbstractCartesianDiagram::addAxis and AbstractCartesianDiagram::takeAxis.
43
 
      *
44
 
      * \sa PolarAxis, AbstractCartesianDiagram
45
 
      */
46
 
    class KDCHART_EXPORT CartesianAxis : public AbstractAxis
47
 
    {
48
 
        Q_OBJECT
49
 
 
50
 
        Q_DISABLE_COPY( CartesianAxis )
51
 
        KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( CartesianAxis, AbstractDiagram* )
52
 
 
53
 
    public:
54
 
        enum Position {
55
 
            Bottom,
56
 
            Top,
57
 
            Right,
58
 
            Left
59
 
        };
60
 
 
61
 
        /**
62
 
          * C'tor of the class for cartesian axes.
63
 
          *
64
 
          * \note If using a zero parent for the constructor, you need to call
65
 
          * your diagram's addAxis function to add your axis to the diagram.
66
 
          * Otherwise, there is no need to call addAxis, since the constructor
67
 
          * does that automatically for you, if you pass a diagram as parameter.
68
 
          *
69
 
          * \sa AbstractCartesianDiagram::addAxis
70
 
          */
71
 
        explicit CartesianAxis ( AbstractCartesianDiagram* diagram = 0 );
72
 
        ~CartesianAxis();
73
 
 
74
 
        /**
75
 
         * Returns true if both axes have the same settings.
76
 
         */
77
 
        bool compare( const CartesianAxis* other )const;
78
 
 
79
 
        /** reimpl */
80
 
        virtual void paint( QPainter* );
81
 
        /** reimpl */
82
 
        virtual void paintCtx( PaintContext* );
83
 
 
84
 
        void setTitleText( const QString& text );
85
 
        QString titleText() const;
86
 
 
87
 
        void setTitleTextAttributes( const TextAttributes &a );
88
 
        /**
89
 
          * Returns the text attributes that will be used for displaying the
90
 
          * title text.
91
 
          * This is either the text attributes as specified by setTitleTextAttributes,
92
 
          * or (if setTitleTextAttributes() was not called) the default text attributes.
93
 
          * \sa resetTitleTextAttributes, hasDefaultTitleTextAttributes
94
 
          */
95
 
        TextAttributes titleTextAttributes() const;
96
 
        /**
97
 
          * Reset the title text attributes to the built-in default:
98
 
          *
99
 
          * Same font and pen as AbstractAxis::textAttributes()
100
 
          * and 1.5 times their size.
101
 
          */
102
 
        void resetTitleTextAttributes();
103
 
        bool hasDefaultTitleTextAttributes() const;
104
 
 
105
 
        virtual void setPosition ( Position p );
106
 
#if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
107
 
        virtual const Position position () const;
108
 
#else
109
 
        virtual Position position () const;
110
 
#endif
111
 
 
112
 
        virtual void layoutPlanes();
113
 
 
114
 
        virtual bool isAbscissa() const;
115
 
        virtual bool isOrdinate() const;
116
 
 
117
 
        /**
118
 
         * Sets the axis annotations to \a annotations.
119
 
         * Annotations are a QMap of doubles and QStrings defining special
120
 
         * markers and their position.
121
 
         * If you use annotations, the normal ticks and values will be invisible.
122
 
         * To unset the annotations, pass an empty QMap.
123
 
         */
124
 
        void setAnnotations( const QMap< double, QString >& annotations );
125
 
        /**
126
 
         * Returns the currently set axis annotations.
127
 
         */
128
 
        QMap< double, QString > annotations() const;
129
 
 
130
 
        /** pure virtual in QLayoutItem */
131
 
        virtual bool isEmpty() const;
132
 
        /** pure virtual in QLayoutItem */
133
 
        virtual Qt::Orientations expandingDirections() const;
134
 
        /** pure virtual in QLayoutItem */
135
 
        virtual QSize maximumSize() const;
136
 
        /** pure virtual in QLayoutItem */
137
 
        virtual QSize minimumSize() const;
138
 
        /** pure virtual in QLayoutItem */
139
 
        virtual QSize sizeHint() const;
140
 
        /** pure virtual in QLayoutItem */
141
 
        virtual void setGeometry( const QRect& r );
142
 
        /** pure virtual in QLayoutItem */
143
 
        virtual QRect geometry() const;
144
 
 
145
 
    public Q_SLOTS:
146
 
        void setCachedSizeDirty() const;
147
 
 
148
 
 
149
 
        int tickLength( bool subUnitTicks = false ) const;
150
 
    };
151
 
 
152
 
    typedef QList<CartesianAxis*> CartesianAxisList;
153
 
}
154
 
 
155
 
#endif