| |
1 /* |
| |
2 * Purple - Internet Messaging Library |
| |
3 * Copyright (C) Pidgin Developers <devel@pidgin.im> |
| |
4 * |
| |
5 * This library is free software; you can redistribute it and/or |
| |
6 * modify it under the terms of the GNU Lesser General Public |
| |
7 * License as published by the Free Software Foundation; either |
| |
8 * version 2 of the License, or (at your option) any later version. |
| |
9 * |
| |
10 * This library 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 GNU |
| |
13 * Lesser General Public License for more details. |
| |
14 * |
| |
15 * You should have received a copy of the GNU Lesser General Public |
| |
16 * License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| |
17 */ |
| |
18 |
| |
19 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
| |
20 # error "only <purple.h> may be included directly" |
| |
21 #endif |
| |
22 |
| |
23 #ifndef PURPLE_ADD_CONTACT_REQUEST_H |
| |
24 #define PURPLE_ADD_CONTACT_REQUEST_H |
| |
25 |
| |
26 #include <glib.h> |
| |
27 #include <glib-object.h> |
| |
28 |
| |
29 #include "account.h" |
| |
30 |
| |
31 G_BEGIN_DECLS |
| |
32 |
| |
33 /** |
| |
34 * PurpleAddContactRequest: |
| |
35 * |
| |
36 * #PurpleAddContactRequest is a data structure that contains all of the |
| |
37 * information when someone has added you to their contact list, so the user |
| |
38 * interface can ask the user to add the remote user to their contact list. |
| |
39 * |
| |
40 * Since: 3.0.0 |
| |
41 */ |
| |
42 |
| |
43 #define PURPLE_TYPE_ADD_CONTACT_REQUEST (purple_add_contact_request_get_type()) |
| |
44 G_DECLARE_FINAL_TYPE(PurpleAddContactRequest, purple_add_contact_request, |
| |
45 PURPLE, ADD_CONTACT_REQUEST, GObject) |
| |
46 |
| |
47 /** |
| |
48 * purple_add_contact_request_new: |
| |
49 * @account: The account that this request is for. |
| |
50 * @username: The username of the user requesting authorization. |
| |
51 * |
| |
52 * Creates a new [class@Purple.AddContactRequest] for @username on @account. |
| |
53 * |
| |
54 * This is typically only used by libpurple itself. |
| |
55 * |
| |
56 * Returns: The new instance. |
| |
57 * |
| |
58 * Since: 3.0.0 |
| |
59 */ |
| |
60 PurpleAddContactRequest *purple_add_contact_request_new(PurpleAccount *account, const gchar *username); |
| |
61 |
| |
62 /** |
| |
63 * purple_add_contact_request_get_account: |
| |
64 * @request: The instance. |
| |
65 * |
| |
66 * Gets the [class@Account] for @request. |
| |
67 * |
| |
68 * Returns: (transfer none): The account. |
| |
69 * |
| |
70 * Since: 3.0.0 |
| |
71 */ |
| |
72 PurpleAccount *purple_add_contact_request_get_account(PurpleAddContactRequest *request); |
| |
73 |
| |
74 /** |
| |
75 * purple_add_contact_request_get_remote_username: |
| |
76 * @request: The instance. |
| |
77 * |
| |
78 * Gets the username for the user requesting authorization. |
| |
79 * |
| |
80 * Returns: The username of the remote user. |
| |
81 * |
| |
82 * Since: 3.0.0 |
| |
83 */ |
| |
84 const gchar *purple_add_contact_request_get_username(PurpleAddContactRequest *request); |
| |
85 |
| |
86 /** |
| |
87 * purple_add_contact_request_set_alias: |
| |
88 * @request: The instance. |
| |
89 * @alias: (nullable): The alias of the remote user. |
| |
90 * |
| |
91 * Sets the alias of the remote user to @alias. User interfaces can use this |
| |
92 * when presenting the authorization request to the end user. |
| |
93 * |
| |
94 * Since: 3.0.0 |
| |
95 */ |
| |
96 void purple_add_contact_request_set_alias(PurpleAddContactRequest *request, const gchar *alias); |
| |
97 |
| |
98 /** |
| |
99 * purple_add_contact_request_get_alias: |
| |
100 * @request: The instance. |
| |
101 * |
| |
102 * Gets the alias of the remote user if one was set. |
| |
103 * |
| |
104 * Returns: (nullable): The alias if one was set. |
| |
105 * |
| |
106 * Since: 3.0.0 |
| |
107 */ |
| |
108 const gchar *purple_add_contact_request_get_alias(PurpleAddContactRequest *request); |
| |
109 |
| |
110 /** |
| |
111 * purple_add_contact_request_set_message: |
| |
112 * @request: The instance. |
| |
113 * @message: (nullable): An optional message from the remote user. |
| |
114 * |
| |
115 * Sets an optional message from remote user, that the user interface can |
| |
116 * display to the end user. |
| |
117 * |
| |
118 * Since: 3.0.0 |
| |
119 */ |
| |
120 void purple_add_contact_request_set_message(PurpleAddContactRequest *request, const gchar *message); |
| |
121 |
| |
122 /** |
| |
123 * purple_add_contact_request_get_message: |
| |
124 * @request: The instance. |
| |
125 * |
| |
126 * Gets the message that was optionally sent by the remote user. |
| |
127 * |
| |
128 * Returns: (nullable): The optional message. |
| |
129 * |
| |
130 * Since: 3.0.0 |
| |
131 */ |
| |
132 const gchar *purple_add_contact_request_get_message(PurpleAddContactRequest *request); |
| |
133 |
| |
134 /** |
| |
135 * purple_add_contact_request_add: |
| |
136 * @request: The instance. |
| |
137 * |
| |
138 * Emits the [signal@AddContactRequest::add] signal. This is typically called |
| |
139 * by the user interface when the user has clicked the add button. |
| |
140 * |
| |
141 * If this is called multiple times, then this does nothing. |
| |
142 * |
| |
143 * Since: 3.0.0 |
| |
144 */ |
| |
145 void purple_add_contact_request_add(PurpleAddContactRequest *request); |
| |
146 |
| |
147 G_END_DECLS |
| |
148 |
| |
149 #endif /* PURPLE_ADD_CONTACT_REQUEST_H */ |