transactionmatcher.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef TRANSACTIONMATCHER_H
00019 #define TRANSACTIONMATCHER_H
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <kmymoney/mymoneytransaction.h>
00031 #include <kmymoney/mymoneyaccount.h>
00032 class MyMoneySchedule;
00033
00034 class TransactionMatcher
00035 {
00036 public:
00037 typedef enum {
00038 notMatched = 0,
00039 matched,
00040 matchedExact,
00041 matchedDuplicate
00042 } autoMatchResultE;
00043
00044 TransactionMatcher(const MyMoneyAccount& acc);
00045
00078 void match(MyMoneyTransaction tm, MyMoneySplit sm, MyMoneyTransaction ti, MyMoneySplit si, bool allowImportedTransactions = false);
00079
00097 void unmatch(const MyMoneyTransaction& t, const MyMoneySplit& s);
00098
00110 void accept(const MyMoneyTransaction& t, const MyMoneySplit& s);
00111
00129 MyMoneyObject const * findMatch(const MyMoneyTransaction& ti, const MyMoneySplit& si, MyMoneySplit& sm, autoMatchResultE& result);
00130
00134 void setMatchWindow(int days) { m_days = days; }
00135
00136 private:
00137 void checkTransaction(const MyMoneyTransaction& tm, const MyMoneyTransaction& ti, const MyMoneySplit& si, QPair<MyMoneyTransaction, MyMoneySplit>& lastMatch, autoMatchResultE& result, int variation = 0) const;
00138
00139 private:
00140 MyMoneyAccount m_account;
00141 int m_days;
00142 };
00143
00144
00145 #endif