qscilexerspice.h 3.0 KB

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