#region License
// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
// This source code is made available under the terms of the GNU Lesser General Public License v3.0
// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
#endregion
using System;
namespace MiniSqlQuery.Core
{
///
/// A control that allows its text to be "found" and optionally "replaced".
/// The query editor is an obvious provider but other windows can also provide
/// find/replace functionality by implementing this interface (tools, output windows etc).
///
public interface IFindReplaceProvider : ISupportCursorOffset
{
///
/// Gets a value indicating whether the text can be replaced, otherwise false.
///
/// The can replace text.
bool CanReplaceText { get; }
///
/// Gets a reference to the text finding service.
///
///
/// The text find service.
ITextFindService TextFindService { get; }
///
/// Attemps to find in the controls text.
///
/// The string to search for.
/// The starting position within the buffer.
/// The string comparison type to use, e.g.
/// The find string.
int FindString(string value, int startIndex, StringComparison comparisonType);
///
/// Replaces the text from for characters
/// with .
///
/// The new string.
/// the starting position.
/// The length (0 implies an insert).
/// True if successful, otherwise false.
///
bool ReplaceString(string value, int startIndex, int length);
///
/// Overrides the default text find service with (e.g. a RegEx service).
///
/// The service to use.
void SetTextFindService(ITextFindService textFindService);
}
}