QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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 enum Styles
34 {
35 Default = 0, // whitespace
36 Error = 1,
37 LineComment = 2,
38 Number = 3, // numeric literal
39 Keyword = 4,
40 String = 5, // string literal
41 SingleQuotedString = 6, // string literal
42 Operator = 7,
43 Identifier = 8,
44 ScalarVariable = 9, // identifier
45 Parameter = 10, // identifier
46 BacktickQuotedCommand = 11, // string literal
47 HeredocDelimiter = 12, // operator
48 HeredocQuotedString = 13 // string literal
49 };
50
51 QgsQsciLexerBash( QObject *parent = nullptr );
52 const char *language() const override;
53 const char *lexer() const override;
54 int lexerId() const override;
55 QString description( int style ) const override;
56 const char *keywords( int set ) const override;
57};
58
59class GUI_EXPORT QgsQsciLexerBatch : public QsciLexer
60{
61 Q_OBJECT
62 public:
63 enum Styles
64 {
65 Default = 0, // whitespace
66 Comment = 1, // "Fake label"
67 Word = 2, // keyword
68 Label = 3, // "real label"
69 Hide = 4, // hide command -- @echo off/on
70 Command = 5, // external command/program
71 Identifier = 6, // argument / variable
72 Operator = 7,
73 };
74
75 QgsQsciLexerBatch( QObject *parent = nullptr );
76 const char *language() const override;
77 const char *lexer() const override;
78 int lexerId() const override;
79 QString description( int style ) const override;
80 const char *keywords( int set ) const override;
81};
83#endif
84
96class GUI_EXPORT QgsCodeEditorShell : public QgsCodeEditor
97{
98 Q_OBJECT
99
100 public:
109 Qgis::ScriptLanguage language() const override;
110
111 protected:
112 void initializeLexer() override;
113
114 private:
116};
117
118#endif // QGSCODEEDITORSHELL_H
ScriptLanguage
Scripting languages.
Definition qgis.h:4244
@ Unknown
Unknown/other language.
A shell script code editor based on QScintilla2.
A text editor based on QScintilla2.
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