Back to index

lightning-sunbird  0.9+nobinonly
icaltimezone.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /*======================================================================
00003  FILE: icaltimezone.h
00004  CREATOR: Damon Chaplin 15 March 2001
00005 
00006 
00007  $Id: icaltimezone.h,v 1.10 2002/11/03 23:51:55 acampi Exp $
00008  $Locker:  $
00009 
00010  (C) COPYRIGHT 2001, Damon Chaplin
00011 
00012  This program is free software; you can redistribute it and/or modify
00013  it under the terms of either: 
00014 
00015     The LGPL as published by the Free Software Foundation, version
00016     2.1, available at: http://www.fsf.org/copyleft/lesser.html
00017 
00018   Or:
00019 
00020     The Mozilla Public License Version 1.0. You may obtain a copy of
00021     the License at http://www.mozilla.org/MPL/
00022 
00023 
00024 ======================================================================*/
00030 #ifndef ICALTIMEZONE_H
00031 #define ICALTIMEZONE_H
00032 
00033 #include <stdio.h> /* For FILE* */
00034 #include "icaltime.h"
00035 #include "icalarray.h"
00036 #include "icalcomponent.h"
00037 
00038 
00039 #ifndef ICALTIMEZONE_DEFINED
00040 #define ICALTIMEZONE_DEFINED
00041 
00044 typedef struct _icaltimezone              icaltimezone;
00045 #endif
00046 
00052 icaltimezone *icaltimezone_new                   (void);
00053 
00056 void icaltimezone_free                           (icaltimezone *zone,
00057                                            int free_struct);
00058 
00059 
00065 void icaltimezone_free_builtin_timezones(void);
00066 
00068 icalarray* icaltimezone_get_builtin_timezones    (void);
00069 
00071 icaltimezone* icaltimezone_get_builtin_timezone  (const char *location);
00072 
00074 icaltimezone* icaltimezone_get_builtin_timezone_from_tzid (const char *tzid);
00075 
00077 icaltimezone* icaltimezone_get_utc_timezone      (void);
00078 
00080 char*  icaltimezone_get_tzid                     (icaltimezone *zone);
00081 
00083 char*  icaltimezone_get_location          (icaltimezone *zone);
00084 
00089 char*  icaltimezone_get_tznames           (icaltimezone *zone);
00090 
00092 double icaltimezone_get_latitude          (icaltimezone *zone);
00093 
00095 double icaltimezone_get_longitude         (icaltimezone *zone);
00096 
00098 icalcomponent*       icaltimezone_get_component  (icaltimezone *zone);
00099 
00103 int    icaltimezone_set_component         (icaltimezone *zone,
00104                                            icalcomponent       *comp);
00105 
00110 void   icaltimezone_convert_time          (struct icaltimetype *tt,
00111                                            icaltimezone *from_zone,
00112                                            icaltimezone *to_zone);
00113 
00114 
00123 int    icaltimezone_get_utc_offset        (icaltimezone *zone,
00124                                            struct icaltimetype *tt,
00125                                            int          *is_daylight);
00126 
00131 int    icaltimezone_get_utc_offset_of_utc_time   (icaltimezone *zone,
00132                                            struct icaltimetype *tt,
00133                                            int          *is_daylight);
00134 
00135 
00136 
00137 /*
00138  * Handling arrays of timezones. Mainly for internal use.
00139  */
00140 icalarray*  icaltimezone_array_new        (void);
00141 
00142 void       icaltimezone_array_append_from_vtimezone (icalarray     *timezones,
00143                                                 icalcomponent *child);
00144 void       icaltimezone_array_free        (icalarray    *timezones);
00145 
00146 
00147 /*
00148  * @par Handling the default location the timezone files
00149  */
00150 
00152 void set_zone_directory(char *path);
00153 
00155 void free_zone_directory(void);
00156 
00157 /*
00158  * @par Debugging Output.
00159  */
00160 
00163 int    icaltimezone_dump_changes          (icaltimezone *zone,
00164                                            int           max_year,
00165                                            FILE         *fp);
00166 
00167 #endif /* ICALTIMEZONE_H */