2008-02-29 Cosimo Cecchi <cosimoc@gnome.org>
[nautilus.git] / libnautilus-private / nautilus-search-engine.h
blob2be4c1e13db81dd578cbfb3757527e9c080ba92d
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /*
3 * Copyright (C) 2005 Novell, Inc.
5 * Nautilus is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * Nautilus 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 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; see the file COPYING. If not,
17 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Anders Carlsson <andersca@imendio.com>
24 #ifndef NAUTILUS_SEARCH_ENGINE_H
25 #define NAUTILUS_SEARCH_ENGINE_H
27 #include <glib-object.h>
28 #include <libnautilus-private/nautilus-query.h>
30 #define NAUTILUS_TYPE_SEARCH_ENGINE (nautilus_search_engine_get_type ())
31 #define NAUTILUS_SEARCH_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_SEARCH_ENGINE, NautilusSearchEngine))
32 #define NAUTILUS_SEARCH_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_SEARCH_ENGINE, NautilusSearchEngineClass))
33 #define NAUTILUS_IS_SEARCH_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_SEARCH_ENGINE))
34 #define NAUTILUS_IS_SEARCH_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_SEARCH_ENGINE))
35 #define NAUTILUS_SEARCH_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_SEARCH_ENGINE, NautilusSearchEngineClass))
37 typedef struct NautilusSearchEngineDetails NautilusSearchEngineDetails;
39 typedef struct NautilusSearchEngine {
40 GObject parent;
41 NautilusSearchEngineDetails *details;
42 } NautilusSearchEngine;
44 typedef struct {
45 GObjectClass parent_class;
47 /* VTable */
48 void (*set_query) (NautilusSearchEngine *engine, NautilusQuery *query);
49 void (*start) (NautilusSearchEngine *engine);
50 void (*stop) (NautilusSearchEngine *engine);
51 gboolean (*is_indexed) (NautilusSearchEngine *engine);
53 /* Signals */
54 void (*hits_added) (NautilusSearchEngine *engine, GList *hits);
55 void (*hits_subtracted) (NautilusSearchEngine *engine, GList *hits);
56 void (*finished) (NautilusSearchEngine *engine);
57 void (*error) (NautilusSearchEngine *engine, const char *error_message);
58 } NautilusSearchEngineClass;
60 GType nautilus_search_engine_get_type (void);
61 gboolean nautilus_search_engine_enabled (void);
63 NautilusSearchEngine* nautilus_search_engine_new (void);
65 void nautilus_search_engine_set_query (NautilusSearchEngine *engine, NautilusQuery *query);
66 void nautilus_search_engine_start (NautilusSearchEngine *engine);
67 void nautilus_search_engine_stop (NautilusSearchEngine *engine);
68 gboolean nautilus_search_engine_is_indexed (NautilusSearchEngine *engine);
70 void nautilus_search_engine_hits_added (NautilusSearchEngine *engine, GList *hits);
71 void nautilus_search_engine_hits_subtracted (NautilusSearchEngine *engine, GList *hits);
72 void nautilus_search_engine_finished (NautilusSearchEngine *engine);
73 void nautilus_search_engine_error (NautilusSearchEngine *engine, const char *error_message);
75 #endif /* NAUTILUS_SEARCH_ENGINE_H */