KChart

KChartBackgroundAttributes.h
1 /*
2  * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8 
9 #ifndef KCHARTBACKGROUNDATTRIBUTES_H
10 #define KCHARTBACKGROUNDATTRIBUTES_H
11 
12 #include <QDebug>
13 #include <QMetaType>
14 #include <QBrush>
15 #include "KChartGlobal.h"
16 
17 namespace KChart {
18 
19 /**
20  * Set of attributes usable for background pixmaps
21  */
22 class KCHART_EXPORT BackgroundAttributes
23 {
24 public:
27  BackgroundAttributes &operator= ( const BackgroundAttributes& );
28 
30 
31  enum BackgroundPixmapMode { BackgroundPixmapModeNone,
32  BackgroundPixmapModeCentered,
33  BackgroundPixmapModeScaled,
34  BackgroundPixmapModeStretched };
35 
36  void setVisible( bool visible );
37  bool isVisible() const;
38 
39  void setBrush( const QBrush &brush );
40  QBrush brush() const;
41 
42  void setPixmapMode( BackgroundPixmapMode mode );
43  BackgroundPixmapMode pixmapMode() const;
44 
45  void setPixmap( const QPixmap &backPixmap );
46  QPixmap pixmap() const;
47 
48  bool operator==( const BackgroundAttributes& ) const;
49  inline bool operator!=( const BackgroundAttributes& other ) const { return !operator==(other); }
50 
51  bool isEqualTo( const BackgroundAttributes& other, bool ignorePixmap=false ) const;
52 
53 private:
54  KCHART_DECLARE_PRIVATE_BASE_VALUE( BackgroundAttributes )
55 }; // End of class BackgroundAttributes
56 
57 }
58 
59 #if !defined(QT_NO_DEBUG_STREAM)
61 #endif /* QT_NO_DEBUG_STREAM */
62 
63 KCHART_DECLARE_SWAP_SPECIALISATION( KChart::BackgroundAttributes )
64 
65 QT_BEGIN_NAMESPACE
66 Q_DECLARE_TYPEINFO( KChart::BackgroundAttributes, Q_MOVABLE_TYPE );
67 QT_END_NAMESPACE
68 
69 Q_DECLARE_METATYPE( KChart::BackgroundAttributes )
70 
71 #endif // KCHARTBACKGROUNDATTRIBUTES_H
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
Set of attributes usable for background pixmaps.
Contains KChart macros.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:52:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.