1// This is the SIP interface definition for QsciLexer. 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 21class QsciLexer : QObject 22{ 23%TypeHeaderCode 24#include <Qsci/qscilexer.h> 25%End 26 27public: 28 QsciLexer(QObject *parent /TransferThis/ = 0); 29 virtual ~QsciLexer(); 30 31 virtual const char *language() const = 0; 32 virtual const char *lexer() const; 33 virtual int lexerId() const; 34 QsciAbstractAPIs *apis() const; 35 virtual const char *autoCompletionFillups() const /Encoding="None"/; 36 virtual QStringList autoCompletionWordSeparators() const; 37 int autoIndentStyle(); 38 virtual const char *blockEnd(int *style = 0) const /Encoding="None"/; 39 virtual int blockLookback() const; 40 virtual const char *blockStart(int *style = 0) const /Encoding="None"/; 41 virtual const char *blockStartKeyword(int *style = 0) const /Encoding="None"/; 42 virtual int braceStyle() const; 43 virtual bool caseSensitive() const; 44 virtual QColor color(int style) const; 45 virtual bool eolFill(int style) const; 46 virtual QFont font(int style) const; 47 virtual int indentationGuideView() const; 48 virtual const char *keywords(int set) const; 49 virtual QString description(int style) const = 0; 50 virtual QColor paper(int style) const; 51 QColor defaultColor() const; 52 virtual QColor defaultColor(int style) const; 53 virtual bool defaultEolFill(int style) const; 54 QFont defaultFont() const; 55 virtual QFont defaultFont(int style) const; 56 QColor defaultPaper() const; 57 virtual QColor defaultPaper(int style) const; 58 virtual int defaultStyle() const; 59 QsciScintilla *editor() const; 60 virtual void refreshProperties(); 61 void setAPIs(QsciAbstractAPIs *apis); 62 void setDefaultColor(const QColor &c); 63 void setDefaultFont(const QFont &f); 64 void setDefaultPaper(const QColor &c); 65 virtual int styleBitsNeeded() const; 66 virtual const char *wordCharacters() const; 67 bool readSettings(QSettings &qs, const char *prefix = "/Scintilla"); 68 bool writeSettings(QSettings &qs, const char *prefix = "/Scintilla") const; 69 70public slots: 71 virtual void setAutoIndentStyle(int autoindentstyle); 72 virtual void setColor(const QColor &c, int style = -1); 73 virtual void setEolFill(bool eolfill, int style = -1); 74 virtual void setFont(const QFont &f, int style = -1); 75 virtual void setPaper(const QColor &c, int style = -1); 76 77signals: 78 void colorChanged(const QColor &c, int style); 79 void eolFillChanged(bool eolfilled, int style); 80 void fontChanged(const QFont &f, int style); 81 void paperChanged(const QColor &c, int style); 82 void propertyChanged(const char *prop, const char *val); 83 84protected: 85 virtual bool readProperties(QSettings &qs, const QString &prefix); 86 virtual bool writeProperties(QSettings &qs, const QString &prefix) const; 87 88private: 89 QsciLexer(const QsciLexer &); 90}; 91