qscilexerdiff.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // This defines the interface to the QsciLexerDiff 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 QSCILEXERDIFF_H
  20. #define QSCILEXERDIFF_H
  21. #include <QObject>
  22. #include <Qsci/qsciglobal.h>
  23. #include <Qsci/qscilexer.h>
  24. //! \brief The QsciLexerDiff class encapsulates the Scintilla Diff
  25. //! lexer.
  26. class QSCINTILLA_EXPORT QsciLexerDiff : public QsciLexer
  27. {
  28. Q_OBJECT
  29. public:
  30. //! This enum defines the meanings of the different styles used by the
  31. //! Diff lexer.
  32. enum {
  33. //! The default.
  34. Default = 0,
  35. //! A comment.
  36. Comment = 1,
  37. //! A command.
  38. Command = 2,
  39. //! A header.
  40. Header = 3,
  41. //! A position.
  42. Position = 4,
  43. //! A removed line.
  44. LineRemoved = 5,
  45. //! An added line.
  46. LineAdded = 6,
  47. //! A changed line.
  48. LineChanged = 7
  49. };
  50. //! Construct a QsciLexerDiff with parent \a parent. \a parent is
  51. //! typically the QsciScintilla instance.
  52. QsciLexerDiff(QObject *parent = 0);
  53. //! Destroys the QsciLexerDiff instance.
  54. virtual ~QsciLexerDiff();
  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. //! Returns the foreground colour of the text for style number \a style.
  63. QColor defaultColor(int style) const;
  64. //! Returns the descriptive name for style number \a style. If the
  65. //! style is invalid for this language then an empty QString is returned.
  66. //! This is intended to be used in user preference dialogs.
  67. QString description(int style) const;
  68. private:
  69. QsciLexerDiff(const QsciLexerDiff &);
  70. QsciLexerDiff &operator=(const QsciLexerDiff &);
  71. };
  72. #endif