QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
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 "qgscodeeditor.h"
20#include "qgis_sip.h"
21#include "qgis_gui.h"
22#include <Qsci/qscilexer.h>
23
24SIP_IF_MODULE( HAVE_QSCI_SIP )
25
26#ifndef SIP_RUN
27
29class GUI_EXPORT QgsQsciLexerBash : public QsciLexer
30{
31 Q_OBJECT
32 public:
33
34 enum Styles
35 {
36 Default = 0, // whitespace
37 Error = 1,
38 LineComment = 2,
39 Number = 3, // numeric literal
40 Keyword = 4,
41 String = 5, // string literal
42 SingleQuotedString = 6, // string literal
43 Operator = 7,
44 Identifier = 8,
45 ScalarVariable = 9, // identifier
46 Parameter = 10, // identifier
47 BacktickQuotedCommand = 11, // string literal
48 HeredocDelimiter = 12, // operator
49 HeredocQuotedString = 13 // string literal
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};
61
62class GUI_EXPORT QgsQsciLexerBatch : public QsciLexer
63{
64 Q_OBJECT
65 public:
66
67 enum Styles
68 {
69 Default = 0, // whitespace
70 Comment = 1, // "Fake label"
71 Word = 2, // keyword
72 Label = 3, // "real label"
73 Hide = 4, // hide command -- @echo off/on
74 Command = 5, // external command/program
75 Identifier = 6, // argument / variable
76 Operator = 7,
77 };
78
79 QgsQsciLexerBatch( QObject *parent = nullptr );
80 const char *language() const override;
81 const char *lexer() const override;
82 int lexerId() const override;
83 QString description( int style ) const override;
84 const char *keywords( int set ) const override;
85
86
87};
89#endif
90
102class GUI_EXPORT QgsCodeEditorShell : public QgsCodeEditor
103{
104 Q_OBJECT
105
106 public:
107
116 Qgis::ScriptLanguage language() const override;
117
118 protected:
119 void initializeLexer() override;
120
121 private:
122
124
125};
126
127#endif // QGSCODEEDITORSHELL_H
ScriptLanguage
Scripting languages.
Definition: qgis.h:3718
@ Unknown
Unknown/other language.
A shell script code editor based on QScintilla2.
A text editor based on QScintilla2.
Definition: qgscodeeditor.h:93
Mode
Code editor modes.
@ ScriptEditor
Standard mode, allows for display and edit of entire scripts.
#define SIP_IF_MODULE(condition)
Definition: qgis_sip.h:28
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53