2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2006 Tobias Koenig <tokoe@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-09-03 19:52:46 +00:00
|
|
|
|
|
|
|
#ifndef _OKULAR_TEXTPAGE_P_H_
|
|
|
|
#define _OKULAR_TEXTPAGE_P_H_
|
|
|
|
|
2024-02-07 14:07:08 +00:00
|
|
|
#include "textpage.h"
|
2018-08-31 09:23:45 +00:00
|
|
|
#include <QList>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QPair>
|
|
|
|
#include <QTransform>
|
2007-09-03 19:52:46 +00:00
|
|
|
|
|
|
|
class SearchPoint;
|
2019-07-21 08:49:24 +00:00
|
|
|
|
2011-07-08 18:12:39 +00:00
|
|
|
class RegionText;
|
2007-09-03 19:52:46 +00:00
|
|
|
|
|
|
|
namespace Okular
|
|
|
|
{
|
2007-09-04 22:37:39 +00:00
|
|
|
class PagePrivate;
|
2023-12-14 11:54:15 +00:00
|
|
|
class RegularAreaRect;
|
|
|
|
class Page;
|
2007-09-04 22:37:39 +00:00
|
|
|
|
2013-10-18 14:28:54 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the two strings match.
|
|
|
|
* Satisfies the condition that if two strings match then their lengths are equal.
|
|
|
|
*/
|
2023-12-06 12:03:30 +00:00
|
|
|
typedef bool (*TextComparisonFunction)(QStringView from, const QStringView to);
|
2009-12-27 14:22:13 +00:00
|
|
|
|
2011-08-21 04:44:42 +00:00
|
|
|
/**
|
|
|
|
* A list of RegionText. It keeps a bunch of TextList with their bounding rectangles
|
|
|
|
*/
|
2011-07-13 11:16:03 +00:00
|
|
|
typedef QList<RegionText> RegionTextList;
|
2011-06-29 12:17:15 +00:00
|
|
|
|
2007-09-03 19:52:46 +00:00
|
|
|
class TextPagePrivate
|
|
|
|
{
|
|
|
|
public:
|
2008-04-18 09:57:55 +00:00
|
|
|
TextPagePrivate();
|
2007-09-03 19:52:46 +00:00
|
|
|
~TextPagePrivate();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2024-02-07 14:07:08 +00:00
|
|
|
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);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2011-08-17 04:45:46 +00:00
|
|
|
/**
|
2011-08-23 14:10:43 +00:00
|
|
|
* Copy a TextList to m_words, the pointers of list are adopted
|
2011-08-17 04:45:46 +00:00
|
|
|
*/
|
2024-02-07 14:07:08 +00:00
|
|
|
void setWordList(const TextEntity::List &list);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2011-10-17 17:09:26 +00:00
|
|
|
/**
|
|
|
|
* Make necessary modifications in the TextList to make the text order correct, so
|
|
|
|
* that textselection works fine
|
|
|
|
*/
|
|
|
|
void correctTextOrder();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2011-07-13 13:27:04 +00:00
|
|
|
// variables those can be accessed directly from TextPage
|
2024-02-07 14:07:08 +00:00
|
|
|
TextEntity::List m_words;
|
2007-09-03 19:52:46 +00:00
|
|
|
QMap<int, SearchPoint *> m_searchPoints;
|
2017-12-05 22:07:10 +00:00
|
|
|
Page *m_page;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2013-10-18 14:28:54 +00:00
|
|
|
private:
|
|
|
|
RegularAreaRect *searchPointToArea(const SearchPoint *sp);
|
2007-09-03 19:52:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|