GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnucash-date-picker.h
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 [email protected] *
20  * *
21 \********************************************************************/
22 
23 #ifndef GNUCASH_DATE_PICKER_H
24 #define GNUCASH_DATE_PICKER_H
25 
26 #include <libgnomecanvas/libgnomecanvas.h>
27 
28 #define GNC_DATE_PICKER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), gnc_date_picker_get_type (), GNCDatePicker)
29 #define GNC_DATE_PICKER_CLASS(k) G_TYPE_CHECK_CLASS_CAST((k), gnc_date_picker_get_type (), GNCDatePickerClass)
30 #define IS_GNC_DATE_PICKER(o) G_TYPE_CHECK_INSTANCE_TYPE((o), gnc_date_picker_get_type ())
31 
32 
33 typedef struct
34 {
35  GnomeCanvasWidget canvas_widget;
36 
37  GtkCalendar *calendar;
39 
40 
41 GType gnc_date_picker_get_type (void);
42 
43 GnomeCanvasItem *gnc_date_picker_new (GnomeCanvasGroup *parent);
44 
45 /* days are 1-31, mon is 0-11, year 1900 == 1900 */
46 void gnc_date_picker_set_date (GNCDatePicker *date_picker,
47  guint day, guint mon, guint year);
48 
49 void gnc_date_picker_get_date (GNCDatePicker *date_picker,
50  guint *day, guint *mon, guint *year);
51 
52 typedef struct
53 {
54  GnomeCanvasWidgetClass parent_class;
55 
56  void (*date_selected) (GNCDatePicker *date_picker);
57 
58  void (*date_picked) (GNCDatePicker *date_picker);
59 
60  void (*key_press_event) (GNCDatePicker *date_picker,
61  GdkEventKey *event);
62 
64 
65 
66 #endif /* GNUCASH_DATE_PICKER_H */