pidgin/pidgincontactcompletion.h

changeset 41321
97b0dbc1873f
parent 41320
1695e758b590
child 41323
21185b889103
equal deleted inserted replaced
41320:1695e758b590 41321:97b0dbc1873f
1 /* pidgin
2 *
3 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
20 */
21
22 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
23 # error "only <pidgin.h> may be included directly"
24 #endif
25
26 #ifndef PIDGIN_CONTACT_COMPLETION_H
27 #define PIDGIN_CONTACT_COMPLETION_H
28
29 #include <gtk/gtk.h>
30
31 #include <purple.h>
32
33 G_BEGIN_DECLS
34
35 /**
36 * PidginContactCompletion:
37 *
38 * #PidginContactCompletion should be treated like a normal
39 * #GtkEntryCompletion, except it already does all of the setup for the
40 * completion. You can also filter by a #PurpleAccount to limit what's shown.
41 *
42 * |[<!-- language="C" -->
43 * GtkWidget *entry = gtk_entry_new();
44 * GtkEntryCompletion *completion = pidgin_contact_completion_new();
45 *
46 * gtk_entry_set_completion(GTK_ENTRY(entry), completion);
47 * pidgin_contact_completion_set_account(PIDGIN_CONTACT_COMPLETION(completion), account);
48 * g_object_unref(completion);
49 * ]|
50 */
51
52 #define PIDGIN_TYPE_CONTACT_COMPLETION pidgin_contact_completion_get_type()
53
54 G_DECLARE_FINAL_TYPE(PidginContactCompletion, pidgin_contact_completion, PIDGIN,
55 CONTACT_COMPLETION, GtkEntryCompletion)
56
57 /**
58 * pidgin_contact_completion_new:
59 *
60 * Creates a new #GtkEntryCompletion for looking up contacts.
61 *
62 * Returns: (transfer full): The new #GtkEntryCompletion instance.
63 *
64 * Since: 3.0.0
65 */
66 GtkEntryCompletion *pidgin_contact_completion_new(void);
67
68 /**
69 * pidgin_contact_completion_get_account:
70 * @completion: The #PidginContactCompletion instance.
71 *
72 * Gets the account that @completion is filtering for. If no filtering is set
73 * %NULL will be returned.
74 *
75 * Returns: (transfer full) (nullable): The #PurpleAccount that's being
76 * filtered for.
77 *
78 * Since: 3.0.0
79 */
80 PurpleAccount *pidgin_contact_completion_get_account(PidginContactCompletion *completion);
81
82 /**
83 * pidgin_contact_completion_set_account:
84 * @completion: The #PidginContactCompletion instance.
85 * @account: (nullable): The #PurpleAccount to filter for or %NULL.
86 *
87 * Set the #PurpleAccount that @completion should filter for. If @account is
88 * %NULL, all filtering will be disabled.
89 *
90 * Since: 3.0.0
91 */
92 void pidgin_contact_completion_set_account(PidginContactCompletion *completion, PurpleAccount *account);
93
94 G_END_DECLS
95
96 #endif /* PIDGIN_CONTACT_COMPLETION_H */

mercurial