Add KAddressBook files.
[beagle.git] / chooser-fu / beaglequery.h
blob0e7e82c1502220fefb6698f9100f5ccfd3985181
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4 /*
5 * beaglequery.h
7 * Copyright (C) 2004 Novell, Inc.
9 */
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 * USA.
28 #ifndef __BEAGLEQUERY_H__
29 #define __BEAGLEQUERY_H__
31 #include <glib.h>
32 #include <time.h>
34 typedef struct _BeagleHit BeagleHit;
35 struct _BeagleHit {
36 char *uri;
37 char *type;
38 char *mime_type;
39 char *source;
40 float score;
41 time_t timestamp;
44 void beagle_hit_free (BeagleHit *);
46 #define beagle_hit_get_uri(hit) ((hit)->uri)
47 #define beagle_hit_get_type(hit) ((hit)->type)
48 #define beagle_hit_get_mime_type(hit) ((hit)->mime_type)
49 #define beagle_hit_get_source(hit) ((hit)->source)
50 #define beagle_hit_get_score(hit) ((hit)->score)
51 #define beagle_hit_get_timestamp(hit) ((hit)->timestamp)
55 typedef struct _BeagleQueryResult BeagleQueryResult;
56 struct _BeagleQueryResult {
57 int count;
58 GSList *all;
59 GHashTable *by_uri;
62 void beagle_query_result_free (BeagleQueryResult *bqr);
64 #define beagle_query_result_get_count(bqr) ((bqr)->count)
65 #define beagle_query_result_get_all(bqr) ((bqr)->all)
67 BeagleHit *beagle_query_result_get_by_uri (BeagleQueryResult *bqr,
68 const char *uri);
70 BeagleQueryResult *beagle_query (const char *query_string);
72 #endif /* __BEAGLEQUERY_H__ */