KChart

KChartDataValueAttributes.h
Go to the documentation of this file.
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 KCHARTDATAVALUEATTRIBUTES_H
21 #define KCHARTDATAVALUEATTRIBUTES_H
22 
23 #include <Qt>
24 #include <QMetaType>
25 #include "KChartGlobal.h"
26 #include "KChartEnums.h"
27 #include "KChartRelativePosition.h"
28 
36 namespace KChart {
37 
38  class TextAttributes;
39  class BackgroundAttributes;
40  class FrameAttributes;
41  class MarkerAttributes;
42 
52 class KCHART_EXPORT DataValueAttributes
53 {
54 public:
57  DataValueAttributes &operator= ( const DataValueAttributes& );
58  bool operator==( const DataValueAttributes& ) const;
59  inline bool operator!=( const DataValueAttributes& other ) const { return !operator==(other); }
60 
62 
63  static const DataValueAttributes& defaultAttributes();
64  static const QVariant& defaultAttributesAsVariant();
65 
69  void setVisible( bool visible );
70 
74  bool isVisible() const;
75 
81  void setTextAttributes( const TextAttributes &a );
82 
86  TextAttributes textAttributes() const;
87 
94  bool mirrorNegativeValueTextRotation() const;
95 
99  void setMirrorNegativeValueTextRotation( bool enable );
100 
106  void setFrameAttributes( const FrameAttributes &a );
107 
113  FrameAttributes frameAttributes() const;
114 
120  void setBackgroundAttributes( const BackgroundAttributes &a );
121 
127  BackgroundAttributes backgroundAttributes() const;
128 
135  void setMarkerAttributes( const MarkerAttributes &a );
136 
142  MarkerAttributes markerAttributes() const;
143 
153  void setUsePercentage( bool enable );
154 
159  bool usePercentage() const;
160 
166  void setDecimalDigits( int digits );
167 
171  int decimalDigits() const;
172 
177  void setPrefix( const QString prefix );
178 
183  QString prefix() const;
184 
189  void setSuffix( const QString suffix );
190 
195  QString suffix() const;
196 
202  void setDataLabel( const QString label );
203 
208  QString dataLabel() const;
209 
213  bool showRepetitiveDataLabels() const;
214 
220  void setShowRepetitiveDataLabels( bool showRepetitiveDataLabels );
221 
225  bool showOverlappingDataLabels() const;
226 
232  void setShowOverlappingDataLabels( bool showOverlappingDataLabels );
233 
241  void setPowerOfTenDivisor( int powerOfTenDivisor );
242  int powerOfTenDivisor() const;
254  void setShowInfinite( bool infinite );
255  bool showInfinite() const;
272  void setNegativePosition( const RelativePosition& relPosition );
273 
278  const RelativePosition negativePosition() const;
279 
292  void setPositivePosition( const RelativePosition& relPosition );
293 
298  const RelativePosition positivePosition() const;
299 
300  const RelativePosition position( bool positive ) const
301  {
302  return positive ? positivePosition() : negativePosition();
303  }
304 
305 private:
306  KCHART_DECLARE_PRIVATE_BASE_VALUE( DataValueAttributes )
307 
308 }; // End of class DataValueAttributes
309 
310 }
311 
312 #if !defined(QT_NO_DEBUG_STREAM)
313 KCHART_EXPORT QDebug operator<<(QDebug, const KChart::DataValueAttributes& );
314 #endif /* QT_NO_DEBUG_STREAM */
315 
316 KCHART_DECLARE_SWAP_SPECIALISATION( KChart::DataValueAttributes )
317 
318 QT_BEGIN_NAMESPACE
319 Q_DECLARE_TYPEINFO( KChart::DataValueAttributes, Q_MOVABLE_TYPE );
320 QT_END_NAMESPACE
321 
322 Q_DECLARE_METATYPE( KChart::DataValueAttributes )
323 
324 #endif // KCHARTDATAVALUEATTRIBUTES_H
Defines relative position information: reference area, position in this area (reference position)...
A set of attributes controlling the appearance of data set markers.
Diagram attributes dealing with data value labels.
Contains KChart macros.
Set of attributes usable for background pixmaps.
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Definition of global enums.
A set of text attributes.
Global namespace.
A set of attributes for frames around items.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Sep 19 2020 22:36:25 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.