//
//
//
//
// $Revision$
//
using System;
namespace ICSharpCode.TextEditor.Document
{
///
/// This interface handles the auto and smart indenting and formating
/// in the document while you type. Language bindings could overwrite this
/// interface and define their own indentation/formating.
///
public interface IFormattingStrategy
{
///
/// This function formats a specific line after ch
is pressed.
///
void FormatLine(TextArea textArea, int line, int caretOffset, char charTyped);
///
/// This function sets the indentation level in a specific line
///
///
/// The target caret position (length of new indentation).
///
int IndentLine(TextArea textArea, int line);
///
/// This function sets the indentlevel in a range of lines.
///
void IndentLines(TextArea textArea, int begin, int end);
///
/// Finds the offset of the opening bracket in the block defined by offset skipping
/// brackets in strings and comments.
///
/// The document to search in.
/// The offset of an position in the block or the offset of the closing bracket.
/// The character for the opening bracket.
/// The character for the closing bracket.
/// Returns the offset of the opening bracket or -1 if no matching bracket was found.
int SearchBracketBackward(IDocument document, int offset, char openBracket, char closingBracket);
///
/// Finds the offset of the closing bracket in the block defined by offset skipping
/// brackets in strings and comments.
///
/// The document to search in.
/// The offset of an position in the block or the offset of the opening bracket.
/// The character for the opening bracket.
/// The character for the closing bracket.
/// Returns the offset of the closing bracket or -1 if no matching bracket was found.
int SearchBracketForward(IDocument document, int offset, char openBracket, char closingBracket);
}
}