QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
codeeditors
qgscodeeditorshell.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgscodeeditorshell.h
3
-------------------
4
Date : April 2023
5
Copyright : (C) 2023 by Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSCODEEDITORSHELL_H
17
#define QGSCODEEDITORSHELL_H
18
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgscodeeditor.h
"
22
23
#include <Qsci/qscilexer.h>
24
25
SIP_IF_MODULE
( HAVE_QSCI_SIP )
26
27
#ifndef SIP_RUN
28
30
class
GUI_EXPORT QgsQsciLexerBash :
public
QsciLexer
31
{
32
Q_OBJECT
33
public
:
34
enum
Styles
35
{
36
Default = 0,
37
Error = 1,
38
LineComment = 2,
39
Number = 3,
40
Keyword = 4,
41
String = 5,
42
SingleQuotedString = 6,
43
Operator = 7,
44
Identifier = 8,
45
ScalarVariable = 9,
46
Parameter = 10,
47
BacktickQuotedCommand = 11,
48
HeredocDelimiter = 12,
49
HeredocQuotedString = 13
50
};
51
52
QgsQsciLexerBash( QObject *parent =
nullptr
);
53
const
char
*language()
const override
;
54
const
char
*lexer()
const override
;
55
int
lexerId()
const override
;
56
QString description(
int
style )
const override
;
57
const
char
*keywords(
int
set )
const override
;
58
};
59
60
class
GUI_EXPORT QgsQsciLexerBatch :
public
QsciLexer
61
{
62
Q_OBJECT
63
public
:
64
enum
Styles
65
{
66
Default = 0,
// whitespace
67
Comment = 1,
// "Fake label"
68
Word = 2,
// keyword
69
Label = 3,
// "real label"
70
Hide = 4,
// hide command -- @echo off/on
71
Command = 5,
// external command/program
72
Identifier = 6,
// argument / variable
73
Operator = 7,
74
};
75
76
QgsQsciLexerBatch( QObject *parent =
nullptr
);
77
const
char
*language()
const override
;
78
const
char
*lexer()
const override
;
79
int
lexerId()
const override
;
80
QString description(
int
style )
const override
;
81
const
char
*keywords(
int
set )
const override
;
82
};
84
#endif
85
98
class
GUI_EXPORT
QgsCodeEditorShell
:
public
QgsCodeEditor
99
{
100
Q_OBJECT
101
102
public
:
110
QgsCodeEditorShell
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
,
QgsCodeEditor::Mode
mode
=
QgsCodeEditor::Mode::ScriptEditor
,
Qgis::ScriptLanguage
language
=
Qgis::ScriptLanguage::Unknown
);
111
Qgis::ScriptLanguage
language
()
const override
;
112
113
protected
:
114
void
initializeLexer
()
override
;
115
116
private
:
117
Qgis::ScriptLanguage
mLanguage =
Qgis::ScriptLanguage::Unknown
;
118
};
119
120
#endif
// QGSCODEEDITORSHELL_H
Qgis::ScriptLanguage
ScriptLanguage
Scripting languages.
Definition
qgis.h:4978
Qgis::ScriptLanguage::Unknown
@ Unknown
Unknown/other language.
Definition
qgis.h:4989
QgsCodeEditorShell::initializeLexer
void initializeLexer() override
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
Definition
qgscodeeditorshell.cpp:71
QgsCodeEditorShell::language
Qgis::ScriptLanguage language() const override
Returns the associated scripting language.
Definition
qgscodeeditorshell.cpp:66
QgsCodeEditorShell::QgsCodeEditorShell
QgsCodeEditorShell(QWidget *parent=nullptr, QgsCodeEditor::Mode mode=QgsCodeEditor::Mode::ScriptEditor, Qgis::ScriptLanguage language=Qgis::ScriptLanguage::Unknown)
Constructor for QgsCodeEditorShell.
Definition
qgscodeeditorshell.cpp:26
QgsCodeEditor::mode
QgsCodeEditor::Mode mode() const
Returns the code editor mode.
Definition
qgscodeeditor.h:344
QgsCodeEditor::Mode
Mode
Code editor modes.
Definition
qgscodeeditor.h:123
QgsCodeEditor::Mode::ScriptEditor
@ ScriptEditor
Standard mode, allows for display and edit of entire scripts.
Definition
qgscodeeditor.h:124
QgsCodeEditor::QgsCodeEditor
QgsCodeEditor(QWidget *parent=nullptr, const QString &title=QString(), bool folding=false, bool margin=false, QgsCodeEditor::Flags flags=QgsCodeEditor::Flags(), QgsCodeEditor::Mode mode=QgsCodeEditor::Mode::ScriptEditor)
Construct a new code editor.
Definition
qgscodeeditor.cpp:96
qgis_sip.h
SIP_IF_MODULE
#define SIP_IF_MODULE(condition)
Definition
qgis_sip.h:27
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgscodeeditor.h
Generated on
for QGIS API Documentation by
1.17.0