File indexing completed on 2024-05-12 04:20:31

0001 /*
0002  * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
0003  *
0004  * This file is part of the KD Chart library.
0005  *
0006  * SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #ifndef KCHARTBACKGROUNDATTRIBUTES_H
0010 #define KCHARTBACKGROUNDATTRIBUTES_H
0011 
0012 #include <QDebug>
0013 #include <QMetaType>
0014 #include <QBrush>
0015 #include "KChartGlobal.h"
0016 
0017 namespace KChart {
0018 
0019 /**
0020   * Set of attributes usable for background pixmaps
0021   */
0022 class KCHART_EXPORT BackgroundAttributes
0023 {
0024 public:
0025     BackgroundAttributes();
0026     BackgroundAttributes( const BackgroundAttributes& );
0027     BackgroundAttributes &operator= ( const BackgroundAttributes& );
0028 
0029     ~BackgroundAttributes();
0030 
0031     enum BackgroundPixmapMode { BackgroundPixmapModeNone,
0032                                 BackgroundPixmapModeCentered,
0033                                 BackgroundPixmapModeScaled,
0034                                 BackgroundPixmapModeStretched };
0035 
0036     void setVisible( bool visible );
0037     bool isVisible() const;
0038 
0039     void setBrush( const QBrush &brush );
0040     QBrush brush() const;
0041 
0042     void setPixmapMode( BackgroundPixmapMode mode );
0043     BackgroundPixmapMode pixmapMode() const;
0044 
0045     void setPixmap( const QPixmap &backPixmap );
0046     QPixmap pixmap() const;
0047 
0048     bool operator==( const BackgroundAttributes& ) const;
0049     inline bool operator!=( const BackgroundAttributes& other ) const { return !operator==(other); }
0050 
0051     bool isEqualTo( const BackgroundAttributes& other, bool ignorePixmap=false ) const;
0052 
0053 private:
0054     KCHART_DECLARE_PRIVATE_BASE_VALUE( BackgroundAttributes )
0055 }; // End of class BackgroundAttributes
0056 
0057 }
0058 
0059 #if !defined(QT_NO_DEBUG_STREAM)
0060 KCHART_EXPORT QDebug operator<<(QDebug, const KChart::BackgroundAttributes& );
0061 #endif /* QT_NO_DEBUG_STREAM */
0062 
0063 KCHART_DECLARE_SWAP_SPECIALISATION( KChart::BackgroundAttributes )
0064 
0065 QT_BEGIN_NAMESPACE
0066 Q_DECLARE_TYPEINFO( KChart::BackgroundAttributes, Q_MOVABLE_TYPE );
0067 QT_END_NAMESPACE
0068 
0069 Q_DECLARE_METATYPE( KChart::BackgroundAttributes )
0070 
0071 #endif // KCHARTBACKGROUNDATTRIBUTES_H