|
a/src/qtgui/plaintorich.h |
|
b/src/qtgui/plaintorich.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _PLAINTORICH_H_INCLUDED_
|
17 |
#ifndef _PLAINTORICH_H_INCLUDED_
|
18 |
#define _PLAINTORICH_H_INCLUDED_
|
18 |
#define _PLAINTORICH_H_INCLUDED_
|
19 |
/* @(#$Id: plaintorich.h,v 1.11 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: plaintorich.h,v 1.12 2007-01-19 15:22:50 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
22 |
|
22 |
|
23 |
#include "searchdata.h"
|
23 |
// A data struct to hold words and groups of words to be highlighted
|
|
|
24 |
struct HiliteData {
|
|
|
25 |
vector<string> terms;
|
|
|
26 |
vector<vector<string> > groups;
|
|
|
27 |
vector<int> gslks; // group slacks (number of permitted non-matched words)
|
|
|
28 |
};
|
24 |
|
29 |
|
25 |
/**
|
30 |
/**
|
26 |
* Transform plain text into qt rich text for the preview window.
|
31 |
* Transform plain text into qt rich text for the preview window.
|
27 |
*
|
32 |
*
|
28 |
* We escape characters like < or &, and add qt rich text tags to
|
33 |
* We escape characters like < or &, and add qt rich text tags to
|
29 |
* colorize the query terms. The latter is a quite complicated matter because
|
34 |
* colorize the query terms. The latter is a quite complicated matter because
|
30 |
* of phrase/near searches. We treat all such searches as "near", not "phrase"
|
35 |
* of phrase/near searches. We treat all such searches as "near", not "phrase"
|
31 |
*
|
36 |
*
|
32 |
* @param in raw text out of internfile.
|
37 |
* @param in raw text out of internfile.
|
33 |
* @param out rich text output
|
38 |
* @param out rich text output
|
34 |
* @param terms list of query terms. These are out of Rcl::Db and dumb
|
39 |
* @param hdata terms and groups to be highlighted. These are
|
35 |
* @param firstTerm out: value of the first search term in text.
|
40 |
* lowercase and unaccented.
|
36 |
* @param frsttocc out: occurrence of 1st term to look for
|
|
|
37 |
* @param noHeader if true don't output header (<qt><title>...)
|
41 |
* @param noHeader if true don't output header (<qt><title>...)
|
|
|
42 |
* @param fft If true mark the first term position in the text
|
38 |
*/
|
43 |
*/
|
39 |
extern bool plaintorich(const string &in, string &out,
|
44 |
extern bool plaintorich(const string &in, string &out,
|
40 |
RefCntr<Rcl::SearchData> sdata,
|
45 |
const HiliteData& hdata,
|
41 |
bool noHeader = false,
|
46 |
bool noHeader = false,
|
42 |
bool fft = false);
|
47 |
bool fft = false);
|
43 |
|
48 |
|
44 |
extern const char *firstTermAnchorName;
|
49 |
extern const char *firstTermAnchorName;
|
45 |
|
50 |
|