AudioBook Plugin: Display texts on page

This commit is contained in:
Jakub Melka
2021-08-22 18:25:24 +02:00
parent 8ccfbe291d
commit 4cb077f75e
13 changed files with 513 additions and 14 deletions

View File

@ -229,6 +229,18 @@ void PDFDocumentTextFlowEditorModel::endFlowChange()
endResetModel();
}
void PDFDocumentTextFlowEditorModel::clear()
{
if (!m_editor || m_editor->isEmpty())
{
return;
}
beginFlowChange();
m_editor->clear();
endFlowChange();
}
void PDFDocumentTextFlowEditorModel::setSelectionActivated(bool activate)
{
if (!m_editor || m_editor->isEmpty())
@ -285,4 +297,26 @@ void PDFDocumentTextFlowEditorModel::selectByPageIndices(const PDFClosedInterval
emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast));
}
void PDFDocumentTextFlowEditorModel::restoreOriginalTexts()
{
if (!m_editor || m_editor->isEmpty())
{
return;
}
m_editor->restoreOriginalTexts();
m_editor->deselect();
emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast));
}
void PDFDocumentTextFlowEditorModel::notifyDataChanged()
{
if (!m_editor || m_editor->isEmpty())
{
return;
}
emit dataChanged(index(0, 0), index(rowCount(QModelIndex()) - 1, ColumnLast));
}
} // namespace pdf