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 KCHARTABSTRACTAREABASE_P_H 21 #define KCHARTABSTRACTAREABASE_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 /** \file KChartAbstractAreaBase_p.h 35 * \internal 36 */ 37 38 #include "KChartAbstractAreaBase.h" 39 #include "KChartTextAttributes.h" 40 #include "KChartFrameAttributes.h" 41 #include "KChartBackgroundAttributes.h" 42 #include "KChartMath_p.h" 43 44 45 namespace KChart { 46 47 /** 48 * \internal 49 */ 50 class Q_DECL_HIDDEN AbstractAreaBase::Private 51 { 52 friend class AbstractAreaBase; 53 public: 54 explicit Private(); 55 virtual ~Private(); 56 Private(const Private & rhs)57 Private( const Private& rhs ) : 58 amountOfLeftOverlap( 0 ), 59 amountOfRightOverlap( 0 ), 60 amountOfTopOverlap( 0 ), 61 amountOfBottomOverlap( 0 ), 62 visible( rhs.visible ), 63 frameAttributes( rhs.frameAttributes ), 64 backgroundAttributes( rhs.backgroundAttributes ) 65 { 66 } 67 68 protected: 69 void init(); 70 71 // These are set each time the area's sizeHint() 72 // (or the maximumSize(), resp.) is calculated: 73 // They store additional layout-information about 74 // space needed around the area. 75 // Other classes (e.g. KChart::AutoSpacer) can use 76 // these data to determine how much space has to 77 // be added additionally ... 78 mutable int amountOfLeftOverlap; 79 mutable int amountOfRightOverlap; 80 mutable int amountOfTopOverlap; 81 mutable int amountOfBottomOverlap; 82 83 private: 84 bool visible; 85 KChart::FrameAttributes frameAttributes; 86 KChart::BackgroundAttributes backgroundAttributes; 87 }; 88 AbstractAreaBase(AbstractAreaBase::Private * p)89 inline AbstractAreaBase::AbstractAreaBase( AbstractAreaBase::Private * p ) : 90 _d( p ) { init(); } 91 92 } 93 #endif /* KCHARTABSTRACTAREABASE_P_H */ 94