GnuCash  5.6-150-g038405b370+
gnc-ledger-display.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-ledger-display.h -- utilities for dealing with multiple *
3  * register/ledger windows in GnuCash *
4  * *
5  * Copyright (C) 1997 Robin D. Clark *
6  * Copyright (C) 1997, 1998 Linas Vepstas *
7  * Copyright (C) 2001 Linux Developers Group *
8  * *
9  * This program is free software; you can redistribute it and/or *
10  * modify it under the terms of the GNU General Public License as *
11  * published by the Free Software Foundation; either version 2 of *
12  * the License, or (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License*
20  * along with this program; if not, write to the Free Software *
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
22  * *
23 \********************************************************************/
24 
25 #ifndef GNC_LEDGER_DISPLAY_H
26 #define GNC_LEDGER_DISPLAY_H
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 #include <glib.h>
34 
35 #include "Account.h"
36 #include "Query.h"
37 #include "split-register.h"
38 #include "SchedXaction.h"
39 #include "Transaction.h"
40 
52 typedef struct gnc_ledger_display GNCLedgerDisplay;
53 
54 typedef void (*GNCLedgerDisplayDestroy) (GNCLedgerDisplay* ld);
55 typedef GtkWidget* (*GNCLedgerDisplayGetParent) (GNCLedgerDisplay* ld);
56 typedef void (*GNCLedgerDisplaySetHelp) (GNCLedgerDisplay* ld,
57  const char* help_str);
58 
59 typedef enum
60 {
61  LD_SINGLE,
62  LD_SUBACCOUNT,
63  LD_GL,
64 } GNCLedgerDisplayType;
65 
66 
68 Account* gnc_ledger_display_leader (GNCLedgerDisplay* ld);
69 
70 GNCLedgerDisplayType gnc_ledger_display_type (GNCLedgerDisplay* ld);
71 
73 void gnc_ledger_display_set_user_data (GNCLedgerDisplay* ld,
74  gpointer user_data);
75 gpointer gnc_ledger_display_get_user_data (GNCLedgerDisplay* ld);
76 
78 void gnc_ledger_display_set_handlers (GNCLedgerDisplay* ld,
79  GNCLedgerDisplayDestroy destroy,
80  GNCLedgerDisplayGetParent get_parent);
81 
83 GtkWidget* gnc_ledger_display_get_parent (GNCLedgerDisplay* ld);
84 
86 SplitRegister* gnc_ledger_display_get_split_register (GNCLedgerDisplay* ld);
87 
89 GNCLedgerDisplay* gnc_ledger_display_simple (Account* account);
90 
93 GNCLedgerDisplay* gnc_ledger_display_subaccounts (Account* account,
94  gboolean mismatched_commodities);
95 
97 GNCLedgerDisplay* gnc_ledger_display_gl (void);
98 
106 GNCLedgerDisplay* gnc_ledger_display_template_gl (char* id);
107 
109 GNCLedgerDisplay* gnc_ledger_display_query (Query* query,
110  SplitRegisterType type,
111  SplitRegisterStyle style);
112 
114 void gnc_ledger_display_set_query (GNCLedgerDisplay* ledger_display,
115  Query* q);
116 
118 Query* gnc_ledger_display_get_query (GNCLedgerDisplay* ld);
119 
122 GNCLedgerDisplay* gnc_ledger_display_find_by_query (Query* q);
123 
126 void gnc_ledger_display_refresh (GNCLedgerDisplay* ledger_display);
127 void gnc_ledger_display_refresh_by_split_register (SplitRegister* reg);
128 
130 void gnc_ledger_display_set_focus (GNCLedgerDisplay* ld, gboolean focus);
131 
133 void gnc_ledger_display_close (GNCLedgerDisplay* ledger_display);
134 
137 gboolean gnc_ledger_display_default_double_line (GNCLedgerDisplay* gld);
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif
void gnc_ledger_display_close(GNCLedgerDisplay *ledger_display)
close the window
void gnc_ledger_display_set_focus(GNCLedgerDisplay *ld, gboolean focus)
Mark the ledger as being in focus (refresh immediately) or not.
void gnc_ledger_display_refresh(GNCLedgerDisplay *ledger_display)
redisplay/redraw only the indicated window.
gboolean gnc_ledger_display_default_double_line(GNCLedgerDisplay *gld)
Returns a boolean of whether this display should be single or double lined mode by default...
STRUCTS.
Account * gnc_ledger_display_leader(GNCLedgerDisplay *ld)
returns the &#39;lead&#39; account of a ledger display, or NULL if none.
void gnc_ledger_display_set_query(GNCLedgerDisplay *ledger_display, Query *q)
Set the query used for a register.
Query * gnc_ledger_display_get_query(GNCLedgerDisplay *ld)
return the query associated with a ledger
GNCLedgerDisplay * gnc_ledger_display_subaccounts(Account *account, gboolean mismatched_commodities)
opens up a register window to display the parent account and all of its children. ...
Account handling public routines.
void gnc_ledger_display_set_handlers(GNCLedgerDisplay *ld, GNCLedgerDisplayDestroy destroy, GNCLedgerDisplayGetParent get_parent)
set the handlers used by the ledger display
The GNCLedgerDisplay struct describes a single register/ledger instance.
GtkWidget * gnc_ledger_display_get_parent(GNCLedgerDisplay *ld)
Returns the parent of a given ledger display.
API for checkbook register display area.
GNCLedgerDisplay * gnc_ledger_display_template_gl(char *id)
Displays a template ledger.
GNCLedgerDisplay * gnc_ledger_display_simple(Account *account)
opens up a register window to display a single account
GNCLedgerDisplay * gnc_ledger_display_find_by_query(Query *q)
If the given ledger display still exists, return it.
GNCLedgerDisplay * gnc_ledger_display_query(Query *query, SplitRegisterType type, SplitRegisterStyle style)
display a general ledger for an arbitrary query
GNCLedgerDisplay * gnc_ledger_display_gl(void)
opens up a general ledger window
SplitRegister * gnc_ledger_display_get_split_register(GNCLedgerDisplay *ld)
return the split register associated with a ledger display
SplitRegisterType
Register types.
Scheduled Transactions public handling routines.
API for Transactions and Splits (journal entries)
A Query.
Definition: qofquery.cpp:74
void gnc_ledger_display_set_user_data(GNCLedgerDisplay *ld, gpointer user_data)
get and set the user data associated with the ledger
SplitRegisterStyle
Register styles.