/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see .
*/
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using dnSpy.Contracts.Hex.Formatting;
using VSTF = Microsoft.VisualStudio.Text.Formatting;
namespace dnSpy.Contracts.Hex.Editor {
///
/// Hex view line collection
///
public abstract class HexViewLineCollection : IReadOnlyList {
///
/// Constructor
///
protected HexViewLineCollection() { }
///
/// true if it's valid, false if it has been disposed
///
public abstract bool IsValid { get; }
///
/// Gets the number of lines in this collection
///
public abstract int Count { get; }
///
/// Gets a line
///
/// Index
///
public abstract HexViewLine this[int index] { get; }
///
/// Gets the span of all lines in this collection
///
public abstract HexBufferSpan FormattedSpan { get; }
///
/// Gets the first visible line
///
public abstract HexViewLine FirstVisibleLine { get; }
///
/// Gets the last visible line
///
public abstract HexViewLine LastVisibleLine { get; }
///
/// Gets normalized text bounds
///
/// Position
/// Flags
///
public abstract Collection GetNormalizedTextBounds(HexBufferSpan bufferPosition, HexSpanSelectionFlags flags);
///
/// Returns true if this collection contains
///
/// Position
///
public abstract bool ContainsBufferPosition(HexBufferPoint bufferPosition);
///
/// Returns true if this collection intersects with
///
/// Span
///
public abstract bool IntersectsBufferSpan(HexBufferSpan bufferSpan);
///
/// Gets the line containing
///
/// Position
///
public abstract HexViewLine? GetHexViewLineContainingBufferPosition(HexBufferPoint bufferPosition);
///
/// Gets the line containing
///
/// Y position
///
public abstract HexViewLine? GetHexViewLineContainingYCoordinate(double y);
///
/// Gets all lines intersecting with
///
/// Span
///
public abstract Collection GetHexViewLinesIntersectingSpan(HexBufferSpan bufferSpan);
///
/// Gets the enumerator
///
///
public abstract IEnumerator GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
}