GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
split-register.h
Go to the documentation of this file.
1 /********************************************************************\
2  * split-register.h -- split register API *
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 [email protected] *
20  * *
21 \********************************************************************/
140 #ifndef SPLIT_REGISTER_H
141 #define SPLIT_REGISTER_H
142 
143 #include <glib.h>
144 
145 #include "Transaction.h"
146 #include "table-allgui.h"
147 
152 typedef enum
153 {
154  BANK_REGISTER,
155  CASH_REGISTER,
156  ASSET_REGISTER,
157  CREDIT_REGISTER,
158  LIABILITY_REGISTER,
159  INCOME_REGISTER,
160  EXPENSE_REGISTER,
161  EQUITY_REGISTER,
162  STOCK_REGISTER,
163  CURRENCY_REGISTER,
164  RECEIVABLE_REGISTER,
165  PAYABLE_REGISTER,
166  TRADING_REGISTER,
167  NUM_SINGLE_REGISTER_TYPES,
168 
169  GENERAL_LEDGER = NUM_SINGLE_REGISTER_TYPES,
170  INCOME_LEDGER,
171  PORTFOLIO_LEDGER,
172  SEARCH_LEDGER,
173 
174  NUM_REGISTER_TYPES
176 
178 typedef enum
179 {
180  REG_STYLE_LEDGER,
181  REG_STYLE_AUTO_LEDGER,
182  REG_STYLE_JOURNAL
184 
189 #define ACTN_CELL "action"
190 #define BALN_CELL "balance"
191 #define CRED_CELL "credit"
192 #define DATE_CELL "date"
193 #define DDUE_CELL "date-due"
194 #define DEBT_CELL "debit"
195 #define DESC_CELL "description"
196 #define FCRED_CELL "credit-formula"
197 #define FDEBT_CELL "debit-formula"
198 #define MEMO_CELL "memo"
199 #define MXFRM_CELL "transfer"
200 #define NOTES_CELL "notes"
201 #define NUM_CELL "num"
202 #define TNUM_CELL "trans-num"
203 #define PRIC_CELL "price"
204 #define RATE_CELL "exchrate"
205 #define RECN_CELL "reconcile"
206 #define SHRS_CELL "shares"
207 #define TBALN_CELL "trans-balance"
208 #define TCRED_CELL "trans-credit"
209 #define TDEBT_CELL "trans-debit"
210 #define TSHRS_CELL "trans-shares"
211 #define TYPE_CELL "split-type"
212 #define XFRM_CELL "account"
213 #define VNOTES_CELL "void-notes"
214 #define RBALN_CELL "reg-run-balance"
215 
222 #define CURSOR_SINGLE_LEDGER "cursor-single-ledger"
223 #define CURSOR_DOUBLE_LEDGER "cursor-double-ledger"
224 #define CURSOR_DOUBLE_LEDGER_NUM_ACTN "cursor-double-ledger-num-actn"
225 #define CURSOR_SINGLE_JOURNAL "cursor-single-journal"
226 #define CURSOR_DOUBLE_JOURNAL "cursor-double-journal"
227 #define CURSOR_DOUBLE_JOURNAL_NUM_ACTN "cursor-double-journal-num-actn"
228 #define CURSOR_SPLIT "cursor-split"
229 
233 typedef enum
234 {
235  CURSOR_CLASS_NONE = -1,
236  CURSOR_CLASS_SPLIT,
237  CURSOR_CLASS_TRANS,
238  NUM_CURSOR_CLASSES
239 } CursorClass;
240 
241 
244 typedef struct sr_info SRInfo;
245 
248 {
251  SplitRegisterType type;
252  SplitRegisterStyle style;
253 
254  gboolean use_double_line;
258  gboolean is_template;
259  gboolean do_auto_complete;
262 };
263 
265 typedef GtkWidget *(*SRGetParentCallback) (gpointer user_data);
266 
267 
268 /* Prototypes ******************************************************/
269 
284  SplitRegisterStyle style,
285  gboolean use_double_line,
286  gboolean is_template);
287 
293 
306  SplitRegisterType type,
307  SplitRegisterStyle style,
308  gboolean use_double_line);
309 
317  gboolean do_auto_complete);
318 
325 void gnc_split_register_set_read_only (SplitRegister *reg, gboolean read_only);
326 
327 
335  Account *template_account);
336 
338 void gnc_split_register_set_data (SplitRegister *reg, gpointer user_data,
339  SRGetParentCallback get_parent);
340 
348 
358 (SplitRegister *reg,
359  VirtualCellLocation vcell_loc);
360 
369 
380 Split *
382  VirtualCellLocation *vcell_loc);
383 
392 
401 
416 gboolean
418  VirtualCellLocation *vcell_loc);
419 
432 gboolean
434  VirtualLocation *virt_loc);
435 
441 
445 
449 
453 
457 
461 
465  const char *reason);
466 
470 
474 void gnc_split_register_empty_current_trans (SplitRegister *reg);
475 
480 
485 
503 void gnc_split_register_load (SplitRegister *reg, GList * slist,
504  Account *default_account);
505 
513 gboolean gnc_split_register_save (SplitRegister *reg, gboolean do_commit);
514 
517 
520 
525  gboolean show_present);
526 
529  gboolean expand);
530 
533 
536 
539 
542 
543 
549 gboolean
550 gnc_split_register_handle_exchange (SplitRegister *reg, gboolean force_dialog);
551 
552 /* returns TRUE if begin_edit was aborted */
553 gboolean
554 gnc_split_register_begin_edit_or_warn(SRInfo *info, Transaction *trans);
555 
560 /* -------------------------------------------------------------- */
561 
564 
567  gboolean use_cut_semantics,
568  gboolean do_commit);
569 
570 #endif
void gnc_copy_trans_onto_trans(Transaction *from, Transaction *to, gboolean use_cut_semantics, gboolean do_commit)
Transaction * gnc_split_register_get_current_trans(SplitRegister *reg)
const char * gnc_split_register_get_debit_string(SplitRegister *reg)
void gnc_split_register_void_current_trans(SplitRegister *reg, const char *reason)
void gnc_split_register_cancel_cursor_split_changes(SplitRegister *reg)
void gnc_split_register_copy_current(SplitRegister *reg)
The type, style and table for the register.
gboolean use_tran_num_for_num_field
void gnc_split_register_unvoid_current_trans(SplitRegister *reg)
Split * gnc_split_register_get_current_split(SplitRegister *reg)
void gnc_split_register_delete_current_split(SplitRegister *reg)
Split * gnc_split_register_get_blank_split(SplitRegister *reg)
void gnc_split_register_collapse_current_trans(SplitRegister *reg)
CursorClass gnc_split_register_get_cursor_class(SplitRegister *reg, VirtualCellLocation vcell_loc)
gboolean gnc_split_register_full_refresh_ok(SplitRegister *reg)
SplitRegister * gnc_split_register_new(SplitRegisterType type, SplitRegisterStyle style, gboolean use_double_line, gboolean is_template)
Split * gnc_split_register_get_current_trans_split(SplitRegister *reg, VirtualCellLocation *vcell_loc)
gboolean gnc_split_register_changed(SplitRegister *reg)
SplitRegisterType
Register types.
void gnc_split_register_expand_current_trans(SplitRegister *reg, gboolean expand)
gboolean gnc_split_register_save(SplitRegister *reg, gboolean do_commit)
void gnc_split_register_set_auto_complete(SplitRegister *reg, gboolean do_auto_complete)
void gnc_split_register_redraw(SplitRegister *reg)
gboolean use_double_line
gboolean gnc_split_register_get_split_virt_loc(SplitRegister *reg, Split *split, VirtualCellLocation *vcell_loc)
void gnc_split_register_paste_current(SplitRegister *reg)
gboolean do_auto_complete
GtkWidget *(* SRGetParentCallback)(gpointer user_data)
void gnc_split_register_set_template_account(SplitRegister *reg, Account *template_account)
gboolean gnc_split_register_current_trans_expanded(SplitRegister *reg)
void gnc_split_register_empty_current_trans_except_split(SplitRegister *reg, Split *split)
void gnc_split_register_set_read_only(SplitRegister *reg, gboolean read_only)
CursorClass
const char * gnc_split_register_get_credit_string(SplitRegister *reg)
gboolean gnc_split_register_handle_exchange(SplitRegister *reg, gboolean force_dialog)
Definition: SplitP.h:71
void gnc_split_register_load(SplitRegister *reg, GList *slist, Account *default_account)
CursorClass gnc_split_register_get_current_cursor_class(SplitRegister *reg)
Declarations for the Table object.
void gnc_split_register_delete_current_trans(SplitRegister *reg)
gboolean gnc_split_register_get_split_amount_virt_loc(SplitRegister *reg, Split *split, VirtualLocation *virt_loc)
Split * gnc_split_register_duplicate_current(SplitRegister *reg)
void gnc_split_register_show_present_divider(SplitRegister *reg, gboolean show_present)
void gnc_split_register_destroy(SplitRegister *reg)
void gnc_split_register_set_data(SplitRegister *reg, gpointer user_data, SRGetParentCallback get_parent)
void gnc_split_register_cut_current(SplitRegister *reg)
SplitRegisterStyle
API for Transactions and Splits (journal entries)
void gnc_split_register_cancel_cursor_trans_changes(SplitRegister *reg)
void gnc_split_register_config(SplitRegister *reg, SplitRegisterType type, SplitRegisterStyle style, gboolean use_double_line)