KTextEditor

katevariableexpansionmanager.h
1 /*
2  SPDX-FileCopyrightText: 2019 Dominik Haumann <[email protected]>
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 <QString>
11 #include <QVector>
12 #include <QWidget>
13 
14 #include "variable.h"
15 
16 namespace KTextEditor
17 {
18 class View;
19 }
20 
21 /**
22  * Manager class for variable expansion.
23  */
25 {
26 public:
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 QVector<QWidget *> &widgets, const QStringList &names) const;
57 
58 private:
60 };
61 
62 #endif // KTEXTEDITOR_VARIABLE_MANAGER
63 
64 // kate: space-indent on; indent-width 4; replace-tabs on;
bool removeVariable(const QString &name)
Removes variable name.
bool addVariable(const KTextEditor::Variable &variable)
Adds variable to the expansion list view.
Manager class for variable expansion.
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:146
Variable for variable expansion.
Definition: variable.h:34
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition: katetextblock.h:22
const QVector< KTextEditor::Variable > & variables() const
Returns all registered variables.
QObject * parent() const const
KateVariableExpansionManager(QObject *parent)
Constructor with parent that takes ownership.
KTextEditor::Variable variable(const QString &name) const
Returns the variable called name.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 03:55:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.