GnuCash c935c2f+
Loading...
Searching...
No Matches
gnc-date-edit.h
1/*
2 * gnc-dateedit.c -- Date editor widget
3 *
4 * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
5 * All rights reserved.
6 *
7 * This file was part of the Gnome Library. It was modified by
8 * Dave Peticolas <dave@krondo.com> for use in GnuCash.
9 *
10 * GnuCash is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Library General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * Gnucash is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, contact:
22 *
23 * Free Software Foundation Voice: +1-617-542-5942
24 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
25 * Boston, MA 02110-1301, USA gnu@gnu.org
26 * */
27/*
28 @NOTATION@
29 */
30
31#ifndef GNC_DATE_EDIT_H
32#define GNC_DATE_EDIT_H
33
34#include <glib.h>
35#include <time.h>
36#include "gnc-date.h"
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42typedef enum
43{
44 GNC_DATE_EDIT_SHOW_TIME = 1 << 0,
45 GNC_DATE_EDIT_24_HR = 1 << 1,
46} GNCDateEditFlags;
47
48#define GNC_TYPE_DATE_EDIT (gnc_date_edit_get_type ())
49#define GNC_DATE_EDIT(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnc_date_edit_get_type(), GNCDateEdit)
50#define GNC_DATE_EDIT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnc_date_edit_get_type(), GNCDateEditClass)
51#define GNC_IS_DATE_EDIT(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, gnc_date_edit_get_type ())
52
62typedef struct
63{
64 GtkBox hbox;
65
66 GtkWidget *date_entry;
67 GtkWidget *date_button;
68
69 GtkWidget *time_entry;
70 GtkWidget *time_combo;
71
72 GtkWidget *cal_label;
73 GtkWidget *cal_popup;
74 GtkWidget *calendar;
75
76 time64 initial_time;
77
78 int lower_hour;
79 int upper_hour;
80
81 int flags;
82
83 int disposed;
84
85 gboolean popup_in_progress;
86 gboolean in_selected_handler;
88
89typedef struct
90{
91 GtkBoxClass parent_class;
92 void (*date_changed) (GNCDateEdit *gde);
93 void (*time_changed) (GNCDateEdit *gde);
95
96GType gnc_date_edit_get_type (void);
97
98GtkWidget *gnc_date_edit_new (time64 the_time,
99 int show_time, int use_24_format);
100
117GtkWidget *gnc_date_edit_new_glade (gchar *widget_name,
118 gchar *string1, gchar *string2,
119 gint int1, gint int2);
120
121GtkWidget *gnc_date_edit_new_flags (time64 the_time,
122 GNCDateEditFlags flags);
123
124void gnc_date_edit_set_gdate (GNCDateEdit *gde, const GDate *date);
125void gnc_date_edit_set_time (GNCDateEdit *gde, time64 the_time);
126
127void gnc_date_edit_set_popup_range (GNCDateEdit *gde,
128 int low_hour, int up_hour);
129
130void gnc_date_edit_get_gdate (GNCDateEdit *gde, GDate *date);
131time64 gnc_date_edit_get_date (GNCDateEdit *gde);
132time64 gnc_date_edit_get_date_end (GNCDateEdit *gde);
133
134void gnc_date_edit_set_flags (GNCDateEdit *gde,
135 GNCDateEditFlags flags);
136int gnc_date_edit_get_flags (GNCDateEdit *gde);
137
138void gnc_date_activates_default (GNCDateEdit *gde, gboolean state);
139void gnc_date_grab_focus (GNCDateEdit *gde);
140
141void gnc_date_make_mnemonic_target (GNCDateEdit *gde, GtkWidget *label);
142
143#ifdef __cplusplus
144}
145#endif
146
147#endif
Date and Time handling routines.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
Definition gnc-date.h:87