qscilexermakefile.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // This defines the interface to the QsciLexerMakefile 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 QSCILEXERMAKEFILE_H
  20. #define QSCILEXERMAKEFILE_H
  21. #include <QObject>
  22. #include <Qsci/qsciglobal.h>
  23. #include <Qsci/qscilexer.h>
  24. //! \brief The QsciLexerMakefile class encapsulates the Scintilla
  25. //! Makefile lexer.
  26. class QSCINTILLA_EXPORT QsciLexerMakefile : public QsciLexer
  27. {
  28. Q_OBJECT
  29. public:
  30. //! This enum defines the meanings of the different styles used by the
  31. //! Makefile lexer.
  32. enum {
  33. //! The default.
  34. Default = 0,
  35. //! A comment.
  36. Comment = 1,
  37. //! A pre-processor directive.
  38. Preprocessor = 2,
  39. //! A variable.
  40. Variable = 3,
  41. //! An operator.
  42. Operator = 4,
  43. //! A target.
  44. Target = 5,
  45. //! An error.
  46. Error = 9
  47. };
  48. //! Construct a QsciLexerMakefile with parent \a parent. \a parent is
  49. //! typically the QsciScintilla instance.
  50. QsciLexerMakefile(QObject *parent = 0);
  51. //! Destroys the QsciLexerMakefile instance.
  52. virtual ~QsciLexerMakefile();
  53. //! Returns the name of the language.
  54. const char *language() const;
  55. //! Returns the name of the lexer. Some lexers support a number of
  56. //! languages.
  57. const char *lexer() const;
  58. //! Returns the string of characters that comprise a word.
  59. const char *wordCharacters() const;
  60. //! Returns the foreground colour of the text for style number \a style.
  61. //!
  62. //! \sa defaultPaper()
  63. QColor defaultColor(int style) const;
  64. //! Returns the end-of-line fill for style number \a style.
  65. bool defaultEolFill(int style) const;
  66. //! Returns the font for style number \a style.
  67. QFont defaultFont(int style) const;
  68. //! Returns the background colour of the text for style number \a style.
  69. //!
  70. //! \sa defaultColor()
  71. QColor defaultPaper(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. QsciLexerMakefile(const QsciLexerMakefile &);
  78. QsciLexerMakefile &operator=(const QsciLexerMakefile &);
  79. };
  80. #endif