~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to plugins/chartshape/kdchart/src/KDChartStockDiagram_p.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
/****************************************************************************
 
2
** Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.  All rights reserved.
 
3
**
 
4
** This file is part of the KD Chart library.
 
5
**
 
6
** Licensees holding valid commercial KD Chart licenses may use this file in
 
7
** accordance with the KD Chart Commercial License Agreement provided with
 
8
** the Software.
 
9
**
 
10
**
 
11
** This file may be distributed and/or modified under the terms of the
 
12
** GNU General Public License version 2 and version 3 as published by the
 
13
** Free Software Foundation and appearing in the file LICENSE.GPL included.
 
14
**
 
15
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
16
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
17
**
 
18
** Contact info@kdab.com if any conditions of this licensing are not
 
19
** clear to you.
 
20
**
 
21
**********************************************************************/
 
22
 
 
23
#ifndef KDCHART_STOCK_DIAGRAM_P_H
 
24
#define KDCHART_STOCK_DIAGRAM_P_H
 
25
 
 
26
#include "KDChartStockDiagram.h"
 
27
#include "KDChartAbstractCartesianDiagram_p.h"
 
28
#include "KDChartCartesianDiagramDataCompressor_p.h"
 
29
#include "KDChartPaintContext.h"
 
30
 
 
31
namespace KDChart {
 
32
 
 
33
class StockDiagram::Private : public AbstractCartesianDiagram::Private
 
34
{
 
35
    friend class StockDiagram;
 
36
 
 
37
public:
 
38
    Private();
 
39
    Private( const Private& r );
 
40
    ~Private();
 
41
 
 
42
    Type type;
 
43
    StockDiagram *diagram;
 
44
 
 
45
    QBrush upTrendCandlestickBrush;
 
46
    QBrush downTrendCandlestickBrush;
 
47
    QPen upTrendCandlestickPen;
 
48
    QPen downTrendCandlestickPen;
 
49
 
 
50
    QMap<int, QBrush> upTrendCandlestickBrushes;
 
51
    QMap<int, QBrush> downTrendCandlestickBrushes;
 
52
    QMap<int, QPen> upTrendCandlestickPens;
 
53
    QMap<int, QPen> downTrendCandlestickPens;
 
54
 
 
55
    QPen lowHighLinePen;
 
56
    QMap<int, QPen> lowHighLinePens;
 
57
 
 
58
 
 
59
    void drawOHLCBar( const CartesianDiagramDataCompressor::DataPoint &open,
 
60
                      const CartesianDiagramDataCompressor::DataPoint &high,
 
61
                      const CartesianDiagramDataCompressor::DataPoint &low,
 
62
                      const CartesianDiagramDataCompressor::DataPoint &close,
 
63
                      PaintContext *context );
 
64
    void drawHLCBar( const CartesianDiagramDataCompressor::DataPoint &high,
 
65
                     const CartesianDiagramDataCompressor::DataPoint &low,
 
66
                     const CartesianDiagramDataCompressor::DataPoint &close,
 
67
                     PaintContext *context );
 
68
    void drawCandlestick( const CartesianDiagramDataCompressor::DataPoint &open,
 
69
                          const CartesianDiagramDataCompressor::DataPoint &high,
 
70
                          const CartesianDiagramDataCompressor::DataPoint &low,
 
71
                          const CartesianDiagramDataCompressor::DataPoint &close,
 
72
                          PaintContext *context );
 
73
 
 
74
private:
 
75
    void drawLine( int col, const QPointF &point1, const QPointF &p2, PaintContext *context );
 
76
    QPointF projectPoint( PaintContext *context, const QPointF &point ) const;
 
77
    QRectF projectCandlestick( PaintContext *context, const QPointF &open, const QPointF &close, qreal width ) const;
 
78
    int openValueColumn() const;
 
79
    int highValueColumn() const;
 
80
    int lowValueColumn() const;
 
81
    int closeValueColumn() const;
 
82
 
 
83
    class ThreeDPainter;
 
84
};
 
85
 
 
86
KDCHART_IMPL_DERIVED_DIAGRAM( StockDiagram, AbstractCartesianDiagram, CartesianCoordinatePlane )
 
87
 
 
88
}
 
89
 
 
90
#endif // KDCHART_STOCK_DIAGRAM_P_H
 
91