1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB.  All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef KCHARTHEADERFOOTER_P_H
21 #define KCHARTHEADERFOOTER_P_H
22 
23 //
24 //  W A R N I N G
25 //  -------------
26 //
27 // This file is not part of the KD Chart API.  It exists purely as an
28 // implementation detail.  This header file may change from version to
29 // version without notice, or even be removed.
30 //
31 // We mean it.
32 //
33 
34 #include "KChartHeaderFooter.h"
35 #include "KChartTextArea_p.h"
36 #include "KChartChart.h"
37 #include "KChartMath_p.h"
38 
39 #include <QMap>
40 
41 
42 class KTextDocument;
43 
44 namespace KChart {
45     class Chart;
46     class TextAttributes;
47 }
48 
49 /**
50  * \internal
51  */
52 class Q_DECL_HIDDEN KChart::HeaderFooter::Private : public KChart::TextArea::Private
53 {
54     friend class KChart::HeaderFooter;
55 public:
56     explicit Private();
57     ~Private();
58 
Private(const Private & rhs)59     Private( const Private& rhs ) :
60         TextArea::Private( rhs ),
61         type( rhs.type ),
62         position( rhs.position )
63         {
64         }
65 
66     void updateTextDoc();
67 
68 private:
69     // user-settable
70     HeaderFooterType type;
71     Position position;
72 };
73 
HeaderFooter(Private * d,KChart::Chart * parent)74 inline KChart::HeaderFooter::HeaderFooter( Private* d, KChart::Chart* parent )
75     : TextArea( d )
76 {
77     setParent( parent );
78     init();
79 }
d_func()80 inline KChart::HeaderFooter::Private * KChart::HeaderFooter::d_func()
81 {
82     return static_cast<Private*>( TextArea::d_func() );
83 }
d_func()84 inline const KChart::HeaderFooter::Private * KChart::HeaderFooter::d_func() const
85 {
86     return static_cast<const Private*>( TextArea::d_func() );
87 }
88 
89 
90 #endif /* KCHARTHEADERFOOTER_P_H */
91