icalproperty.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*======================================================================
  2. FILE: icalproperty.h
  3. CREATOR: eric 20 March 1999
  4. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  5. http://www.softwarestudio.org
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of either:
  8. The LGPL as published by the Free Software Foundation, version
  9. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  10. Or:
  11. The Mozilla Public License Version 1.0. You may obtain a copy of
  12. the License at http://www.mozilla.org/MPL/
  13. ======================================================================*/
  14. #ifndef ICALPROPERTY_H
  15. #define ICALPROPERTY_H
  16. #include "libical_ical_export.h"
  17. #include "icalderivedproperty.h" /* To get icalproperty_kind enumerations */
  18. #include <stdarg.h> /* for va_... */
  19. LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new(icalproperty_kind kind);
  20. LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_impl(icalproperty_kind kind);
  21. LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_clone(icalproperty *prop);
  22. LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_from_string(const char *str);
  23. LIBICAL_ICAL_EXPORT const char *icalproperty_as_ical_string(icalproperty *prop);
  24. LIBICAL_ICAL_EXPORT char *icalproperty_as_ical_string_r(icalproperty *prop);
  25. LIBICAL_ICAL_EXPORT void icalproperty_free(icalproperty *prop);
  26. LIBICAL_ICAL_EXPORT icalproperty_kind icalproperty_isa(icalproperty *property);
  27. LIBICAL_ICAL_EXPORT int icalproperty_isa_property(void *property);
  28. LIBICAL_ICAL_EXPORT void icalproperty_add_parameters(struct icalproperty_impl *prop, va_list args);
  29. LIBICAL_ICAL_EXPORT void icalproperty_add_parameter(icalproperty *prop, icalparameter *parameter);
  30. LIBICAL_ICAL_EXPORT void icalproperty_set_parameter(icalproperty *prop, icalparameter *parameter);
  31. LIBICAL_ICAL_EXPORT void icalproperty_set_parameter_from_string(icalproperty *prop,
  32. const char *name,
  33. const char *value);
  34. LIBICAL_ICAL_EXPORT const char *icalproperty_get_parameter_as_string(icalproperty *prop,
  35. const char *name);
  36. LIBICAL_ICAL_EXPORT char *icalproperty_get_parameter_as_string_r(icalproperty *prop,
  37. const char *name);
  38. LIBICAL_ICAL_EXPORT void icalproperty_remove_parameter(icalproperty *prop,
  39. icalparameter_kind kind);
  40. LIBICAL_ICAL_EXPORT void icalproperty_remove_parameter_by_kind(icalproperty *prop,
  41. icalparameter_kind kind);
  42. LIBICAL_ICAL_EXPORT void icalproperty_remove_parameter_by_name(icalproperty *prop,
  43. const char *name);
  44. LIBICAL_ICAL_EXPORT void icalproperty_remove_parameter_by_ref(icalproperty *prop,
  45. icalparameter *param);
  46. LIBICAL_ICAL_EXPORT int icalproperty_count_parameters(const icalproperty *prop);
  47. /* Iterate through the parameters */
  48. LIBICAL_ICAL_EXPORT icalparameter *icalproperty_get_first_parameter(icalproperty *prop,
  49. icalparameter_kind kind);
  50. LIBICAL_ICAL_EXPORT icalparameter *icalproperty_get_next_parameter(icalproperty *prop,
  51. icalparameter_kind kind);
  52. /* Access the value of the property */
  53. LIBICAL_ICAL_EXPORT void icalproperty_set_value(icalproperty *prop, icalvalue *value);
  54. LIBICAL_ICAL_EXPORT void icalproperty_set_value_from_string(icalproperty *prop, const char *value,
  55. const char *kind);
  56. LIBICAL_ICAL_EXPORT icalvalue *icalproperty_get_value(const icalproperty *prop);
  57. LIBICAL_ICAL_EXPORT const char *icalproperty_get_value_as_string(const icalproperty *prop);
  58. LIBICAL_ICAL_EXPORT char *icalproperty_get_value_as_string_r(const icalproperty *prop);
  59. LIBICAL_ICAL_EXPORT void icalvalue_set_parent(icalvalue *value, icalproperty *property);
  60. /* Deal with X properties */
  61. LIBICAL_ICAL_EXPORT void icalproperty_set_x_name(icalproperty *prop, const char *name);
  62. LIBICAL_ICAL_EXPORT const char *icalproperty_get_x_name(icalproperty *prop);
  63. /** Return the name of the property -- the type name converted to a
  64. * string, or the value of _get_x_name if the type is and X
  65. * property
  66. */
  67. LIBICAL_ICAL_EXPORT const char *icalproperty_get_property_name(const icalproperty *prop);
  68. LIBICAL_ICAL_EXPORT char *icalproperty_get_property_name_r(const icalproperty *prop);
  69. LIBICAL_ICAL_EXPORT icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value);
  70. /* Convert kinds to string and get default value type */
  71. LIBICAL_ICAL_EXPORT icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind);
  72. LIBICAL_ICAL_EXPORT icalproperty_kind icalproperty_value_kind_to_kind(icalvalue_kind kind);
  73. LIBICAL_ICAL_EXPORT const char *icalproperty_kind_to_string(icalproperty_kind kind);
  74. LIBICAL_ICAL_EXPORT icalproperty_kind icalproperty_string_to_kind(const char *string);
  75. /** Check validity of a specific icalproperty_kind **/
  76. LIBICAL_ICAL_EXPORT int icalproperty_kind_is_valid(const icalproperty_kind kind);
  77. LIBICAL_ICAL_EXPORT icalproperty_method icalproperty_string_to_method(const char *str);
  78. LIBICAL_ICAL_EXPORT const char *icalproperty_method_to_string(icalproperty_method method);
  79. LIBICAL_ICAL_EXPORT const char *icalproperty_enum_to_string(int e);
  80. LIBICAL_ICAL_EXPORT char *icalproperty_enum_to_string_r(int e);
  81. LIBICAL_ICAL_EXPORT int icalproperty_string_to_enum(const char *str);
  82. LIBICAL_ICAL_EXPORT int icalproperty_kind_and_string_to_enum(const int kind, const char *str);
  83. LIBICAL_ICAL_EXPORT const char *icalproperty_status_to_string(icalproperty_status);
  84. LIBICAL_ICAL_EXPORT icalproperty_status icalproperty_string_to_status(const char *string);
  85. LIBICAL_ICAL_EXPORT int icalproperty_enum_belongs_to_property(icalproperty_kind kind, int e);
  86. #endif /*ICALPROPERTY_H */