KTextEditor

katevariableexpansionmanager.h
1/*
2 SPDX-FileCopyrightText: 2019 Dominik Haumann <dhaumann@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KTEXTEDITOR_VARIABLE_MANAGER
8#define KTEXTEDITOR_VARIABLE_MANAGER
9
10#include <QList>
11#include <QString>
12#include <QWidget>
13
14#include "variable.h"
15
16namespace KTextEditor
17{
18class View;
19}
20
21/**
22 * Manager class for variable expansion.
23 */
25{
26public:
27 /**
28 * Constructor with @p parent that takes ownership.
29 */
31
32 /**
33 * Adds @p variable to the expansion list view.
34 */
36
37 /**
38 * Removes variable @p name.
39 */
40 bool removeVariable(const QString &name);
41
42 /**
43 * Returns the variable called @p name.
44 */
45 KTextEditor::Variable variable(const QString &name) const;
46
47 /**
48 * Returns all registered variables.
49 */
51
52 bool expandVariable(const QString &variable, KTextEditor::View *view, QString &output) const;
53
54 static QString expandText(const QString &text, KTextEditor::View *view);
55
56 void showDialog(const QList<QWidget *> &widgets, const QStringList &names) const;
57
58private:
60};
61
62#endif // KTEXTEDITOR_VARIABLE_MANAGER
63
64// kate: space-indent on; indent-width 4; replace-tabs on;
Variable for variable expansion.
Definition variable.h:35
A text widget with KXMLGUIClient that represents a Document.
Definition view.h:244
Manager class for variable expansion.
KTextEditor::Variable variable(const QString &name) const
Returns the variable called name.
KateVariableExpansionManager(QObject *parent)
Constructor with parent that takes ownership.
bool addVariable(const KTextEditor::Variable &variable)
Adds variable to the expansion list view.
bool removeVariable(const QString &name)
Removes variable name.
const QList< KTextEditor::Variable > & variables() const
Returns all registered variables.
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:15:44 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.