summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qashmoney/transactiondisplay.h
blob: 594776a4f7d4302bcb73bbc45a133516485072e8 (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
#ifndef TRANSACTIONDISPLAY_H
#define TRANSACTIONDISPLAY_H

#include <qlayout.h>
#include <qhbox.h>
#include <qlistview.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qdatetime.h>

class TransactionDisplay : public QWidget
  {
    Q_OBJECT

  public:
    TransactionDisplay ( QWidget* parent );

    QListView* listview;
    QPushButton* newtransaction;
    QPushButton* edittransaction;
    QPushButton* deletetransaction;
    QPushButton* toggletransaction;
    QPushButton* viewtransactionnotes;

    QLabel *name;
    QLabel *balance;
    QLineEdit *limitbox;
    QLineEdit *amount;
    QLineEdit *date;

    int getIDColumn ();

  public slots:
    void setChildren ( bool );
    void setAccountID ( int );
    void showTransactionNotes ();

  private slots:
    void addTransaction ();
    void editTransaction ();
    void editTransfer ();
    void deleteTransaction ();
    void toggleTransaction ();
    void checkListViewDelete ();
    void checkListViewEdit ();
    void checkListViewToggle ();
    void saveColumnSize ( int column, int oldsize, int newsize );
    void limitDisplay ( const QString & );
    void showCalculator ();
    void showCalendar ();
    void setTransactionDisplayDate ();
    void saveSortingPreference ( int column );

  private:
    int accountid, fromaccount, fromparent, toaccount, toparent, day, month, year, transferid;
    QDate displaydate;
    bool children;
    QBoxLayout *layout;
    QHBox *firstline;
    QHBox *secondline;
    void redisplayAccountBalance ();
    void updateAndDisplay ( int accountid );
  };

#endif

#ifndef COLORLISTITEM_H
#define COLORLISTITEM_H

class ColorListItem : public QListViewItem
  {
    public:

      ColorListItem ( QListView *parent );
      ColorListItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4 );
      ColorListItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5 );

      virtual void paintCell ( QPainter *p, const QColorGroup &cg, int column, int width, int alignment );
  };

#endif