GnuCash 2.4.99
gncEntryLedger.h
00001 /*
00002  * gncEntryLedger.h -- a ledger widget for manipulating GncEntry's
00003  * Copyright (C) 2001, 2003 Derek Atkins
00004  * Author: Derek Atkins <warlord@MIT.EDU>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License as
00008  * published by the Free Software Foundation; either version 2 of
00009  * the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, contact:
00018  *
00019  * Free Software Foundation           Voice:  +1-617-542-5942
00020  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
00021  * Boston, MA  02110-1301,  USA       gnu@gnu.org
00022  */
00023 
00024 #ifndef GNC_ENTRY_LEDGER_H
00025 #define GNC_ENTRY_LEDGER_H
00026 
00027 #include "qof.h"
00028 #include "gncEntry.h"
00029 #include "gncOrder.h"
00030 #include "table-allgui.h"
00031 
00032 typedef enum
00033 {
00034     GNCENTRY_ORDER_ENTRY,
00035     GNCENTRY_ORDER_VIEWER,
00036     GNCENTRY_INVOICE_ENTRY,
00037     GNCENTRY_INVOICE_VIEWER,
00038     GNCENTRY_CUST_CREDIT_NOTE_ENTRY,
00039     GNCENTRY_CUST_CREDIT_NOTE_VIEWER,
00040     GNCENTRY_BILL_ENTRY,
00041     GNCENTRY_BILL_VIEWER,
00042     GNCENTRY_VEND_CREDIT_NOTE_ENTRY,
00043     GNCENTRY_VEND_CREDIT_NOTE_VIEWER,
00044     GNCENTRY_EXPVOUCHER_ENTRY,
00045     GNCENTRY_EXPVOUCHER_VIEWER,
00046     GNCENTRY_EMPL_CREDIT_NOTE_ENTRY,
00047     GNCENTRY_EMPL_CREDIT_NOTE_VIEWER,
00048     GNCENTRY_NUM_REGISTER_TYPES
00049 } GncEntryLedgerType;
00050 
00051 typedef struct entry_ledger_colors
00052 {
00053     guint32 header_bg_color;
00054 
00055     guint32 primary_bg_color;
00056     guint32 secondary_bg_color;
00057 
00058     guint32 primary_active_bg_color;
00059     guint32 secondary_active_bg_color;
00060 } GncEntryLedgerColors;
00061 
00062 #define ENTRY_IACCT_CELL        "inv-account"
00063 #define ENTRY_BACCT_CELL        "bill-account"
00064 #define ENTRY_ACTN_CELL         "action"
00065 #define ENTRY_DATE_CELL         "date"
00066 #define ENTRY_DESC_CELL         "description"
00067 #define ENTRY_DISC_CELL         "discount"
00068 #define ENTRY_DISTYPE_CELL      "discount-type"
00069 #define ENTRY_DISHOW_CELL       "discount-how"
00070 #define ENTRY_PRIC_CELL         "price"
00071 #define ENTRY_QTY_CELL          "quantity"
00072 #define ENTRY_TAXABLE_CELL      "istaxable"
00073 #define ENTRY_TAXTABLE_CELL     "taxtable"
00074 #define ENTRY_TAXINCLUDED_CELL  "taxincluded"
00075 #define ENTRY_BILLABLE_CELL     "isbillable"
00076 
00077 #define ENTRY_INV_CELL          "isinvoiced"
00078 #define ENTRY_VALUE_CELL        "line-value"
00079 #define ENTRY_TAXVAL_CELL       "line-tax-val"
00080 
00081 #define ENTRY_PAYMENT_CELL      "payment"
00082 
00083 typedef struct GncEntryLedger_s GncEntryLedger;
00084 
00087 /* Create and return a new GncEntry Ledger */
00088 GncEntryLedger * gnc_entry_ledger_new (QofBook *book, GncEntryLedgerType type);
00089 
00090 /* Set the default order for this ledger */
00091 void gnc_entry_ledger_set_default_order (GncEntryLedger *ledger,
00092         GncOrder *order);
00093 
00094 /* Set the default invoice for this ledger */
00095 void gnc_entry_ledger_set_default_invoice (GncEntryLedger *ledger,
00096         GncInvoice *invoice);
00097 
00098 /* Destroy the GncEntry Ledger */
00099 void gnc_entry_ledger_destroy (GncEntryLedger *ledger);
00100 
00101 /* Returns the Entry where the cursor is currently located. */
00102 GncEntry * gnc_entry_ledger_get_current_entry (GncEntryLedger *ledger);
00103 
00104 /* Copy GncEntry information from the list to the rows of the Ledger. */
00105 void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list);
00106 
00107 void gnc_entry_ledger_display_refresh (GncEntryLedger *ledger);
00108 
00109 /* Get the Table */
00110 Table * gnc_entry_ledger_get_table (GncEntryLedger *ledger);
00111 
00112 void gnc_entry_ledger_set_parent (GncEntryLedger *ledger, GtkWidget *parent);
00113 
00114 void gnc_entry_ledger_set_readonly (GncEntryLedger *ledger, gboolean readonly);
00115 
00116 gboolean gnc_entry_ledger_changed (GncEntryLedger *ledger);
00117 
00118 void gnc_entry_ledger_cancel_cursor_changes (GncEntryLedger *ledger);
00119 
00120 /* This will act just like hitting 'return' to record an entry */
00121 gboolean gnc_entry_ledger_commit_entry (GncEntryLedger *ledger);
00122 
00123 /* This will ask the user if they really want to make a change */
00124 gboolean gnc_entry_ledger_check_close (GtkWidget *parent, GncEntryLedger *ledger);
00125 
00126 void gnc_entry_ledger_reset_query (GncEntryLedger *ledger);
00127 
00130 GncEntry * gnc_entry_ledger_get_entry (GncEntryLedger *ledger,
00131                                        VirtualCellLocation vcell_loc);
00132 
00135 GncEntry * gnc_entry_ledger_get_blank_entry (GncEntryLedger *ledger);
00136 
00140 gboolean gnc_entry_ledger_get_entry_virt_loc (GncEntryLedger *ledger,
00141         const GncEntry *entry,
00142         VirtualCellLocation *vcell_loc);
00143 
00144 void gnc_entry_ledger_delete_current_entry (GncEntryLedger *ledger);
00145 void gnc_entry_ledger_duplicate_current_entry (GncEntryLedger *ledger);
00146 
00154 void gnc_entry_ledger_move_current_entry_updown (GncEntryLedger *ledger,
00155         gboolean move_up);
00156 
00157 QofQuery * gnc_entry_ledger_get_query (GncEntryLedger *ledger);
00158 
00159 void gnc_entry_ledger_set_gconf_section (GncEntryLedger *ledger, const gchar *string);
00160 
00161 #endif /* GNC_ENTRY_LEDGER_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines