Merged pidgin/main into default
[pidgin-git.git] / libpurple / countingnode.h
blob8ba141be35284a6c9f482f0f09d9b3aa2e1c75dc
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_COUNTING_NODE_H
23 #define PURPLE_COUNTING_NODE_H
24 /**
25 * SECTION:countingnode
26 * @section_id: libpurple-countingnode
27 * @short_description: <filename>countingnode.h</filename>
28 * @title: CountingNode Object
31 #include <glib.h>
32 #include <glib-object.h>
34 #include "blistnode.h"
36 #define PURPLE_TYPE_COUNTING_NODE (purple_counting_node_get_type())
37 #define PURPLE_COUNTING_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_COUNTING_NODE, PurpleCountingNode))
38 #define PURPLE_COUNTING_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_COUNTING_NODE, PurpleCountingNodeClass))
39 #define PURPLE_IS_COUNTING_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_COUNTING_NODE))
40 #define PURPLE_IS_COUNTING_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_COUNTING_NODE))
41 #define PURPLE_COUNTING_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_COUNTING_NODE, PurpleCountingNodeClass))
43 typedef struct _PurpleCountingNode PurpleCountingNode;
44 typedef struct _PurpleCountingNodeClass PurpleCountingNodeClass;
46 /**
47 * PurpleCountingNode:
49 * A node that keeps count of the number of children that it has. It tracks the
50 * total number of children, the number of children corresponding to online
51 * accounts, and the number of online children.
53 * The two types of counting nodes are:
54 * <orderedlist>
55 * <listitem>Contact: Keeps track of the number of buddies under it.</listitem>
56 * <listitem>Group: Keeps track of the number of chats and contacts under it.
57 * </listitem>
58 * </orderedlist>
60 * See #PurpleContact, #PurpleGroup
62 struct _PurpleCountingNode {
63 PurpleBlistNode node;
66 struct _PurpleCountingNodeClass {
67 PurpleBlistNodeClass node_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 * purple_counting_node_get_type:
81 * Returns: The #GType for the #PurpleCountingNode object.
83 GType purple_counting_node_get_type(void);
85 /**
86 * purple_counting_node_get_total_size:
87 * @counter: The node
89 * Returns the total number of children of the counting node.
91 * Returns: The total number of children of the node
93 int purple_counting_node_get_total_size(PurpleCountingNode *counter);
95 /**
96 * purple_counting_node_get_current_size:
97 * @counter: The node
99 * Returns the number of children of the counting node corresponding to online
100 * accounts.
102 * Returns: The number of children with online accounts
104 int purple_counting_node_get_current_size(PurpleCountingNode *counter);
107 * purple_counting_node_get_online_count:
108 * @counter: The node
110 * Returns the number of children of the counting node that are online.
112 * Returns: The total number of online children
114 int purple_counting_node_get_online_count(PurpleCountingNode *counter);
117 * purple_counting_node_change_total_size:
118 * @counter: The node
119 * @delta: The value to change the total size by
121 * Changes the total number of children of the counting node. The provided
122 * delta value is added to the count, or if it's negative, the count is
123 * decreased.
125 void purple_counting_node_change_total_size(PurpleCountingNode *counter, int delta);
128 * purple_counting_node_change_current_size:
129 * @counter: The node
130 * @delta: The value to change the current size by
132 * Changes the number of children of the counting node corresponding to online
133 * accounts. The provided delta value is added to the count, or if it's
134 * negative, the count is decreased.
136 void purple_counting_node_change_current_size(PurpleCountingNode *counter, int delta);
139 * purple_counting_node_change_online_count:
140 * @counter: The node
141 * @delta: The value to change the online count by
143 * Changes the number of children of the counting node that are online. The
144 * provided delta value is added to the count, or if it's negative, the count is
145 * decreased.
147 void purple_counting_node_change_online_count(PurpleCountingNode *counter, int delta);
150 * purple_counting_node_set_total_size:
151 * @counter: The node
152 * @totalsize: The total number of children of the node
154 * Sets the total number of children of the counting node.
156 void purple_counting_node_set_total_size(PurpleCountingNode *counter, int totalsize);
159 * purple_counting_node_set_current_size:
160 * @counter: The node
161 * @currentsize: The number of children with online accounts
163 * Sets the number of children of the counting node corresponding to online
164 * accounts.
166 void purple_counting_node_set_current_size(PurpleCountingNode *counter, int currentsize);
169 * purple_counting_node_set_online_count:
170 * @counter: The node
171 * @onlinecount: The total number of online children
173 * Sets the number of children of the counting node that are online.
175 void purple_counting_node_set_online_count(PurpleCountingNode *counter, int onlinecount);
177 G_END_DECLS
179 #endif /* PURPLE_COUNTING_NODE_H */