GnuCash  5.6-150-g038405b370+
split-register-p.h
Go to the documentation of this file.
1 /********************************************************************\
2  * split-register-p.h -- private split register declarations *
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, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA gnu@gnu.org *
20  * *
21 \********************************************************************/
22 
23 #ifndef SPLIT_REGISTER_P_H
24 #define SPLIT_REGISTER_P_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include "split-register.h"
31 
39 #define SPLIT_TRANS_STR _("-- Split Transaction --")
40 #define STOCK_SPLIT_STR _("-- Stock Split --")
41 
42 #define ACTION_BUY_STR _("Buy")
43 #define ACTION_SELL_STR _("Sell")
44 
45 typedef enum {
46  RATE_RESET_NOT_REQD = 0,
47  RATE_RESET_REQD = 1,
48  RATE_RESET_DONE = 2
49 } RateReset_t;
50 
51 struct sr_info
52 {
55 
58 
60  Transaction *cursor_hint_trans;
61 
64 
67 
70 
73 
75  gboolean traverse_to_new;
76 
79  gboolean exact_traversal;
80 
83  gboolean trans_expanded;
84 
86  gboolean reg_loaded;
87 
89  gboolean full_refresh;
90 
93 
96 
99 
103 
105  gboolean first_pass;
106 
108  gboolean quickfill_setup;
109 
113 
118  RateReset_t rate_reset;
119 
121  gboolean auto_complete;
122 
125 
127  gpointer user_data;
128 
131 
134 
136  const char *debit_str;
137  const char *credit_str;
138  char *tdebit_str;
139  char *tcredit_str;
140 
143 };
144 
145 
146 SRInfo * gnc_split_register_get_info (SplitRegister *reg);
147 
148 GtkWidget *gnc_split_register_get_parent (SplitRegister *reg);
149 
150 Split * gnc_split_register_get_split (SplitRegister *reg,
151  VirtualCellLocation vcell_loc);
152 
153 Account * gnc_split_register_get_default_account (SplitRegister *reg);
154 
155 Transaction * gnc_split_register_get_trans (SplitRegister *reg,
156  VirtualCellLocation vcell_loc);
157 
158 Split *
159 gnc_split_register_get_trans_split (SplitRegister *reg,
160  VirtualCellLocation vcell_loc,
161  VirtualCellLocation *trans_split_loc);
162 
163 gboolean gnc_split_register_find_split (SplitRegister *reg,
164  Transaction *trans, Split *trans_split,
165  Split *split, CursorClass cursor_class,
166  VirtualCellLocation *vcell_loc);
167 
168 void gnc_split_register_show_trans (SplitRegister *reg,
169  VirtualCellLocation start_loc);
170 
181 void gnc_split_register_set_trans_visible (SplitRegister *reg,
182  VirtualCellLocation vcell_loc,
183  gboolean visible,
184  gboolean only_blank_split);
185 
186 void gnc_split_register_set_cell_fractions (SplitRegister *reg, Split *split);
187 
188 CellBlock * gnc_split_register_get_passive_cursor (SplitRegister *reg);
189 CellBlock * gnc_split_register_get_active_cursor (SplitRegister *reg);
190 
191 void gnc_split_register_set_last_num (SplitRegister *reg, const char *num);
192 
193 Account * gnc_split_register_get_account_by_name(
194  SplitRegister *reg, BasicCell * cell, const char *name);
195 Account * gnc_split_register_get_account (SplitRegister *reg,
196  const char *cell_name);
197 
198 gboolean gnc_split_register_recn_cell_confirm (char old_flag, gpointer data);
199 
200 gboolean gnc_split_register_check_cell (SplitRegister *reg,
201  const char *cell_name);
202 
203 CursorClass gnc_split_register_cursor_name_to_class (const char *cursor_name);
204 
205 gnc_numeric gnc_split_register_debcred_cell_value (SplitRegister *reg);
206 
211 gboolean gnc_split_register_split_needs_amount(
212  SplitRegister *reg, Split *split);
213 gboolean gnc_split_register_needs_conv_rate(
214  SplitRegister *reg, Transaction *txn, Account *acc);
215 
216 #ifdef __cplusplus
217 }
218 #endif
219 
221 #endif
Split * cursor_hint_trans_split
A split used to remember where to put the cursor.
gboolean full_refresh
flag indicating whether full refresh is ok
gpointer user_data
User data for users of SplitRegisters.
void gnc_split_register_set_trans_visible(SplitRegister *reg, VirtualCellLocation vcell_loc, gboolean visible, gboolean only_blank_split)
Set the visibility of the split rows belonging to a transaction located at vcell_loc.
STRUCTS.
GncGUID pending_trans_guid
The currently open transaction, if any.
gboolean trans_expanded
Indicates that the current transaction is expanded in ledger mode.
gboolean gnc_split_reg_has_rate_cell(SplitRegisterType type)
Determine if we need to perform any conversion on the splits in this transaction, and if so...
gboolean traverse_to_new
If traverse is to the newly created split.
gboolean change_confirmed
true if the user has already confirmed changes of a reconciled split
time64 last_date_entered
The last date recorded in the blank split.
SRGetParentCallback get_parent
hook to get parent widget
GncGUID template_account
The template account which template transaction should belong to.
gboolean reg_loaded
set to TRUE after register is loaded
CursorClass
Types of cursors.
gboolean hint_set_by_traverse
If the hints were set by the traverse callback.
gboolean first_pass
true if we are loading the register for the first time
gboolean auto_complete
true if the transaction being edited was auto-filled
GncGUID default_account
The default account where new splits are added.
gboolean show_present_divider
true if the demarcation between 'past' and 'future' transactions should be visible ...
API for checkbook register display area.
CursorClass cursor_hint_cursor_class
Used to remember where to put the cursor.
gboolean separator_changed
true if the account separator has changed
Transaction * cursor_hint_trans
A transaction used to remember where to put the cursor.
Split * cursor_hint_split
A split used to remember where to put the cursor.
gboolean blank_split_edited
true if the current blank split has been edited and committed
GtkWidget *(* SRGetParentCallback)(gpointer user_data)
Callback function type.
gboolean quickfill_setup
true if we have setup the quickfills
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
Definition: gnc-date.h:87
RateReset_t rate_reset
RATE_RESET_NOT_REQD => No exchange rate dialog needed for current split RATE_RESET_REQD => Need new e...
const char * debit_str
configured strings for debit/credit headers
gboolean exact_traversal
A flag indicating if the last traversal was 'exact'.
Account * rate_account
account on the current split when the exchange rate was last set
SplitRegisterType
Register types.
The type used to store guids in C.
Definition: guid.h:75
GncGUID blank_split_guid
The blank split at the bottom of the register.