GnuCash  4.12-404-geb24099a91
gnc-period-select.h
Go to the documentation of this file.
1 /*
2  * gnc-period-select.h -- Accounting period selection widget
3  *
4  * Copyright (c) 2005 David Hampton <hampton@employees.org>
5  * All rights reserved.
6  *
7  * GnuCash is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Library 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  * Gnucash 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 GNU
15  * Library 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 
32 #ifndef GNC_PERIOD_SELECT_H
33 #define GNC_PERIOD_SELECT_H
34 
35 #include "gnc-accounting-period.h"
36 
37 G_BEGIN_DECLS
38 
39 #define GNC_TYPE_PERIOD_SELECT (gnc_period_select_get_type())
40 #define GNC_PERIOD_SELECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PERIOD_SELECT, GncPeriodSelect))
41 #define GNC_PERIOD_SELECT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_PERIOD_SELECT, GncPeriodSelectClass))
42 #define GNC_IS_PERIOD_SELECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PERIOD_SELECT))
43 
44 /* typedefs & structures */
45 typedef struct
46 {
47  GtkBox hbox;
49 
50 typedef struct
51 {
52  GtkBoxClass hbox;
53 
54  /* Signals */
55  void (*changed) (GncPeriodSelect *period);
56 
58 
59 
65 GType gnc_period_select_get_type (void);
66 
67 
77 GtkWidget *gnc_period_select_new (gboolean starting_labels);
78 
79 
87 GtkWidget * gnc_period_select_new_glade (gchar *widget_name,
88  gchar *string1, gchar *string2,
89  gint int1, gint int2);
106 void gnc_period_select_set_fy_end (GncPeriodSelect *period, const GDate *fy_end);
107 
108 
120 
121 
125 gboolean
127 
128 
133 void gnc_period_select_set_show_date (GncPeriodSelect *period, const gboolean show_date);
134 
135 
136 GDate *gnc_period_select_get_date_base (GncPeriodSelect *period);
137 
138 /* Set the base date used by a GncPeriodSelect widget. All example
139  * dates presented by the widget will be computed from this date.
140  */
141 void gnc_period_select_set_date_base (GncPeriodSelect *period, const GDate *sample_base);
142 
155 
156 
166 
167 
176 
177 G_END_DECLS
178 
179 #endif /* GNC_PERIOD_SELECT_H */
180 
GncAccountingPeriod gnc_period_select_get_active(GncPeriodSelect *period)
Get the currently selected accounting period from a GncPeriodSelect widget.
void gnc_period_select_set_show_date(GncPeriodSelect *period, const gboolean show_date)
Set the "show sample" setting on a GncPeriodSelect widget.
GDate * gnc_period_select_get_date(GncPeriodSelect *period)
Get the currently selected accounting period choice from a GncPeriodSelect widget.
GType gnc_period_select_get_type(void)
Returns the GType of a GncPeriodSelect widget.
General utilities for dealing with accounting periods.
GncAccountingPeriod
This specifies a time interval.
GDate * gnc_period_select_get_fy_end(GncPeriodSelect *period)
Get the current value of the fiscal year end setting from a GncPeriodSelect widget.
void gnc_period_select_set_fy_end(GncPeriodSelect *period, const GDate *fy_end)
Set the fiscal year end on a GncPeriodSelect widget.
gboolean gnc_period_select_get_show_date(GncPeriodSelect *period)
Get the current value of the "show sample" setting from a GncPeriodSelect widget. ...
GtkWidget * gnc_period_select_new_glade(gchar *widget_name, gchar *string1, gchar *string2, gint int1, gint int2)
Create a new GncPeriodSelect widget from a glade file.
GtkWidget * gnc_period_select_new(gboolean starting_labels)
Create a new GncPeriodSelect widget which is used to select a accounting period like "previous month"...
void gnc_period_select_set_active(GncPeriodSelect *period, GncAccountingPeriod which)
Set which item in the GncPeriodSelect is initially selected.