1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
2 |
|
3 |
/* |
4 |
* Copyright (C) 2004 Hiroyuki Ikezoe |
5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
8 |
* the Free Software Foundation; either version 2, or (at your option) |
9 |
* any later version. |
10 |
* |
11 |
* This program is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU General Public License |
17 |
* along with this program; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 |
*/ |
20 |
|
21 |
#ifndef __KZ_SEARCH_COMMON_H__ |
22 |
#define __KZ_SEARCH_COMMON_H__ |
23 |
|
24 |
#include <glib.h> |
25 |
|
26 |
G_BEGIN_DECLS |
27 |
|
28 |
#define DTD "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" |
29 |
#define HEAD "<head>\n" \ |
30 |
" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n" \ |
31 |
" <title>%s - Full-text search in history</title>\n" \ |
32 |
" <link rel=\"stylesheet\" type=\"text/css\" href=\"history-search:?css=search-result.css\">\n" \ |
33 |
" <script type=\"text/javascript\" src=\"history-search:?css=search-result.js\"></script>\n" \ |
34 |
"</head>\n" |
35 |
#define HEADER "" |
36 |
#define CONTENT "<div class=\"content\">\n" \ |
37 |
" <div class=\"header\"><span class=\"title\"><a href=\"%s\">%s</a></span></div>\n" \ |
38 |
" <div class=\"summary\"><img src=\"%s\" class=\"thumbnail\">\n" \ |
39 |
" <span class=\"sentence\">%s</span>\n" \ |
40 |
" </div>\n" \ |
41 |
" <div class=\"footer\">\n" \ |
42 |
" <span class=\"uri\">%s</span>\n" \ |
43 |
" %s\n" \ |
44 |
" <span class=\"date\">%s</span>\n" \ |
45 |
" </div>\n" \ |
46 |
"</div>\n" |
47 |
#define FOOTER "<div class=\"footer\">\n" \ |
48 |
"Powered by <a href=\"%s\">%s</a> version %s\n" \ |
49 |
"</div>\n" |
50 |
|
51 |
G_END_DECLS |
52 |
|
53 |
|
54 |
typedef struct { |
55 |
unsigned int mask; |
56 |
char *exp; |
57 |
} KZ_SEARCH_FLAG; |
58 |
|
59 |
#define KZ_SEARCH_FLAG_GROUP_OPERATOR 0x0000000f |
60 |
#define KZ_SEARCH_FLAG_MASK_NOT 0x00000001 |
61 |
#define KZ_SEARCH_FLAG_GROUP_OPTION 0x000000f0 /* exclusive */ |
62 |
#define KZ_SEARCH_FLAG_MASK_SITE 0x00000010 |
63 |
|
64 |
//NOTE: synchronize FLAG_NUMBER and FLAGS order |
65 |
enum KZ_SEARCH_FLAG_NUMBER { |
66 |
KZ_SEARCH_FLAG_NOT, |
67 |
KZ_SEARCH_FLAG_SITE |
68 |
}; |
69 |
|
70 |
KZ_SEARCH_FLAG KZ_SEARCH_FLAGS[] = { |
71 |
{ KZ_SEARCH_FLAG_MASK_NOT, "-"}, |
72 |
{ KZ_SEARCH_FLAG_MASK_SITE, "site:"} |
73 |
}; |
74 |
|
75 |
#define KZ_SEARCH_FLAG_SIZE (sizeof(KZ_SEARCH_FLAGS)/sizeof(KZ_SEARCH_FLAG)) |
76 |
|
77 |
|
78 |
|
79 |
#endif /* __KZ_SEARCH_COMMON_H__ */ |