KTextEditor
katevariableexpansionmanager.cpp
80 i18n("Full document path including file name, with native path separator (backslash on Windows)."),
88 i18n("Full document path excluding file name, with native path separator (backslash on Windows)."),
112 return view ? QString::number(view->mapToGlobal(view->cursorPositionCoordinates()).x()) : QString();
119 return view ? QString::number(view->mapToGlobal(view->cursorPositionCoordinates()).y()) : QString();
133 return (view && view->selection()) ? QString::number(view->selectionRange().start().line()) : QString();
140 return (view && view->selection()) ? QString::number(view->selectionRange().start().column()) : QString();
147 return (view && view->selection()) ? QString::number(view->selectionRange().end().line()) : QString();
154 return (view && view->selection()) ? QString::number(view->selectionRange().end().column()) : QString();
168 return view ? qobject_cast<KTextEditor::DocumentPrivate *>(view->document())->variable(str.mid(18).toString()) : QString();
265 const auto alreadyExists = std::any_of(m_variables.begin(), m_variables.end(), [&var](const KTextEditor::Variable &v) {
283 auto it = std::find_if(m_variables.begin(), m_variables.end(), [&name](const KTextEditor::Variable &var) {
295 auto it = std::find_if(m_variables.begin(), m_variables.end(), [&name](const KTextEditor::Variable &var) {
309bool KateVariableExpansionManager::expandVariable(const QString &name, KTextEditor::View *view, QString &output) const
336void KateVariableExpansionManager::showDialog(const QList<QWidget *> &widgets, const QStringList &names) const
QUrl url() const
constexpr int column() const noexcept
Retrieve the column on which this cursor is situated.
Definition cursor.h:192
constexpr int line() const noexcept
Retrieve the line on which this cursor is situated.
Definition cursor.h:174
constexpr Cursor end() const noexcept
Get the end position of this range.
Definition include/ktexteditor/range.h:163
constexpr Cursor start() const noexcept
Get the start position of this range.
Definition include/ktexteditor/range.h:153
bool isValid() const
Returns true, if the name is non-empty and the function provided in the constructor is not a nullptr.
Definition variable.cpp:19
bool isPrefixMatch() const
Returns whether this Variable represents an exact match (false) or a prefix match (true).
Definition variable.cpp:24
QString name() const
Returns the name that was provided in the constructor.
Definition variable.cpp:29
virtual Document * document() const =0
Get the view's document, that means the view is a view of the returned document.
virtual QPoint cursorPositionCoordinates() const =0
Get the screen coordinates (x, y) of the cursor position in pixels.
virtual Cursor cursorPosition() const =0
Get the view's current cursor position.
virtual bool selection() const =0
Query the view whether it has selected text, i.e.
virtual Range selectionRange() const =0
Get the range occupied by the current selection.
virtual QString selectionText() const =0
Get the view's selected text.
Helper dialog that shows a non-modal dialog listing all available variables.
Definition katevariableexpansionhelpers.h:46
Manager class for variable expansion.
Definition katevariableexpansionmanager.h:25
KTextEditor::Variable variable(const QString &name) const
Returns the variable called name.
Definition katevariableexpansionmanager.cpp:293
KateVariableExpansionManager(QObject *parent)
Constructor with parent that takes ownership.
Definition katevariableexpansionmanager.cpp:251
bool addVariable(const KTextEditor::Variable &variable)
Adds variable to the expansion list view.
Definition katevariableexpansionmanager.cpp:258
bool removeVariable(const QString &name)
Removes variable name.
Definition katevariableexpansionmanager.cpp:281
const QList< KTextEditor::Variable > & variables() const
Returns all registered variables.
Definition katevariableexpansionmanager.cpp:304
QString i18n(const char *text, const TYPE &arg...)
QString expandMacro(const QString &input, KTextEditor::View *view)
Expands the input text based on the view.
Definition katevariableexpansionhelpers.cpp:57
const char * constData() const const
QDate currentDate()
QString toString(QStringView format, QCalendar cal) const const
QString absoluteFilePath() const const
QString absolutePath() const const
QString baseName() const const
QString completeSuffix() const const
QString fileName() const const
QJSValue evaluate(const QString &program, const QString &fileName, int lineNumber, QStringList *exceptionStackTrace)
QString toString() const const
iterator begin()
const_iterator cbegin() const const
const_iterator cend() const const
iterator end()
iterator erase(const_iterator begin, const_iterator end)
bool isEmpty() const const
void push_back(parameter_type value)
ShortFormat
QString toString(QDate date, FormatType format) const const
Variable
int x() const const
int y() const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
QString fromLocal8Bit(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
QString number(double n, char format, int precision)
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QStringView mid(qsizetype start, qsizetype length) const const
QByteArray toLocal8Bit() const const
QString toString() const const
ISODate
QTime currentTime()
QString toString(QStringView format) const const
QString toLocalFile() const const
QByteArray toPercentEncoding(const QString &input, const QByteArray &exclude, const QByteArray &include)
WithoutBraces
QUuid createUuid()
QString toString(StringFormat mode) const const
QPoint mapToGlobal(const QPoint &pos) const const
QWidget * window() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.