KChart

KChartRulerAttributes.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 KCHARTRULERATTRIBUTES_H
10#define KCHARTRULERATTRIBUTES_H
11
12#include <QMetaType>
13#include "KChartGlobal.h"
14#include "KChartEnums.h"
15
16QT_BEGIN_NAMESPACE
17class QPen;
18QT_END_NAMESPACE
19
20namespace KChart {
21
22/**
23 * @brief A set of attributes controlling the appearance of axis rulers
24 */
25class KCHART_EXPORT RulerAttributes
26{
27public:
30 RulerAttributes &operator= ( const RulerAttributes& );
31
33
34 /**
35 * Sets the pen used to draw the tick marks
36 */
37 void setTickMarkPen( const QPen& pen );
38 QPen tickMarkPen() const;
39
40 /**
41 * Sets the pen used to draw major tick marks
42 */
43 void setMajorTickMarkPen( const QPen& pen );
44 bool majorTickMarkPenIsSet() const;
45 QPen majorTickMarkPen() const;
46
47 /**
48 * Sets the pen used to draw minor tick marks
49 */
50 void setMinorTickMarkPen( const QPen& pen );
51 bool minorTickMarkPenIsSet() const;
52 QPen minorTickMarkPen() const;
53
54 /**
55 * Sets the pen used to draw the tick mark at a specific value
56 *
57 * Note: This will not paint a tick mark at the specified value
58 * if it wasn't already drawn before.
59 */
60 void setTickMarkPen( qreal value, const QPen& pen );
61 QPen tickMarkPen( qreal value ) const;
63 TickMarkerPensMap tickMarkPens() const;
64
65 bool hasTickMarkPenAt( qreal value) const;
66
67 /**
68 * Color setter method provided for convenience
69 */
70 void setTickMarkColor( const QColor& color );
71 QColor tickMarkColor() const;
72
73 /**
74 * Shows or hides minor tick marks
75 */
76 void setShowMinorTickMarks( bool show );
77 bool showMinorTickMarks() const;
78
79 /**
80 * Set the ruler line pen to @p pen
81 */
82 void setRulerLinePen(const QPen &pen);
83 /** @return the ruler line pen
84 */
85 QPen rulerLinePen() const;
86
87 void setShowRulerLine( bool show );
88 bool showRulerLine() const;
89
90 /**
91 * Shows or hides major tick marks
92 */
93 void setShowMajorTickMarks( bool show );
94 bool showMajorTickMarks() const;
95
96 /**
97 * Sets the length of major tick marks
98 */
99 void setMajorTickMarkLength( int length );
100 int majorTickMarkLength() const;
101 bool majorTickMarkLengthIsSet() const;
102
103 /**
104 * Sets the length of minor tick marks
105 */
106 void setMinorTickMarkLength( int length );
107 int minorTickMarkLength() const;
108 bool minorTickMarkLengthIsSet() const;
109
110 /**
111 * Set margin that should be used between the labels and the ticks. By
112 * default the value is -1, which means that half of the label's font
113 * height/width should be used as margin.
114 */
115 void setLabelMargin(int margin);
116 int labelMargin() const;
117
118 /**
119 * Shows or hides the first tick. This is usually where the axes cross.
120 * The tick itself may be obscured by the other axis, but the label will be visible.
121 */
122 void setShowFirstTick( bool show );
123 bool showFirstTick() const;
124
125 bool operator==( const RulerAttributes& ) const;
126 inline bool operator!=( const RulerAttributes& other ) const { return !operator==(other); }
127
128private:
129 KCHART_DECLARE_PRIVATE_BASE_VALUE( RulerAttributes )
130}; // End of class RulerAttributes
131
132}
133
134#if !defined(QT_NO_DEBUG_STREAM)
135KCHART_EXPORT QDebug operator<<(QDebug, const KChart::RulerAttributes& );
136#endif /* QT_NO_DEBUG_STREAM */
137
138KCHART_DECLARE_SWAP_SPECIALISATION( KChart::RulerAttributes )
139
140QT_BEGIN_NAMESPACE
141Q_DECLARE_TYPEINFO( KChart::RulerAttributes, Q_MOVABLE_TYPE );
142QT_END_NAMESPACE
143
144Q_DECLARE_METATYPE( KChart::RulerAttributes )
145
146#endif // KCHARTRULERATTRIBUTES_H
Definition of global enums.
Contains KChart macros.
A set of attributes controlling the appearance of axis rulers.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:04:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.