forked from KDE/okular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextpage_p.h
69 lines (53 loc) · 1.83 KB
/
textpage_p.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
SPDX-FileCopyrightText: 2006 Tobias Koenig <[email protected]>
SPDX-FileCopyrightText: 2007 Pino Toscano <[email protected]>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _OKULAR_TEXTPAGE_P_H_
#define _OKULAR_TEXTPAGE_P_H_
#include "textpage.h"
#include <QList>
#include <QMap>
#include <QPair>
#include <QTransform>
class SearchPoint;
class RegionText;
namespace Okular
{
class PagePrivate;
class RegularAreaRect;
class Page;
/**
* Returns whether the two strings match.
* Satisfies the condition that if two strings match then their lengths are equal.
*/
typedef bool (*TextComparisonFunction)(QStringView from, const QStringView to);
/**
* A list of RegionText. It keeps a bunch of TextList with their bounding rectangles
*/
typedef QList<RegionText> RegionTextList;
class TextPagePrivate
{
public:
TextPagePrivate();
~TextPagePrivate();
RegularAreaRect *findTextInternalForward(int searchID, const QString &query, TextComparisonFunction comparer, const TextEntity::List::ConstIterator start, int start_offset, const TextEntity::List::ConstIterator end);
RegularAreaRect *findTextInternalBackward(int searchID, const QString &query, TextComparisonFunction comparer, const TextEntity::List::ConstIterator start, int start_offset, const TextEntity::List::ConstIterator end);
/**
* Copy a TextList to m_words, the pointers of list are adopted
*/
void setWordList(const TextEntity::List &list);
/**
* Make necessary modifications in the TextList to make the text order correct, so
* that textselection works fine
*/
void correctTextOrder();
// variables those can be accessed directly from TextPage
TextEntity::List m_words;
QMap<int, SearchPoint *> m_searchPoints;
Page *m_page;
private:
RegularAreaRect *searchPointToArea(const SearchPoint *sp);
};
}
#endif