Dont add null mimetypes. Fixes bgo# 337431. The patch hasnt been officially accepted...
[beagle.git] / libbeagle / beagle / beagle-query.h
blob3cea12b49a205c6d720fe97b5792445b2d318288
1 /*
2 * beagle-query.h
4 * Copyright (C) 2005 Novell, Inc.
6 */
8 /*
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
28 #ifndef __BEAGLE_QUERY_H
29 #define __BEAGLE_QUERY_H
31 #include <glib-object.h>
33 #include <beagle/beagle-request.h>
34 #include <beagle/beagle-hits-added-response.h>
35 #include <beagle/beagle-hits-subtracted-response.h>
36 #include <beagle/beagle-finished-response.h>
37 #include <beagle/beagle-query-part.h>
39 #define BEAGLE_TYPE_QUERY (beagle_query_get_type ())
40 #define BEAGLE_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BEAGLE_TYPE_QUERY, BeagleQuery))
41 #define BEAGLE_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BEAGLE_TYPE_QUERY, BeagleQueryClass))
42 #define BEAGLE_IS_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BEAGLE_TYPE_QUERY))
43 #define BEAGLE_IS_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BEAGLE_TYPE_QUERY))
44 #define BEAGLE_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BEAGLE_TYPE_QUERY, BeagleQueryClass))
46 typedef enum {
47 BEAGLE_QUERY_DOMAIN_LOCAL = 1,
48 BEAGLE_QUERY_DOMAIN_SYSTEM = 2,
49 BEAGLE_QUERY_DOMAIN_NEIGHBORHOOD = 4,
50 BEAGLE_QUERY_DOMAIN_GLOBAL = 8
51 } BeagleQueryDomain;
53 typedef struct _BeagleQuery BeagleQuery;
54 typedef struct _BeagleQueryClass BeagleQueryClass;
56 struct _BeagleQuery {
57 BeagleRequest parent;
60 struct _BeagleQueryClass {
61 BeagleRequestClass parent_class;
63 void (*hits_added) (BeagleQuery *query, BeagleHitsAddedResponse *response);
64 void (*hits_subtracted) (BeagleQuery *query, BeagleHitsSubtractedResponse *response);
65 void (*finished) (BeagleQuery *query, BeagleFinishedResponse *response);
68 GType beagle_query_get_type (void);
69 BeagleQuery *beagle_query_new (void);
70 void beagle_query_add_part (BeagleQuery *query,
71 BeagleQueryPart *part);
72 void beagle_query_add_text (BeagleQuery *query,
73 const char *str);
75 void beagle_query_add_mime_type (BeagleQuery *query,
76 const char *mime_type);
77 void beagle_query_add_hit_type (BeagleQuery *query,
78 const char *hit_type);
80 void beagle_query_add_source (BeagleQuery *query,
81 const char *source);
83 void beagle_query_set_domain (BeagleQuery *query,
84 BeagleQueryDomain domain);
85 void beagle_query_add_domain (BeagleQuery *query,
86 BeagleQueryDomain domain);
87 void beagle_query_remove_domain (BeagleQuery *query,
88 BeagleQueryDomain domain);
90 void beagle_query_set_max_hits (BeagleQuery *query,
91 int max_hits);
92 int beagle_query_get_max_hits (BeagleQuery *query);
94 GSList *beagle_query_get_exact_text (BeagleQuery *query);
95 GSList *beagle_query_get_stemmed_text (BeagleQuery *query);
97 #endif /* __BEAGLE_QUERY_H */