~siretart/gnucash/ubuntu-fullsource

« back to all changes in this revision

Viewing changes to src/gnome/gnc-plugin-page-register.h

  • Committer: Reinhard Tartler
  • Date: 2008-08-03 07:25:46 UTC
  • Revision ID: siretart@tauware.de-20080803072546-y6p8xda8zpfi62ys
import gnucash_2.2.4.orig.tar.gz

The original tarball had the md5sum: 27e660297dc5b8ce574515779d05a5a5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * gnc-plugin-page-register.h -- 
 
3
 *
 
4
 * Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de>
 
5
 * Copyright (C) 2003 David Hampton <hampton@employees.org>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU General Public License as
 
9
 * published by the Free Software Foundation; either version 2 of
 
10
 * the License, or (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, contact:
 
19
 *
 
20
 * Free Software Foundation           Voice:  +1-617-542-5942
 
21
 * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
 
22
 * Boston, MA  02110-1301,  USA       gnu@gnu.org
 
23
 */
 
24
 
 
25
/** @addtogroup ContentPlugins
 
26
    @{ */
 
27
/** @addtogroup RegisterPlugin Register Page
 
28
    @{ */
 
29
/** @file gnc-plugin-page-register.h 
 
30
    @brief  Functions providing a register page for the GnuCash UI
 
31
    @author Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de>
 
32
    @author Copyright (C) 2003 David Hampton <hampton@employees.org>
 
33
*/
 
34
 
 
35
#ifndef __GNC_PLUGIN_PAGE_REGISTER_H
 
36
#define __GNC_PLUGIN_PAGE_REGISTER_H
 
37
 
 
38
#include <gtk/gtkwindow.h>
 
39
 
 
40
#include "Account.h"
 
41
#include "gnc-ledger-display.h"
 
42
#include "gnc-plugin-page.h"
 
43
#include "gnc-split-reg.h"
 
44
 
 
45
G_BEGIN_DECLS
 
46
 
 
47
/* type macros */
 
48
#define GNC_TYPE_PLUGIN_PAGE_REGISTER            (gnc_plugin_page_register_get_type ())
 
49
#define GNC_PLUGIN_PAGE_REGISTER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegister))
 
50
#define GNC_PLUGIN_PAGE_REGISTER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegisterClass))
 
51
#define GNC_IS_PLUGIN_PAGE_REGISTER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER))
 
52
#define GNC_IS_PLUGIN_PAGE_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE_REGISTER))
 
53
#define GNC_PLUGIN_PAGE_REGISTER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegisterClass))
 
54
#define GNC_PLUGIN_PAGE_REGISTER_NAME "GncPluginPageRegister"
 
55
 
 
56
/* typedefs & structures */
 
57
typedef struct {
 
58
        GncPluginPage gnc_plugin_page;
 
59
} GncPluginPageRegister;
 
60
 
 
61
typedef struct {
 
62
        GncPluginPageClass gnc_plugin_page;
 
63
} GncPluginPageRegisterClass;
 
64
 
 
65
/* function prototypes */
 
66
 
 
67
/** Retrieve the type number for the plugin page.
 
68
 *
 
69
 *  @return The type number.
 
70
 */
 
71
GType gnc_plugin_page_register_get_type (void);
 
72
 
 
73
 
 
74
/** Create a new "register" plugin page, given a pointer to an
 
75
 *  account.
 
76
 *
 
77
 *  @param account The pointer to the account to embed in the
 
78
 *  register.
 
79
 *
 
80
 *  @param subaccounts TRUE if all the sub-accounts of the specified
 
81
 *  account should be included in the register.
 
82
 *
 
83
 *  @return The newly created plugin page.
 
84
 */
 
85
GncPluginPage *
 
86
gnc_plugin_page_register_new (Account *account, gboolean subaccounts);
 
87
 
 
88
 
 
89
/** Create a new "register" plugin page, given a pointer to an already
 
90
 *  created ledger.  This function should be used when the ledger
 
91
 *  already exists.  (E.G.  From the "find transaction" code, or from
 
92
 *  the scheduled transaction code.)
 
93
 *
 
94
 *  @param ledger The pointer to the ledger to embed into the
 
95
 *  register.
 
96
 *
 
97
 *  @return The newly created plugin page.
 
98
 */
 
99
GncPluginPage *
 
100
gnc_plugin_page_register_new_ledger (GNCLedgerDisplay *ledger);
 
101
 
 
102
 
 
103
/** Create a new "register" plugin page containing a general ledger.
 
104
 *
 
105
 *  @return The newly created plugin page.
 
106
 */
 
107
GncPluginPage *
 
108
gnc_plugin_page_register_new_gl (void);
 
109
 
 
110
 
 
111
/** Set various register options on a newly created "register" plugin page.
 
112
 *
 
113
 *  @param plugin_page The "register" page to modify.
 
114
 *
 
115
 *  @param lines_opt_page The name of the options page containing the
 
116
 *  number of lines per register.
 
117
 *
 
118
 *  @param lines_opt_name The name of the options (within the page
 
119
 *  specified above) containing the number of lines per register.
 
120
 *
 
121
 *  @param lines_default The number of lines to use if the specified
 
122
 *  options cannot be found or has never been set.
 
123
 *
 
124
 *  @param read_only True if the register should be read-only.
 
125
 */
 
126
void
 
127
gnc_plugin_page_register_set_options (GncPluginPage *plugin_page,
 
128
                                      const char *lines_opt_page,
 
129
                                      const char *lines_opt_name,
 
130
                                      gint lines_default,
 
131
                                      gboolean read_only);
 
132
 
 
133
 
 
134
/** Get the GNCSplitReg data structure associated with this register page.
 
135
 *
 
136
 *  @param plugin_page A "register" page.
 
137
 */
 
138
GNCSplitReg *
 
139
gnc_plugin_page_register_get_gsr (GncPluginPage *plugin_page);
 
140
 
 
141
 
 
142
/** Get the Account associated with this register page.
 
143
 *
 
144
 *  @param page A "register" page.
 
145
 *
 
146
 *  @return The account if the register contains only a single
 
147
 *  account, or an account and its sub-accounts.  NULL otherwise.
 
148
 */
 
149
Account *
 
150
gnc_plugin_page_register_get_account (GncPluginPageRegister *page);
 
151
 
 
152
G_END_DECLS
 
153
/** @} */
 
154
/** @} */
 
155
 
 
156
#endif /* __GNC_PLUGIN_PAGE_REGISTER_H */
 
157