GnuCash  5.6-150-g038405b370+
gncEntryLedger.h
Go to the documentation of this file.
1 /*
2  * gncEntryLedger.h -- a ledger widget for manipulating GncEntry's
3  * Copyright (C) 2001, 2003 Derek Atkins
4  * Author: Derek Atkins <warlord@MIT.EDU>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, contact:
18  *
19  * Free Software Foundation Voice: +1-617-542-5942
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
21  * Boston, MA 02110-1301, USA gnu@gnu.org
22  */
23 
24 #ifndef GNC_ENTRY_LEDGER_H
25 #define GNC_ENTRY_LEDGER_H
26 
27 #include "qof.h"
28 #include "gncEntry.h"
29 #include "gncOrder.h"
30 #include "table-allgui.h"
38 typedef enum
39 {
40  GNC_ENTRY_ORDER_NONE = -1, //Force clang to use int representation of enum.
41  GNCENTRY_ORDER_ENTRY,
42  GNCENTRY_ORDER_VIEWER,
43  GNCENTRY_INVOICE_ENTRY,
44  GNCENTRY_INVOICE_VIEWER,
45  GNCENTRY_CUST_CREDIT_NOTE_ENTRY,
46  GNCENTRY_CUST_CREDIT_NOTE_VIEWER,
47  GNCENTRY_BILL_ENTRY,
48  GNCENTRY_BILL_VIEWER,
49  GNCENTRY_VEND_CREDIT_NOTE_ENTRY,
50  GNCENTRY_VEND_CREDIT_NOTE_VIEWER,
51  GNCENTRY_EXPVOUCHER_ENTRY,
52  GNCENTRY_EXPVOUCHER_VIEWER,
53  GNCENTRY_EMPL_CREDIT_NOTE_ENTRY,
54  GNCENTRY_EMPL_CREDIT_NOTE_VIEWER,
55  GNCENTRY_NUM_REGISTER_TYPES
56 } GncEntryLedgerType;
57 
58 #define ENTRY_IACCT_CELL "inv-account"
59 #define ENTRY_BACCT_CELL "bill-account"
60 #define ENTRY_ACTN_CELL "action"
61 #define ENTRY_DATE_CELL "date"
62 #define ENTRY_DESC_CELL "description"
63 #define ENTRY_DISC_CELL "discount"
64 #define ENTRY_DISTYPE_CELL "discount-type"
65 #define ENTRY_DISHOW_CELL "discount-how"
66 #define ENTRY_PRIC_CELL "price"
67 #define ENTRY_QTY_CELL "quantity"
68 #define ENTRY_TAXABLE_CELL "istaxable"
69 #define ENTRY_TAXTABLE_CELL "taxtable"
70 #define ENTRY_TAXINCLUDED_CELL "taxincluded"
71 #define ENTRY_BILLABLE_CELL "isbillable"
72 
73 #define ENTRY_INV_CELL "isinvoiced"
74 #define ENTRY_VALUE_CELL "line-value"
75 #define ENTRY_TAXVAL_CELL "line-tax-val"
76 
77 #define ENTRY_PAYMENT_CELL "payment"
78 
79 typedef struct GncEntryLedger_s GncEntryLedger;
80 
81 /* Prototypes ***************************************************/
82 
84 GncEntryLedger * gnc_entry_ledger_new (QofBook *book, GncEntryLedgerType type);
85 
87 void gnc_entry_ledger_set_default_order (GncEntryLedger *ledger,
88  GncOrder *order);
89 
91 void gnc_entry_ledger_set_default_invoice (GncEntryLedger *ledger,
92  GncInvoice *invoice);
93 
95 void gnc_entry_ledger_destroy (GncEntryLedger *ledger);
96 
98 GncEntry * gnc_entry_ledger_get_current_entry (GncEntryLedger *ledger);
99 
101 void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list);
102 
103 void gnc_entry_ledger_display_refresh (GncEntryLedger *ledger);
104 
106 Table * gnc_entry_ledger_get_table (GncEntryLedger *ledger);
107 
108 void gnc_entry_ledger_set_parent (GncEntryLedger *ledger, GtkWidget *parent);
109 
110 void gnc_entry_ledger_set_readonly (GncEntryLedger *ledger, gboolean readonly);
111 
112 gboolean gnc_entry_ledger_changed (GncEntryLedger *ledger);
113 
114 void gnc_entry_ledger_cancel_cursor_changes (GncEntryLedger *ledger);
115 
117 gboolean gnc_entry_ledger_commit_entry (GncEntryLedger *ledger);
118 
120 gboolean gnc_entry_ledger_check_close (GtkWidget *parent, GncEntryLedger *ledger);
121 
122 void gnc_entry_ledger_reset_query (GncEntryLedger *ledger);
123 
126 GncEntry * gnc_entry_ledger_get_entry (GncEntryLedger *ledger,
127  VirtualCellLocation vcell_loc);
128 
131 GncEntry * gnc_entry_ledger_get_blank_entry (GncEntryLedger *ledger);
132 
136 gboolean gnc_entry_ledger_get_entry_virt_loc (GncEntryLedger *ledger,
137  const GncEntry *entry,
138  VirtualCellLocation *vcell_loc);
139 
140 void gnc_entry_ledger_delete_current_entry (GncEntryLedger *ledger);
141 void gnc_entry_ledger_duplicate_current_entry (GncEntryLedger *ledger);
142 
150 void gnc_entry_ledger_move_current_entry_updown (GncEntryLedger *ledger,
151  gboolean move_up);
152 
153 QofQuery * gnc_entry_ledger_get_query (GncEntryLedger *ledger);
154 
155 void gnc_entry_ledger_set_prefs_group (GncEntryLedger *ledger, const gchar *string);
157 #endif /* GNC_ENTRY_LEDGER_H */
GncEntry * gnc_entry_ledger_get_entry(GncEntryLedger *ledger, VirtualCellLocation vcell_loc)
Returns the GncEntry at the given location, or NULL if the location is not valid. ...
void gnc_entry_ledger_move_current_entry_updown(GncEntryLedger *ledger, gboolean move_up)
This implements the command of moving the current entry (where the cursor is currently located) one r...
GncEntryLedger * gnc_entry_ledger_new(QofBook *book, GncEntryLedgerType type)
Create and return a new GncEntry Ledger.
GncEntry * gnc_entry_ledger_get_current_entry(GncEntryLedger *ledger)
Returns the Entry where the cursor is currently located.
GtkWidget * parent
A Hint for where to display.
void gnc_entry_ledger_set_default_order(GncEntryLedger *ledger, GncOrder *order)
Set the default order for this ledger.
gboolean gnc_entry_ledger_check_close(GtkWidget *parent, GncEntryLedger *ledger)
This will ask the user if they really want to make a change.
void gnc_entry_ledger_destroy(GncEntryLedger *ledger)
Destroy the GncEntry Ledger.
Declarations for the Table object.
void gnc_entry_ledger_set_default_invoice(GncEntryLedger *ledger, GncInvoice *invoice)
Set the default invoice for this ledger.
Table * gnc_entry_ledger_get_table(GncEntryLedger *ledger)
Get the Table.
void gnc_entry_ledger_load(GncEntryLedger *ledger, GList *entry_list)
Copy GncEntry information from the list to the rows of the Ledger.
Business Entry Interface.
gboolean gnc_entry_ledger_get_entry_virt_loc(GncEntryLedger *ledger, const GncEntry *entry, VirtualCellLocation *vcell_loc)
Looks up the cell location of the given "entry" and writes the location into the variable pointed to ...
A Query.
Definition: qofquery.cpp:74
GncEntry * gnc_entry_ledger_get_blank_entry(GncEntryLedger *ledger)
Returns the GncEntry that represents the blank new line at the bottom of the ledger.
gboolean gnc_entry_ledger_commit_entry(GncEntryLedger *ledger)
This will act just like hitting &#39;return&#39; to record an entry.