/usr/include/KChart/KChartDataValueAttributes.h is in libkchart-dev 2.6.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | /**
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KCHARTDATAVALUEATTRIBUTES_H
#define KCHARTDATAVALUEATTRIBUTES_H
#include <Qt>
#include <QMetaType>
#include "KChartGlobal.h"
#include "KChartEnums.h"
#include "KChartRelativePosition.h"
/** \file KChartDataValueAttributes.h
* \brief Declaring the class KChart::DataValueAttributes.
*
*
*/
namespace KChart {
class TextAttributes;
class BackgroundAttributes;
class FrameAttributes;
class MarkerAttributes;
/**
* \class DataValueAttributes KChartDataValueAttributes.h KChartDataValueAttributes
* \brief Diagram attributes dealing with data value labels.
*
* The DataValueAttributes group all properties that can be set
* wrt data value labels and if and how they are displayed. This
* includes things like the text attributes (font, color), what
* markers are used, how many decimal digits are displayed, etc.
*/
class KCHART_EXPORT DataValueAttributes
{
public:
DataValueAttributes();
DataValueAttributes( const DataValueAttributes& );
DataValueAttributes &operator= ( const DataValueAttributes& );
bool operator==( const DataValueAttributes& ) const;
inline bool operator!=( const DataValueAttributes& other ) const { return !operator==(other); }
~DataValueAttributes();
static const DataValueAttributes& defaultAttributes();
static const QVariant& defaultAttributesAsVariant();
/** Set whether data value labels should be displayed.
* \param visible Whether data value labels should be displayed.
*/
void setVisible( bool visible );
/**
* @return Whether data value labels should be displayed.
*/
bool isVisible() const;
/**
* Set the text attributes to use for the data value labels.
* \param a The text attributes to set.
* \see TextAttributes
*/
void setTextAttributes( const TextAttributes &a );
/**
* \return The text attributes used for painting data value labels.
*/
TextAttributes textAttributes() const;
/**
* If true, rotation of negative value labels is negated, so that negative
* values are rotated in opposite direction of textAttributes().rotation(),
* and in this sense appear "mirrored" to positive value labels, though the
* text itself is *not* mirrored, only its rotation.
*/
bool mirrorNegativeValueTextRotation() const;
/**
* \see mirrorNegativeValueTextRotation()
*/
void setMirrorNegativeValueTextRotation( bool enable );
/**
* Set the frame attributes to use for the data value labels area.
* \param a The frame attributes to set.
* \see FrameAttributes
*/
void setFrameAttributes( const FrameAttributes &a );
/**
* \return The frame attributes used for painting the data
* value labels area.
* \see FrameAttributes
*/
FrameAttributes frameAttributes() const;
/**
* Set the background attributes to use for the data value labels area.
* \param a The background attributes to set.
* \see BackgroundAttributes
*/
void setBackgroundAttributes( const BackgroundAttributes &a );
/**
* \return The background attributes used for painting the data
* value labels area.
* \see BackgroundAttributes
*/
BackgroundAttributes backgroundAttributes() const;
/**
* Set the marker attributes to use for the data values. This includes
* the marker type.
* \param a The marker attributes to set.
* \see MarkerAttributes
*/
void setMarkerAttributes( const MarkerAttributes &a );
/**
* \return The marker attributes used for decorating the data
* values.
* \see MarkerAttributes
*/
MarkerAttributes markerAttributes() const;
/**
* Specify whether to use percentages instead of actual data point values when no
* specific label is set. In a bar or cartesian diagram, this means that the value
* will be shown in % in relation to the sum of all values in the same category, in
* a polar diagram in relation to the sum of all values in a data set.
*
* When this is turned on, the value will \b not automatically have the '%' postfix.
* \param enable Whether to enable percentage values
*/
void setUsePercentage( bool enable );
/**
* \return Whether to use percentage values
* \see setUsePercentage
*/
bool usePercentage() const;
/**
* Set how many decimal digits to display when rendering the data value
* labels. If there are no decimal digits it will not be displayed.
* \param digits The number of decimal digits to use.
*/
void setDecimalDigits( int digits );
/**
* \return The number of decimal digits displayed.
*/
int decimalDigits() const;
/**
* \brief Prepend a prefix string to the data value label
* \sa prefix
*/
void setPrefix( const QString prefix );
/**
* \brief Returns the string used as a prefix to the data value text.
* \sa setPrefix
*/
QString prefix() const;
/**
* \brief Append a suffix string to the data value label
* \sa suffix
*/
void setSuffix( const QString suffix );
/**
* \brief Returns the string used as a suffix to the data value text.
* \sa setSuffix
*/
QString suffix() const;
/**
* \brief display a string label instead of the original data value label
* Supports HTML code.
* \sa dataLabel
*/
void setDataLabel( const QString label );
/**
* \brief Returns the string displayed instead of the data value label
* \sa setDataLabel
*/
QString dataLabel() const;
/**
* \return Whether data values not different from their predecessors are drawn.
*/
bool showRepetitiveDataLabels() const;
/**
*
* Set whether data value labels not different from their predecessors should be drawn.
* \param showRepetitiveDataLabels Whether data value not different from their predecessors are drawn.
*/
void setShowRepetitiveDataLabels( bool showRepetitiveDataLabels );
/**
* \return Whether data value texts overlapping other data value texts of the same diagram are drawn.
*/
bool showOverlappingDataLabels() const;
/**
*
* Set whether data value texts overlapping other data value texts of the same diagram should be drawn.
* \param showOverlappingDataLabels Whether data texts overlapping other data value texts of the same diagram are drawn.
*/
void setShowOverlappingDataLabels( bool showOverlappingDataLabels );
/**
* \cond PLANNED_FOR_FUTURE
*
* These method are planned for future versions of KD Chart,
* so they are not part of the documented API yet.
*
*/
void setPowerOfTenDivisor( int powerOfTenDivisor );
int powerOfTenDivisor() const;
/**
* \endcond
*/
/**
* \cond PLANNED_FOR_FUTURE
*
* These method are planned for future versions of KD Chart,
* so they are not part of the documented API yet.
*/
void setShowInfinite( bool infinite );
bool showInfinite() const;
/**
* \endcond
*/
/**
* \brief Defines the relative positioning of the data value labels for negative values.
*
* The position is specified in relation to the respective data value point, or in
* relation to the respective data representation area, that's one area segment in
* a LineDiagram showing areas, or one bar in a BarDiagram, one pie slice ...
*
* See detailed description of \a KChart::Position for an illustration of the
* different possible reference positions.
*
* \sa negativePosition
*/
void setNegativePosition( const RelativePosition& relPosition );
/**
* \brief Return the relative positioning of the data value labels
* \sa setNegativePosition
*/
const RelativePosition negativePosition() const;
/**
* \brief Defines the relative position of the data value labels for positive values.
*
* The position is specified in relation to the respective data value point, or in
* relation to the respective data representation area, that's one area segment in
* a LineDiagram showing areas, or one bar in a BarDiagram, one pie slice ...
*
* See detailed description of \a KChart::Position for an illustration of the
* different possible reference positions.
*
* \sa positivePosition
*/
void setPositivePosition( const RelativePosition& relPosition );
/**
* \brief Return the relative positioning of the data value labels
* \sa setPositivePosition
*/
const RelativePosition positivePosition() const;
const RelativePosition position( bool positive ) const
{
return positive ? positivePosition() : negativePosition();
}
private:
KCHART_DECLARE_PRIVATE_BASE_VALUE( DataValueAttributes )
}; // End of class DataValueAttributes
}
#if !defined(QT_NO_DEBUG_STREAM)
KCHART_EXPORT QDebug operator<<(QDebug, const KChart::DataValueAttributes& );
#endif /* QT_NO_DEBUG_STREAM */
KCHART_DECLARE_SWAP_SPECIALISATION( KChart::DataValueAttributes )
QT_BEGIN_NAMESPACE
Q_DECLARE_TYPEINFO( KChart::DataValueAttributes, Q_MOVABLE_TYPE );
QT_END_NAMESPACE
Q_DECLARE_METATYPE( KChart::DataValueAttributes )
#endif // KCHARTDATAVALUEATTRIBUTES_H
|