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 PRINTINGPARAMETERS_H
21 #define PRINTINGPARAMETERS_H
22 
23 #include <QPen>
24 #include <QDebug>
25 
26 //
27 //  W A R N I N G
28 //  -------------
29 //
30 // This file is not part of the KD Chart API.  It exists purely as an
31 // implementation detail.  This header file may change from version to
32 // version without notice, or even be removed.
33 //
34 // We mean it.
35 //
36 
37 namespace KChart {
38     /**
39      * PrintingParameters stores the scale factor which lines has to been scaled with when printing.
40      * It's essentially printer's logical DPI / widget's logical DPI
41      * \internal
42      */
43     class PrintingParameters {
44     public:
45         static qreal scaleFactor();
46         static void setScaleFactor( const qreal scaleFactor );
47         static void resetScaleFactor();
48         static QPen scalePen( const QPen& pen );
49 
50     private:
51         PrintingParameters();
52         static PrintingParameters* instance();
53 
54         qreal m_scaleFactor;
55     };
56 }
57 
58 #endif
59