//
//
//
//
// $Revision$
//
using System;
using System.Windows.Forms;
namespace ICSharpCode.TextEditor.Gui.CompletionWindow
{
public interface ICompletionDataProvider
{
ImageList ImageList {
get;
}
string PreSelection {
get;
}
///
/// Gets the index of the element in the list that is chosen by default.
///
int DefaultIndex {
get;
}
///
/// Processes a keypress. Returns the action to be run with the key.
///
CompletionDataProviderKeyResult ProcessKey(char key);
///
/// Executes the insertion. The provider should set the caret position and then
/// call data.InsertAction.
///
bool InsertAction(ICompletionData data, TextArea textArea, int insertionOffset, char key);
///
/// Generates the completion data. This method is called by the text editor control.
///
ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped);
}
public enum CompletionDataProviderKeyResult
{
///
/// Normal key, used to choose an entry from the completion list
///
NormalKey,
///
/// This key triggers insertion of the completed expression
///
InsertionKey,
///
/// Increment both start and end offset of completion region when inserting this
/// key. Can be used to insert whitespace (or other characters) in front of the expression
/// while the completion window is open.
///
BeforeStartKey
}
}