]> Pileus Git - ~andy/gtk/blob - gtk/gtksearchengine.h
Add search file support in the GtkFileChooser. Original patch by Federico
[~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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  *
18  * Author: Anders Carlsson <andersca@imendio.com> 
19  *
20  * Based on nautilus-search-engine.h
21  */
22
23 #ifndef __GTK_SEARCH_ENGINE_H__
24 #define __GTK_SEARCH_ENGINE_H__
25
26 #include <glib-object.h>
27 #include "gtkquery.h"
28
29 G_BEGIN_DECLS
30
31 #define GTK_TYPE_SEARCH_ENGINE          (_gtk_search_engine_get_type ())
32 #define GTK_SEARCH_ENGINE(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngine))
33 #define GTK_SEARCH_ENGINE_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngineClass))
34 #define GTK_IS_SEARCH_ENGINE(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SEARCH_ENGINE))
35 #define GTK_IS_SEARCH_ENGINE_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SEARCH_ENGINE))
36 #define GTK_SEARCH_ENGINE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngineClass))
37
38 typedef struct _GtkSearchEngine GtkSearchEngine;
39 typedef struct _GtkSearchEngineClass GtkSearchEngineClass;
40 typedef struct _GtkSearchEnginePrivate GtkSearchEnginePrivate;
41
42 struct _GtkSearchEngine 
43 {
44   GObject parent;
45
46   GtkSearchEnginePrivate *priv;
47 };
48
49 struct _GtkSearchEngineClass 
50 {
51   GObjectClass parent_class;
52   
53   /* VTable */
54   void     (*set_query)       (GtkSearchEngine *engine, 
55                                GtkQuery        *query);
56   void     (*start)           (GtkSearchEngine *engine);
57   void     (*stop)            (GtkSearchEngine *engine);
58   gboolean (*is_indexed)      (GtkSearchEngine *engine);
59   
60   /* Signals */
61   void     (*hits_added)      (GtkSearchEngine *engine, 
62                                GList           *hits);
63   void     (*hits_subtracted) (GtkSearchEngine *engine, 
64                                GList           *hits);
65   void     (*finished)        (GtkSearchEngine *engine);
66   void     (*error)           (GtkSearchEngine *engine, 
67                                const gchar     *error_message);
68 };
69
70 GType            _gtk_search_engine_get_type        (void);
71 gboolean         _gtk_search_engine_enabled         (void);
72
73 GtkSearchEngine* _gtk_search_engine_new             (void);
74
75 void             _gtk_search_engine_set_query       (GtkSearchEngine *engine, 
76                                                      GtkQuery        *query);
77 void             _gtk_search_engine_start           (GtkSearchEngine *engine);
78 void             _gtk_search_engine_stop            (GtkSearchEngine *engine);
79 gboolean         _gtk_search_engine_is_indexed      (GtkSearchEngine *engine);
80
81 void             _gtk_search_engine_hits_added      (GtkSearchEngine *engine, 
82                                                      GList           *hits);
83 void             _gtk_search_engine_hits_subtracted (GtkSearchEngine *engine, 
84                                                      GList           *hits);
85 void             _gtk_search_engine_finished        (GtkSearchEngine *engine);
86 void             _gtk_search_engine_error           (GtkSearchEngine *engine, 
87                                                      const gchar     *error_message);
88
89 G_END_DECLS
90
91 #endif /* __GTK_SEARCH_ENGINE_H__ */