1 /*
2  * Copyright 2017       Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef WIDGETENUMS_H
19 #define WIDGETENUMS_H
20 
21 #include <qnamespace.h>
22 
23 namespace eWidgets {
24 
25   enum class SortField {
26   Unknown = 0,      ///< unknown sort criteria
27   PostDate = 1,     ///< sort by post date
28   EntryDate,        ///< sort by entry date
29   Payee,            ///< sort by payee name
30   Value,            ///< sort by value
31   NoSort,               ///< sort by number field
32   EntryOrder,       ///< sort by entry order
33   Type,             ///< sort by CashFlowDirection
34   Category,         ///< sort by Category
35   ReconcileState,   ///< sort by reconciliation state
36   Security,         ///< sort by security (only useful for investment accounts)
37   // insert new values in front of this line
38   MaxFields
39   };
40 
41   namespace eTransaction {
42     enum class Column {
43       Number = 0,
44       Date,
45       Account,
46       Security,
47       Detail,
48       ReconcileFlag,
49       Payment,
50       Deposit,
51       Quantity,
52       Price,
53       Value,
54       Balance,
55       // insert new values above this line
56       LastColumn
57     };
58   }
59 
60   namespace eTransactionForm {
61     enum class Column {
62       Label1 = 0,
63       Value1,
64       Label2,
65       Value2,
66       // insert new values above this line
67       LastColumn
68     };
69   }
70 
71   namespace eTabBar {
72     enum class SignalEmission {
73       Normal = 0,      // standard signal behaviour
74       Never,           // don't signal selection of a tab at all
75       Always           // always signal selection of a tab
76     };
77   }
78 
79   namespace eRegister {
80     enum class ItemState {
81       Any,
82       Imported,
83       Matched,
84       Erroneous,
85       NotMarked,
86       NotReconciled,
87       Cleared,
88       Scheduled
89     };
90 
91     enum class Action {
92       None = -1,
93       Check = 0,
94       /* these should be values which qt 3.3 never uses for QTab:
95        * qt starts upwards from 0
96        */
97       Deposit = 12201,
98       Transfer = 12202,
99       Withdrawal = 12203,
100       Atm,
101       // insert new values above this line
102       LastAction
103     };
104 
105     enum class CashFlowDirection {
106       Deposit = 0,          //< transaction is deposit
107       Payment,              //< transaction is payment
108       Unknown               //< transaction cashflow is unknown
109     };
110 
111     enum class DetailColumn {
112       PayeeFirst = 0,       ///< show the payee on the first row of the transaction in the details column and the account on the second
113       AccountFirst          ///< show the account on the first row of the transaction in the details column and the payee on the second
114     };
115   }
116 
117   namespace ValidationFeedback {
118     enum class MessageType {
119       None,
120       Positive,
121       Information,
122       Warning,
123       Error
124     };
125   }
126 
127   namespace Selector {
128     enum class Role {
129       Id = Qt::UserRole,      /**< The id is stored in this role in column 0 as a string.*/
130       Key = Qt::UserRole + 1, /**< The key is stored in this role in column 0 as a string.*/
131     };
132   }
133 
134 }
135 
136 #endif
137