Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/models/modelenums.h
1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
---|---|---|---|---|---|
2 | modelenums.h | 2 | modelenums.h | ||
3 | ------------------- | 3 | ------------------- | ||
4 | copyright : (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | 4 | copyright : (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | ||
5 | 5 | | |||
6 | ***************************************************************************/ | 6 | ***************************************************************************/ | ||
7 | 7 | | |||
8 | /*************************************************************************** | 8 | /*************************************************************************** | ||
9 | * * | 9 | * * | ||
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * | ||
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * | ||
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * | ||
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * | ||
14 | * * | 14 | * * | ||
15 | ***************************************************************************/ | 15 | ***************************************************************************/ | ||
16 | 16 | | |||
17 | #include <QHash> | 17 | #include <QHashFunctions> | ||
18 | #include <qnamespace.h> | ||||
18 | 19 | | |||
19 | #ifndef MODELENUMS_H | 20 | #ifndef MODELENUMS_H | ||
20 | #define MODELENUMS_H | 21 | #define MODELENUMS_H | ||
21 | 22 | | |||
22 | namespace eAccountsModel { | 23 | namespace eAccountsModel { | ||
23 | enum class Column { | 24 | enum class Column { | ||
24 | FirstColumnMarker = 0, | 25 | FirstColumnMarker = 0, | ||
25 | Account = 0, // CAUTION! Assumption is being made that Account column number is always 0 and you shouldn't change this | 26 | Account = 0, // CAUTION! Assumption is being made that Account column number is always 0 and you shouldn't change this | ||
Show All 19 Lines | 41 | enum class Role { | |||
45 | Value = Qt::UserRole + 4, /**< The account value (the balance converted to base currency) is stored in this role in column 0 as a MyMoneyMoney object.*/ | 46 | Value = Qt::UserRole + 4, /**< The account value (the balance converted to base currency) is stored in this role in column 0 as a MyMoneyMoney object.*/ | ||
46 | TotalValue = Qt::UserRole + 5, /**< The account total value (the value of the account and of child accounts) is stored in this role in column 0 as a MyMoneyMoney object.*/ | 47 | TotalValue = Qt::UserRole + 5, /**< The account total value (the value of the account and of child accounts) is stored in this role in column 0 as a MyMoneyMoney object.*/ | ||
47 | DisplayOrder = Qt::UserRole + 9, /**< This role is used by the filtering proxies to order the accounts for displaying.*/ | 48 | DisplayOrder = Qt::UserRole + 9, /**< This role is used by the filtering proxies to order the accounts for displaying.*/ | ||
48 | FullName = Qt::UserRole + 10, /**< This role is used to provide the full pathname of the account */ | 49 | FullName = Qt::UserRole + 10, /**< This role is used to provide the full pathname of the account */ | ||
49 | }; | 50 | }; | ||
50 | 51 | | |||
51 | inline uint qHash(const Role key, uint seed) { return ::qHash(static_cast<uint>(key), seed); } | 52 | inline uint qHash(const Role key, uint seed) { return ::qHash(static_cast<uint>(key), seed); } | ||
52 | } | 53 | } | ||
54 | | ||||
55 | namespace eLedgerModel { | ||||
56 | enum class Column { | ||||
57 | Number = 0, | ||||
58 | Date, | ||||
59 | Security, | ||||
60 | CostCenter, | ||||
61 | Detail, | ||||
62 | Reconciliation, | ||||
63 | Payment, | ||||
64 | Deposit, | ||||
65 | Quantity, | ||||
66 | Price, | ||||
67 | Amount, | ||||
68 | Value, | ||||
69 | Balance, | ||||
70 | | ||||
71 | // insert new columns above this line | ||||
72 | LastColumn | ||||
73 | }; | ||||
74 | | ||||
75 | enum class Role { | ||||
76 | // Roles returning values | ||||
77 | PostDate = Qt::UserRole, | ||||
78 | PayeeName, | ||||
79 | Account, | ||||
80 | CounterAccount, | ||||
81 | SplitCount, | ||||
82 | Reconciliation, | ||||
83 | ReconciliationShort, | ||||
84 | ReconciliationLong, | ||||
85 | SplitShares, | ||||
86 | ShareAmount, | ||||
87 | ShareAmountSuffix, | ||||
88 | SplitValue, | ||||
89 | Memo, | ||||
90 | SingleLineMemo, | ||||
91 | Number, | ||||
92 | Erroneous, | ||||
93 | Import, | ||||
94 | Split, | ||||
95 | Transaction, | ||||
96 | | ||||
97 | // Roles returning ids | ||||
98 | TransactionId, | ||||
99 | SplitId, | ||||
100 | TransactionSplitId, | ||||
101 | PayeeId, | ||||
102 | AccountId, | ||||
103 | CounterAccountId, | ||||
104 | CostCenterId, | ||||
105 | ScheduleId, | ||||
106 | TransactionCommodity, | ||||
107 | | ||||
108 | // A pseudo role to emit the dataChanged() signal when | ||||
109 | // used with setData() | ||||
110 | EmitDataChanged | ||||
111 | | ||||
112 | }; | ||||
113 | } | ||||
114 | | ||||
53 | #endif | 115 | #endif |