Tue, 13 May 2025 00:49:03 -0500
Start of the appearance preferences
Testing Done:
Toggled the preference and verified the key file updated. Also edited the key file and verified the widget updated.
Bugs closed: PIDGIN-18082
Reviewed at https://reviews.imfreedom.org/r/3996/
| 42915 | 1 | /* |
| 2 | * Purple - Internet Messaging Library | |
| 3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> | |
| 4 | * | |
| 5 | * Purple is the legal property of its developers, whose names are too numerous | |
| 6 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 7 | * source distribution. | |
| 8 | * | |
| 9 | * This library is free software; you can redistribute it and/or modify it | |
| 10 | * under the terms of the GNU General Public License as published by the Free | |
| 11 | * Software Foundation; either version 2 of the License, or (at your option) | |
| 12 | * any later version. | |
| 13 | * | |
| 14 | * This library is distributed in the hope that it will be useful, but WITHOUT | |
| 15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
| 17 | * more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License along with | |
| 20 | * this library; if not, see <https://www.gnu.org/licenses/>. | |
| 21 | */ | |
| 22 | ||
| 23 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) | |
| 24 | # error "only <purple.h> may be included directly" | |
| 25 | #endif | |
| 26 | ||
| 27 | #ifndef PURPLE_BADGE_H | |
| 28 | #define PURPLE_BADGE_H | |
| 29 | ||
| 30 | #include <glib.h> | |
| 31 | #include <glib-object.h> | |
| 32 | ||
| 33 | #include "purpleversion.h" | |
| 34 | ||
| 35 | G_BEGIN_DECLS | |
| 36 | ||
| 37 | /** | |
| 38 | * PurpleBadge: | |
| 39 | * | |
| 40 | * #PurpleBadge is a data structure for badges. They are intended to be used | |
| 41 | * on [class@ConversationMembers] to display badges like "admin", "moderator", | |
| 42 | * "broadcaster", etc. | |
| 43 | * | |
| 44 | * Since: 3.0 | |
| 45 | */ | |
| 46 | ||
| 47 | #define PURPLE_TYPE_BADGE (purple_badge_get_type()) | |
| 48 | ||
| 49 | PURPLE_AVAILABLE_IN_3_0 | |
| 50 | G_DECLARE_FINAL_TYPE(PurpleBadge, purple_badge, PURPLE, BADGE, GObject) | |
| 51 | ||
| 52 | /** | |
| 53 | * purple_badge_new: | |
| 54 | * @id: The id. | |
| 55 | * @priority: The priority. | |
| 56 | * @icon_name: The icon name. | |
| 57 | * @mnemonic: A character as a mnemonic. | |
| 58 | * | |
| 59 | * Creates a new badge. | |
| 60 | * | |
| 61 | * Returns: (transfer full): The new instance. | |
| 62 | * | |
| 63 | * Since: 3.0 | |
| 64 | */ | |
| 65 | PURPLE_AVAILABLE_IN_3_0 | |
| 66 | PurpleBadge *purple_badge_new(const char *id, int priority, const char *icon_name, const char *mnemonic); | |
| 67 | ||
| 68 | /** | |
| 69 | * purple_badge_get_id: | |
| 70 | * @badge: The instance. | |
| 71 | * | |
| 72 | * Gets the id of @badge. | |
| 73 | * | |
| 74 | * Returns: The id of @badge. | |
| 75 | * | |
| 76 | * Since: 3.0 | |
| 77 | */ | |
| 78 | PURPLE_AVAILABLE_IN_3_0 | |
| 79 | const char *purple_badge_get_id(PurpleBadge *badge); | |
| 80 | ||
| 81 | /** | |
| 82 | * purple_badge_get_priority: | |
| 83 | * @badge: The instance. | |
| 84 | * | |
| 85 | * Gets the priority of @badge. | |
| 86 | * | |
| 87 | * Returns: The priority of @badge. | |
| 88 | * | |
| 89 | * Since: 3.0 | |
| 90 | */ | |
| 91 | PURPLE_AVAILABLE_IN_3_0 | |
| 92 | int purple_badge_get_priority(PurpleBadge *badge); | |
| 93 | ||
| 94 | /** | |
| 95 | * purple_badge_get_icon_name: | |
| 96 | * @badge: The instance. | |
| 97 | * | |
| 98 | * Gets the icon-name from @badge. | |
| 99 | * | |
| 100 | * Returns: The icon-name. | |
| 101 | * | |
| 102 | * Since: 3.0 | |
| 103 | */ | |
| 104 | PURPLE_AVAILABLE_IN_3_0 | |
| 105 | const char *purple_badge_get_icon_name(PurpleBadge *badge); | |
| 106 | ||
| 107 | /** | |
| 108 | * purple_badge_get_mnemonic: | |
| 109 | * @badge: The instance. | |
| 110 | * | |
| 111 | * Gets the mnemonic from @badge. | |
| 112 | * | |
| 113 | * Returns: The mnemonic. | |
| 114 | * | |
| 115 | * Since: 3.0 | |
| 116 | */ | |
| 117 | PURPLE_AVAILABLE_IN_3_0 | |
| 118 | const char *purple_badge_get_mnemonic(PurpleBadge *badge); | |
| 119 | ||
| 120 | /** | |
| 121 | * purple_badge_get_tooltip_text: | |
| 122 | * @badge: The instance. | |
| 123 | * | |
| 124 | * Gets the tooltip text from @badge. | |
| 125 | * | |
| 126 | * Returns: (nullable): The tooltip text. | |
| 127 | * | |
| 128 | * Since: 3.0 | |
| 129 | */ | |
| 130 | PURPLE_AVAILABLE_IN_3_0 | |
| 131 | const char *purple_badge_get_tooltip_text(PurpleBadge *badge); | |
| 132 | ||
| 133 | /** | |
| 134 | * purple_badge_set_tooltip_text: | |
| 135 | * @badge: The instance. | |
| 136 | * @tooltip_text: (nullable): The new tooltip text. | |
| 137 | * | |
| 138 | * Sets the tooltip text of @badge. | |
| 139 | * | |
| 140 | * Since: 3.0 | |
| 141 | */ | |
| 142 | PURPLE_AVAILABLE_IN_3_0 | |
| 143 | void purple_badge_set_tooltip_text(PurpleBadge *badge, const char *tooltip_text); | |
| 144 | ||
| 145 | /** | |
| 146 | * purple_badge_get_description: | |
| 147 | * @badge: The instance. | |
| 148 | * | |
| 149 | * Gets the description of @badge. | |
| 150 | * | |
| 151 | * This can be used by user interfaces to tell the user what this badge | |
| 152 | * represents. | |
| 153 | * | |
| 154 | * Returns: (nullable): The description of @badge. | |
| 155 | * | |
| 156 | * Since: 3.0 | |
| 157 | */ | |
| 158 | PURPLE_AVAILABLE_IN_3_0 | |
| 159 | const char *purple_badge_get_description(PurpleBadge *badge); | |
| 160 | ||
| 161 | /** | |
| 162 | * purple_badge_set_description: | |
| 163 | * @badge: The instance. | |
| 164 | * @description: (nullable): The new description. | |
| 165 | * | |
| 166 | * Sets the description of @badge to @description. | |
| 167 | * | |
| 168 | * Since: 3.0 | |
| 169 | */ | |
| 170 | PURPLE_AVAILABLE_IN_3_0 | |
| 171 | void purple_badge_set_description(PurpleBadge *badge, const char *description); | |
| 172 | ||
| 173 | /** | |
| 174 | * purple_badge_get_link_text: | |
| 175 | * @badge: The instance. | |
| 176 | * | |
| 177 | * Gets the text that should be displayed when displaying the link for @badge. | |
| 178 | * | |
| 179 | * Returns: (nullable): The link text. | |
| 180 | * | |
| 181 | * Since: 3.0 | |
| 182 | */ | |
| 183 | PURPLE_AVAILABLE_IN_3_0 | |
| 184 | const char *purple_badge_get_link_text(PurpleBadge *badge); | |
| 185 | ||
| 186 | /** | |
| 187 | * purple_badge_set_link_text: | |
| 188 | * @badge: The instance. | |
| 189 | * @link_text: (nullable): The new link text. | |
| 190 | * | |
| 191 | * Sets the link text of @badge to @link_text. | |
| 192 | * | |
| 193 | * Since: 3.0 | |
| 194 | */ | |
| 195 | PURPLE_AVAILABLE_IN_3_0 | |
| 196 | void purple_badge_set_link_text(PurpleBadge *badge, const char *link_text); | |
| 197 | ||
| 198 | /** | |
| 199 | * purple_badge_get_link_uri: | |
| 200 | * @badge: The instance. | |
| 201 | * | |
| 202 | * Gets the link URI of @badge. | |
| 203 | * | |
| 204 | * Returns: (nullable): The URI. | |
| 205 | * | |
| 206 | * Since: 3.0 | |
| 207 | */ | |
| 208 | PURPLE_AVAILABLE_IN_3_0 | |
| 209 | const char *purple_badge_get_link_uri(PurpleBadge *badge); | |
| 210 | ||
| 211 | /** | |
| 212 | * purple_badge_set_link_uri: | |
| 213 | * @badge: The instance. | |
| 214 | * @link_uri: (nullable): The new link URI. | |
| 215 | * | |
| 216 | * Sets the link URI of @badge to @link_uri. | |
| 217 | * | |
| 218 | * Since: 3.0 | |
| 219 | */ | |
| 220 | PURPLE_AVAILABLE_IN_3_0 | |
| 221 | void purple_badge_set_link_uri(PurpleBadge *badge, const char *link_uri); | |
| 222 | ||
| 223 | /** | |
| 224 | * purple_badge_compare: | |
| 225 | * @badge1: (nullable): The first badge. | |
| 226 | * @badge2: (nullable): The second badge. | |
| 227 | * | |
| 228 | * Gets which badge has higher priority. | |
| 229 | * | |
| 230 | * If @badge1 has a higher priority then an integer less than 0 will be | |
| 231 | * returned. If their priorities are equal, 0 will be returned. If @badge2 has | |
| 232 | * a higher priority, an integer greater than 0 will be returned. | |
| 233 | * | |
| 234 | * Returns: An integer less than 0 if @badge1 has higher priorty, 0 if they | |
| 235 | * have equal priorities, and an integer greater than 0 if @badge2 has | |
| 236 | * a higher priority. | |
| 237 | * | |
| 238 | * Since: 3.0 | |
| 239 | */ | |
| 240 | PURPLE_AVAILABLE_IN_3_0 | |
| 241 | int purple_badge_compare(PurpleBadge *badge1, PurpleBadge *badge2); | |
| 242 | ||
| 243 | /** | |
| 244 | * purple_badge_equal: | |
| 245 | * @badge1: (nullable): The first badge. | |
| 246 | * @badge2: (nullable): The second badge. | |
| 247 | * | |
| 248 | * Checks if @badge1 and @badge2 have the same id. | |
| 249 | * | |
| 250 | * Returns: %TRUE if the badges have the same id. | |
| 251 | * | |
| 252 | * Since: 3.0 | |
| 253 | */ | |
| 254 | PURPLE_AVAILABLE_IN_3_0 | |
| 255 | gboolean purple_badge_equal(PurpleBadge *badge1, PurpleBadge *badge2); | |
| 256 | ||
| 257 | G_END_DECLS | |
| 258 | ||
| 259 | #endif /* PURPLE_BADGE_H */ |