Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icaltimezone.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: icaltimezone.h
3 CREATOR: Damon Chaplin 15 March 2001
4
5 SPDX-FileCopyrightText: 2001, Damon Chaplin <damon@ximian.com>
6 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7======================================================================*/
8
13
14#ifndef ICALTIMEZONE_H
15#define ICALTIMEZONE_H
16
17#include "libical_ical_export.h"
18#include "icalcomponent.h"
19
20#include <stdbool.h>
21#include <stdio.h>
22
23#if !defined(ICALTIMEZONE_DEFINED)
24#define ICALTIMEZONE_DEFINED
29typedef struct _icaltimezone icaltimezone;
30#endif
31
32/*
33 * Creating/Destroying individual icaltimezones.
34 */
35
42LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_new(void);
43
53LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_copy(const icaltimezone *originalzone);
54
59LIBICAL_ICAL_EXPORT void icaltimezone_free(icaltimezone *zone, int free_struct);
60
76LIBICAL_ICAL_EXPORT void icaltimezone_set_tzid_prefix(const char *new_prefix);
77
83LIBICAL_ICAL_EXPORT const char *icaltimezone_tzid_prefix(void);
84
85/*
86 * Accessing timezones.
87 */
88
90LIBICAL_ICAL_EXPORT void icaltimezone_free_builtin_timezones(void);
91
102LIBICAL_ICAL_EXPORT icalarray *icaltimezone_get_builtin_timezones(void);
103
113LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_get_builtin_timezone(const char *location);
114
125LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_get_builtin_timezone_from_offset(int offset,
126 const char *tzname);
127
135LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_get_builtin_timezone_from_tzid(const char *tzid);
136
142LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_get_utc_timezone(void);
143
152LIBICAL_ICAL_EXPORT const char *icaltimezone_get_tzid(icaltimezone *zone);
153
162LIBICAL_ICAL_EXPORT const char *icaltimezone_get_location(const icaltimezone *zone);
163
176LIBICAL_ICAL_EXPORT const char *icaltimezone_get_tznames(icaltimezone *zone);
177
185LIBICAL_ICAL_EXPORT double icaltimezone_get_latitude(const icaltimezone *zone);
186
194LIBICAL_ICAL_EXPORT double icaltimezone_get_longitude(const icaltimezone *zone);
195
203LIBICAL_ICAL_EXPORT icalcomponent *icaltimezone_get_component(icaltimezone *zone);
204
214LIBICAL_ICAL_EXPORT bool icaltimezone_set_component(icaltimezone *zone, icalcomponent *comp);
215
227LIBICAL_ICAL_EXPORT const char *icaltimezone_get_display_name(icaltimezone *zone);
228
239
240LIBICAL_ICAL_EXPORT void icaltimezone_convert_time(struct icaltimetype *tt,
241 icaltimezone *from_zone,
242 icaltimezone *to_zone);
243
244/*
245 * Getting offsets from UTC.
246 */
247
263LIBICAL_ICAL_EXPORT int icaltimezone_get_utc_offset(icaltimezone *zone,
264 const struct icaltimetype *tt, int *is_daylight);
265
280LIBICAL_ICAL_EXPORT int icaltimezone_get_utc_offset_of_utc_time(icaltimezone *zone,
281 const struct icaltimetype *tt,
282 int *is_daylight);
283
285
286/*
287 * Handling arrays of timezones. For internal use.
288 */
289LIBICAL_ICAL_NO_EXPORT icalarray *icaltimezone_array_new(void);
290
291LIBICAL_ICAL_NO_EXPORT void icaltimezone_array_append_from_vtimezone(icalarray *timezones,
292 icalcomponent *child);
293
294LIBICAL_ICAL_NO_EXPORT void icaltimezone_array_free(icalarray *timezones);
296
305LIBICAL_ICAL_EXPORT void icaltimezone_expand_vtimezone(icalcomponent *comp,
306 int end_year,
307 icalarray *changes);
308
317LIBICAL_ICAL_EXPORT char *icaltimezone_get_location_from_vtimezone(icalcomponent *component);
318
330LIBICAL_ICAL_EXPORT char *icaltimezone_get_tznames_from_vtimezone(icalcomponent *component);
331
349LIBICAL_ICAL_EXPORT void icaltimezone_truncate_vtimezone(icalcomponent *vtz,
350 icaltimetype start,
351 icaltimetype end,
352 bool ms_compatible);
353
354/*
355 * @par Handling the default location the timezone files
356 */
357
372LIBICAL_ICAL_EXPORT const char *icaltimezone_get_system_zone_directory(void);
373
381LIBICAL_ICAL_EXPORT void icaltimezone_set_system_zone_directory(const char *zonepath);
382
388LIBICAL_ICAL_EXPORT const char *icaltimezone_get_zone_directory(void);
389
397LIBICAL_ICAL_EXPORT void icaltimezone_set_zone_directory(const char *path);
398
404LIBICAL_ICAL_EXPORT void icaltimezone_free_zone_directory(void);
405
412LIBICAL_ICAL_EXPORT void icaltimezone_set_builtin_tzdata(bool set);
413
419LIBICAL_ICAL_EXPORT bool icaltimezone_get_builtin_tzdata(void);
420
421/*
422 * Debugging Output.
423 */
424
448LIBICAL_ICAL_EXPORT bool icaltimezone_dump_changes(icaltimezone *zone, int max_year, FILE *fp);
449
450#endif /* ICALTIMEZONE_H */
Defines the data structure for iCalendar components.
icaltimezone * icaltimezone_new(void)
void icaltimezone_set_tzid_prefix(const char *new_prefix)
icaltimezone * icaltimezone_get_builtin_timezone_from_offset(int offset, const char *tzname)
double icaltimezone_get_longitude(const icaltimezone *zone)
void icaltimezone_free_zone_directory(void)
const char * icaltimezone_get_location(const icaltimezone *zone)
void icaltimezone_truncate_vtimezone(icalcomponent *vtz, icaltimetype start, icaltimetype end, bool ms_compatible)
void icaltimezone_set_builtin_tzdata(bool set)
icaltimezone * icaltimezone_copy(const icaltimezone *originalzone)
char * icaltimezone_get_location_from_vtimezone(icalcomponent *component)
char * icaltimezone_get_tznames_from_vtimezone(icalcomponent *component)
double icaltimezone_get_latitude(const icaltimezone *zone)
void icaltimezone_expand_vtimezone(icalcomponent *comp, int end_year, icalarray *changes)
void icaltimezone_set_system_zone_directory(const char *zonepath)
int icaltimezone_get_utc_offset_of_utc_time(icaltimezone *zone, const struct icaltimetype *tt, int *is_daylight)
icalcomponent * icaltimezone_get_component(icaltimezone *zone)
const char * icaltimezone_get_system_zone_directory(void)
void icaltimezone_free_builtin_timezones(void)
Releases builtin timezone memory.
int icaltimezone_get_utc_offset(icaltimezone *zone, const struct icaltimetype *tt, int *is_daylight)
const char * icaltimezone_get_tznames(icaltimezone *zone)
struct _icaltimezone icaltimezone
icaltimezone * icaltimezone_get_builtin_timezone(const char *location)
icalarray * icaltimezone_get_builtin_timezones(void)
const char * icaltimezone_get_tzid(icaltimezone *zone)
icaltimezone * icaltimezone_get_utc_timezone(void)
void icaltimezone_set_zone_directory(const char *path)
void icaltimezone_free(icaltimezone *zone, int free_struct)
Frees all memory used for the icaltimezone.
const char * icaltimezone_get_display_name(icaltimezone *zone)
const char * icaltimezone_get_zone_directory(void)
icaltimezone * icaltimezone_get_builtin_timezone_from_tzid(const char *tzid)
void icaltimezone_convert_time(struct icaltimetype *tt, icaltimezone *from_zone, icaltimezone *to_zone)
bool icaltimezone_dump_changes(icaltimezone *zone, int max_year, FILE *fp)
bool icaltimezone_get_builtin_tzdata(void)
bool icaltimezone_set_component(icaltimezone *zone, icalcomponent *comp)
const char * icaltimezone_tzid_prefix(void)