]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-live-search.h
use the 48x48 version of the local-xmpp icon
[empathy.git] / libempathy-gtk / empathy-live-search.h
1 /*
2  * Copyright (C) 2010 Collabora Ltd.
3  * Copyright (C) 2007-2010 Nokia Corporation.
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.1 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, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  * Authors: Felix Kaser <felix.kaser@collabora.co.uk>
20  *          Xavier Claessens <xavier.claessens@collabora.co.uk>
21  *          Claudio Saavedra <csaavedra@igalia.com>
22  */
23
24 #ifndef __EMPATHY_LIVE_SEARCH_H__
25 #define __EMPATHY_LIVE_SEARCH_H__
26
27 #include <gtk/gtk.h>
28
29 G_BEGIN_DECLS
30
31 #define EMPATHY_TYPE_LIVE_SEARCH         (empathy_live_search_get_type ())
32 #define EMPATHY_LIVE_SEARCH(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_LIVE_SEARCH, EmpathyLiveSearch))
33 #define EMPATHY_LIVE_SEARCH_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_LIVE_SEARCH, EmpathyLiveSearchClass))
34 #define EMPATHY_IS_LIVE_SEARCH(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_LIVE_SEARCH))
35 #define EMPATHY_IS_LIVE_SEARCH_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_LIVE_SEARCH))
36 #define EMPATHY_LIVE_SEARCH_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_LIVE_SEARCH, EmpathyLiveSearchClass))
37
38 typedef struct _EmpathyLiveSearch      EmpathyLiveSearch;
39 typedef struct _EmpathyLiveSearchClass EmpathyLiveSearchClass;
40
41 struct _EmpathyLiveSearch {
42   GtkHBox parent;
43
44   /*<private>*/
45   gpointer priv;
46 };
47
48 struct _EmpathyLiveSearchClass {
49   GtkHBoxClass parent_class;
50 };
51
52 GType empathy_live_search_get_type (void) G_GNUC_CONST;
53 GtkWidget *empathy_live_search_new (GtkWidget *hook);
54
55 GtkWidget *empathy_live_search_get_hook_widget (EmpathyLiveSearch *self);
56 void empathy_live_search_set_hook_widget (EmpathyLiveSearch *self,
57     GtkWidget *hook);
58
59 const gchar *empathy_live_search_get_text (EmpathyLiveSearch *self);
60 void empathy_live_search_set_text (EmpathyLiveSearch *self,
61     const gchar *text);
62
63 gboolean empathy_live_search_match (EmpathyLiveSearch *self,
64     const gchar *string);
65
66 GPtrArray * empathy_live_search_strip_utf8_string (const gchar *string);
67
68 gboolean empathy_live_search_match_words (const gchar *string,
69     GPtrArray *words);
70
71 GPtrArray * empathy_live_search_get_words (EmpathyLiveSearch *self);
72
73 /* Made public for unit tests */
74 gboolean empathy_live_search_match_string (const gchar *string,
75    const gchar *prefix);
76
77 G_END_DECLS
78
79 #endif /* __EMPATHY_LIVE_SEARCH_H__ */