1 /*
2  * Copyright (C) 2019 Red Hat, Inc. (www.redhat.com)
3  *
4  * This library is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #if !defined (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION)
19 #error "Only <libecal/libecal.h> should be included directly."
20 #endif
21 
22 #ifndef E_CAL_COMPONENT_PARAMETER_BAG_H
23 #define E_CAL_COMPONENT_PARAMETER_BAG_H
24 
25 #include <glib-object.h>
26 #include <libical-glib/libical-glib.h>
27 
28 G_BEGIN_DECLS
29 
30 /**
31  * ECalComponentParameterBag:
32  *
33  * Opaque structure, which represents a bad (list) of #ICalParameter objects.
34  * Use the functions below to work with it.
35  **/
36 typedef struct _ECalComponentParameterBag ECalComponentParameterBag;
37 
38 /**
39  * ECalComponentParameterBagFilterFunc:
40  * @parameter: an #ICalParameter
41  * @user_data: user data for the callback
42  *
43  * A function used to filter which parameters should be added to the bag,
44  * when filling it with e_cal_component_parameter_bag_new_from_property()
45  * and e_cal_component_parameter_bag_set_from_property().
46  *
47  * Returns: %TRUE, to add the parameter to the bag; %FALSE, to not add it to the bag
48  *
49  * Since: 3.34
50  **/
51 typedef gboolean (* ECalComponentParameterBagFilterFunc)
52 						(ICalParameter *parameter,
53 						 gpointer user_data);
54 
55 GType		e_cal_component_parameter_bag_get_type
56 						(void);
57 ECalComponentParameterBag *
58 		e_cal_component_parameter_bag_new
59 						(void);
60 ECalComponentParameterBag *
61 		e_cal_component_parameter_bag_new_from_property
62 						(const ICalProperty *property,
63 						 ECalComponentParameterBagFilterFunc func,
64 						 gpointer user_data);
65 ECalComponentParameterBag *
66 		e_cal_component_parameter_bag_copy
67 						(const ECalComponentParameterBag *bag);
68 void		e_cal_component_parameter_bag_free
69 						(gpointer bag); /* ECalComponentParameterBag * */
70 void		e_cal_component_parameter_bag_set_from_property
71 						(ECalComponentParameterBag *bag,
72 						 const ICalProperty *property,
73 						 ECalComponentParameterBagFilterFunc func,
74 						 gpointer user_data);
75 void		e_cal_component_parameter_bag_fill_property
76 						(const ECalComponentParameterBag *bag,
77 						 ICalProperty *property);
78 void		e_cal_component_parameter_bag_assign
79 						(ECalComponentParameterBag *bag,
80 						 const ECalComponentParameterBag *src_bag);
81 void		e_cal_component_parameter_bag_add(ECalComponentParameterBag *bag,
82 						 const ICalParameter *param);
83 void		e_cal_component_parameter_bag_take
84 						(ECalComponentParameterBag *bag,
85 						 ICalParameter *param);
86 guint		e_cal_component_parameter_bag_get_count
87 						(const ECalComponentParameterBag *bag);
88 ICalParameter *	e_cal_component_parameter_bag_get(const ECalComponentParameterBag *bag,
89 						 guint index);
90 guint		e_cal_component_parameter_bag_get_first_by_kind
91 						(const ECalComponentParameterBag *bag,
92 						 ICalParameterKind kind);
93 void		e_cal_component_parameter_bag_remove
94 						(ECalComponentParameterBag *bag,
95 						 guint index);
96 guint		e_cal_component_parameter_bag_remove_by_kind
97 						(ECalComponentParameterBag *bag,
98 						 ICalParameterKind kind,
99 						 gboolean all);
100 void		e_cal_component_parameter_bag_clear
101 						(ECalComponentParameterBag *bag);
102 
103 G_END_DECLS
104 
105 #endif /* E_CAL_COMPONENT_PARAMETER_BAG_H */
106