Git init
[framework/multimedia/gstreamer0.10.git] / gst / gstdatetime.h
1 /* GStreamer
2  * Copyright (C) 2010 Thiago Santos <thiago.sousa.santos@collabora.co.uk>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GST_DATE_TIME_H__
21 #define __GST_DATE_TIME_H__
22
23 #include <time.h>
24 #include <glib.h>
25
26 G_BEGIN_DECLS
27
28 /**
29  * GstDateTime:
30  *
31  * Opaque, immutable, refcounted struct that stores date, time and timezone
32  * information. It currently supports ranges from 0001-01-01 to
33  * 9999-12-31 in the Gregorian proleptic calendar.
34  *
35  * Use the acessor functions to get the stored values.
36  */
37 typedef struct _GstDateTime GstDateTime;
38
39 gint    gst_date_time_get_year          (const GstDateTime * datetime);
40 gint    gst_date_time_get_month         (const GstDateTime * datetime);
41 gint    gst_date_time_get_day           (const GstDateTime * datetime);
42 gint    gst_date_time_get_hour          (const GstDateTime * datetime);
43 gint    gst_date_time_get_minute        (const GstDateTime * datetime);
44 gint    gst_date_time_get_second        (const GstDateTime * datetime);
45 gint    gst_date_time_get_microsecond   (const GstDateTime * datetime);
46 gfloat  gst_date_time_get_time_zone_offset (const GstDateTime * datetime);
47
48 GstDateTime     *gst_date_time_new_from_unix_epoch_local_time (gint64 secs);
49 GstDateTime     *gst_date_time_new_from_unix_epoch_utc  (gint64 secs);
50 GstDateTime     *gst_date_time_new_local_time           (gint year, gint month,
51                                                          gint day, gint hour,
52                                                          gint minute,
53                                                          gdouble seconds);
54 GstDateTime     *gst_date_time_new                      (gfloat tzoffset,
55                                                          gint year, gint month,
56                                                          gint day, gint hour,
57                                                          gint minute,
58                                                          gdouble seconds);
59 GstDateTime     *gst_date_time_new_now_local_time (void);
60 GstDateTime     *gst_date_time_new_now_utc      (void);
61
62 GstDateTime     *gst_date_time_ref              (GstDateTime * datetime);
63 void            gst_date_time_unref             (GstDateTime * datetime);
64
65 G_END_DECLS
66 #endif /* __GST_DATE_TIME_H__ */