1 /*
2  * Copyright (C) 2006 - 2011 Vivien Malerba <malerba@gnome-db.org>
3  * Copyright (C) 2007 - 2011 Murray Cumming <murrayc@murrayc.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA  02110-1301, USA.
19  */
20 
21 #ifndef __GDA_HANDLER_TIME__
22 #define __GDA_HANDLER_TIME__
23 
24 #include <glib-object.h>
25 #include <libgda/gda-data-handler.h>
26 
27 G_BEGIN_DECLS
28 
29 #define GDA_TYPE_HANDLER_TIME          (gda_handler_time_get_type())
30 #define GDA_HANDLER_TIME(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, gda_handler_time_get_type(), GdaHandlerTime)
31 #define GDA_HANDLER_TIME_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, gda_handler_time_get_type (), GdaHandlerTimeClass)
32 #define GDA_IS_HANDLER_TIME(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, gda_handler_time_get_type ())
33 
34 typedef struct _GdaHandlerTime      GdaHandlerTime;
35 typedef struct _GdaHandlerTimeClass GdaHandlerTimeClass;
36 typedef struct _GdaHandlerTimePriv  GdaHandlerTimePriv;
37 
38 /* struct for the object's data */
39 struct _GdaHandlerTime
40 {
41 	GObject              object;
42 	GdaHandlerTimePriv  *priv;
43 };
44 
45 /* struct for the object's class */
46 struct _GdaHandlerTimeClass
47 {
48 	GObjectClass         parent_class;
49 
50 	/*< private >*/
51 	/* Padding for future expansion */
52 	void (*_gda_reserved1) (void);
53 	void (*_gda_reserved2) (void);
54 };
55 
56 /**
57  * SECTION:gda-handler-time
58  * @short_description: Default handler for time values
59  * @title: GdaHanderTime
60  * @stability: Stable
61  * @see_also: #GdaDataHandler interface
62  *
63  * You should normally not need to use this API, refer to the #GdaDataHandler
64  * interface documentation for more information.
65  */
66 
67 GType           gda_handler_time_get_type      (void) G_GNUC_CONST;
68 GdaDataHandler *gda_handler_time_new           (void);
69 GdaDataHandler *gda_handler_time_new_no_locale (void);
70 void            gda_handler_time_set_sql_spec  (GdaHandlerTime *dh, GDateDMY first, GDateDMY sec,
71 						GDateDMY third, gchar separator, gboolean twodigits_years);
72 void            gda_handler_time_set_str_spec  (GdaHandlerTime *dh, GDateDMY first, GDateDMY sec,
73 						GDateDMY third, gchar separator, gboolean twodigits_years);
74 gchar          *gda_handler_time_get_no_locale_str_from_value (GdaHandlerTime *dh, const GValue *value);
75 
76 gchar          *gda_handler_time_get_format    (GdaHandlerTime *dh, GType type);
77 G_END_DECLS
78 
79 #endif
80