1 // This defines the interface to the QsciLexerEDIFACT class.
2 //
3 // Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
4 //
5 // This file is part of QScintilla.
6 //
7 // This file may be used under the terms of the GNU General Public License
8 // version 3.0 as published by the Free Software Foundation and appearing in
9 // the file LICENSE included in the packaging of this file.  Please review the
10 // following information to ensure the GNU General Public License version 3.0
11 // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 //
13 // If you do not wish to use this file under the terms of the GPL version 3.0
14 // then you may purchase a commercial license.  For more information contact
15 // info@riverbankcomputing.com.
16 //
17 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 
20 
21 #ifndef QSCILEXEREDIFACT_H
22 #define QSCILEXEREDIFACT_H
23 
24 #include <QObject>
25 
26 #include <Qsci/qsciglobal.h>
27 #include <Qsci/qscilexer.h>
28 
29 
30 //! \brief The QsciLexerEDIFACT class encapsulates the Scintilla EDIFACT lexer.
31 class QSCINTILLA_EXPORT QsciLexerEDIFACT : public QsciLexer
32 {
33     Q_OBJECT
34 
35 public:
36     //! This enum defines the meanings of the different styles used by the
37     //! EDIFACT lexer.
38     enum {
39         //! The default.
40         Default = 0,
41 
42         //! A segment start.
43         SegmentStart = 1,
44 
45         //! A segment end.
46         SegmentEnd = 2,
47 
48         //! An element separator.
49         ElementSeparator = 3,
50 
51         //! A composite separator.
52         CompositeSeparator = 4,
53 
54         //! A release separator.
55         ReleaseSeparator = 5,
56 
57         //! A UNA segment header.
58         UNASegmentHeader = 6,
59 
60         //! A UNH segment header.
61         UNHSegmentHeader = 7,
62 
63         //! A bad segment.
64         BadSegment = 8,
65     };
66 
67     //! Construct a QsciLexerEDIFACT with parent \a parent.  \a parent is
68     //! typically the QsciScintilla instance.
69     QsciLexerEDIFACT(QObject *parent = 0);
70 
71     //! Destroys the QsciLexerEDIFACT instance.
72     virtual ~QsciLexerEDIFACT();
73 
74     //! Returns the name of the language.
75     const char *language() const;
76 
77     //! Returns the name of the lexer.  Some lexers support a number of
78     //! languages.
79     const char *lexer() const;
80 
81     //! Returns the foreground colour of the text for style number \a style.
82     //!
83     //! \sa defaultPaper()
84     QColor defaultColor(int style) const;
85 
86     //! Returns the descriptive name for style number \a style.  If the
87     //! style is invalid for this language then an empty QString is returned.
88     //! This is intended to be used in user preference dialogs.
89     QString description(int style) const;
90 
91 private:
92     QsciLexerEDIFACT(const QsciLexerEDIFACT &);
93     QsciLexerEDIFACT &operator=(const QsciLexerEDIFACT &);
94 };
95 
96 #endif
97