Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

aqfinance / src / fox / lib / modules / accounts / fm_accstmpage.hpp @ 242027ca

History | View | Annotate | Download (3.02 KB)

1
/****************************************************************************
2
 * This file is part of the project AqFinance.
3
 * AqFinance (c) by 2009 Martin Preuss, all rights reserved.
4
 *
5
 * The license for this file can be found in the file COPYING which you
6
 * should have received along with this file.
7
 ****************************************************************************/
8

    
9
#ifndef FM_BANKACCSPLITPAGE_HPP
10
#define FM_BANKACCSPLITPAGE_HPP
11

    
12

    
13
#include "ff_modtabpage.hpp"
14

    
15
#include <aqfinance/engine/lib/book/ae_book.h>
16

    
17
#include <fx.h>
18

    
19

    
20
class FF_TransactionTable;
21
class FOX16_HtmlLabel;
22
class FM_AccountPage;
23

    
24

    
25
class FM_AccountStmPage: public FF_ModTabPage {
26
  FXDECLARE(FM_AccountStmPage)
27
public:
28
  enum {
29
    ID_SPLIT_TABLE=FXPacker::ID_LAST,
30
    ID_CMD_DELSPLIT,
31
    ID_CMD_ASSIGN_TO_BUY_PAYMENT,
32
    ID_CMD_ASSIGN_TO_SELL_PAYMENT,
33
    ID_CMD_CREATE_BUY_PAYMENT,
34
    ID_CMD_CREATE_SELL_PAYMENT,
35
    ID_CMD_MOVE_TO_ACCOUNT,
36
    ID_EDIT_SPLITS,
37
    ID_MATCHER,
38
    ID_CMD_ADDTRANS,
39
    ID_LAST
40
  };
41

    
42

    
43
  FM_AccountStmPage(const FXString &pageId,
44
                    FM_AccountPage *mainPage,
45
                    const AE_ACCOUNT *acc,
46
                    FXuint opts=0,
47
                    FXint x=0, FXint y=0, FXint w=0, FXint h=0);
48
  ~FM_AccountStmPage();
49

    
50
  AQDB_ID getBankAccountId() const { return m_accountId;};
51

    
52
  void init(GWEN_DB_NODE *db);
53
  void fini(GWEN_DB_NODE *db);
54

    
55
  void dbOpened(AE_BOOK *bk);
56
  void dbClosing();
57
  void dbClosed();
58
  void dbReload(AE_BOOK_TABLE_TYPE tt);
59

    
60
  void aboutToSendJobs();
61

    
62
  void enter();
63
  void leave();
64
  void reset();
65

    
66
  void create();
67

    
68
  long onCmdTable(FXObject*, FXSelector, void* ptr);
69
  long onTableRightButtonRelease(FXObject*, FXSelector, void* ptr);
70
  long onTableContentReplaced(FXObject*, FXSelector, void* ptr);
71
  long onCmdAddStm(FXObject*, FXSelector, void* ptr);
72
  long onCmdDelStm(FXObject*, FXSelector, void* ptr);
73
  long onCmdSplitEditor(FXObject*, FXSelector, void *ptr);
74

    
75
  long onCmdAssignToIncomingPayment(FXObject*, FXSelector, void *ptr);
76
  long onCmdAssignToOutgoingPayment(FXObject*, FXSelector, void *ptr);
77

    
78
  long onCmdCreateIncomingPayment(FXObject*, FXSelector, void *ptr);
79
  long onCmdCreateOutgoingPayment(FXObject*, FXSelector, void *ptr);
80

    
81
  long onCmdMoveToAccount(FXObject*, FXSelector, void* ptr);
82

    
83
  long onChgMatcher(FXObject*, FXSelector, void* ptr);
84

    
85
protected:
86
  FM_AccountStmPage();
87
  void rebuild();
88
  void reload();
89

    
90
  int readAccountSplits(AE_SPLIT_LIST *splits);
91
  int readAccountTransactions(AE_SPLIT_IDMAP *sMap,
92
                              AE_TRANSACTION_LIST *transactions,
93
                              AE_TRANSACTION_IDMAP *tMap);
94
  int readTransactionSplits(AE_TRANSACTION_IDMAP *tMap);
95

    
96
  FM_AccountPage *m_mainPage;
97

    
98
  AQDB_ID m_accountId;
99
  FOX16_HtmlLabel *m_hLabel;
100
  FOX16_HtmlLabel *m_fLabel;
101
  FF_TransactionTable *m_transTable;
102

    
103
  AE_ACCOUNT *m_account;
104
  AE_COMMODITY *m_accountCommodity;
105

    
106
  bool m_needReload;
107
  bool m_isVisible;
108
  bool m_blockReload;
109

    
110
  FXTextField *m_matcher;
111
  FXString m_tempMatcherString;
112

    
113
  AE_TRANSACTION_LIST *m_transactions;
114

    
115
};
116

    
117

    
118

    
119
#endif