#region License Information
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/* HeuristicLab
* Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
*
* This file is part of HeuristicLab.
*
* HeuristicLab 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.
*
* HeuristicLab 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 HeuristicLab. If not, see .
*/
#endregion
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
namespace ICSharpCode.SharpDevelop.Editor {
///
/// Represents a text marker.
///
public interface ITextMarker {
///
/// Gets the start offset of the marked text region.
///
int StartOffset { get; }
///
/// Gets the end offset of the marked text region.
///
int EndOffset { get; }
///
/// Gets the length of the marked region.
///
int Length { get; }
///
/// Deletes the text marker.
///
void Delete();
///
/// Gets whether the text marker was deleted.
///
bool IsDeleted { get; }
///
/// Event that occurs when the text marker is deleted.
///
event EventHandler Deleted;
///
/// Gets/Sets the background color.
///
Color? BackgroundColor { get; set; }
///
/// Gets/Sets the foreground color.
///
Color? ForegroundColor { get; set; }
///
/// Gets/Sets the font weight.
///
FontWeight? FontWeight { get; set; }
///
/// Gets/Sets the font style.
///
FontStyle? FontStyle { get; set; }
///
/// Gets/Sets the type of the marker. Use TextMarkerType.None for normal markers.
///
TextMarkerTypes MarkerTypes { get; set; }
///
/// Gets/Sets the color of the marker.
///
Color MarkerColor { get; set; }
///
/// Gets/Sets an object with additional data for this text marker.
///
object Tag { get; set; }
///
/// Gets/Sets an object that will be displayed as tooltip in the text editor.
///
object ToolTip { get; set; }
}
[Flags]
public enum TextMarkerTypes {
///
/// Use no marker
///
None = 0x0000,
///
/// Use squiggly underline marker
///
SquigglyUnderline = 0x001,
///
/// Normal underline.
///
NormalUnderline = 0x002,
///
/// Dotted underline.
///
DottedUnderline = 0x004,
///
/// Horizontal line in the scroll bar.
///
LineInScrollBar = 0x0100,
///
/// Small triangle in the scroll bar, pointing to the right.
///
ScrollBarRightTriangle = 0x0400,
///
/// Small triangle in the scroll bar, pointing to the left.
///
ScrollBarLeftTriangle = 0x0800,
///
/// Small circle in the scroll bar.
///
CircleInScrollBar = 0x1000
}
public interface ITextMarkerService {
///
/// Creates a new text marker. The text marker will be invisible at first,
/// you need to set one of the Color properties to make it visible.
///
ITextMarker Create(int startOffset, int length);
///
/// Gets the list of text markers.
///
IEnumerable TextMarkers { get; }
///
/// Removes the specified text marker.
///
void Remove(ITextMarker marker);
///
/// Removes all text markers that match the condition.
///
void RemoveAll(Predicate predicate);
///
/// Finds all text markers at the specified offset.
///
IEnumerable GetMarkersAtOffset(int offset);
}
}