AudioBook Plugin: Item selection by text, regular expression, page indices

This commit is contained in:
Jakub Melka
2021-08-21 20:18:47 +02:00
parent 1aa60dca40
commit 8ccfbe291d
8 changed files with 199 additions and 2 deletions

View File

@ -20,6 +20,7 @@
#include "pdfglobal.h"
#include "pdfexception.h"
#include "pdfutils.h"
namespace pdf
{
@ -198,6 +199,9 @@ public:
/// Returns true, if text flow is empty
bool isEmpty() const { return m_originalTextFlow.isEmpty(); }
/// Returns true, if text selection is empty
bool isSelectionEmpty() const;
/// Returns item count in edited text flow
size_t getItemCount() const { return m_editedTextFlow.size(); }
@ -214,6 +218,18 @@ public:
/// \param rectangle Selection rectangle
void selectByRectangle(QRectF rectangle);
/// Select items which contains text
/// \param text Text
void selectByContainedText(QString text);
/// Select items which matches regular expression
/// \param expression Regular expression
void selectByRegularExpression(const QRegularExpression& expression);
/// Select all items on a given page indices
/// \param indices Indices
void selectByPageIndices(const PDFClosedIntervalSet& indices);
private:
void createEditedFromOriginalTextFlow();
void updateModifiedFlag(size_t index);