File indexing completed on 2024-12-15 04:02:33

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 KCHARTSTOCKBARATTRIBUTES_H
0010 #define KCHARTSTOCKBARATTRIBUTES_H
0011 
0012 #include <QMetaType>
0013 #include "KChartGlobal.h"
0014 
0015 namespace KChart {
0016 
0017 /**
0018   * @brief Attributes to customize the appearance of a column in a stock chart
0019   */
0020 class KCHART_EXPORT StockBarAttributes
0021 {
0022 public:
0023     StockBarAttributes();
0024     StockBarAttributes( const StockBarAttributes& );
0025     StockBarAttributes &operator= ( const StockBarAttributes& );
0026 
0027     ~StockBarAttributes();
0028 
0029 
0030     /**
0031       * Sets the width of a candlestick
0032       *
0033       * @param width The width of a candlestick
0034       */
0035     void setCandlestickWidth( qreal width );
0036 
0037     /**
0038       * @return the width of a candlestick
0039       */
0040     qreal candlestickWidth() const;
0041 
0042     /**
0043       * Sets the tick length of both the open and close marker
0044       *
0045       * @param length the tick length
0046       */
0047     void setTickLength( qreal length );
0048 
0049     /**
0050       * @return the tick length used for both the open and close marker
0051       */
0052     qreal tickLength() const;
0053 
0054     bool operator==( const StockBarAttributes& ) const;
0055     inline bool operator!=( const StockBarAttributes& other ) const { return !operator==(other); }
0056 
0057 private:
0058     class Private;
0059     Private * _d;
0060     Private * d_func() { return _d; }
0061     const Private * d_func() const { return _d; }
0062 };
0063 
0064 }
0065 
0066 Q_DECLARE_METATYPE( KChart::StockBarAttributes )
0067 
0068 #endif // KCHARTSTOCKBARATTRIBUTES_H