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_H
21 #define KCHARTHEADERFOOTER_H
22 
23 #include "KChartTextArea.h"
24 #include "KChartPosition.h"
25 
26 namespace KChart {
27 
28     class Chart;
29     class TextAttributes;
30 
31 /**
32   * @brief A header or footer displaying text above or below charts
33   */
34 class KCHART_EXPORT HeaderFooter : public TextArea
35 {
36     Q_OBJECT
37 
38     KCHART_DECLARE_PRIVATE_DERIVED_PARENT( HeaderFooter, Chart* )
39 
40 public:
41     HeaderFooter( Chart* parent = nullptr );
42     virtual ~HeaderFooter();
43 
44     /**
45       * Creates an exact copy of this header/footer.
46       */
47     virtual HeaderFooter * clone() const;
48 
49     bool compare( const HeaderFooter& other ) const;
50 
51     enum HeaderFooterType{ Header,
52                            Footer };
53 
54     void setType( HeaderFooterType type );
55     HeaderFooterType type() const;
56 
57     void setPosition( Position position );
58     Position position() const;
59 
60     void setParent( QObject* parent );
61 
62 Q_SIGNALS:
63     void destroyedHeaderFooter( HeaderFooter* );
64     void positionChanged( HeaderFooter* );
65 
66 }; // End of class HeaderFooter
67 
68 }
69 
70 
71 #endif // KCHARTHEADERFOOTER_H
72