qscilexerbatch.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // This defines the interface to the QsciLexerBatch 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 QSCILEXERBATCH_H
  20. #define QSCILEXERBATCH_H
  21. #include <QObject>
  22. #include <Qsci/qsciglobal.h>
  23. #include <Qsci/qscilexer.h>
  24. //! \brief The QsciLexerBatch class encapsulates the Scintilla batch file
  25. //! lexer.
  26. class QSCINTILLA_EXPORT QsciLexerBatch : public QsciLexer
  27. {
  28. Q_OBJECT
  29. public:
  30. //! This enum defines the meanings of the different styles used by the
  31. //! batch file lexer.
  32. enum {
  33. //! The default.
  34. Default = 0,
  35. //! A comment.
  36. Comment = 1,
  37. //! A keyword.
  38. Keyword = 2,
  39. //! A label.
  40. Label = 3,
  41. //! An hide command character.
  42. HideCommandChar = 4,
  43. //! An external command .
  44. ExternalCommand = 5,
  45. //! A variable.
  46. Variable = 6,
  47. //! An operator
  48. Operator = 7
  49. };
  50. //! Construct a QsciLexerBatch with parent \a parent. \a parent is
  51. //! typically the QsciScintilla instance.
  52. QsciLexerBatch(QObject *parent = 0);
  53. //! Destroys the QsciLexerBatch instance.
  54. virtual ~QsciLexerBatch();
  55. //! Returns the name of the language.
  56. const char *language() const;
  57. //! Returns the name of the lexer. Some lexers support a number of
  58. //! languages.
  59. const char *lexer() const;
  60. //! Returns the string of characters that comprise a word.
  61. const char *wordCharacters() const;
  62. //! \internal Returns true if the language is case sensitive.
  63. bool caseSensitive() const;
  64. //! Returns the foreground colour of the text for style number \a style.
  65. //!
  66. //! \sa defaultPaper()
  67. QColor defaultColor(int style) const;
  68. //! Returns the end-of-line fill for style number \a style.
  69. bool defaultEolFill(int style) const;
  70. //! Returns the font for style number \a style.
  71. QFont defaultFont(int style) const;
  72. //! Returns the background colour of the text for style number \a style.
  73. //!
  74. //! \sa defaultColor()
  75. QColor defaultPaper(int style) const;
  76. //! Returns the set of keywords for the keyword set \a set recognised
  77. //! by the lexer as a space separated string.
  78. const char *keywords(int set) const;
  79. //! Returns the descriptive name for style number \a style. If the
  80. //! style is invalid for this language then an empty QString is returned.
  81. //! This is intended to be used in user preference dialogs.
  82. QString description(int style) const;
  83. private:
  84. QsciLexerBatch(const QsciLexerBatch &);
  85. QsciLexerBatch &operator=(const QsciLexerBatch &);
  86. };
  87. #endif