|
BibleTime
|
#include <btqmlinterface.h>
Classes | |
| struct | Selection |
Signals | |
| void | activeLinkChanged (QString newActiveLink) |
| void | backgroundColorChanged () |
| void | backgroundHighlightColorChanged () |
| void | backgroundHighlightColorIndexChanged () |
| void | contextMenuColumnChanged () |
| void | contextMenuIndexChanged () |
| void | currentModelIndexChanged () |
| void | dragOccuring (const QString &moduleName, const QString &keyName) |
| void | fontChanged () |
| void | foregroundColorChanged () |
| void | numModulesChanged () |
| void | pixelsPerMMChanged () |
| void | positionItemOnScreen (int index) |
| void | selectionChanged (std::optional< Selection > newSelection) |
| void | setBibleReference (const QString &reference) |
| void | textChanged () |
| void | textModelChanged () |
| void | updateReference (const QString &reference) |
Public Member Functions | |
| QString const & | activeLink () const noexcept |
| BtQmlInterface (QObject *parent=nullptr) | |
| void | cancelMagTimer () |
| void | changeColorTheme () |
| Q_INVOKABLE void | changeReference (int i) |
| Q_INVOKABLE void | clearSelection () noexcept |
| void | copyRange (int index1, int index2) const |
| Q_INVOKABLE void | dragHandler (int index) |
| void | findText (bool backward) |
| QColor | getBackgroundColor () const |
| QColor | getBackgroundHighlightColor () const |
| int | getBackgroundHighlightColorIndex () const |
| QString | getBibleUrlFromLink (const QString &url) |
| int | getContextMenuColumn () const |
| int | getContextMenuIndex () const |
| int | getCurrentModelIndex () const |
| QFont | getFont0 () const |
| QFont | getFont1 () const |
| QFont | getFont2 () const |
| QFont | getFont3 () const |
| QFont | getFont4 () const |
| QFont | getFont5 () const |
| QFont | getFont6 () const |
| QFont | getFont7 () const |
| QFont | getFont8 () const |
| QFont | getFont9 () const |
| QColor | getForegroundColor () const |
| QString | getLemmaFromLink (const QString &url) |
| CSwordKey * | getMouseClickedKey () const |
| int | getNumModules () const |
| double | getPixelsPerMM () const |
| QString | getSelectedText () const |
| QVariant | getTextModel () |
| Q_INVOKABLE int | indexToVerse (int index) |
| bool | isBibleOrCommentary () |
| Q_INVOKABLE bool | moduleIsWritable (int column) |
| Q_INVOKABLE void | openEditor (int row, int column) |
| Q_INVOKABLE QString | rawText (int row, int column) |
| void | scrollToSwordKey (CSwordKey *key) |
| std::optional< Selection > const & | selection () const noexcept |
| Q_INVOKABLE void | setBibleKey (const QString &link) |
| void | setContextMenuColumn (int index) |
| void | setContextMenuIndex (int index) |
| void | setHighlightWords (const QString &words, bool caseSensitivy) |
| Q_INVOKABLE void | setHoveredLink (QString const &link) |
| void | setMagReferenceByUrl (const QString &url) |
| void | setModules (const QStringList &modules) |
| Q_INVOKABLE void | setRawText (int row, int column, const QString &text) |
| Q_INVOKABLE void | setSelection (int column, int startIndex, int endIndex, QString const &selectedText) |
| void | settingsChanged () |
| BtModuleTextModel * | textModel () |
| BtModuleTextModel const * | textModel () const |
| ~BtQmlInterface () override | |
Static Public Member Functions | |
| static void | copyVerseRange (CSwordVerseKey const &key1, CSwordVerseKey const &key2) |
Static Public Attributes | |
| static int | typeId |
Protected Member Functions | |
| void | timerEvent (QTimerEvent *event) final override |
Properties | |
| QML_SINGLETONQColor | backgroundColor |
| QColor | backgroundHighlightColor |
| int | backgroundHighlightColorIndex |
| int | contextMenuColumn |
| int | contextMenuIndex |
| int | currentModelIndex |
| QFont | font0 |
| QFont | font1 |
| QFont | font2 |
| QFont | font3 |
| QFont | font4 |
| QFont | font5 |
| QFont | font6 |
| QFont | font7 |
| QFont | font8 |
| QFont | font9 |
| QColor | foregroundColor |
| int | numModules |
| double | pixelsPerMM |
| QVariant | textModel |
Private Member Functions | |
| QFont | font (int column) const |
| void | getFontsFromSettings () |
| QString | getReferenceFromUrl (const QString &url) |
Private Attributes | |
| QString | m_activeLink |
| int | m_backgroundHighlightColorIndex = -1 |
| int | m_contextMenuColumn |
| int | m_contextMenuIndex |
| std::optional< FindState > | m_findState |
| bool | m_firstHref = false |
| QList< QFont > | m_fonts |
| int | m_linkTimerId = 0 |
| QStringList | m_moduleNames |
| BtModuleTextModel *const | m_moduleTextModel |
| std::optional< Selection > | m_selection |
| CSwordKey * | m_swordKey = nullptr |
| QString | m_timeoutUrl |
/brief This class provides communications between QML and c++.
It is instantiated by usage within the QML files. It provides properties and functions written in c++ and usable by QML.
Definition at line 36 of file btqmlinterface.h.
| BtQmlInterface::BtQmlInterface | ( | QObject * | parent = nullptr | ) |
Definition at line 40 of file btqmlinterface.cpp.
|
overridedefault |
|
inlinenoexcept |
Definition at line 103 of file btqmlinterface.h.
References m_activeLink.
|
signal |
Referenced by BtModelViewReadDisplay::BtModelViewReadDisplay(), and setHoveredLink().
|
signal |
Referenced by changeColorTheme().
|
signal |
Referenced by changeColorTheme().
|
signal |
Referenced by scrollToSwordKey().
| void BtQmlInterface::cancelMagTimer | ( | ) |
Definition at line 249 of file btqmlinterface.cpp.
References m_linkTimerId.
Referenced by BtQuickWidget::event(), setMagReferenceByUrl(), and timerEvent().
| void BtQmlInterface::changeColorTheme | ( | ) |
Definition at line 382 of file btqmlinterface.cpp.
References backgroundColorChanged(), backgroundHighlightColorChanged(), and foregroundColorChanged().
Referenced by BtModelViewReadDisplay::BtModelViewReadDisplay(), and settingsChanged().
| void BtQmlInterface::changeReference | ( | int | i | ) |
Definition at line 315 of file btqmlinterface.cpp.
References BtModuleTextModel::indexToKeyName(), m_moduleTextModel, and updateReference().
|
noexcept |
Definition at line 139 of file btqmlinterface.cpp.
References m_selection, and selectionChanged().
|
signal |
Referenced by setContextMenuColumn().
|
signal |
Referenced by setContextMenuIndex().
| void BtQmlInterface::copyRange | ( | int | index1, |
| int | index2 | ||
| ) | const |
Definition at line 388 of file btqmlinterface.cpp.
References CSwordKey::copy(), BtModuleTextModel::indexToKeyName(), m_moduleTextModel, and m_swordKey.
|
static |
Definition at line 402 of file btqmlinterface.cpp.
References BT_ASSERT, FilterOptions::footnotes, FilterOptions::greekAccents, FilterOptions::headings, FilterOptions::hebrewCantillation, FilterOptions::hebrewPoints, FilterOptions::lemmas, DisplayOptions::lineBreaks, CSwordKey::module(), FilterOptions::morphSegmentation, FilterOptions::morphTags, FilterOptions::redLetterWords, Rendering::CTextRendering::renderKeyRange(), FilterOptions::scriptureReferences, Rendering::CTextRendering::setDisplayOptions(), Rendering::CTextRendering::setFilterOptions(), FilterOptions::strongNumbers, FilterOptions::textualVariants, and DisplayOptions::verseNumbers.
|
signal |
Referenced by scrollToSwordKey().
| void BtQmlInterface::dragHandler | ( | int | index | ) |
Definition at line 320 of file btqmlinterface.cpp.
References dragOccuring(), BtModuleTextModel::indexToKeyName(), m_activeLink, m_moduleNames, and m_moduleTextModel.
|
signal |
Referenced by BtModelViewReadDisplay::BtModelViewReadDisplay(), and dragHandler().
| void BtQmlInterface::findText | ( | bool | backward | ) |
Definition at line 456 of file btqmlinterface.cpp.
References BtModuleTextModel::data(), getCurrentModelIndex(), m_findState, m_moduleTextModel, positionItemOnScreen(), BtModuleTextModel::rowCount(), BtModuleTextModel::setFindState(), and ModuleEntry::Text1Role.
Referenced by BtModelViewReadDisplay::findText().
|
private |
Definition at line 342 of file btqmlinterface.cpp.
References m_fonts.
Referenced by getFont0(), getFont1(), getFont2(), getFont3(), getFont4(), getFont5(), getFont6(), getFont7(), getFont8(), and getFont9().
|
signal |
Referenced by getFontsFromSettings().
|
signal |
Referenced by changeColorTheme().
| QColor BtQmlInterface::getBackgroundColor | ( | ) | const |
Definition at line 75 of file btqmlinterface.cpp.
References ColorManager::getBackgroundColor().
| QColor BtQmlInterface::getBackgroundHighlightColor | ( | ) | const |
Definition at line 78 of file btqmlinterface.cpp.
References ColorManager::getBackgroundHighlightColor().
| int BtQmlInterface::getBackgroundHighlightColorIndex | ( | ) | const |
Definition at line 81 of file btqmlinterface.cpp.
References m_backgroundHighlightColorIndex.
| QString BtQmlInterface::getBibleUrlFromLink | ( | const QString & | url | ) |
Definition at line 182 of file btqmlinterface.cpp.
Referenced by BtModelViewReadDisplay::BtModelViewReadDisplay().
| int BtQmlInterface::getContextMenuColumn | ( | ) | const |
Definition at line 66 of file btqmlinterface.cpp.
References m_contextMenuColumn.
| int BtQmlInterface::getContextMenuIndex | ( | ) | const |
Definition at line 57 of file btqmlinterface.cpp.
References m_contextMenuIndex.
| int BtQmlInterface::getCurrentModelIndex | ( | ) | const |
Definition at line 88 of file btqmlinterface.cpp.
References CSwordModuleInfo::Bible, CSwordModuleInfo::Commentary, CSwordModuleInfo::GenericBook, CSwordKey::key(), CSwordModuleInfo::Lexicon, m_moduleTextModel, m_swordKey, CSwordKey::module(), CSwordTreeKey::offset(), CSwordTreeKey::positionToRoot(), CSwordTreeKey::setKey(), CSwordModuleInfo::type(), and BtModuleTextModel::verseKeyToIndex().
Referenced by findText().
| QFont BtQmlInterface::getFont0 | ( | ) | const |
Definition at line 348 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont1 | ( | ) | const |
Definition at line 349 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont2 | ( | ) | const |
Definition at line 350 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont3 | ( | ) | const |
Definition at line 351 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont4 | ( | ) | const |
Definition at line 352 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont5 | ( | ) | const |
Definition at line 353 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont6 | ( | ) | const |
Definition at line 354 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont7 | ( | ) | const |
Definition at line 355 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont8 | ( | ) | const |
Definition at line 356 of file btqmlinterface.cpp.
References font().
| QFont BtQmlInterface::getFont9 | ( | ) | const |
Definition at line 357 of file btqmlinterface.cpp.
References font().
|
private |
Definition at line 268 of file btqmlinterface.cpp.
References btConfig(), CSwordBackend::findModuleByName(), fontChanged(), BtConfig::getFontForLanguage(), CSwordBackend::instance(), m_fonts, and m_moduleNames.
Referenced by setModules(), and settingsChanged().
| QColor BtQmlInterface::getForegroundColor | ( | ) | const |
Definition at line 85 of file btqmlinterface.cpp.
References ColorManager::getForegroundColor().
| QString BtQmlInterface::getLemmaFromLink | ( | const QString & | url | ) |
Definition at line 174 of file btqmlinterface.cpp.
Referenced by BtModelViewReadDisplay::BtModelViewReadDisplay().
| CSwordKey * BtQmlInterface::getMouseClickedKey | ( | ) | const |
Definition at line 338 of file btqmlinterface.cpp.
References BtModuleTextModel::indexToKey(), m_contextMenuColumn, m_contextMenuIndex, and m_moduleTextModel.
Referenced by BtQuickWidget::getMouseClickedKey().
| int BtQmlInterface::getNumModules | ( | ) | const |
Definition at line 113 of file btqmlinterface.cpp.
References m_moduleNames.
| double BtQmlInterface::getPixelsPerMM | ( | ) | const |
Definition at line 117 of file btqmlinterface.cpp.
|
private |
Definition at line 190 of file btqmlinterface.cpp.
Referenced by timerEvent().
| QString BtQmlInterface::getSelectedText | ( | ) | const |
Definition at line 144 of file btqmlinterface.cpp.
References m_selection.
| QVariant BtQmlInterface::getTextModel | ( | ) |
Definition at line 359 of file btqmlinterface.cpp.
References m_moduleTextModel.
| int BtQmlInterface::indexToVerse | ( | int | index | ) |
Definition at line 159 of file btqmlinterface.cpp.
References BtModuleTextModel::indexToVerse(), and m_moduleTextModel.
| bool BtQmlInterface::isBibleOrCommentary | ( | ) |
Definition at line 47 of file btqmlinterface.cpp.
References CSwordModuleInfo::Bible, CSwordModuleInfo::Commentary, m_swordKey, CSwordKey::module(), and CSwordModuleInfo::type().
Referenced by BtQuickWidget::dragEnterEvent().
| bool BtQmlInterface::moduleIsWritable | ( | int | column | ) |
Definition at line 372 of file btqmlinterface.cpp.
References BT_ASSERT, and m_moduleNames.
|
signal |
Referenced by setModules().
| void BtQmlInterface::openEditor | ( | int | row, |
| int | column | ||
| ) |
Definition at line 147 of file btqmlinterface.cpp.
References BtModuleTextModel::data(), ModuleEntry::Edit0Role, BtModuleTextModel::indexToKeyName(), m_fonts, m_moduleTextModel, BtEditTextWizard::setFont(), setRawText(), BtEditTextWizard::setText(), BtEditTextWizard::setTitle(), and BtEditTextWizard::text().
|
signal |
|
signal |
Referenced by findText().
| QString BtQmlInterface::rawText | ( | int | row, |
| int | column | ||
| ) |
Definition at line 227 of file btqmlinterface.cpp.
References BtModuleTextModel::data(), m_moduleTextModel, and ModuleEntry::Text0Role.
| void BtQmlInterface::scrollToSwordKey | ( | CSwordKey * | key | ) |
Definition at line 296 of file btqmlinterface.cpp.
References backgroundHighlightColorIndexChanged(), currentModelIndexChanged(), BtModuleTextModel::firstEntryIndex(), BtModuleTextModel::keyToIndex(), m_backgroundHighlightColorIndex, m_moduleTextModel, and m_swordKey.
Referenced by BtModelViewReadDisplay::scrollToKey().
|
inlinenoexcept |
Definition at line 138 of file btqmlinterface.h.
References m_selection.
Referenced by CDisplayWindow::CDisplayWindow().
|
signal |
Referenced by CDisplayWindow::CDisplayWindow(), clearSelection(), and setSelection().
| void BtQmlInterface::setBibleKey | ( | const QString & | link | ) |
Definition at line 289 of file btqmlinterface.cpp.
References setBibleReference().
|
signal |
Referenced by BtModelViewReadDisplay::BtModelViewReadDisplay(), and setBibleKey().
| void BtQmlInterface::setContextMenuColumn | ( | int | index | ) |
Definition at line 70 of file btqmlinterface.cpp.
References contextMenuColumnChanged(), and m_contextMenuColumn.
| void BtQmlInterface::setContextMenuIndex | ( | int | index | ) |
Definition at line 61 of file btqmlinterface.cpp.
References contextMenuIndexChanged(), and m_contextMenuIndex.
| void BtQmlInterface::setHighlightWords | ( | const QString & | words, |
| bool | caseSensitivy | ||
| ) |
Definition at line 434 of file btqmlinterface.cpp.
References m_findState, m_moduleTextModel, BtModuleTextModel::setFindState(), and BtModuleTextModel::setHighlightWords().
Referenced by BtModelViewReadDisplay::highlightText().
| void BtQmlInterface::setHoveredLink | ( | QString const & | link | ) |
Definition at line 163 of file btqmlinterface.cpp.
References activeLinkChanged(), m_activeLink, and setMagReferenceByUrl().
| void BtQmlInterface::setMagReferenceByUrl | ( | const QString & | url | ) |
Definition at line 254 of file btqmlinterface.cpp.
References cancelMagTimer(), m_linkTimerId, and m_timeoutUrl.
Referenced by setHoveredLink().
| void BtQmlInterface::setModules | ( | const QStringList & | modules | ) |
Definition at line 308 of file btqmlinterface.cpp.
References getFontsFromSettings(), m_moduleNames, m_moduleTextModel, numModulesChanged(), and BtModuleTextModel::setModules().
Referenced by BtModelViewReadDisplay::setModules().
| void BtQmlInterface::setRawText | ( | int | row, |
| int | column, | ||
| const QString & | text | ||
| ) |
Definition at line 232 of file btqmlinterface.cpp.
References ModuleEntry::Edit0Role, BtModuleIndexDialog::indexAllModules(), CSwordBackend::instance(), m_moduleNames, m_moduleTextModel, and BtModuleTextModel::setData().
Referenced by openEditor().
| void BtQmlInterface::setSelection | ( | int | column, |
| int | startIndex, | ||
| int | endIndex, | ||
| QString const & | selectedText | ||
| ) |
Definition at line 123 of file btqmlinterface.cpp.
References BT_ASSERT, m_selection, and selectionChanged().
| void BtQmlInterface::settingsChanged | ( | ) |
Definition at line 262 of file btqmlinterface.cpp.
References changeColorTheme(), getFontsFromSettings(), and textChanged().
Referenced by BtModelViewReadDisplay::settingsChanged().
|
signal |
Referenced by settingsChanged().
| BtModuleTextModel * BtQmlInterface::textModel | ( | ) |
| BtModuleTextModel const * BtQmlInterface::textModel | ( | ) | const |
Definition at line 369 of file btqmlinterface.cpp.
References m_moduleTextModel.
|
signal |
|
finaloverrideprotected |
Definition at line 442 of file btqmlinterface.cpp.
References BT_ASSERT, cancelMagTimer(), Rendering::detectInfo(), getReferenceFromUrl(), BibleTime::infoDisplay(), BibleTime::instance(), m_linkTimerId, m_timeoutUrl, and InfoDisplay::CInfoDisplay::setInfo().
|
signal |
Referenced by BtModelViewReadDisplay::BtModelViewReadDisplay(), and changeReference().
|
private |
Definition at line 198 of file btqmlinterface.h.
Referenced by activeLink(), dragHandler(), and setHoveredLink().
|
private |
Definition at line 193 of file btqmlinterface.h.
Referenced by getBackgroundHighlightColorIndex(), and scrollToSwordKey().
|
private |
Definition at line 197 of file btqmlinterface.h.
Referenced by getContextMenuColumn(), getMouseClickedKey(), and setContextMenuColumn().
|
private |
Definition at line 196 of file btqmlinterface.h.
Referenced by getContextMenuIndex(), getMouseClickedKey(), and setContextMenuIndex().
|
private |
Definition at line 199 of file btqmlinterface.h.
Referenced by findText(), and setHighlightWords().
|
private |
Definition at line 187 of file btqmlinterface.h.
|
private |
Definition at line 192 of file btqmlinterface.h.
Referenced by font(), getFontsFromSettings(), and openEditor().
|
private |
Definition at line 188 of file btqmlinterface.h.
Referenced by cancelMagTimer(), setMagReferenceByUrl(), and timerEvent().
|
private |
Definition at line 194 of file btqmlinterface.h.
Referenced by dragHandler(), getFontsFromSettings(), getNumModules(), moduleIsWritable(), setModules(), and setRawText().
|
private |
Definition at line 189 of file btqmlinterface.h.
Referenced by changeReference(), copyRange(), dragHandler(), findText(), getCurrentModelIndex(), getMouseClickedKey(), getTextModel(), indexToVerse(), openEditor(), rawText(), scrollToSwordKey(), setHighlightWords(), setModules(), setRawText(), and textModel().
|
private |
Definition at line 200 of file btqmlinterface.h.
Referenced by clearSelection(), getSelectedText(), selection(), and setSelection().
|
private |
Definition at line 190 of file btqmlinterface.h.
Referenced by copyRange(), getCurrentModelIndex(), isBibleOrCommentary(), and scrollToSwordKey().
|
private |
Definition at line 195 of file btqmlinterface.h.
Referenced by setMagReferenceByUrl(), and timerEvent().
|
static |
Definition at line 183 of file btqmlinterface.h.
Referenced by anonymous_namespace{main.cpp}::registerMetaTypes().
|
read |
Definition at line 41 of file btqmlinterface.h.
|
read |
Definition at line 42 of file btqmlinterface.h.
|
read |
Definition at line 43 of file btqmlinterface.h.
|
readwrite |
Definition at line 45 of file btqmlinterface.h.
|
readwrite |
Definition at line 44 of file btqmlinterface.h.
|
read |
Definition at line 46 of file btqmlinterface.h.
|
read |
Definition at line 47 of file btqmlinterface.h.
|
read |
Definition at line 48 of file btqmlinterface.h.
|
read |
Definition at line 49 of file btqmlinterface.h.
|
read |
Definition at line 50 of file btqmlinterface.h.
|
read |
Definition at line 51 of file btqmlinterface.h.
|
read |
Definition at line 52 of file btqmlinterface.h.
|
read |
Definition at line 53 of file btqmlinterface.h.
|
read |
Definition at line 54 of file btqmlinterface.h.
|
read |
Definition at line 55 of file btqmlinterface.h.
|
read |
Definition at line 56 of file btqmlinterface.h.
|
read |
Definition at line 57 of file btqmlinterface.h.
|
read |
Definition at line 58 of file btqmlinterface.h.
|
read |
Definition at line 59 of file btqmlinterface.h.
|
read |
Definition at line 60 of file btqmlinterface.h.
Referenced by BtModelViewReadDisplay::reloadModules(), and BtModelViewReadDisplay::setOptions().