6 * Copyright (C) 2011-2013 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
25 struct sipe_core_private
;
35 struct sipe_group
*sipe_group_find_by_id(struct sipe_core_private
*sipe_private
,
38 struct sipe_group
*sipe_group_find_by_name(struct sipe_core_private
*sipe_private
,
41 void sipe_group_create(struct sipe_core_private
*sipe_private
,
45 gboolean
sipe_group_rename(struct sipe_core_private
*sipe_private
,
46 struct sipe_group
*group
,
50 * Creates @c sipe_group structure for a new group and adds it into the group
51 * list of given account. If buddy is already in the list, its existing
52 * structure is returned.
54 * @param sipe_private SIPE core data
55 * @param name name of group (may be @c NULL)
56 * @param exchange_key Exchange key (may be @c NULL)
57 * @param change_key Change key (may be @c NULL)
58 * @param id numeric ID of group
60 * @return @c sipe_group structure or @c NULL if group creation failed
62 struct sipe_group
*sipe_group_add(struct sipe_core_private
*sipe_private
,
64 const gchar
*exchange_key
,
65 const gchar
*change_key
,
68 /* remove group from core & backend */
69 void sipe_group_remove(struct sipe_core_private
*sipe_private
,
70 struct sipe_group
*group
);
72 /* update alias/group list for a buddy on the server */
73 void sipe_group_update_buddy(struct sipe_core_private
*sipe_private
,
74 struct sipe_buddy
*buddy
);
77 * Prepare group list for an update
79 * @param sipe_private SIPE core data
81 void sipe_group_update_start(struct sipe_core_private
*sipe_private
);
84 * Finish group list update. This will remove obsolete groups.
86 * NOTE: this must be call after sipe_buddy_update_finish(), i.e. it
87 * assumes that the group is no longer associated with any buddy.
89 * @param sipe_private SIPE core data
91 void sipe_group_update_finish(struct sipe_core_private
*sipe_private
);
96 * @param sipe_private SIPE core data
98 * @return sipe_group structure or @c NULL if there are no groups
100 struct sipe_group
*sipe_group_first(struct sipe_core_private
*sipe_private
);
105 * @param sipe_private SIPE core data
107 guint
sipe_group_count(struct sipe_core_private
*sipe_private
);
110 * Initialize group data
112 * @param sipe_private SIPE core data
114 void sipe_group_init(struct sipe_core_private
*sipe_private
);
119 * @param sipe_private SIPE core data
121 void sipe_group_free(struct sipe_core_private
*sipe_private
);