| 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_AVATAR_H |
|
| 28 #define PURPLE_AVATAR_H |
|
| 29 |
|
| 30 #include <glib.h> |
|
| 31 #include <glib-object.h> |
|
| 32 |
|
| 33 #include <gdk-pixbuf/gdk-pixbuf.h> |
|
| 34 |
|
| 35 #include "purpletags.h" |
|
| 36 #include "purpleversion.h" |
|
| 37 |
|
| 38 G_BEGIN_DECLS |
|
| 39 |
|
| 40 #define PURPLE_TYPE_AVATAR (purple_avatar_get_type()) |
|
| 41 |
|
| 42 PURPLE_AVAILABLE_IN_3_0 |
|
| 43 G_DECLARE_FINAL_TYPE(PurpleAvatar, purple_avatar, PURPLE, AVATAR, GObject) |
|
| 44 |
|
| 45 /** |
|
| 46 * PurpleAvatar: |
|
| 47 * |
|
| 48 * A representation of an Avatar that is used for accounts, contacts, and |
|
| 49 * conversations. |
|
| 50 * |
|
| 51 * Since: 3.0 |
|
| 52 */ |
|
| 53 |
|
| 54 /** |
|
| 55 * purple_avatar_new_from_filename: |
|
| 56 * @filename: The filename for the avatar. |
|
| 57 * @error: Return address for a #GError, or %NULL. |
|
| 58 * |
|
| 59 * Creates a new avatar from @filename. |
|
| 60 * |
|
| 61 * Returns: (transfer full): The new instance. |
|
| 62 * |
|
| 63 * Since: 3.0 |
|
| 64 */ |
|
| 65 PURPLE_AVAILABLE_IN_3_0 |
|
| 66 PurpleAvatar *purple_avatar_new_from_filename(const char *filename, GError **error); |
|
| 67 |
|
| 68 /** |
|
| 69 * purple_avatar_new_from_resource: |
|
| 70 * @resource_path: The path of the resource file. |
|
| 71 * @error: Return address for a #GError, or %NULL. |
|
| 72 * |
|
| 73 * Creates a new avatar from the resource at @resource_path. |
|
| 74 * |
|
| 75 * Returns: (transfer full): The new instance. |
|
| 76 * |
|
| 77 * Since: 3.0 |
|
| 78 */ |
|
| 79 PURPLE_AVAILABLE_IN_3_0 |
|
| 80 PurpleAvatar *purple_avatar_new_from_resource(const char *resource_path, GError **error); |
|
| 81 |
|
| 82 /** |
|
| 83 * purple_avatar_get_filename: |
|
| 84 * @avatar: The instance. |
|
| 85 * |
|
| 86 * Gets the base filename of @avatar. |
|
| 87 * |
|
| 88 * Returns: The base filename of @avatar. |
|
| 89 * |
|
| 90 * Since: 3.0 |
|
| 91 */ |
|
| 92 PURPLE_AVAILABLE_IN_3_0 |
|
| 93 const char *purple_avatar_get_filename(PurpleAvatar *avatar); |
|
| 94 |
|
| 95 /** |
|
| 96 * purple_avatar_get_pixbuf: |
|
| 97 * @avatar: The instance. |
|
| 98 * |
|
| 99 * Gets the [class@GdkPixbuf.Pixbuf] of @avatar. |
|
| 100 * |
|
| 101 * If [property@Purple.Avatar:animated] is %TRUE, this returns a single frame |
|
| 102 * of the animation. To get the animation see |
|
| 103 * [method@Purple.Avatar.get_animation]. |
|
| 104 * |
|
| 105 * Returns: (transfer none): The pixbuf of the avatar which could be %NULL. |
|
| 106 * |
|
| 107 * Since: 3.0 |
|
| 108 */ |
|
| 109 PURPLE_AVAILABLE_IN_3_0 |
|
| 110 GdkPixbuf *purple_avatar_get_pixbuf(PurpleAvatar *avatar); |
|
| 111 |
|
| 112 /** |
|
| 113 * purple_avatar_get_animated: |
|
| 114 * @avatar: The instance. |
|
| 115 * |
|
| 116 * Gets whether or not @avatar is animated. |
|
| 117 * |
|
| 118 * Returns: %TRUE if @avatar is animated, %FALSE otherwise. |
|
| 119 * |
|
| 120 * Since: 3.0 |
|
| 121 */ |
|
| 122 PURPLE_AVAILABLE_IN_3_0 |
|
| 123 gboolean purple_avatar_get_animated(PurpleAvatar *avatar); |
|
| 124 |
|
| 125 /** |
|
| 126 * purple_avatar_get_animation: |
|
| 127 * @avatar: The instance. |
|
| 128 * |
|
| 129 * Gets the [class@GdkPixbuf.PixbufAnimation] if |
|
| 130 * [property@Purple.Avatar:animated] is %TRUE, otherwise %NULL. |
|
| 131 * |
|
| 132 * Returns: (transfer none): The animation or %NULL. |
|
| 133 * |
|
| 134 * Since: 3.0 |
|
| 135 */ |
|
| 136 PURPLE_AVAILABLE_IN_3_0 |
|
| 137 GdkPixbufAnimation *purple_avatar_get_animation(PurpleAvatar *avatar); |
|
| 138 |
|
| 139 /** |
|
| 140 * purple_avatar_get_tags: |
|
| 141 * @avatar: The instance. |
|
| 142 * |
|
| 143 * Gets the [class@Purple.Tags] for @avatar. |
|
| 144 * |
|
| 145 * Returns: (transfer none): The [class@Purple.Tags] for @avatar. |
|
| 146 * |
|
| 147 * Since: 3.0 |
|
| 148 */ |
|
| 149 PURPLE_AVAILABLE_IN_3_0 |
|
| 150 PurpleTags *purple_avatar_get_tags(PurpleAvatar *avatar); |
|
| 151 |
|
| 152 G_END_DECLS |
|
| 153 |
|
| 154 #endif /* PURPLE_AVATAR_H */ |
|