|
Packit Service |
963350 |
/* GStreamer
|
|
Packit Service |
963350 |
* Copyright (C) 2010 Thiago Santos <thiago.sousa.santos@collabora.co.uk>
|
|
Packit Service |
963350 |
*
|
|
Packit Service |
963350 |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
963350 |
* modify it under the terms of the GNU Library General Public
|
|
Packit Service |
963350 |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
963350 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit Service |
963350 |
*
|
|
Packit Service |
963350 |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
963350 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
963350 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
963350 |
* Library General Public License for more details.
|
|
Packit Service |
963350 |
*
|
|
Packit Service |
963350 |
* You should have received a copy of the GNU Library General Public
|
|
Packit Service |
963350 |
* License along with this library; if not, write to the
|
|
Packit Service |
963350 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit Service |
963350 |
* Boston, MA 02110-1301, USA.
|
|
Packit Service |
963350 |
*/
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
#ifndef __GST_DATE_TIME_H__
|
|
Packit Service |
963350 |
#define __GST_DATE_TIME_H__
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
#include <gst/gstconfig.h>
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
#include <time.h>
|
|
Packit Service |
963350 |
#include <glib.h>
|
|
Packit Service |
963350 |
#include <glib-object.h>
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
G_BEGIN_DECLS
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
/**
|
|
Packit Service |
963350 |
* GstDateTime:
|
|
Packit Service |
963350 |
*
|
|
Packit Service |
963350 |
* Opaque, immutable, refcounted struct that stores date, time and timezone
|
|
Packit Service |
963350 |
* information. It currently supports ranges from 0001-01-01 to
|
|
Packit Service |
963350 |
* 9999-12-31 in the Gregorian proleptic calendar.
|
|
Packit Service |
963350 |
*
|
|
Packit Service |
963350 |
* Use the accessor functions to get the stored values.
|
|
Packit Service |
963350 |
*/
|
|
Packit Service |
963350 |
typedef struct _GstDateTime GstDateTime;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API GType _gst_date_time_type;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
/**
|
|
Packit Service |
963350 |
* GST_TYPE_DATE_TIME:
|
|
Packit Service |
963350 |
*
|
|
Packit Service |
963350 |
* a boxed #GValue type for #GstDateTime that represents a date and time.
|
|
Packit Service |
963350 |
*
|
|
Packit Service |
963350 |
* Returns: the #GType of GstDateTime
|
|
Packit Service |
963350 |
*/
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
#define GST_TYPE_DATE_TIME (_gst_date_time_type)
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GType gst_date_time_get_type (void);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
/* query which fields are set */
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gboolean gst_date_time_has_year (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gboolean gst_date_time_has_month (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gboolean gst_date_time_has_day (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gboolean gst_date_time_has_time (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gboolean gst_date_time_has_second (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
/* field getters */
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gint gst_date_time_get_year (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gint gst_date_time_get_month (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gint gst_date_time_get_day (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gint gst_date_time_get_hour (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gint gst_date_time_get_minute (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gint gst_date_time_get_second (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gint gst_date_time_get_microsecond (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gfloat gst_date_time_get_time_zone_offset (const GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
/* constructors */
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_from_unix_epoch_local_time (gint64 secs) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_from_unix_epoch_utc (gint64 secs) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_local_time (gint year,
|
|
Packit Service |
963350 |
gint month,
|
|
Packit Service |
963350 |
gint day,
|
|
Packit Service |
963350 |
gint hour,
|
|
Packit Service |
963350 |
gint minute,
|
|
Packit Service |
963350 |
gdouble seconds) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_y (gint year) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_ym (gint year,
|
|
Packit Service |
963350 |
gint month) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_ymd (gint year,
|
|
Packit Service |
963350 |
gint month,
|
|
Packit Service |
963350 |
gint day) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new (gfloat tzoffset,
|
|
Packit Service |
963350 |
gint year, gint month,
|
|
Packit Service |
963350 |
gint day, gint hour,
|
|
Packit Service |
963350 |
gint minute,
|
|
Packit Service |
963350 |
gdouble seconds) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_now_local_time (void) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_now_utc (void) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
gchar * gst_date_time_to_iso8601_string (GstDateTime * datetime) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_from_iso8601_string (const gchar * string) G_GNUC_MALLOC;
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GDateTime * gst_date_time_to_g_date_time (GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_new_from_g_date_time (GDateTime * dt);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
/* refcounting */
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
GstDateTime * gst_date_time_ref (GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
GST_API
|
|
Packit Service |
963350 |
void gst_date_time_unref (GstDateTime * datetime);
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
Packit Service |
963350 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDateTime, gst_date_time_unref)
|
|
Packit Service |
963350 |
#endif
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
G_END_DECLS
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
#endif /* __GST_DATE_TIME_H__ */
|