summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kmymoneypriceview.h
blob: 4415b881bf2431523cd12f30ffeef7dfae561821 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/***************************************************************************
                          kmymoneypriceview.h  -  description
                             -------------------
    begin                : Wed Mar 24 2004
    copyright            : (C) 2004 by Thomas Baumgart
    email                : Thomas Baumgart <ipwizard@users.sourceforge.net>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 KMYMONEYPRICEVIEW_H
#define KMYMONEYPRICEVIEW_H

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

#include <tqwidget.h>
// class TQListViewItem;

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

#include <kpopupmenu.h>
#include <klistview.h>

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

#include <kmymoney/kmymoneylistviewitem.h>
//#include <kmymoney/mymoneymoney.h>
#include <kmymoney/mymoneyprice.h>

/**
  * @author Thomas Baumgart
  */

class KMyMoneyPriceItem : public KMyMoneyListViewItem
{
public:
  KMyMoneyPriceItem(TDEListView *, const MyMoneyPrice& pr);
  ~KMyMoneyPriceItem() {}

  int compare(TQListViewItem *p, int col, bool ascending) const;

  const MyMoneyPrice& price(void) const { return m_pr; };

private:
  MyMoneyPrice  m_pr;
};


class KMyMoneyPriceView : public TDEListView
{
   Q_OBJECT
  
public:
  KMyMoneyPriceView(TQWidget *parent=0, const char *name=0);
  ~KMyMoneyPriceView();

protected:
  /// the resize event
  virtual void resizeEvent(TQResizeEvent*);

protected slots:
  void slotListClicked(TQListViewItem* item, const TQPoint&, int);

private slots:
  void slotTimerDone(void);

signals:
  void newPrice(void);
  void deletePrice(void);
  void editPrice(void);
  void onlinePriceUpdate(void);

private:
  TDEPopupMenu*     m_contextMenu;
  bool            m_showAll;
};

#endif