|
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.14 2007-06-25 10:13:40 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: plaintorich.h,v 1.15 2007-10-18 10:39:41 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
|
|
22 |
#include <list>
|
|
|
23 |
using std::list;
|
|
|
24 |
using std::string;
|
22 |
|
25 |
|
23 |
// A data struct to hold words and groups of words to be highlighted
|
26 |
// A data struct to hold words and groups of words to be highlighted
|
24 |
struct HiliteData {
|
27 |
struct HiliteData {
|
25 |
vector<string> terms;
|
28 |
vector<string> terms;
|
26 |
vector<vector<string> > groups;
|
29 |
vector<vector<string> > groups;
|
|
... |
|
... |
33 |
* We escape characters like < or &, and add qt rich text tags to
|
36 |
* We escape characters like < or &, and add qt rich text tags to
|
34 |
* colorize the query terms. The latter is a quite complicated matter because
|
37 |
* colorize the query terms. The latter is a quite complicated matter because
|
35 |
* of phrase/near searches. We treat all such searches as "near", not "phrase"
|
38 |
* of phrase/near searches. We treat all such searches as "near", not "phrase"
|
36 |
*
|
39 |
*
|
37 |
* @param in raw text out of internfile.
|
40 |
* @param in raw text out of internfile.
|
38 |
* @param out rich text output
|
41 |
* @param out rich text output, divided in chunks (to help our caller
|
|
|
42 |
* avoid inserting half tags into textedit which doesnt like it)
|
39 |
* @param hdata terms and groups to be highlighted. These are
|
43 |
* @param hdata terms and groups to be highlighted. These are
|
40 |
* lowercase and unaccented.
|
44 |
* lowercase and unaccented.
|
41 |
* @param noHeader if true don't output header (<qt><title>...)
|
45 |
* @param noHeader if true don't output header (<qt><title>...)
|
42 |
* @param needBeacons Need to navigate highlighted terms, mark them.
|
46 |
* @param needBeacons Need to navigate highlighted terms, mark them.
|
43 |
*/
|
47 |
*/
|
44 |
extern bool plaintorich(const string &in, string &out,
|
48 |
extern bool plaintorich(const string &in, list<string> &out,
|
45 |
const HiliteData& hdata,
|
49 |
const HiliteData& hdata,
|
46 |
bool noHeader = false,
|
50 |
bool noHeader,
|
47 |
bool needBeacons = true);
|
51 |
bool needBeacons,
|
|
|
52 |
int chunksize = 50000
|
|
|
53 |
);
|
48 |
|
54 |
|
49 |
extern string termAnchorName(int i);
|
55 |
extern string termAnchorName(int i);
|
50 |
|
56 |
|
51 |
#define QT_SCROLL_TO_ANCHOR_BUG
|
57 |
#define QT_SCROLL_TO_ANCHOR_BUG
|
52 |
#ifdef QT_SCROLL_TO_ANCHOR_BUG
|
58 |
#ifdef QT_SCROLL_TO_ANCHOR_BUG
|
53 |
// For some reason, can't get scrollToAnchor() to work. We use a string made
|
59 |
// For some reason, can't get scrollToAnchor() to work. We use a special
|
54 |
// of a few rare utf8 chars as a beacon for the match area.
|
60 |
// string as a beacon for the match area.
|
55 |
extern const char *firstTermBeacon;
|
61 |
extern const char *firstTermBeacon;
|
56 |
#endif
|
62 |
#endif
|
57 |
|
63 |
|
58 |
#endif /* _PLAINTORICH_H_INCLUDED_ */
|
64 |
#endif /* _PLAINTORICH_H_INCLUDED_ */
|