KTextEditor

katehighlightingcmds.h
1/*
2 SPDX-FileCopyrightText: 2014 Christoph Rüßler <christoph.ruessler@mailbox.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KATE_HIGHLIGHTING_CMDS_H
8#define KATE_HIGHLIGHTING_CMDS_H
9
10#include <KTextEditor/Command>
11
12namespace KateCommands
13{
14class Highlighting : public KTextEditor::Command
15{
16 Highlighting()
17 : KTextEditor::Command({QStringLiteral("reload-highlighting"), QStringLiteral("edit-highlighting")})
18 {
19 }
20
21 static Highlighting *m_instance;
22
23public:
24 ~Highlighting() override
25 {
26 m_instance = nullptr;
27 }
28
29 static Highlighting *self()
30 {
31 if (m_instance == nullptr) {
32 m_instance = new Highlighting();
33 }
34 return m_instance;
35 }
36
37 /**
38 * execute command
39 * @param view view to use for execution
40 * @param cmd cmd string
41 * @param errorMsg error to return if no success
42 * @return success
43 */
44 bool exec(class KTextEditor::View *view, const QString &cmd, QString &errorMsg, const KTextEditor::Range &range = KTextEditor::Range::invalid()) override;
45
46 /** This command does not have help. @see KTextEditor::Command::help */
47 bool help(class KTextEditor::View *, const QString &, QString &) override;
48};
49
50}
51
52#endif
An Editor command line command.
An object representing a section of text, from one Cursor to another.
static constexpr Range invalid() noexcept
Returns an invalid range.
A text widget with KXMLGUIClient that represents a Document.
Definition view.h:244
The KateCommands namespace collects subclasses of KTextEditor::Command for specific use in kate.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.