qscilexerpython.sip 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // This is the SIP interface definition for QsciLexerPython.
  2. //
  3. // Copyright (c) 2017 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. class QsciLexerPython : QsciLexer
  20. {
  21. %TypeHeaderCode
  22. #include <Qsci/qscilexerpython.h>
  23. %End
  24. public:
  25. enum {
  26. Default,
  27. Comment,
  28. Number,
  29. DoubleQuotedString,
  30. SingleQuotedString,
  31. Keyword,
  32. TripleSingleQuotedString,
  33. TripleDoubleQuotedString,
  34. ClassName,
  35. FunctionMethodName,
  36. Operator,
  37. Identifier,
  38. CommentBlock,
  39. UnclosedString,
  40. HighlightedIdentifier,
  41. Decorator,
  42. };
  43. enum IndentationWarning {
  44. NoWarning,
  45. Inconsistent,
  46. TabsAfterSpaces,
  47. Spaces,
  48. Tabs
  49. };
  50. QsciLexerPython(QObject *parent /TransferThis/ = 0);
  51. virtual ~QsciLexerPython();
  52. const char *language() const;
  53. const char *lexer() const;
  54. QColor defaultColor(int style) const;
  55. bool defaultEolFill(int style) const;
  56. QFont defaultFont(int style) const;
  57. QColor defaultPaper(int style) const;
  58. const char *keywords(int set) const;
  59. QString description(int style) const;
  60. QStringList autoCompletionWordSeparators() const;
  61. int blockLookback() const;
  62. const char *blockStart(int *style = 0) const /Encoding="None"/;
  63. int braceStyle() const;
  64. int indentationGuideView() const;
  65. void refreshProperties();
  66. bool foldComments() const;
  67. void setFoldCompact(bool fold);
  68. bool foldCompact() const;
  69. bool foldQuotes() const;
  70. QsciLexerPython::IndentationWarning indentationWarning() const;
  71. void setHighlightSubidentifiers(bool enabled);
  72. bool highlightSubidentifiers() const;
  73. void setStringsOverNewlineAllowed(bool allowed);
  74. bool stringsOverNewlineAllowed() const;
  75. void setV2UnicodeAllowed(bool allowed);
  76. bool v2UnicodeAllowed() const;
  77. void setV3BinaryOctalAllowed(bool allowed);
  78. bool v3BinaryOctalAllowed() const;
  79. void setV3BytesAllowed(bool allowed);
  80. bool v3BytesAllowed() const;
  81. public slots:
  82. virtual void setFoldComments(bool fold);
  83. virtual void setFoldQuotes(bool fold);
  84. virtual void setIndentationWarning(QsciLexerPython::IndentationWarning warn);
  85. protected:
  86. bool readProperties(QSettings &qs, const QString &prefix);
  87. bool writeProperties(QSettings &qs, const QString &prefix) const;
  88. private:
  89. QsciLexerPython(const QsciLexerPython &);
  90. };