2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-12-08 17:43:01 +01:00
|
|
|
|
2015-02-26 13:22:35 +01:00
|
|
|
#include "texteditor_global.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-02-26 13:22:35 +01:00
|
|
|
#include <QList>
|
2018-11-25 18:52:41 +01:00
|
|
|
#include <QTextCursor>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace TextEditor {
|
|
|
|
|
|
2014-09-22 18:43:31 +02:00
|
|
|
class TextDocument;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-09-26 11:37:54 +02:00
|
|
|
//
|
|
|
|
|
// TextEditorPrivate
|
|
|
|
|
//
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-09-26 11:37:54 +02:00
|
|
|
struct TextEditorPrivateHighlightBlocks
|
2009-04-23 17:28:53 +02:00
|
|
|
{
|
|
|
|
|
QList<int> open;
|
|
|
|
|
QList<int> close;
|
|
|
|
|
QList<int> visualIndent;
|
2009-04-28 11:43:13 +02:00
|
|
|
inline int count() const { return visualIndent.size(); }
|
2009-04-24 16:44:48 +02:00
|
|
|
inline bool isEmpty() const { return open.isEmpty() || close.isEmpty() || visualIndent.isEmpty(); }
|
2014-09-26 11:37:54 +02:00
|
|
|
inline bool operator==(const TextEditorPrivateHighlightBlocks &o) const {
|
2009-04-23 17:28:53 +02:00
|
|
|
return (open == o.open && close == o.close && visualIndent == o.visualIndent);
|
|
|
|
|
}
|
2014-09-26 11:37:54 +02:00
|
|
|
inline bool operator!=(const TextEditorPrivateHighlightBlocks &o) const { return !(*this == o); }
|
2009-04-23 17:28:53 +02:00
|
|
|
};
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace TextEditor
|