MauiKit TextEditor
documenthandler.cpp
166 auto alert = new DocumentAlert(i18nd("mauikittexteditor","File changed externally"), i18nd("mauikittexteditor","You can reload the file or save your changes now"), DocumentAlert::WARNING_LEVEL, Alerts::MODIFIED);
177 alert->setActions({{i18nd("mauikittexteditor","Reload"), reloadAction}, {i18nd("mauikittexteditor","Auto Reload"), autoReloadAction}, {i18nd("mauikittexteditor","Ignore"), []() {}}});
183 auto alert = new DocumentAlert(i18nd("mauikittexteditor","File can not be saved"), details, DocumentAlert::DANGER_LEVEL, Alerts::SAVE_ERROR);
191 auto alert = new DocumentAlert(i18nd("mauikittexteditor","Your file was removed"), i18nd("mauikittexteditor","This file does not longer exist in your local storage, however you can save it again"), DocumentAlert::DANGER_LEVEL, Alerts::MISSING);
373 qDebug() << "Highliging definition is not valid" << def.name() << def.filePath() << def.author() << m_formatName;
381 qDebug() << "Highliging definition info" << def.name() << def.filePath() << def.author() << m_formatName;
387 const auto style = DocumentHandler::m_repository->defaultTheme(isDark ? KSyntaxHighlighting::Repository::DarkTheme : KSyntaxHighlighting::Repository::LightTheme);
391 qDebug() << "Applying theme << " << m_theme << DocumentHandler::m_repository->theme(m_theme).isValid();
459 connect(this->textDocument(), &QTextDocument::modificationChanged, this, &DocumentHandler::modifiedChanged);
461 connect(this->textDocument(), &QTextDocument::blockCountChanged, this, &DocumentHandler::lineCountChanged);
782 // qWarning() << "can not save file" << textWriter.supportedDocumentFormats() << textWriter.format();
783 // this->m_alerts->append(this->canNotSaveAlert(i18nd("mauikittexteditor","Cannot save file ")+ url.toString()));
792 this->m_alerts->append(this->canNotSaveAlert(i18nd("mauikittexteditor","Cannot save file ") + file.errorString() + url.toString()));
824 return std::accumulate(definitions.constBegin(), definitions.constEnd(), QStringList(), [](QStringList &languages, const auto &definition) -> QStringList {
1052 qDebug() << "Fold line"<< line << startBlock.position() << endBlock.position() << doc->blockCount();
1070 qDebug() << "Fold line"<< line << startBlock.position() << endBlock.position() << doc->blockCount();
1086 return int(doc->documentLayout()->blockBoundingRect(doc->findBlockByLineNumber(line)).height());
void setEnableSyntaxHighlighting(const bool &value)
setEnableSyntaxHighlighting
Definition documenthandler.cpp:1112
void setExternallyModified(const bool &value)
setExternallyModified
Definition documenthandler.cpp:346
static const QString getLanguageNameFromFileName(const QUrl &fileName)
getLanguageNameFromFileName
Definition documenthandler.cpp:809
bool isValid() const
QString name() const
Q_INVOKABLE KSyntaxHighlighting::Theme defaultTheme(DefaultTheme t=LightTheme) const
Q_INVOKABLE KSyntaxHighlighting::Theme theme(const QString &themeName) const
Q_INVOKABLE KSyntaxHighlighting::Definition definitionForName(const QString &defName) const
Q_INVOKABLE QList< KSyntaxHighlighting::Definition > definitions() const
Q_INVOKABLE KSyntaxHighlighting::Definition definitionForFileName(const QString &fileName) const
QTextBlock findFoldingRegionEnd(const QTextBlock &startBlock) const
void setTheme(const Theme &theme) override
bool startsFoldingRegion(const QTextBlock &startBlock) const
void setDefinition(const Definition &def) override
bool isValid() const
Q_SCRIPTABLE Q_NOREPLY void start()
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
bool fileExists(const QUrl &path)
static const QHash< MODEL_KEY, QString > MODEL_NAME
QAction * saveAs(const QObject *recvr, const char *slot, QObject *parent)
KGuiItem reset()
const QList< QKeySequence > & begin()
void beginInsertRows(const QModelIndex &parent, int first, int last)
void beginRemoveRows(const QModelIndex &parent, int first, int last)
void endInsertRows()
void endRemoveRows()
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
virtual QRectF blockBoundingRect(const QTextBlock &block) const const=0
virtual QSizeF documentSize() const const=0
void documentSizeChanged(const QSizeF &newSize)
void updateBlock(const QTextBlock &block)
const QColor & color() const const
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
virtual void close() override
bool exists(const QString &path)
QString fileName() const const
QString suffix() const const
bool addPath(const QString &path)
void fileChanged(const QString &path)
QStringList files() const const
QStringList removePaths(const QStringList &paths)
AllUppercase
Bold
QString family() const const
int pointSize() const const
QString errorString() const const
QByteArray readAll()
qint64 write(const QByteArray &data)
ReadOnly
void append(QList< T > &&value)
int row() const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
void moveToThread(QThread *targetThread)
QObject * parent() const const
QTextDocument * textDocument() const const
qreal height() const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
QString fromStdString(const std::string &str)
bool isEmpty() const const
QTextDocument * document() const const
void rehighlight()
void setDocument(QTextDocument *doc)
bool mightBeRichText(const QString &text)
typedef Alignment
black
int blockNumber() const const
bool isVisible() const const
QTextBlock next() const const
int position() const const
Qt::Alignment alignment() const const
void setAlignment(Qt::Alignment alignment)
QFont font() const const
QFont::Capitalization fontCapitalization() const const
bool fontItalic() const const
bool fontUnderline() const const
int fontWeight() const const
void setFontCapitalization(QFont::Capitalization capitalization)
void setFontFamilies(const QStringList &families)
void setFontItalic(bool italic)
void setFontPointSize(qreal size)
void setFontUnderline(bool underline)
void setFontWeight(int weight)
KeepAnchor
Start
WordUnderCursor
void beginEditBlock()
QTextBlockFormat blockFormat() const const
QTextCharFormat charFormat() const const
void endEditBlock()
bool hasSelection() const const
void insertText(const QString &text)
bool isNull() const const
void mergeBlockFormat(const QTextBlockFormat &modifier)
void mergeCharFormat(const QTextCharFormat &modifier)
int position() const const
void select(SelectionType selection)
int selectionEnd() const const
int selectionStart() const const
void setPosition(int pos, MoveMode m)
FindFlags
blockCount
void blockCountChanged(int newBlockCount)
defaultTextOption
QAbstractTextDocumentLayout * documentLayout() const const
QTextBlock end() const const
QTextCursor find(const QRegularExpression &expr, const QTextCursor &cursor, FindFlags options) const const
QTextBlock findBlock(int pos) const const
QTextBlock findBlockByLineNumber(int lineNumber) const const
void modificationChanged(bool changed)
void setModified(bool m)
void setDefaultTextOption(const QTextOption &option)
QString toHtml() const const
QString toPlainText() const const
FontPointSize
QBrush foreground() const const
QVariant property(int propertyId) const const
void setForeground(const QBrush &brush)
void setTabStopDistance(qreal tabStopDistance)
void finished()
void quit()
bool wait(QDeadlineTimer deadline)
bool isActive() const const
void start()
void stop()
void timeout()
QUrl fromLocalFile(const QString &localFile)
bool isEmpty() const const
bool isLocalFile() const const
bool isValid() const const
QString toLocalFile() const const
QString toString(FormattingOptions options) const const
QVariant fromValue(T &&value)
int toInt(bool *ok) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.