summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kbudgetvalues.h
blob: eed16ebf12a49af693f384bc1339c94d51f5e4f0 (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
/***************************************************************************
                          kbudgetvalues  -  description
                             -------------------
    begin                : Wed Nov 28 2007
    copyright            : (C) 2007 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 KBUDGETVALUES_H
#define KBUDGETVALUES_H

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

#include <tqdatetime.h>
class TQLabel;

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

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

#include <kmymoney/kbudgetvaluesdecl.h>
#include <kmymoney/mymoneybudget.h>
class kMyMoneyEdit;

/**
 * @author Thomas Baumgart <ipwizard@users.sourceforge.net>
 */
class KBudgetValues : public KBudgetValuesDecl
{
  Q_OBJECT
  
  public:
    KBudgetValues(TQWidget* parent = 0, const char* name = 0);
    ~KBudgetValues();

    void setBudgetValues(const MyMoneyBudget& budget, const MyMoneyBudget::AccountGroup& budgetAccount);
    void budgetValues(const MyMoneyBudget& budget, MyMoneyBudget::AccountGroup& budgetAccount);
    void clear(void);

  private:
    void enableMonths(bool enabled);
    void fillMonthLabels(void);

  protected slots:
    void slotChangePeriod(int id);

    /**
     * This slot clears the value in the value widgets of the selected budget type.
     * Values of the other types are unaffected.
     */
    void slotClearAllValues(void);

    /**
     * Helper slot used to postpone sending the valuesChanged() signal.
     */
    void slotNeedUpdate(void);

    void slotUpdateClearButton(void);

  protected:
    bool eventFilter(TQObject* o, TQEvent* e);

  private:
    kMyMoneyEdit*   m_field[12];
    TQLabel*         m_label[12];
    TQWidget*        m_currentTab;
    TQDate           m_budgetDate;

  signals:
    void valuesChanged(void);
};

#endif