qscilexermatlab.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // This defines the interface to the QsciLexerMatlab class.
  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. #ifndef QSCILEXERMATLAB_H
  20. #define QSCILEXERMATLAB_H
  21. #include <QObject>
  22. #include <Qsci/qsciglobal.h>
  23. #include <Qsci/qscilexer.h>
  24. //! \brief The QsciLexerMatlab class encapsulates the Scintilla Matlab file
  25. //! lexer.
  26. class QSCINTILLA_EXPORT QsciLexerMatlab : public QsciLexer
  27. {
  28. Q_OBJECT
  29. public:
  30. //! This enum defines the meanings of the different styles used by the
  31. //! Matlab file lexer.
  32. enum {
  33. //! The default.
  34. Default = 0,
  35. //! A comment.
  36. Comment = 1,
  37. //! A command.
  38. Command = 2,
  39. //! A number.
  40. Number = 3,
  41. //! A keyword.
  42. Keyword = 4,
  43. //! A single quoted string.
  44. SingleQuotedString = 5,
  45. //! An operator
  46. Operator = 6,
  47. //! An identifier.
  48. Identifier = 7,
  49. //! A double quoted string.
  50. DoubleQuotedString = 8
  51. };
  52. //! Construct a QsciLexerMatlab with parent \a parent. \a parent is
  53. //! typically the QsciScintilla instance.
  54. QsciLexerMatlab(QObject *parent = 0);
  55. //! Destroys the QsciLexerMatlab instance.
  56. virtual ~QsciLexerMatlab();
  57. //! Returns the name of the language.
  58. const char *language() const;
  59. //! Returns the name of the lexer. Some lexers support a number of
  60. //! languages.
  61. const char *lexer() const;
  62. //! Returns the foreground colour of the text for style number \a style.
  63. //!
  64. //! \sa defaultPaper()
  65. QColor defaultColor(int style) const;
  66. //! Returns the font for style number \a style.
  67. QFont defaultFont(int style) const;
  68. //! Returns the set of keywords for the keyword set \a set recognised
  69. //! by the lexer as a space separated string.
  70. const char *keywords(int set) const;
  71. //! Returns the descriptive name for style number \a style. If the
  72. //! style is invalid for this language then an empty QString is returned.
  73. //! This is intended to be used in user preference dialogs.
  74. QString description(int style) const;
  75. private:
  76. QsciLexerMatlab(const QsciLexerMatlab &);
  77. QsciLexerMatlab &operator=(const QsciLexerMatlab &);
  78. };
  79. #endif