libkcal

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 
00008  (C) COPYRIGHT 2001, Damon Chaplin
00009 
00010  This program is free software; you can redistribute it and/or modify
00011  it under the terms of either: 
00012 
00013     The LGPL as published by the Free Software Foundation, version
00014     2.1, available at: http://www.fsf.org/copyleft/lesser.html
00015 
00016   Or:
00017 
00018     The Mozilla Public License Version 1.0. You may obtain a copy of
00019     the License at http://www.mozilla.org/MPL/
00020 
00021 
00022 ======================================================================*/
00028 #ifndef ICALTIMEZONE_H
00029 #define ICALTIMEZONE_H
00030 
00031 #include <stdio.h> /* For FILE* */
00032 #include "icaltime.h"
00033 #include "icalarray.h"
00034 #include "icalcomponent.h"
00035 
00036 
00037 #ifndef ICALTIMEZONE_DEFINED
00038 #define ICALTIMEZONE_DEFINED
00039 
00042 typedef struct _icaltimezone        icaltimezone;
00043 #endif
00044 
00050 icaltimezone *icaltimezone_new          (void);
00051 
00054 void icaltimezone_free              (icaltimezone *zone,
00055                          int free_struct);
00056 
00057 
00063 void icaltimezone_free_builtin_timezones(void);
00064 
00066 icalarray* icaltimezone_get_builtin_timezones   (void);
00067 
00069 icaltimezone* icaltimezone_get_builtin_timezone (const char *location);
00070 
00072 icaltimezone* icaltimezone_get_builtin_timezone_from_tzid (const char *tzid);
00073 
00075 icaltimezone* icaltimezone_get_utc_timezone (void);
00076 
00078 const char* icaltimezone_get_tzid           (icaltimezone *zone);
00079 
00081 const char* icaltimezone_get_location       (icaltimezone *zone);
00082 
00087 const char* icaltimezone_get_tznames        (icaltimezone *zone);
00088 
00090 double  icaltimezone_get_latitude       (icaltimezone *zone);
00091 
00093 double  icaltimezone_get_longitude      (icaltimezone *zone);
00094 
00096 icalcomponent*  icaltimezone_get_component  (icaltimezone *zone);
00097 
00101 int icaltimezone_set_component      (icaltimezone *zone,
00102                          icalcomponent  *comp);
00103 
00108 void    icaltimezone_convert_time       (struct icaltimetype *tt,
00109                          icaltimezone *from_zone,
00110                          icaltimezone *to_zone);
00111 
00112 
00121 int icaltimezone_get_utc_offset (icaltimezone *zone,
00122                  struct icaltimetype *tt,
00123                  int        *is_daylight);
00124 
00129 int icaltimezone_get_utc_offset_of_utc_time (icaltimezone *zone,
00130                          struct icaltimetype *tt,
00131                          int        *is_daylight);
00132 
00133 
00134 
00135 /*
00136  * Handling arrays of timezones. Mainly for internal use.
00137  */
00138 icalarray*  icaltimezone_array_new      (void);
00139 
00140 void        icaltimezone_array_append_from_vtimezone (icalarray     *timezones,
00141                               icalcomponent *child);
00142 void        icaltimezone_array_free     (icalarray  *timezones);
00143 
00144 
00145 /*
00146  * @par Handling the default location the timezone files
00147  */
00148 
00150 void set_zone_directory(char *path);
00151 
00153 void free_zone_directory(void);
00154 
00155 /*
00156  * @par Debugging Output.
00157  */
00158 
00161 int icaltimezone_dump_changes       (icaltimezone *zone,
00162                          int         max_year,
00163                          FILE       *fp);
00164 
00165 #endif /* ICALTIMEZONE_H */