icalss.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. #ifndef LIBICAL_ICALSS_H
  2. #define LIBICAL_ICALSS_H
  3. #ifndef S_SPLINT_S
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*======================================================================
  8. FILE: icalgauge.h
  9. CREATOR: eric 23 December 1999
  10. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  11. http://www.softwarestudio.org
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of either:
  14. The LGPL as published by the Free Software Foundation, version
  15. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  16. Or:
  17. The Mozilla Public License Version 1.0. You may obtain a copy of
  18. the License at http://www.mozilla.org/MPL/
  19. The Original Code is eric. The Initial Developer of the Original
  20. Code is Eric Busboom
  21. ======================================================================*/
  22. #ifndef ICALGAUGE_H
  23. #define ICALGAUGE_H
  24. #include "libical_icalss_export.h"
  25. /** @file icalgauge.h
  26. * @brief Routines implementing a filter for ical components
  27. */
  28. typedef struct icalgauge_impl icalgauge;
  29. LIBICAL_ICALSS_EXPORT icalgauge *icalgauge_new_from_sql(char *sql, int expand);
  30. LIBICAL_ICALSS_EXPORT int icalgauge_get_expand(icalgauge *gauge);
  31. LIBICAL_ICALSS_EXPORT void icalgauge_free(icalgauge *gauge);
  32. LIBICAL_ICALSS_EXPORT char *icalgauge_as_sql(icalcomponent *gauge);
  33. LIBICAL_ICALSS_EXPORT void icalgauge_dump(icalgauge *gauge);
  34. /** @brief Return true if comp matches the gauge.
  35. *
  36. * The component must be in
  37. * cannonical form -- a VCALENDAR with one VEVENT, VTODO or VJOURNAL
  38. * sub component
  39. */
  40. LIBICAL_ICALSS_EXPORT int icalgauge_compare(icalgauge *g, icalcomponent *comp);
  41. /** Clone the component, but only return the properties
  42. * specified in the gauge */
  43. LIBICAL_ICALSS_EXPORT icalcomponent *icalgauge_new_clone(icalgauge *g, icalcomponent *comp);
  44. #endif /* ICALGAUGE_H */
  45. /**
  46. @file icalset.h
  47. @author eric 28 November 1999
  48. Icalset is the "base class" for representations of a collection of
  49. iCal components. Derived classes (actually delegatees) include:
  50. icalfileset Store components in a single file
  51. icaldirset Store components in multiple files in a directory
  52. icalbdbset Store components in a Berkeley DB File
  53. icalheapset Store components on the heap
  54. icalmysqlset Store components in a mysql database.
  55. **/
  56. /*
  57. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  58. This program is free software; you can redistribute it and/or modify
  59. it under the terms of either:
  60. The LGPL as published by the Free Software Foundation, version
  61. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  62. Or:
  63. The Mozilla Public License Version 1.0. You may obtain a copy of
  64. the License at http://www.mozilla.org/MPL/
  65. The Original Code is eric. The Initial Developer of the Original
  66. Code is Eric Busboom
  67. ======================================================================*/
  68. #ifndef ICALSET_H
  69. #define ICALSET_H
  70. #include "libical_icalss_export.h"
  71. typedef struct icalset_impl icalset;
  72. typedef enum icalset_kind
  73. {
  74. ICAL_FILE_SET,
  75. ICAL_DIR_SET,
  76. ICAL_BDB_SET
  77. } icalset_kind;
  78. typedef struct icalsetiter
  79. {
  80. icalcompiter iter; /* icalcomponent_kind, pvl_elem iter */
  81. icalgauge *gauge;
  82. icalrecur_iterator *ritr; /*the last iterator */
  83. icalcomponent *last_component; /*the pending recurring component to be processed */
  84. const char *tzid; /* the calendar's timezone id */
  85. } icalsetiter;
  86. struct icalset_impl
  87. {
  88. icalset_kind kind;
  89. size_t size;
  90. char *dsn;
  91. icalset *(*init) (icalset *set, const char *dsn, void *options);
  92. void (*free) (icalset *set);
  93. const char *(*path) (icalset *set);
  94. void (*mark) (icalset *set);
  95. icalerrorenum(*commit) (icalset *set);
  96. icalerrorenum(*add_component) (icalset *set, icalcomponent *comp);
  97. icalerrorenum(*remove_component) (icalset *set, icalcomponent *comp);
  98. int (*count_components) (icalset *set, icalcomponent_kind kind);
  99. icalerrorenum(*select) (icalset *set, icalgauge *gauge);
  100. void (*clear) (icalset *set);
  101. icalcomponent *(*fetch) (icalset *set, icalcomponent_kind kind, const char *uid);
  102. icalcomponent *(*fetch_match) (icalset *set, icalcomponent *comp);
  103. int (*has_uid) (icalset *set, const char *uid);
  104. icalerrorenum(*modify) (icalset *set, icalcomponent *old, icalcomponent *newc);
  105. icalcomponent *(*get_current_component) (icalset *set);
  106. icalcomponent *(*get_first_component) (icalset *set);
  107. icalcomponent *(*get_next_component) (icalset *set);
  108. icalsetiter(*icalset_begin_component) (icalset *set,
  109. icalcomponent_kind kind, icalgauge *gauge,
  110. const char *tzid);
  111. icalcomponent *(*icalsetiter_to_next) (icalset *set, icalsetiter *i);
  112. icalcomponent *(*icalsetiter_to_prior) (icalset *set, icalsetiter *i);
  113. };
  114. /** @brief Register a new derived class */
  115. LIBICAL_ICALSS_EXPORT int icalset_register_class(icalset *set);
  116. /** @brief Generic icalset constructor
  117. *
  118. * @param kind The type of icalset to create
  119. * @param dsn Data Source Name - usually a pathname or DB handle
  120. * @param options Any implementation specific options
  121. *
  122. * @return A valid icalset reference or NULL if error.
  123. *
  124. * This creates any of the icalset types available.
  125. */
  126. LIBICAL_ICALSS_EXPORT icalset *icalset_new(icalset_kind kind, const char *dsn, void *options);
  127. LIBICAL_ICALSS_EXPORT icalset *icalset_new_file(const char *path);
  128. LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_reader(const char *path);
  129. LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_writer(const char *path);
  130. LIBICAL_ICALSS_EXPORT icalset *icalset_new_dir(const char *path);
  131. LIBICAL_ICALSS_EXPORT void icalset_free(icalset *set);
  132. LIBICAL_ICALSS_EXPORT const char *icalset_path(icalset *set);
  133. /** Mark the cluster as changed, so it will be written to disk when it
  134. is freed. **/
  135. LIBICAL_ICALSS_EXPORT void icalset_mark(icalset *set);
  136. /** Write changes to disk immediately */
  137. LIBICAL_ICALSS_EXPORT icalerrorenum icalset_commit(icalset *set);
  138. LIBICAL_ICALSS_EXPORT icalerrorenum icalset_add_component(icalset *set, icalcomponent *comp);
  139. LIBICAL_ICALSS_EXPORT icalerrorenum icalset_remove_component(icalset *set, icalcomponent *comp);
  140. LIBICAL_ICALSS_EXPORT int icalset_count_components(icalset *set, icalcomponent_kind kind);
  141. /** Restrict the component returned by icalset_first, _next to those
  142. that pass the gauge. */
  143. LIBICAL_ICALSS_EXPORT icalerrorenum icalset_select(icalset *set, icalgauge *gauge);
  144. /** Clears the gauge defined by icalset_select() */
  145. LIBICAL_ICALSS_EXPORT void icalset_clear_select(icalset *set);
  146. /** Get a component by uid */
  147. LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch(icalset *set, const char *uid);
  148. LIBICAL_ICALSS_EXPORT int icalset_has_uid(icalset *set, const char *uid);
  149. LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch_match(icalset *set, icalcomponent *c);
  150. /** Modify components according to the MODIFY method of CAP. Works on
  151. the currently selected components. */
  152. LIBICAL_ICALSS_EXPORT icalerrorenum icalset_modify(icalset *set,
  153. icalcomponent *oldc, icalcomponent *newc);
  154. /** Iterate through the components. If a guage has been defined, these
  155. will skip over components that do not pass the gauge */
  156. LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_current_component(icalset *set);
  157. LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_first_component(icalset *set);
  158. LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_next_component(icalset *set);
  159. /** External Iterator with gauge - for thread safety */
  160. LIBICAL_ICALSS_EXPORT extern icalsetiter icalsetiter_null;
  161. LIBICAL_ICALSS_EXPORT icalsetiter icalset_begin_component(icalset *set,
  162. icalcomponent_kind kind,
  163. icalgauge *gauge, const char *tzid);
  164. /** Default _next, _prior, _deref for subclasses that use single cluster */
  165. LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_next(icalsetiter *i);
  166. LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_prior(icalsetiter *i);
  167. LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_deref(icalsetiter *i);
  168. /** for subclasses that use multiple clusters that require specialized cluster traversal */
  169. LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_next(icalset *set, icalsetiter *i);
  170. LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_prior(icalset *set, icalsetiter *i);
  171. #endif /* !ICALSET_H */
  172. /*======================================================================
  173. FILE: icalcluster.h
  174. CREATOR: acampi 13 March 2002
  175. Copyright (C) 2002 Andrea Campi <a.campi@inet.it>
  176. This program is free software; you can redistribute it and/or modify
  177. it under the terms of either:
  178. The LGPL as published by the Free Software Foundation, version
  179. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  180. Or:
  181. The Mozilla Public License Version 1.0. You may obtain a copy of
  182. the License at http://www.mozilla.org/MPL/
  183. ======================================================================*/
  184. #ifndef ICALCLUSTER_H
  185. #define ICALCLUSTER_H
  186. #include "libical_icalss_export.h"
  187. typedef struct icalcluster_impl icalcluster;
  188. LIBICAL_ICALSS_EXPORT icalcluster *icalcluster_new(const char *key, icalcomponent *data);
  189. LIBICAL_ICALSS_EXPORT icalcluster *icalcluster_new_clone(const icalcluster *cluster);
  190. LIBICAL_ICALSS_EXPORT void icalcluster_free(icalcluster *cluster);
  191. LIBICAL_ICALSS_EXPORT const char *icalcluster_key(icalcluster *cluster);
  192. LIBICAL_ICALSS_EXPORT int icalcluster_is_changed(icalcluster *cluster);
  193. LIBICAL_ICALSS_EXPORT void icalcluster_mark(icalcluster *cluster);
  194. LIBICAL_ICALSS_EXPORT void icalcluster_commit(icalcluster *cluster);
  195. LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_component(icalcluster *cluster);
  196. LIBICAL_ICALSS_EXPORT int icalcluster_count_components(icalcluster *cluster,
  197. icalcomponent_kind kind);
  198. LIBICAL_ICALSS_EXPORT icalerrorenum icalcluster_add_component(icalcluster *cluster,
  199. icalcomponent *child);
  200. LIBICAL_ICALSS_EXPORT icalerrorenum icalcluster_remove_component(icalcluster *cluster,
  201. icalcomponent *child);
  202. LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_current_component(icalcluster *cluster);
  203. LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_first_component(icalcluster *cluster);
  204. LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_next_component(icalcluster *cluster);
  205. #endif /* !ICALCLUSTER_H */
  206. /*======================================================================
  207. FILE: icalfileset.h
  208. CREATOR: eric 23 December 1999
  209. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  210. This program is free software; you can redistribute it and/or modify
  211. it under the terms of either:
  212. The LGPL as published by the Free Software Foundation, version
  213. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  214. Or:
  215. The Mozilla Public License Version 1.0. You may obtain a copy of
  216. the License at http://www.mozilla.org/MPL/
  217. The Original Code is eric. The Initial Developer of the Original
  218. Code is Eric Busboom
  219. ======================================================================*/
  220. #ifndef ICALFILESET_H
  221. #define ICALFILESET_H
  222. #include "libical_icalss_export.h"
  223. typedef struct icalfileset_impl icalfileset;
  224. LIBICAL_ICALSS_EXPORT icalset *icalfileset_new(const char *path);
  225. LIBICAL_ICALSS_EXPORT icalset *icalfileset_new_reader(const char *path);
  226. LIBICAL_ICALSS_EXPORT icalset *icalfileset_new_writer(const char *path);
  227. LIBICAL_ICALSS_EXPORT icalset *icalfileset_init(icalset *set, const char *dsn, void *options);
  228. LIBICAL_ICALSS_EXPORT icalfileset *icalfileset_new_from_cluster(const char *path,
  229. icalcluster *cluster);
  230. LIBICAL_ICALSS_EXPORT icalcluster *icalfileset_produce_icalcluster(const char *path);
  231. LIBICAL_ICALSS_EXPORT void icalfileset_free(icalset *cluster);
  232. LIBICAL_ICALSS_EXPORT const char *icalfileset_path(icalset *cluster);
  233. /* Mark the cluster as changed, so it will be written to disk when it
  234. is freed. Commit writes to disk immediately. */
  235. LIBICAL_ICALSS_EXPORT void icalfileset_mark(icalset *set);
  236. LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_commit(icalset *set);
  237. LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_add_component(icalset *set, icalcomponent *child);
  238. LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_remove_component(icalset *set,
  239. icalcomponent *child);
  240. LIBICAL_ICALSS_EXPORT int icalfileset_count_components(icalset *set, icalcomponent_kind kind);
  241. /**
  242. * Restrict the component returned by icalfileset_first, _next to those
  243. * that pass the gauge. _clear removes the gauge
  244. */
  245. LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_select(icalset *set, icalgauge *gauge);
  246. /** clear the gauge **/
  247. LIBICAL_ICALSS_EXPORT void icalfileset_clear(icalset *set);
  248. /** Get and search for a component by uid **/
  249. LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_fetch(icalset *set,
  250. icalcomponent_kind kind, const char *uid);
  251. LIBICAL_ICALSS_EXPORT int icalfileset_has_uid(icalset *set, const char *uid);
  252. LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_fetch_match(icalset *set, icalcomponent *c);
  253. /**
  254. * Modify components according to the MODIFY method of CAP. Works on the
  255. * currently selected components.
  256. */
  257. LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_modify(icalset *set,
  258. icalcomponent *oldcomp,
  259. icalcomponent *newcomp);
  260. /* Iterate through components. If a gauge has been defined, these
  261. will skip over components that do not pass the gauge */
  262. LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_current_component(icalset *cluster);
  263. LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_first_component(icalset *cluster);
  264. LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_next_component(icalset *cluster);
  265. /* External iterator for thread safety */
  266. LIBICAL_ICALSS_EXPORT icalsetiter icalfileset_begin_component(icalset *set,
  267. icalcomponent_kind kind,
  268. icalgauge *gauge, const char *tzid);
  269. LIBICAL_ICALSS_EXPORT icalcomponent *icalfilesetiter_to_next(icalset *set, icalsetiter *iter);
  270. LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_form_a_matched_recurrence_component(icalsetiter *
  271. itr);
  272. /** Return a reference to the internal component. You probably should
  273. not be using this. */
  274. LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_component(icalset *cluster);
  275. /**
  276. * @brief options for opening an icalfileset.
  277. *
  278. * These options should be passed to the icalset_new() function
  279. */
  280. typedef struct icalfileset_options
  281. {
  282. int flags; /**< flags for open() O_RDONLY, etc */
  283. int mode; /**< file mode */
  284. int safe_saves; /**< to lock or not */
  285. icalcluster *cluster; /**< use this cluster to initialize data */
  286. } icalfileset_options;
  287. extern icalfileset_options icalfileset_options_default;
  288. #endif /* !ICALFILESET_H */
  289. /*======================================================================
  290. FILE: icaldirset.h
  291. CREATOR: eric 28 November 1999
  292. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  293. http://www.softwarestudio.org
  294. This program is free software; you can redistribute it and/or modify
  295. it under the terms of either:
  296. The LGPL as published by the Free Software Foundation, version
  297. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  298. Or:
  299. The Mozilla Public License Version 1.0. You may obtain a copy of
  300. the License at http://www.mozilla.org/MPL/
  301. The Original Code is eric. The Initial Developer of the Original
  302. Code is Eric Busboom
  303. ======================================================================*/
  304. #ifndef ICALDIRSET_H
  305. #define ICALDIRSET_H
  306. #include "libical_icalss_export.h"
  307. /* icaldirset Routines for storing, fetching, and searching for ical
  308. * objects in a database */
  309. typedef struct icaldirset_impl icaldirset;
  310. LIBICAL_ICALSS_EXPORT icalset *icaldirset_new(const char *path);
  311. LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_reader(const char *path);
  312. LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_writer(const char *path);
  313. LIBICAL_ICALSS_EXPORT icalset *icaldirset_init(icalset *set, const char *dsn, void *options);
  314. LIBICAL_ICALSS_EXPORT void icaldirset_free(icalset *set);
  315. LIBICAL_ICALSS_EXPORT const char *icaldirset_path(icalset *set);
  316. /* Mark the cluster as changed, so it will be written to disk when it
  317. is freed. Commit writes to disk immediately*/
  318. LIBICAL_ICALSS_EXPORT void icaldirset_mark(icalset *set);
  319. LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_commit(icalset *set);
  320. LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_add_component(icalset *store, icalcomponent *comp);
  321. LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_remove_component(icalset *store,
  322. icalcomponent *comp);
  323. LIBICAL_ICALSS_EXPORT int icaldirset_count_components(icalset *store, icalcomponent_kind kind);
  324. /* Restrict the component returned by icaldirset_first, _next to those
  325. that pass the gauge. _clear removes the gauge. */
  326. LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_select(icalset *store, icalgauge *gauge);
  327. LIBICAL_ICALSS_EXPORT void icaldirset_clear(icalset *store);
  328. /* Get a component by uid */
  329. LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch(icalset *store,
  330. icalcomponent_kind kind, const char *uid);
  331. LIBICAL_ICALSS_EXPORT int icaldirset_has_uid(icalset *store, const char *uid);
  332. LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch_match(icalset *set, icalcomponent *c);
  333. /* Modify components according to the MODIFY method of CAP. Works on
  334. the currently selected components. */
  335. LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_modify(icalset *store,
  336. icalcomponent *oldc, icalcomponent *newc);
  337. /* Iterate through the components. If a gauge has been defined, these
  338. will skip over components that do not pass the gauge */
  339. LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_current_component(icalset *store);
  340. LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_first_component(icalset *store);
  341. LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_next_component(icalset *store);
  342. /* External iterator for thread safety */
  343. LIBICAL_ICALSS_EXPORT icalsetiter icaldirset_begin_component(icalset *set,
  344. icalcomponent_kind kind,
  345. icalgauge *gauge, const char *tzid);
  346. LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_next(icalset *set, icalsetiter *i);
  347. LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_prior(icalset *set, icalsetiter *i);
  348. typedef struct icaldirset_options
  349. {
  350. int flags; /**< flags corresponding to the open() system call O_RDWR, etc. */
  351. } icaldirset_options;
  352. #endif /* !ICALDIRSET_H */
  353. /*======================================================================
  354. FILE: icalcalendar.h
  355. CREATOR: eric 23 December 1999
  356. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  357. This program is free software; you can redistribute it and/or modify
  358. it under the terms of either:
  359. The LGPL as published by the Free Software Foundation, version
  360. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  361. Or:
  362. The Mozilla Public License Version 1.0. You may obtain a copy of
  363. the License at http://www.mozilla.org/MPL/
  364. The Original Code is eric. The Initial Developer of the Original
  365. Code is Eric Busboom
  366. ======================================================================*/
  367. #ifndef ICALCALENDAR_H
  368. #define ICALCALENDAR_H
  369. #include "libical_icalss_export.h"
  370. /* icalcalendar
  371. * Routines for storing calendar data in a file system. The calendar
  372. * has two icaldirsets, one for incoming components and one for booked
  373. * components. It also has interfaces to access the free/busy list
  374. * and a list of calendar properties */
  375. typedef struct icalcalendar_impl icalcalendar;
  376. LIBICAL_ICALSS_EXPORT icalcalendar *icalcalendar_new(char *dir);
  377. LIBICAL_ICALSS_EXPORT void icalcalendar_free(icalcalendar *calendar);
  378. LIBICAL_ICALSS_EXPORT int icalcalendar_lock(icalcalendar *calendar);
  379. LIBICAL_ICALSS_EXPORT int icalcalendar_unlock(icalcalendar *calendar);
  380. LIBICAL_ICALSS_EXPORT int icalcalendar_islocked(icalcalendar *calendar);
  381. LIBICAL_ICALSS_EXPORT int icalcalendar_ownlock(icalcalendar *calendar);
  382. LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_booked(icalcalendar *calendar);
  383. LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_incoming(icalcalendar *calendar);
  384. LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_properties(icalcalendar *calendar);
  385. LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_freebusy(icalcalendar *calendar);
  386. #endif /* !ICALCALENDAR_H */
  387. /*======================================================================
  388. FILE: icalclassify.h
  389. CREATOR: eric 21 Aug 2000
  390. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  391. http://www.softwarestudio.org
  392. This program is free software; you can redistribute it and/or modify
  393. it under the terms of either:
  394. The LGPL as published by the Free Software Foundation, version
  395. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  396. Or:
  397. The Mozilla Public License Version 1.0. You may obtain a copy of
  398. the License at http://www.mozilla.org/MPL/
  399. =========================================================================*/
  400. #ifndef ICALCLASSIFY_H
  401. #define ICALCLASSIFY_H
  402. #include "libical_icalss_export.h"
  403. LIBICAL_ICALSS_EXPORT icalproperty_xlicclass icalclassify(icalcomponent *c,
  404. icalcomponent *match, const char *user);
  405. LIBICAL_ICALSS_EXPORT icalcomponent *icalclassify_find_overlaps(icalset *set,
  406. icalcomponent *comp);
  407. LIBICAL_ICALSS_EXPORT char *icalclassify_class_to_string(icalproperty_xlicclass c);
  408. #endif /* ICALCLASSIFY_H */
  409. /*======================================================================
  410. FILE: icalspanlist.h
  411. CREATOR: eric 21 Aug 2000
  412. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  413. http://www.softwarestudio.org
  414. This program is free software; you can redistribute it and/or modify
  415. it under the terms of either:
  416. The LGPL as published by the Free Software Foundation, version
  417. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  418. Or:
  419. The Mozilla Public License Version 1.0. You may obtain a copy of
  420. the License at http://www.mozilla.org/MPL/
  421. =========================================================================*/
  422. #ifndef ICALSPANLIST_H
  423. #define ICALSPANLIST_H
  424. #include "libical_icalss_export.h"
  425. /** @file icalspanlist.h
  426. * @brief Code that supports collections of free/busy spans of time
  427. */
  428. typedef struct icalspanlist_impl icalspanlist;
  429. /** @brief Constructor
  430. * Make a free list from a set of component. Start and end should be in UTC
  431. */
  432. LIBICAL_ICALSS_EXPORT icalspanlist *icalspanlist_new(icalset *set,
  433. struct icaltimetype start,
  434. struct icaltimetype end);
  435. /** @brief Destructor
  436. */
  437. LIBICAL_ICALSS_EXPORT void icalspanlist_free(icalspanlist *spl);
  438. /* Unimplemented functions */
  439. LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_make_free_list(icalspanlist *sl);
  440. LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_make_busy_list(icalspanlist *sl);
  441. /** Get first next free time after time t. all times are in UTC. */
  442. LIBICAL_ICALSS_EXPORT struct icalperiodtype icalspanlist_next_free_time(icalspanlist *sl,
  443. struct icaltimetype t);
  444. /** Get first next busy time after time t. all times are in UTC. */
  445. LIBICAL_ICALSS_EXPORT struct icalperiodtype icalspanlist_next_busy_time(icalspanlist *sl,
  446. struct icaltimetype t);
  447. LIBICAL_ICALSS_EXPORT void icalspanlist_dump(icalspanlist *s);
  448. /** @brief Return a valid VFREEBUSY component for this span */
  449. LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_as_vfreebusy(icalspanlist *s_in,
  450. const char *organizer,
  451. const char *attendee);
  452. /** @brief Return an integer matrix of total events per delta_t timespan */
  453. LIBICAL_ICALSS_EXPORT int *icalspanlist_as_freebusy_matrix(icalspanlist *span, int delta_t);
  454. /** @brief Construct an icalspanlist from a VFREEBUSY component */
  455. LIBICAL_ICALSS_EXPORT icalspanlist *icalspanlist_from_vfreebusy(icalcomponent *c);
  456. #endif
  457. /*======================================================================
  458. FILE: icalmessage.h
  459. CREATOR: eric 07 Nov 2000
  460. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  461. This program is free software; you can redistribute it and/or modify
  462. it under the terms of either:
  463. The LGPL as published by the Free Software Foundation, version
  464. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  465. Or:
  466. The Mozilla Public License Version 1.0. You may obtain a copy of
  467. the License at http://www.mozilla.org/MPL/
  468. =========================================================================*/
  469. #ifndef ICALMESSAGE_H
  470. #define ICALMESSAGE_H
  471. #include "libical_icalss_export.h"
  472. LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_accept_reply(icalcomponent *c,
  473. const char *user,
  474. const char *msg);
  475. LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_decline_reply(icalcomponent *c,
  476. const char *user,
  477. const char *msg);
  478. /* New is modified version of old */
  479. LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_counterpropose_reply(icalcomponent *oldc,
  480. icalcomponent *newc,
  481. const char *user,
  482. const char *msg);
  483. LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_delegate_reply(icalcomponent *c,
  484. const char *user,
  485. const char *delegatee,
  486. const char *msg);
  487. LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_cancel_event(icalcomponent *c,
  488. const char *user,
  489. const char *msg);
  490. LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_cancel_instance(icalcomponent *c,
  491. const char *user,
  492. const char *msg);
  493. LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_cancel_all(icalcomponent *c,
  494. const char *user, const char *msg);
  495. LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_error_reply(icalcomponent *c,
  496. const char *user,
  497. const char *msg,
  498. const char *debug,
  499. icalrequeststatus rs);
  500. #endif /* ICALMESSAGE_H */
  501. #ifdef __cplusplus
  502. }
  503. #endif
  504. #endif
  505. #endif