Tue, 26 Jun 2012 22:38:37 +0200
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
| 11414 | 1 | /** |
|
13627
44233a1064f9
[gaim-migrate @ 16013]
Evan Schoenberg <evands@pidgin.im>
parents:
12373
diff
changeset
|
2 | * @file gg-utils.h |
| 11414 | 3 | * |
| 15884 | 4 | * purple |
| 11414 | 5 | * |
| 6 | * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us> | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 11414 | 21 | */ |
| 22 | ||
| 15884 | 23 | #ifndef _PURPLE_GG_UTILS_H |
| 24 | #define _PURPLE_GG_UTILS_H | |
| 11414 | 25 | |
| 26 | #include "internal.h" | |
| 27 | ||
| 28 | #include "plugin.h" | |
| 29 | #include "version.h" | |
| 30 | #include "notify.h" | |
| 31 | #include "status.h" | |
| 32 | #include "blist.h" | |
| 33 | #include "accountopt.h" | |
| 34 | #include "debug.h" | |
| 35 | #include "util.h" | |
| 36 | #include "request.h" | |
| 37 | ||
| 38 | #include "gg.h" | |
| 39 | ||
|
33298
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
40 | #define GGP_UIN_LEN_MAX 10 |
| 11414 | 41 | |
| 15288 | 42 | /** |
|
12224
bf547f7989a4
[gaim-migrate @ 14526]
Richard Laager <rlaager@pidgin.im>
parents:
12007
diff
changeset
|
43 | * Convert a base 10 string to a UIN. |
| 11414 | 44 | * |
|
12224
bf547f7989a4
[gaim-migrate @ 14526]
Richard Laager <rlaager@pidgin.im>
parents:
12007
diff
changeset
|
45 | * @param str The string to convert |
| 15288 | 46 | * |
| 47 | * @return UIN or 0 if an error occurred. | |
| 11414 | 48 | */ |
| 49 | uin_t | |
|
12224
bf547f7989a4
[gaim-migrate @ 14526]
Richard Laager <rlaager@pidgin.im>
parents:
12007
diff
changeset
|
50 | ggp_str_to_uin(const char *str); |
| 11414 | 51 | |
|
33298
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
52 | const char * ggp_uin_to_str(uin_t uin); |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
53 | |
| 11414 | 54 | /** |
| 15288 | 55 | * Calculate size of a NULL-terminated array. |
| 56 | * | |
| 57 | * @param array The array. | |
| 58 | * | |
| 59 | * @return Size of the array. | |
| 60 | */ | |
| 61 | unsigned int | |
| 62 | ggp_array_size(char **array); | |
| 63 | ||
| 64 | /** | |
| 11414 | 65 | * Convert enconding of a given string. |
| 66 | * | |
| 67 | * @param locstr Input string. | |
| 68 | * @param encsrc Current encoding of the string. | |
| 69 | * @param encdst Target encoding of the string. | |
| 70 | * | |
| 71 | * @return Converted string (it must be g_free()ed when not used. Or NULL if | |
| 72 | * locstr is NULL. | |
| 73 | */ | |
| 74 | char * | |
| 75 | charset_convert(const gchar *locstr, const char *encsrc, const char *encdst); | |
| 76 | ||
| 77 | /** | |
| 78 | * Get UIN of a given account. | |
| 79 | * | |
| 80 | * @param account Current account. | |
| 81 | * | |
| 82 | * @return UIN of an account. | |
| 83 | */ | |
| 84 | uin_t | |
| 15884 | 85 | ggp_get_uin(PurpleAccount *account); |
| 11414 | 86 | |
| 87 | /** | |
| 88 | * Returns the best name of a buddy from the buddylist. | |
| 89 | * | |
| 15884 | 90 | * @param gc PurpleConnection instance. |
| 11414 | 91 | * @param uin UIN of the buddy. |
| 92 | * | |
| 93 | * @return Name of the buddy, or UIN converted to string. | |
| 94 | */ | |
|
12373
a8f71f73576d
[gaim-migrate @ 14677]
Richard Laager <rlaager@pidgin.im>
parents:
12224
diff
changeset
|
95 | char * |
| 15884 | 96 | ggp_buddy_get_name(PurpleConnection *gc, const uin_t uin); |
| 11414 | 97 | |
|
20289
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
98 | /** |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
99 | * Manages the display of account's status in the buddylist. |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
100 | * |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
101 | * @param account Current account. |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
102 | */ |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
103 | void |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
104 | ggp_status_fake_to_self(PurpleAccount *account); |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
105 | |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
106 | |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
107 | /** |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
108 | * Adds an input handler in purple event loop for http request. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
109 | * |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
110 | * @see purple_input_add |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
111 | * |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
112 | * @param http_req Http connection to watch. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
113 | * @param func The callback function for data. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
114 | * @param user_data User-specified data. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
115 | * |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
116 | * @return The resulting handle (will be greater than 0). |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
117 | */ |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
118 | guint |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
119 | ggp_http_input_add(struct gg_http *http_req, PurpleInputFunction func, |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
120 | gpointer user_data); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20289
diff
changeset
|
121 | |
| 15884 | 122 | #endif /* _PURPLE_GG_UTILS_H */ |
| 11414 | 123 | |
| 12007 | 124 | /* vim: set ts=8 sts=0 sw=8 noet: */ |