aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/mockup
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@theqtcompany.com>2015-11-18 17:07:44 +0100
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-11-26 15:19:27 +0000
commit7ce9ef9db4ae499f4c7ac67e3640785634d5e369 (patch)
tree7d6bbb1ab9663275fc7f312adf97d765c6cc74e7 /tests/unit/mockup
parenteb2457869d2c2b44fcbf6665c5fef9188ac8b240 (diff)
Clang: Integrate highlighting results from backend
Change-Id: I2c3fb69aabfe075bde76d63eafc2ca370f17493c Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Diffstat (limited to 'tests/unit/mockup')
-rw-r--r--tests/unit/mockup/texteditor/semantichighlighter.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/unit/mockup/texteditor/semantichighlighter.h b/tests/unit/mockup/texteditor/semantichighlighter.h
new file mode 100644
index 0000000000..fa9b5d0a66
--- /dev/null
+++ b/tests/unit/mockup/texteditor/semantichighlighter.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms and
+** conditions see http://www.qt.io/terms-conditions. For further information
+** use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef TEXTEDITOR_SEMANTICHIGHLIGHTER_H
+#define TEXTEDITOR_SEMANTICHIGHLIGHTER_H
+
+namespace TextEditor {
+
+class HighlightingResult {
+public:
+ unsigned line;
+ unsigned column;
+ unsigned length;
+ int kind;
+
+ bool isValid() const
+ { return line != 0; }
+
+ bool isInvalid() const
+ { return line == 0; }
+
+ HighlightingResult()
+ : line(0), column(0), length(0), kind(0)
+ {}
+
+ HighlightingResult(unsigned line, unsigned column, unsigned length, int kind)
+ : line(line), column(column), length(length), kind(kind)
+ {}
+
+ bool operator==(const HighlightingResult& other) const
+ {
+ return line == other.line
+ && column == other.column
+ && length == other.length
+ && kind == other.kind;
+ }
+};
+
+} // namespace TextEditor
+
+#endif // TEXTEDITOR_SEMANTICHIGHLIGHTER_H