1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /*
3  * Copyright (C) 2005 Novell, Inc.
4  *
5  * Nemo 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.
9  *
10  * Nemo 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.
14  *
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., 51 Franklin Street - Suite 500,
18  * Boston, MA 02110-1335, USA.
19  *
20  * Author: Anders Carlsson <andersca@imendio.com>
21  *
22  */
23 
24 #ifndef NEMO_SEARCH_ENGINE_H
25 #define NEMO_SEARCH_ENGINE_H
26 
27 #include <glib-object.h>
28 #include <libnemo-private/nemo-query.h>
29 
30 #define NEMO_TYPE_SEARCH_ENGINE		(nemo_search_engine_get_type ())
31 #define NEMO_SEARCH_ENGINE(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), NEMO_TYPE_SEARCH_ENGINE, NemoSearchEngine))
32 #define NEMO_SEARCH_ENGINE_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), NEMO_TYPE_SEARCH_ENGINE, NemoSearchEngineClass))
33 #define NEMO_IS_SEARCH_ENGINE(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NEMO_TYPE_SEARCH_ENGINE))
34 #define NEMO_IS_SEARCH_ENGINE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), NEMO_TYPE_SEARCH_ENGINE))
35 #define NEMO_SEARCH_ENGINE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), NEMO_TYPE_SEARCH_ENGINE, NemoSearchEngineClass))
36 
37 typedef struct NemoSearchEngineDetails NemoSearchEngineDetails;
38 
39 typedef struct NemoSearchEngine {
40 	GObject parent;
41 	NemoSearchEngineDetails *details;
42 } NemoSearchEngine;
43 
44 typedef struct {
45 	GObjectClass parent_class;
46 
47 	/* VTable */
48 	void (*set_query) (NemoSearchEngine *engine, NemoQuery *query);
49 	void (*start) (NemoSearchEngine *engine);
50 	void (*stop) (NemoSearchEngine *engine);
51 
52 	/* Signals */
53 	void (*hits_added) (NemoSearchEngine *engine, GList *hits);
54 	void (*hits_subtracted) (NemoSearchEngine *engine, GList *hits);
55 	void (*finished) (NemoSearchEngine *engine);
56 	void (*error) (NemoSearchEngine *engine, const char *error_message);
57 } NemoSearchEngineClass;
58 
59 GType          nemo_search_engine_get_type  (void);
60 gboolean       nemo_search_engine_enabled (void);
61 
62 NemoSearchEngine* nemo_search_engine_new       (void);
63 
64 void           nemo_search_engine_set_query (NemoSearchEngine *engine, NemoQuery *query);
65 void	       nemo_search_engine_start (NemoSearchEngine *engine);
66 void	       nemo_search_engine_stop (NemoSearchEngine *engine);
67 
68 void	       nemo_search_engine_hits_added (NemoSearchEngine *engine, GList *hits);
69 void	       nemo_search_engine_hits_subtracted (NemoSearchEngine *engine, GList *hits);
70 void	       nemo_search_engine_finished (NemoSearchEngine *engine);
71 void	       nemo_search_engine_error (NemoSearchEngine *engine, const char *error_message);
72 
73 #endif /* NEMO_SEARCH_ENGINE_H */
74