libpurple/purplecontact.h

Wed, 08 Feb 2023 08:59:47 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Wed, 08 Feb 2023 08:59:47 -0600
changeset 42049
16d2e16bd24f
parent 41948
6d844d2faff1
child 42338
2548eb61acc9
permissions
-rw-r--r--

Export Account::error

I can't think of a good reason why we shouldn't expose the error property on
Accounts. But I would like to be able to set the error from the UI when there
is an error in the settings for example.

Testing Done:
Built the docs, ran the tests, used the prune connection action in the demo protocol plugin and verified everything was still working.

Reviewed at https://reviews.imfreedom.org/r/2216/

41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * (at your option) any later version.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * GNU General Public License for more details.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * along with this program; if not, see <https://www.gnu.org/licenses/>.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 # error "only <pidgin.h> may be included directly"
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 #endif
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #ifndef PURPLE_CONTACT_H
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #define PURPLE_CONTACT_H
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include <glib.h>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #include <glib-object.h>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include <gdk-pixbuf/gdk-pixbuf.h>
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
41948
6d844d2faff1 Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41933
diff changeset
31 #include <libpurple/purplecontactinfo.h>
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 G_BEGIN_DECLS
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #define PURPLE_TYPE_CONTACT (purple_contact_get_type())
41948
6d844d2faff1 Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41933
diff changeset
36 G_DECLARE_FINAL_TYPE(PurpleContact, purple_contact, PURPLE, CONTACT,
6d844d2faff1 Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41933
diff changeset
37 PurpleContactInfo)
41918
106ae46b290b Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41917
diff changeset
38
41920
29ebd938c592 Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents: 41918
diff changeset
39 #include <libpurple/account.h>
41933
8ccd6fdc7ceb Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents: 41930
diff changeset
40
8ccd6fdc7ceb Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents: 41930
diff changeset
41 /**
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 * PurpleContact:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 *
41948
6d844d2faff1 Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41933
diff changeset
44 * A contact is a concrete representation of a user in that it contains all of
6d844d2faff1 Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41933
diff changeset
45 * the contact information as well as a [class@Purple.Account] to use that
6d844d2faff1 Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents: 41933
diff changeset
46 * contact information with.
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 * purple_contact_new:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 * @account: The [class@Purple.Account] this contact is from.
41759
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
52 * @id: (nullable): The id of the contact.
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 * Creates a new [class@Purple.Contact].
41759
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
55 *
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
56 * If @id is %NULL, an ID will be randomly generated.
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
57 *
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
58 * Returns: (transfer full): The new instance.
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
59 *
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
60 * Since: 3.0.0
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 */
41759
1ecc0512e714 Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents: 41755
diff changeset
62 PurpleContact *purple_contact_new(PurpleAccount *account, const gchar *id);
41739
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 /**
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 * purple_contact_get_account:
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 * @contact: The instance.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 * Gets the [class@Purple.Account] that @contact belongs to.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * Returns: (transfer none): The [class@Purple.Account] that @contact belongs
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 * to.
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 *
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 * Since: 3.0.0
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 */
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 PurpleAccount *purple_contact_get_account(PurpleContact *contact);
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 G_END_DECLS
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78
f589ceec0172 Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 #endif /* PURPLE_CONTACT_H */

mercurial