Mon, 07 Aug 2023 23:21:08 -0500
Add PurpleProtocolContactSearchInterface to search for contacts
This interface is meant for you to be able to search for new contacts to add to
your contact list. Right now this just does keyword search, but can be extended
in the future.
Searching through your contact list is the ui's responsibility.
Testing Done:
Ran the unit tests
Reviewed at https://reviews.imfreedom.org/r/2533/
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1 | /* pidgin |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
2 | * |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
5 | * source distribution. |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
6 | * |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
7 | * This program is free software; you can redistribute it and/or modify |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
8 | * it under the terms of the GNU General Public License as published by |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
9 | * the Free Software Foundation; either version 2 of the License, or |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
10 | * (at your option) any later version. |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
11 | * |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
12 | * This program is distributed in the hope that it will be useful, |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
15 | * GNU General Public License for more details. |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
16 | * |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
17 | * You should have received a copy of the GNU General Public License |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
18 | * along with this program; if not, write to the Free Software |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
20 | */ |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
21 | |
|
40502
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
22 | #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION) |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
23 | # error "only <pidgin.h> may be included directly" |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
24 | #endif |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
25 | |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
26 | #ifndef PIDGIN_ACCOUNT_CHOOSER_H |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
27 | #define PIDGIN_ACCOUNT_CHOOSER_H |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
28 | |
|
39788
6e86cff44a34
Convert account chooser to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39787
diff
changeset
|
29 | #include <gtk/gtk.h> |
|
41864
6f490dec468f
Move PidginAccountChooser to GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41857
diff
changeset
|
30 | #include <adwaita.h> |
|
39788
6e86cff44a34
Convert account chooser to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39787
diff
changeset
|
31 | |
|
40474
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40248
diff
changeset
|
32 | #include <purple.h> |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
33 | |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
34 | G_BEGIN_DECLS |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
35 | |
|
39788
6e86cff44a34
Convert account chooser to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39787
diff
changeset
|
36 | #define PIDGIN_TYPE_ACCOUNT_CHOOSER (pidgin_account_chooser_get_type()) |
|
6e86cff44a34
Convert account chooser to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39787
diff
changeset
|
37 | |
|
6e86cff44a34
Convert account chooser to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39787
diff
changeset
|
38 | G_DECLARE_FINAL_TYPE(PidginAccountChooser, pidgin_account_chooser, PIDGIN, |
|
41864
6f490dec468f
Move PidginAccountChooser to GtkDropDown
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41857
diff
changeset
|
39 | ACCOUNT_CHOOSER, AdwBin) |
|
39788
6e86cff44a34
Convert account chooser to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39787
diff
changeset
|
40 | |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
41 | /** |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
42 | * pidgin_account_chooser_new: |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
43 | * |
|
39795
5b9c99c1378d
Fix some more account chooser doc errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39793
diff
changeset
|
44 | * Creates a combo box filled with accounts. |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
45 | * |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
46 | * Returns: (transfer full): The account chooser combo box. |
|
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
47 | * |
|
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
48 | * Since: 3.0.0 |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
49 | */ |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
50 | GtkWidget *pidgin_account_chooser_new(void); |
|
39793
2a29bc06910b
Move account chooser filter in a separate setter.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39788
diff
changeset
|
51 | |
|
2a29bc06910b
Move account chooser filter in a separate setter.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39788
diff
changeset
|
52 | /** |
|
41857
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
53 | * pidgin_account_chooser_get_filter: |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
54 | * @chooser: The chooser. |
|
39793
2a29bc06910b
Move account chooser filter in a separate setter.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39788
diff
changeset
|
55 | * |
|
41857
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
56 | * Gets the filter used to determine which accounts to show. |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
57 | * |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
58 | * Returns: (transfer none): Returns the #GtkFilter that is currently |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
59 | * displayed. |
|
39793
2a29bc06910b
Move account chooser filter in a separate setter.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39788
diff
changeset
|
60 | * |
|
2a29bc06910b
Move account chooser filter in a separate setter.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39788
diff
changeset
|
61 | * Since: 3.0.0 |
|
2a29bc06910b
Move account chooser filter in a separate setter.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39788
diff
changeset
|
62 | */ |
|
41857
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
63 | GtkFilter *pidgin_account_chooser_get_filter(PidginAccountChooser *chooser); |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
64 | |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
65 | /** |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
66 | * pidgin_account_chooser_set_filter: |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
67 | * @chooser: The chooser. |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
68 | * @filter: The filter. |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
69 | * |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
70 | * Sets the current list filter for the account chooser. |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
71 | * |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
72 | * Since: 3.0.0 |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
73 | */ |
|
ff94f8ff8a70
Add a filter property to PidginAccountChooser
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41124
diff
changeset
|
74 | void pidgin_account_chooser_set_filter(PidginAccountChooser *chooser, GtkFilter *filter); |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
75 | |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
76 | /** |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
77 | * pidgin_account_chooser_get_selected: |
|
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
78 | * @chooser: The chooser created by pidgin_account_chooser_new(). |
|
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
79 | * |
|
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
80 | * Gets the currently selected account from an account combo box. |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
81 | * |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
82 | * Returns: (transfer full): Returns the #PurpleAccount that is currently |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
83 | * selected. |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
84 | * |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
85 | * Since: 3.0.0 |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
86 | */ |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
87 | PurpleAccount *pidgin_account_chooser_get_selected(PidginAccountChooser *chooser); |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
88 | |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
89 | /** |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
90 | * pidgin_account_chooser_set_selected: |
|
39795
5b9c99c1378d
Fix some more account chooser doc errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39793
diff
changeset
|
91 | * @chooser: The chooser created by pidgin_account_chooser_new(). |
|
5b9c99c1378d
Fix some more account chooser doc errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39793
diff
changeset
|
92 | * @account: The #PurpleAccount to select. |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
93 | * |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
94 | * Sets the currently selected account for an account combo box. |
|
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
95 | * |
|
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
96 | * Since: 3.0.0 |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
97 | */ |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
98 | void pidgin_account_chooser_set_selected(PidginAccountChooser *chooser, |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
99 | PurpleAccount *account); |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
100 | |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
101 | G_END_DECLS |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
102 | |
|
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
103 | #endif /* PIDGIN_ACCOUNT_CHOOSER_H */ |