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
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_CONTACT_H
23 #define PURPLE_CONTACT_H
26 * @section_id: libpurple-contact
27 * @short_description: <filename>contact.h</filename>
28 * @title: Contact Object
31 #define PURPLE_TYPE_CONTACT (purple_contact_get_type())
32 #define PURPLE_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_CONTACT, PurpleContact))
33 #define PURPLE_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_CONTACT, PurpleContactClass))
34 #define PURPLE_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_CONTACT))
35 #define PURPLE_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_CONTACT))
36 #define PURPLE_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_CONTACT, PurpleContactClass))
38 typedef struct _PurpleContact PurpleContact
;
39 typedef struct _PurpleContactClass PurpleContactClass
;
41 #include "countingnode.h"
47 * A contact on the buddy list.
49 * A contact is a counting node, which means it keeps track of the counts of
50 * the buddies under this contact.
52 struct _PurpleContact
{
53 PurpleCountingNode counting
;
56 struct _PurpleContactClass
{
57 PurpleCountingNodeClass counting_class
;
60 void (*_purple_reserved1
)(void);
61 void (*_purple_reserved2
)(void);
62 void (*_purple_reserved3
)(void);
63 void (*_purple_reserved4
)(void);
68 /**************************************************************************/
70 /**************************************************************************/
73 * purple_contact_get_type:
75 * Returns: The #GType for the #PurpleContact object.
77 GType
purple_contact_get_type(void);
82 * Creates a new contact
84 * Returns: A new contact struct
86 PurpleContact
*purple_contact_new(void);
89 * purple_contact_get_group:
90 * @contact: The contact
92 * Gets the PurpleGroup from a PurpleContact
96 PurpleGroup
*purple_contact_get_group(const PurpleContact
*contact
);
99 * purple_contact_get_priority_buddy:
100 * @contact: The contact
102 * Returns the highest priority buddy for a given contact.
104 * Returns: The highest priority buddy
106 PurpleBuddy
*purple_contact_get_priority_buddy(PurpleContact
*contact
);
109 * purple_contact_set_alias:
110 * @contact: The contact
113 * Sets the alias for a contact.
115 void purple_contact_set_alias(PurpleContact
*contact
, const char *alias
);
118 * purple_contact_get_alias:
119 * @contact: The contact
121 * Gets the alias for a contact.
123 * Returns: The alias, or NULL if it is not set.
125 const char *purple_contact_get_alias(PurpleContact
*contact
);
128 * purple_contact_on_account:
129 * @contact: The contact to search through.
130 * @account: The account.
132 * Determines whether an account owns any buddies in a given contact
134 * Returns: TRUE if there are any buddies from account in the contact, or FALSE otherwise.
136 gboolean
purple_contact_on_account(PurpleContact
*contact
, PurpleAccount
*account
);
139 * purple_contact_invalidate_priority_buddy:
140 * @contact: The contact
142 * Invalidates the priority buddy so that the next call to
143 * purple_contact_get_priority_buddy recomputes it.
145 void purple_contact_invalidate_priority_buddy(PurpleContact
*contact
);
148 * purple_contact_merge:
149 * @source: The contact to merge
150 * @node: The place to merge to (a buddy or contact)
152 * Merges two contacts
154 * All of the buddies from source will be moved to target
156 void purple_contact_merge(PurpleContact
*source
, PurpleBlistNode
*node
);
161 #endif /* PURPLE_CONTACT_H */