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
|
2016-01-11 20:41:31 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2016-01-11 20:41:31 +01:00
|
|
|
|
|
|
|
|
namespace TextEditor {
|
|
|
|
|
|
|
|
|
|
class BlockRange
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
BlockRange() = default;
|
|
|
|
|
BlockRange(int firstPosition, int lastPosition)
|
|
|
|
|
: firstPosition(firstPosition),
|
|
|
|
|
lastPosition(lastPosition)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
bool isNull() const
|
|
|
|
|
{
|
|
|
|
|
return lastPosition < firstPosition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int first() const
|
|
|
|
|
{
|
|
|
|
|
return firstPosition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int last() const
|
|
|
|
|
{
|
|
|
|
|
return lastPosition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int firstPosition = 0;
|
|
|
|
|
int lastPosition = -1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace TextEditor
|