zephyr: Remove unused defines and headers.
[pidgin-git.git] / libpurple / group.h
blob8deef6ec51d2259a9517f15f63c47911a93f9c49
1 /* purple
3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef PURPLE_GROUP_H
23 #define PURPLE_GROUP_H
24 /**
25 * SECTION:group
26 * @section_id: libpurple-group
27 * @short_description: <filename>group.h</filename>
28 * @title: Buddy, Chat, Contact and Group node Objects
31 #include "countingnode.h"
33 #define PURPLE_TYPE_GROUP (purple_group_get_type())
34 #define PURPLE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_GROUP, PurpleGroup))
35 #define PURPLE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_GROUP, PurpleGroupClass))
36 #define PURPLE_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_GROUP))
37 #define PURPLE_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_GROUP))
38 #define PURPLE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_GROUP, PurpleGroupClass))
40 typedef struct _PurpleGroup PurpleGroup;
41 typedef struct _PurpleGroupClass PurpleGroupClass;
43 #include "account.h"
44 #include "blistnode.h"
45 #include "buddyicon.h"
46 #include "media.h"
47 #include "presence.h"
48 #include "status.h"
50 /**************************************************************************/
51 /* Data Structures */
52 /**************************************************************************/
55 * PurpleGroup:
57 * A group on the buddy list.
59 * A group is a counting node, which means it keeps track of the counts of the
60 * chats and contacts under this group.
62 struct _PurpleGroup {
63 PurpleCountingNode counting;
66 struct _PurpleGroupClass {
67 PurpleCountingNodeClass counting_class;
69 /*< private >*/
70 void (*_purple_reserved1)(void);
71 void (*_purple_reserved2)(void);
72 void (*_purple_reserved3)(void);
73 void (*_purple_reserved4)(void);
76 G_BEGIN_DECLS
78 /**************************************************************************/
79 /* Group API */
80 /**************************************************************************/
82 /**
83 * purple_group_get_type:
85 * Returns: The #GType for the #PurpleGroup object.
87 GType purple_group_get_type(void);
89 /**
90 * purple_group_new:
91 * @name: The name of the new group
93 * Creates a new group
95 * You can't have more than one group with the same name. Sorry. If you pass
96 * this the name of a group that already exists, it will return that group.
98 * Returns: A new group struct
100 PurpleGroup *purple_group_new(const char *name);
103 * purple_group_get_accounts:
104 * @g: The group
106 * Returns a list of accounts that have buddies in this group
108 * Returns: (element-type PurpleAccount) (transfer container): A list of
109 * accounts, or %NULL if the group has no accounts.
111 GSList *purple_group_get_accounts(PurpleGroup *g);
114 * purple_group_on_account:
115 * @g: The group to search through.
116 * @account: The account.
118 * Determines whether an account owns any buddies in a given group
120 * Returns: TRUE if there are any buddies in the group, or FALSE otherwise.
122 gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account);
125 * purple_group_set_name:
126 * @group: The group.
127 * @name: The name of the group.
129 * Sets the name of a group.
131 void purple_group_set_name(PurpleGroup *group, const char *name);
134 * purple_group_get_name:
135 * @group: The group.
137 * Returns the name of a group.
139 * Returns: The name of the group.
141 const char *purple_group_get_name(PurpleGroup *group);
143 G_END_DECLS
145 #endif /* PURPLE_GROUP_H */