]> Pileus Git - ~andy/gtk/blob - gtk/gtksearchengine.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtksearchengine.h
1 /*
2  * Copyright (C) 2005 Novell, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Author: Anders Carlsson <andersca@imendio.com> 
18  *
19  * Based on nautilus-search-engine.h
20  */
21
22 #ifndef __GTK_SEARCH_ENGINE_H__
23 #define __GTK_SEARCH_ENGINE_H__
24
25 #include "gtkquery.h"
26
27 G_BEGIN_DECLS
28
29 #define GTK_TYPE_SEARCH_ENGINE          (_gtk_search_engine_get_type ())
30 #define GTK_SEARCH_ENGINE(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngine))
31 #define GTK_SEARCH_ENGINE_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngineClass))
32 #define GTK_IS_SEARCH_ENGINE(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SEARCH_ENGINE))
33 #define GTK_IS_SEARCH_ENGINE_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SEARCH_ENGINE))
34 #define GTK_SEARCH_ENGINE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngineClass))
35
36 typedef struct _GtkSearchEngine GtkSearchEngine;
37 typedef struct _GtkSearchEngineClass GtkSearchEngineClass;
38 typedef struct _GtkSearchEnginePrivate GtkSearchEnginePrivate;
39
40 struct _GtkSearchEngine 
41 {
42   GObject parent;
43
44   GtkSearchEnginePrivate *priv;
45 };
46
47 struct _GtkSearchEngineClass 
48 {
49   GObjectClass parent_class;
50   
51   /* VTable */
52   void     (*set_query)       (GtkSearchEngine *engine, 
53                                GtkQuery        *query);
54   void     (*start)           (GtkSearchEngine *engine);
55   void     (*stop)            (GtkSearchEngine *engine);
56   gboolean (*is_indexed)      (GtkSearchEngine *engine);
57   
58   /* Signals */
59   void     (*hits_added)      (GtkSearchEngine *engine, 
60                                GList           *hits);
61   void     (*hits_subtracted) (GtkSearchEngine *engine, 
62                                GList           *hits);
63   void     (*finished)        (GtkSearchEngine *engine);
64   void     (*error)           (GtkSearchEngine *engine, 
65                                const gchar     *error_message);
66 };
67
68 GType            _gtk_search_engine_get_type        (void);
69 gboolean         _gtk_search_engine_enabled         (void);
70
71 GtkSearchEngine* _gtk_search_engine_new             (void);
72
73 void             _gtk_search_engine_set_query       (GtkSearchEngine *engine, 
74                                                      GtkQuery        *query);
75 void             _gtk_search_engine_start           (GtkSearchEngine *engine);
76 void             _gtk_search_engine_stop            (GtkSearchEngine *engine);
77 gboolean         _gtk_search_engine_is_indexed      (GtkSearchEngine *engine);
78
79 void             _gtk_search_engine_hits_added      (GtkSearchEngine *engine, 
80                                                      GList           *hits);
81 void             _gtk_search_engine_hits_subtracted (GtkSearchEngine *engine, 
82                                                      GList           *hits);
83 void             _gtk_search_engine_finished        (GtkSearchEngine *engine);
84 void             _gtk_search_engine_error           (GtkSearchEngine *engine, 
85                                                      const gchar     *error_message);
86
87 G_END_DECLS
88
89 #endif /* __GTK_SEARCH_ENGINE_H__ */