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 KCHARTFRAMEATTRIBUTES_H 21 #define KCHARTFRAMEATTRIBUTES_H 22 23 #include <QDebug> 24 #include <QMetaType> 25 #include <QPen> 26 #include "KChartGlobal.h" 27 28 namespace KChart { 29 30 /** 31 * @brief A set of attributes for frames around items 32 */ 33 class KCHART_EXPORT FrameAttributes 34 { 35 public: 36 FrameAttributes(); 37 FrameAttributes( const FrameAttributes& ); 38 FrameAttributes &operator= ( const FrameAttributes& ); 39 40 ~FrameAttributes(); 41 42 void setVisible( bool visible ); 43 bool isVisible() const; 44 45 void setPen( const QPen & pen ); 46 QPen pen() const; 47 48 void setCornerRadius( qreal radius ); 49 qreal cornerRadius() const; 50 51 void setPadding( int padding ); 52 int padding() const; 53 54 bool operator==( const FrameAttributes& ) const; 55 inline bool operator!=( const FrameAttributes& other ) const { return !operator==(other); } 56 57 private: 58 59 KCHART_DECLARE_PRIVATE_BASE_VALUE( FrameAttributes ) 60 }; // End of class FrameAttributes 61 62 } 63 64 #if !defined(QT_NO_DEBUG_STREAM) 65 KCHART_EXPORT QDebug operator<<(QDebug, const KChart::FrameAttributes& ); 66 #endif /* QT_NO_DEBUG_STREAM */ 67 68 KCHART_DECLARE_SWAP_SPECIALISATION( KChart::FrameAttributes ) 69 70 QT_BEGIN_NAMESPACE 71 Q_DECLARE_TYPEINFO( KChart::FrameAttributes, Q_MOVABLE_TYPE ); 72 QT_END_NAMESPACE 73 74 Q_DECLARE_METATYPE( KChart::FrameAttributes ) 75 76 #endif // KCHARTFRAMEATTRIBUTES_H 77