Wed, 23 Nov 2022 22:41:43 -0600
Make PurpleContact derivable
We want to make PurpleContact derivable so that we can subclass it with
PurpleAccount. This will make things easier for everyone as we start moving
everything to PurpleContact as an account will just be a contact.
Testing Done:
Ran the unit tests and built the docs.
Reviewed at https://reviews.imfreedom.org/r/2081/
|
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 | |
|
41917
b3eda1d781c6
Fix some include loops
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
31 | #include <libpurple/purplepresence.h> |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | #include <libpurple/purpletags.h> |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | G_BEGIN_DECLS |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | #define PURPLE_TYPE_CONTACT (purple_contact_get_type()) |
|
41933
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
37 | G_DECLARE_DERIVABLE_TYPE(PurpleContact, purple_contact, PURPLE, CONTACT, |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
38 | GObject) |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | |
|
41918
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
40 | /** |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
41 | * PurpleContactPermission: |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
42 | * @PURPLE_CONTACT_PERMISSION_UNSET: The value is unset. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
43 | * @PURPLE_CONTACT_PERMISSION_ALLOW: The contact is allowed to contact the |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
44 | * user. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
45 | * @PURPLE_CONTACT_PERMISSION_DENY: The contact is not allowed to contact the |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
46 | * user. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
47 | * |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
48 | * A representation of whether or not a contact has permission to contact the |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
49 | * user. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
50 | * |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
51 | * Since: 3.0.0 |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
52 | */ |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
53 | typedef enum { |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
54 | PURPLE_CONTACT_PERMISSION_UNSET = 0, |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
55 | PURPLE_CONTACT_PERMISSION_ALLOW, |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
56 | PURPLE_CONTACT_PERMISSION_DENY, |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
57 | } PurpleContactPermission; |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
58 | |
|
41920
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
59 | #include <libpurple/account.h> |
|
41755
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
60 | #include <libpurple/purpleperson.h> |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
61 | |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | /** |
|
41933
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
63 | * PurpleContactClass: |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
64 | * @get_account: A virtual method whose sole purpose is to allow |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
65 | * [class@Purple.Account] to subclass [class@Purple.Contact]. |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
66 | * |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
67 | * The class struct for [class@Purple.Contact]. |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
68 | * |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
69 | * Since: 3.0.0 |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
70 | */ |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
71 | struct _PurpleContactClass { |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
72 | /*< private >*/ |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
73 | GObjectClass parent; |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
74 | |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
75 | /*< public >*/ |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
76 | PurpleAccount *(*get_account)(PurpleContact *contact); |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
77 | |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
78 | /*< private >*/ |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
79 | gpointer reserved[4]; |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
80 | }; |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
81 | |
|
8ccd6fdc7ceb
Make PurpleContact derivable
Gary Kramlich <grim@reaperworld.com>
parents:
41930
diff
changeset
|
82 | /** |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | * PurpleContact: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | * A representation of a user. Contacts are used everywhere you need to refer to |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | * a user. Be it a chat, an direct message, a file transfer, etc. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | * purple_contact_new: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | * @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
|
92 | * @id: (nullable): The id of the contact. |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | * 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
|
95 | * |
|
1ecc0512e714
Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
96 | * 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
|
97 | * |
|
1ecc0512e714
Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
98 | * 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
|
99 | * |
|
1ecc0512e714
Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
100 | * Since: 3.0.0 |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | */ |
|
41759
1ecc0512e714
Make purple_contact_new take the id instead of the username.
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
102 | PurpleContact *purple_contact_new(PurpleAccount *account, const gchar *id); |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | * purple_contact_get_account: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | * Gets the [class@Purple.Account] that @contact belongs to. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | * Returns: (transfer none): The [class@Purple.Account] that @contact belongs |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | * to. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | PurpleAccount *purple_contact_get_account(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | * purple_contact_get_id: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | * Gets the id of @contact. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | * If a protocol would like to set this, it should call |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | * [ctor@GObject.Object.new] and pass in the id attribute manually. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | * Returns: The id of the contact. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
129 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
130 | const gchar *purple_contact_get_id(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
131 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | /** |
|
41920
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
133 | * purple_contact_set_id: |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
134 | * @contact: The instance. |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
135 | * @id: The new identifier. |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
136 | * |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
137 | * Sets the identifier of @contact to @id. Note, this should be used rarely if |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
138 | * at all. The main intent of this, is for protocols to update the id of |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
139 | * [property@Purple.Account:contact] when an account is connected if it is |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
140 | * missing. |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
141 | * |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
142 | * Since: 3.0.0 |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
143 | */ |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
144 | void purple_contact_set_id(PurpleContact *contact, const char *id); |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
145 | |
|
29ebd938c592
Add a contact property to PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
41918
diff
changeset
|
146 | /** |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | * purple_contact_get_username: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | * Gets the username of @contact. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | * Returns: The username of @contact. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | const gchar *purple_contact_get_username(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | * purple_contact_set_username: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
161 | * @username: The new username. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
162 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
163 | * Sets the username of @contact to @username. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
164 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
165 | * This is primarily used by protocol plugins like IRC when a user changes |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
166 | * their "nick" which is their username. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
167 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
168 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
169 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
170 | void purple_contact_set_username(PurpleContact *contact, const gchar *username); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
171 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
172 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
173 | * purple_contact_get_display_name: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
174 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
175 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
176 | * Gets the display name for @contact. The display name is typically set by the |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
177 | * contact and is handled by the protocol plugin. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
178 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
179 | * Returns: (nullable): The display name of @contact if one is set, otherwise |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
180 | * %NULL will be returned. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
181 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
182 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
183 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
184 | const gchar *purple_contact_get_display_name(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
185 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
186 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
187 | * purple_contact_set_display_name: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
188 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
189 | * @display_name: (nullable): The new displayname. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
190 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
191 | * Sets the display name of @contact to @display_name. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
192 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
193 | * This should primarily only be used by protocol plugins and everyone else |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
194 | * should be using [method@Purple.Contact.set_alias]. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
195 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
196 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
197 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
198 | void purple_contact_set_display_name(PurpleContact *contact, const gchar *display_name); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
199 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
200 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
201 | * purple_contact_get_alias: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
202 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
203 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
204 | * Gets the alias for @contact. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
205 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
206 | * Returns: (nullable): The alias of @contact if one is set, otherwise %NULL. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
207 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
208 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
209 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
210 | const gchar *purple_contact_get_alias(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
211 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
212 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
213 | * purple_contact_set_alias: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
214 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
215 | * @alias: (nullable): The new alias. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
216 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
217 | * Sets the alias of @contact to @alias. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
218 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
219 | * Protocol plugins may use this value to synchronize across instances. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
220 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
221 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
222 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
223 | void purple_contact_set_alias(PurpleContact *contact, const gchar *alias); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
224 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
225 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
226 | * purple_contact_get_avatar: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
227 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
228 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
229 | * Gets the avatar for @contact if one is set. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
230 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
231 | * Returns: (transfer none): The avatar if set, otherwise %NULL. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
232 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
233 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
234 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
235 | GdkPixbuf *purple_contact_get_avatar(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
236 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
237 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
238 | * purple_contact_set_avatar: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
239 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
240 | * @avatar: (nullable): The new avatar to set. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
241 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
242 | * Sets the avatar for @contact to @avatar. If @avatar is %NULL an existing |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
243 | * avatar will be removed. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
244 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
245 | * Typically this should only called by the protocol plugin. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
247 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
248 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
249 | void purple_contact_set_avatar(PurpleContact *contact, GdkPixbuf *avatar); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
250 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
251 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
252 | * purple_contact_get_presence: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
253 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
254 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
255 | * Gets the [class@Purple.Presence] for @contact. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
256 | * |
|
41753
316c1207f787
Fix various small documentation errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41739
diff
changeset
|
257 | * Returns: (transfer none) (nullable): The presence for @contact if one is |
|
316c1207f787
Fix various small documentation errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41739
diff
changeset
|
258 | * set, otherwise %NULL. |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
259 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
260 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
261 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
262 | PurplePresence *purple_contact_get_presence(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
263 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
264 | /** |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
265 | * purple_contact_get_tags: |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
266 | * @contact: The instance. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
267 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
268 | * Gets the [class@Purple.Tags] instance for @contact. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
269 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
270 | * Returns: (transfer none): The tags for @contact. |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
271 | * |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
272 | * Since: 3.0.0 |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
273 | */ |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
274 | PurpleTags *purple_contact_get_tags(PurpleContact *contact); |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
275 | |
|
41755
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
276 | /** |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
277 | * purple_contact_set_person: |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
278 | * @contact: The instance. |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
279 | * @person: (nullable): The new [class@Purple.Person] or %NULL. |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
280 | * |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
281 | * Sets the person that @contact belongs to to @person. |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
282 | * |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
283 | * Since: 3.0.0 |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
284 | */ |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
285 | void purple_contact_set_person(PurpleContact *contact, PurplePerson *person); |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
286 | |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
287 | /** |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
288 | * purple_contact_get_person: |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
289 | * @contact: The instance. |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
290 | * |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
291 | * Gets the [class@Purple.Person] that @contact belongs to. |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
292 | * |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
293 | * Returns: (transfer none) (nullable): The [class@Purple.Person] that @contact |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
294 | * belongs to, or %NULL. |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
295 | * |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
296 | * Since: 3.0.0 |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
297 | */ |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
298 | PurplePerson *purple_contact_get_person(PurpleContact *contact); |
|
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41753
diff
changeset
|
299 | |
|
41918
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
300 | /** |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
301 | * purple_contact_get_permission: |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
302 | * @contact: The instance. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
303 | * |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
304 | * Gets the [enum@Purple.ContactPermission] for @contact. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
305 | * |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
306 | * Returns: The permission for @contact. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
307 | * |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
308 | * Since: 3.0.0 |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
309 | */ |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
310 | PurpleContactPermission purple_contact_get_permission(PurpleContact *contact); |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
311 | |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
312 | /** |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
313 | * purple_contact_set_permission: |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
314 | * @contact: The instance. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
315 | * @permission: The new permission of the contact. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
316 | * |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
317 | * Sets the permission of @contact to @permission. |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
318 | * |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
319 | * Since: 3.0.0 |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
320 | */ |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
321 | void purple_contact_set_permission(PurpleContact *contact, PurpleContactPermission permission); |
|
106ae46b290b
Add a permission property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41917
diff
changeset
|
322 | |
|
41929
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
323 | /** |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
324 | * purple_contact_get_name_for_display: |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
325 | * @contact: The instance. |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
326 | * |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
327 | * Gets the name that should be displayed for @contact. |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
328 | * |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
329 | * If @contact is associated with a [class@Purple.Person], the value of |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
330 | * [property@Purple.Person:alias] will be returned if it is set. |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
331 | * |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
332 | * Otherwise, this will return the first set property from the following list: |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
333 | * |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
334 | * * [property@Purple.Contact:alias] |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
335 | * * [property@Purple.Contact:display-name] |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
336 | * * [property@Purple.Contact:username] |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
337 | * * [property@Purple.Contact:id] |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
338 | * |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
339 | * Returns: (transfer none): The name to display for @contact. |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
340 | * |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
341 | * Since: 3.0.0 |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
342 | */ |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
343 | const char *purple_contact_get_name_for_display(PurpleContact *contact); |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
344 | |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
345 | /** |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
346 | * purple_contact_compare: |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
347 | * @a: The first instance. |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
348 | * @b: The second instance. |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
349 | * |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
350 | * Compares contacts @a and @b |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
351 | * |
|
41930
0472e404b129
Update purple_contact_sort's documentation to say it returns < 0 and > 1
Gary Kramlich <grim@reaperworld.com>
parents:
41929
diff
changeset
|
352 | * Returns: less than 0 if @a should be sorted before @b, 0 if they sorted |
|
0472e404b129
Update purple_contact_sort's documentation to say it returns < 0 and > 1
Gary Kramlich <grim@reaperworld.com>
parents:
41929
diff
changeset
|
353 | * equally, and greater than 0 if @a should be sorted after @b. |
|
41929
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
354 | * |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
355 | * Since: 3.0.0 |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
356 | */ |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
357 | int purple_contact_compare(PurpleContact *a, PurpleContact *b); |
|
7509b313b098
Add purple_contact_compare and purple_contact_get_name_for_display
Gary Kramlich <grim@reaperworld.com>
parents:
41920
diff
changeset
|
358 | |
|
41739
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
359 | G_END_DECLS |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
360 | |
|
f589ceec0172
Create the new PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
361 | #endif /* PURPLE_CONTACT_H */ |