Tue, 05 Sep 2023 00:05:12 -0500
Use PurpleAvatar for PurplePerson and PurpleContactInfo
I'm not sure why we didn't do this earlier, but it's done now.
Testing Done:
Connected a demo account and verified all of its icons showed up in the contact list.
Reviewed at https://reviews.imfreedom.org/r/2605/
| 41749 | 1 | /* |
| 2 | * Purple - Internet Messaging Library | |
| 3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> | |
| 4 | * | |
| 5 | * This program is free software; you can redistribute it and/or modify | |
| 6 | * it under the terms of the GNU General Public License as published by | |
| 7 | * the Free Software Foundation; either version 2 of the License, or | |
| 8 | * (at your option) any later version. | |
| 9 | * | |
| 10 | * This program is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with this program; if not, see <https://www.gnu.org/licenses/>. | |
| 17 | */ | |
| 18 | ||
| 19 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) | |
| 20 | # error "only <pidgin.h> may be included directly" | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifndef PURPLE_PERSON_H | |
| 24 | #define PURPLE_PERSON_H | |
| 25 | ||
| 26 | #include <glib.h> | |
| 27 | #include <glib-object.h> | |
| 28 | ||
|
42312
7d6f0b8b6e77
Use PurpleAvatar for PurplePerson and PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
42309
diff
changeset
|
29 | #include <libpurple/purpleavatar.h> |
| 41749 | 30 | #include <libpurple/purpletags.h> |
| 31 | ||
| 32 | G_BEGIN_DECLS | |
| 33 | ||
| 34 | #define PURPLE_TYPE_PERSON (purple_person_get_type()) | |
| 35 | G_DECLARE_FINAL_TYPE(PurplePerson, purple_person, PURPLE, PERSON, GObject) | |
| 36 | ||
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
37 | #include <libpurple/purplecontactinfo.h> |
|
41755
b7e6166e5300
Add a person property to PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41749
diff
changeset
|
38 | |
| 41749 | 39 | /** |
| 40 | * PurplePerson: | |
| 41 | * | |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
42 | * A collection of [class@Purple.ContactInfo] that contains a user selectable |
|
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
43 | * custom avatar and alias. |
| 41749 | 44 | * |
| 45 | * Since: 3.0.0 | |
| 46 | */ | |
| 47 | ||
| 48 | /** | |
| 49 | * purple_person_new: | |
| 50 | * | |
| 51 | * Creates a new [class@Purple.Person]. | |
| 52 | * | |
| 53 | * Returns: (transfer full): The new instance. | |
| 54 | * | |
| 55 | * Since: 3.0.0 | |
| 56 | */ | |
| 57 | PurplePerson *purple_person_new(void); | |
| 58 | ||
| 59 | /** | |
| 60 | * purple_person_get_id: | |
| 61 | * @person: The instance. | |
| 62 | * | |
| 63 | * Gets the id of @person. This is created internally and is read-only. | |
| 64 | * | |
| 65 | * Returns: The id of @person. | |
| 66 | * | |
| 67 | * Since: 3.0.0 | |
| 68 | */ | |
|
42309
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
69 | const char *purple_person_get_id(PurplePerson *person); |
| 41749 | 70 | |
| 71 | /** | |
| 72 | * purple_person_get_alias: | |
| 73 | * @person: The instance. | |
| 74 | * | |
| 75 | * Gets the alias of @person that was set by the libpurple user. | |
| 76 | * | |
| 77 | * This will be %NULL if no alias is set. | |
| 78 | * | |
| 79 | * Returns: (nullable): The alias of @person or %NULL. | |
| 80 | * | |
| 81 | * Since: 3.0.0 | |
| 82 | */ | |
|
42309
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
83 | const char *purple_person_get_alias(PurplePerson *person); |
| 41749 | 84 | |
| 85 | /** | |
| 86 | * purple_person_set_alias: | |
| 87 | * @person: The instance. | |
| 88 | * @alias: (nullable): The new alias. | |
| 89 | * | |
| 90 | * Sets the alias of @person to @alias. | |
| 91 | * | |
| 92 | * This should only be called in direct response to a user interaction to set a | |
| 93 | * custom alias. Protocol plugins should only be setting the alias of | |
| 94 | * [class@Purple.Contact]. | |
| 95 | * | |
| 96 | * If @alias is %NULL, then the previous alias is cleared. | |
| 97 | * | |
| 98 | * Since: 3.0.0 | |
| 99 | */ | |
|
42309
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
100 | void purple_person_set_alias(PurplePerson *person, const char *alias); |
| 41749 | 101 | |
| 102 | /** | |
|
42054
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
103 | * purple_person_get_avatar_for_display: |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
104 | * @person: The instance. |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
105 | * |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
106 | * Gets the avatar that should be displayed for @person. If @person has an |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
107 | * avatar set, it will be returned, otherwise this will fallback to the value |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
108 | * of [property@Purple.ContactInfo:avatar] for |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
109 | * [property@Purple.Person:priority-contact-info]. |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
110 | * |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
111 | * Returns: (transfer none) (nullable): The avatar to display. |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
112 | * |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
113 | * Since: 3.0.0 |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
114 | */ |
|
42312
7d6f0b8b6e77
Use PurpleAvatar for PurplePerson and PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
42309
diff
changeset
|
115 | PurpleAvatar *purple_person_get_avatar_for_display(PurplePerson *person); |
|
42054
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
116 | |
|
7aa77854392d
Add a property and accessor for getting the avatar to display for a PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42053
diff
changeset
|
117 | /** |
| 41749 | 118 | * purple_person_get_avatar: |
| 119 | * @person: The instance. | |
| 120 | * | |
| 121 | * Gets the avatar of @person or %NULL if no avatar is set. | |
| 122 | * | |
| 123 | * Returns: (transfer none) (nullable): The avatar for @person. | |
| 124 | * | |
| 125 | * Since: 3.0.0 | |
| 126 | */ | |
|
42312
7d6f0b8b6e77
Use PurpleAvatar for PurplePerson and PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
42309
diff
changeset
|
127 | PurpleAvatar *purple_person_get_avatar(PurplePerson *person); |
| 41749 | 128 | |
| 129 | /** | |
| 130 | * purple_person_set_avatar: | |
| 131 | * @person: The instance. | |
| 132 | * @avatar: (nullable): The new avatar. | |
| 133 | * | |
| 134 | * Sets the avatar of @person to @avatar. If @avatar is %NULL then the previous | |
| 135 | * avatar is cleared. | |
| 136 | * | |
| 137 | * This should only be called in direct response to a user interaction to set a | |
| 138 | * custom avatar. Protocol plugins should only be setting the avatars of | |
| 139 | * [class@Purple.Contact]. | |
| 140 | * | |
| 141 | * Since: 3.0.0 | |
| 142 | */ | |
|
42312
7d6f0b8b6e77
Use PurpleAvatar for PurplePerson and PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
42309
diff
changeset
|
143 | void purple_person_set_avatar(PurplePerson *person, PurpleAvatar *avatar); |
| 41749 | 144 | |
| 145 | /** | |
|
42309
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
146 | * purple_person_get_color: |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
147 | * @person: The instance. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
148 | * |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
149 | * Gets the custom color that has been set for this person. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
150 | * |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
151 | * Returns: (nullable): The custom color or %NULL if one is not set. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
152 | * |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
153 | * Since: 3.0.0 |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
154 | */ |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
155 | const char *purple_person_get_color(PurplePerson *person); |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
156 | |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
157 | /** |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
158 | * purple_person_set_color: |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
159 | * @person: The instance. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
160 | * @color: (nullable): The new color. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
161 | * |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
162 | * Sets the custom color of @person to @color. If @color is %NULL the custom |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
163 | * color is removed. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
164 | * |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
165 | * Since: 3.0.0 |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
166 | */ |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
167 | void purple_person_set_color(PurplePerson *person, const char *color); |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
168 | |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
169 | /** |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
170 | * purple_person_get_color_for_display: |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
171 | * @person: The instance. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
172 | * |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
173 | * Gets the color that should be used for @person. If [property@Person:color] |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
174 | * is set that will be returned, otherwise the result of |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
175 | * [method@ContactInfo.get_color] on the priority contact will be returned. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
176 | * |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
177 | * Returns: The color to display for @person. |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
178 | * |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
179 | * Since: 3.0.0 |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
180 | */ |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
181 | const char *purple_person_get_color_for_display(PurplePerson *person); |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
182 | |
|
52571584c0ae
Add color and color-for-display properties to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
42059
diff
changeset
|
183 | /** |
| 41749 | 184 | * purple_person_get_tags: |
| 185 | * @person: The instance. | |
| 186 | * | |
| 187 | * Gets the [class@Purple.Tags] instance for @person. | |
| 188 | * | |
| 189 | * Returns: (transfer none): The tags for @person. | |
| 190 | * | |
| 191 | * Since: 3.0.0 | |
| 192 | */ | |
| 193 | PurpleTags *purple_person_get_tags(PurplePerson *person); | |
| 194 | ||
| 195 | /** | |
|
42053
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
196 | * purple_person_get_name_for_display: |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
197 | * @person: The instance. |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
198 | * |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
199 | * Gets the name that should be displayed for @person. See |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
200 | * [property@Purple.Person:name-for-display] for more information. |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
201 | * |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
202 | * Returns: (transfer none): The name to display for @person. |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
203 | * |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
204 | * Since: 3.0.0 |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
205 | */ |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
206 | const char *purple_person_get_name_for_display(PurplePerson *person); |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
207 | |
|
742efe62e610
Add a name-for-display property to PurplePerson
Gary Kramlich <grim@reaperworld.com>
parents:
41975
diff
changeset
|
208 | /** |
| 41749 | 209 | * purple_person_add_contact: |
| 210 | * @person: The instance. | |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
211 | * @info: The [class@Purple.ContactInfo] to add. |
| 41749 | 212 | * |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
213 | * Adds @info to @person. |
| 41749 | 214 | * |
| 215 | * Duplicate contacts are currently allowed, but that may change at a later | |
| 216 | * time. | |
| 217 | * | |
| 218 | * Since: 3.0.0 | |
| 219 | */ | |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
220 | void purple_person_add_contact_info(PurplePerson *person, PurpleContactInfo *info); |
| 41749 | 221 | |
| 222 | /** | |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
223 | * purple_person_remove_contact_info: |
| 41749 | 224 | * @person: The instance. |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
225 | * @info: The [class@Purple.ContactInfo] to remove. |
| 41749 | 226 | * |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
227 | * Removes @info from @person. |
| 41749 | 228 | * |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
229 | * Returns: %TRUE if @info was found and removed otherwise %FALSE. |
| 41749 | 230 | * |
| 231 | * Since: 3.0.0 | |
| 232 | */ | |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
233 | gboolean purple_person_remove_contact_info(PurplePerson *person, PurpleContactInfo *info); |
| 41749 | 234 | |
| 235 | /** | |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
236 | * purple_person_get_priority_contact_info: |
| 41749 | 237 | * @person: The instance. |
| 238 | * | |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
239 | * Gets the contact info for the most available contact info in @person. |
| 41749 | 240 | * |
| 241 | * Returns: (transfer none) (nullable): The priority contact or %NULL if | |
| 242 | * @person does not have any contacts. | |
| 243 | * | |
| 244 | * Since: 3.0.0 | |
| 245 | */ | |
|
41948
6d844d2faff1
Split PurpleContactInfo out of PurpleContact
Gary Kramlich <grim@reaperworld.com>
parents:
41755
diff
changeset
|
246 | PurpleContactInfo *purple_person_get_priority_contact_info(PurplePerson *person); |
| 41749 | 247 | |
|
41975
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
248 | /* |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
249 | * purple_person_has_contacts: |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
250 | * @person: The instance. |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
251 | * |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
252 | * Gets whether or not @person has any contacts. |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
253 | * |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
254 | * Returns: %TRUE if @person has at least one contact, otherwise %FALSE. |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
255 | * |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
256 | * Since: 3.0.0 |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
257 | */ |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
258 | gboolean purple_person_has_contacts(PurplePerson *person); |
|
3ef645de21e7
Add tracking of PurplePerson's to PurpleContactManager
Gary Kramlich <grim@reaperworld.com>
parents:
41948
diff
changeset
|
259 | |
|
42059
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
260 | /** |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
261 | * purple_person_matches: |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
262 | * @person: The instance. |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
263 | * @needle: (nullable): The string to match on. |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
264 | * |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
265 | * Checks if the alias matches @needle. This also checks @needle against |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
266 | * [method@Purple.ContactInfo.matches] for each [class@Purple.ContactInfo] that |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
267 | * @person is tracking. |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
268 | * |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
269 | * If @needle is %NULL or empty string, %TRUE will be returned. |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
270 | * |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
271 | * Returns: %TRUE if @person matches @needle in any way. |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
272 | * |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
273 | * Since: 3.0.0 |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
274 | */ |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
275 | gboolean purple_person_matches(PurplePerson *person, const char *needle); |
|
e6dcbf0db616
Add search support to the contact list
Gary Kramlich <grim@reaperworld.com>
parents:
42054
diff
changeset
|
276 | |
| 41749 | 277 | G_END_DECLS |
| 278 | ||
| 279 | #endif /* PURPLE_PERSON_H */ |