summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/stdtransactiondownloaded.h
blob: 9efd54a3d57303490c3c078083279b8166144edb (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/***************************************************************************
                          stdtransactiondownloaded.h
                             -------------------
    begin                : Sun May 11 2008
    copyright            : (C) 2008 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 STDTRANSACTIONDOWNLOADED_H
#define STDTRANSACTIONDOWNLOADED_H

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

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

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

#include <kmymoney/transaction.h>

namespace KMyMoneyTransactionForm {
  class TransactionForm;
}; // namespace

namespace KMyMoneyRegister {

class StdTransactionDownloaded : public StdTransaction
{
public:
  StdTransactionDownloaded(Register* parent, const MyMoneyTransaction& transaction, const MyMoneySplit& split, int uniqueId);
  virtual ~StdTransactionDownloaded() {}

  virtual const char* className(void) { return "StdTransactionDownloaded"; }

  /**
   * This method sets the general paramaters required for the painting of a cell
   * in the register. These are:
   *
   * - background color (alternating)
   * - background color (imported transaction)
   * - background color (matched transaction)
   * - background color (selected transaction)
   * - cellRect (area covering the cell)
   * - textRect (area covering the text)
   * - color of the pen to do the painting of text and lines
   *
   * @param painter pointer to the TQPainter object
   * @param row vertical index of cell in register
   * @param col horizontal index of cell in register
   * @param cellRect ref to TQRect object receiving the area information for the cell
   * @param textRect ref to TQRect object receiving the area information for the text
   * @param cg ref to TQColorGroup object receiving the color information to be used
   * @param brush ref to TQBrush object receiveing the brush information to be used
   */
  virtual bool paintRegisterCellSetup(TQPainter* painter, int& row, int& col, TQRect& cellRect, TQRect& textRect, TQColorGroup& cg, TQBrush& brush);

#if 0
  virtual void paintRegisterCell(TQPainter* painter, int row, int col, const TQRect& r, bool selected, const TQColorGroup& cg);

  bool formCellText(TQString& txt, int& align, int row, int col, TQPainter* painter = 0);
  void registerCellText(TQString& txt, int& align, int row, int col, TQPainter* painter = 0);

  int numColsForm(void) const { return 4; }

  void arrangeWidgetsInForm(TQMap<TQString, TQWidget*>& editWidgets);
  void arrangeWidgetsInRegister(TQMap<TQString, TQWidget*>& editWidgets);
  void tabOrderInForm(TQWidgetList& tabOrderWidgets) const;
  void tabOrderInRegister(TQWidgetList& tabOrderWidgets) const;

  int numRowsRegister(bool expanded) const;
#endif

  /**
    * Provided for internal reasons. No API change. See RegisterItem::numRowsRegister()
    */
  int numRowsRegister(void) const { return StdTransaction::numRowsRegister(); }
};

class InvestTransactionDownloaded : public InvestTransaction
{
  public:
    InvestTransactionDownloaded(Register* parent, const MyMoneyTransaction& transaction, const MyMoneySplit& split, int uniqueId);
    virtual ~InvestTransactionDownloaded() {}

    virtual const char* className(void) { return "InvestTransactionDownloaded"; }

  /**
     * This method sets the general paramaters required for the painting of a cell
   * in the register. These are:
     *
     * - background color (alternating)
     * - background color (imported transaction)
     * - background color (matched transaction)
     * - background color (selected transaction)
     * - cellRect (area covering the cell)
     * - textRect (area covering the text)
     * - color of the pen to do the painting of text and lines
     *
     * @param painter pointer to the TQPainter object
     * @param row vertical index of cell in register
     * @param col horizontal index of cell in register
     * @param cellRect ref to TQRect object receiving the area information for the cell
     * @param textRect ref to TQRect object receiving the area information for the text
     * @param cg ref to TQColorGroup object receiving the color information to be used
     * @param brush ref to TQBrush object receiveing the brush information to be used
   */
    virtual bool paintRegisterCellSetup(TQPainter* painter, int& row, int& col, TQRect& cellRect, TQRect& textRect, TQColorGroup& cg, TQBrush& brush);
  /**
     * Provided for internal reasons. No API change. See RegisterItem::numRowsRegister()
   */
    int numRowsRegister(void) const { return InvestTransaction::numRowsRegister(); }
};


}; // namespace

#endif