GnuCash  5.6-150-g038405b370+
gnucash-date-picker.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnucash-date-picker.h -- A popup date picker using gtk_calendar *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License*
15  * along with this program; if not, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA gnu@gnu.org *
20  * *
21 \********************************************************************/
22 
23 #ifndef GNUCASH_DATE_PICKER_H
24 #define GNUCASH_DATE_PICKER_H
25 
26 #include <gtk/gtk.h>
27 
35 #define GNC_TYPE_DATE_PICKER (gnc_date_picker_get_type ())
36 #define GNC_DATE_PICKER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), gnc_date_picker_get_type (), GNCDatePicker)
37 #define GNC_DATE_PICKER_CLASS(k) G_TYPE_CHECK_CLASS_CAST((k), gnc_date_picker_get_type (), GNCDatePickerClass)
38 #define IS_GNC_DATE_PICKER(o) G_TYPE_CHECK_INSTANCE_TYPE((o), gnc_date_picker_get_type ())
39 
40 
41 typedef struct
42 {
43  GtkBox hbox;
44 
45  GtkCalendar *calendar;
47 
48 
49 GType gnc_date_picker_get_type (void);
50 
51 GtkWidget *gnc_date_picker_new (void);
52 
53 /* days are 1-31, mon is 0-11, year 1900 == 1900 */
54 void gnc_date_picker_set_date (GNCDatePicker *date_picker,
55  guint day, guint mon, guint year);
56 
57 void gnc_date_picker_get_date (GNCDatePicker *date_picker,
58  guint *day, guint *mon, guint *year);
59 
60 typedef struct
61 {
62  GtkBoxClass parent_class;
63 
64  void (*date_selected) (GNCDatePicker *date_picker);
65 
66  void (*date_picked) (GNCDatePicker *date_picker);
67 
69 
71 #endif /* GNUCASH_DATE_PICKER_H */