summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kmymoneyforecastlistviewitem.h
blob: 7e4894548ca237ce871174adfde137ebda3739b0 (plain)
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
/***************************************************************************
                          kmymoneyforecastlistviewitem.h
                             -------------------
    begin                : Sun Nov 25 2007
    copyright            : (C) 2007 by Alvaro Soliverez
    email                : asoliverez@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KMYMONEYFORECASTLISTVIEWITEM_H
#define KMYMONEYFORECASTLISTVIEWITEM_H

// ----------------------------------------------------------------------------
// QT Includes

#include <qobject.h>

// ----------------------------------------------------------------------------
// KDE Includes

#include <klistview.h>

// ----------------------------------------------------------------------------
// Project Includes

/**
  * This class implements a derived version of a KListViewItem that
  * allows printing negative numbers in red
  *
  * @author Alvaro Soliverez
  */
class KMyMoneyForecastListViewItem : public KListViewItem
{
public:
  
  KMyMoneyForecastListViewItem(QListView* parent, QListViewItem* after, bool isNegative);
  
  ~KMyMoneyForecastListViewItem();
  
  void setNegative(bool isNegative);
  
  void setText( int column, const QString &text, const bool &negative = false );

  /**
    * use my own paint method
    */
  void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment);


private:
  
  bool m_negative;
  
  QMap<int, QColor> m_columnsColor;
};

#endif