#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
namespace MiniSqlQuery.Core
{
///
/// The editor interface. Defines the core behaviours for interacting with the core application.
///
public interface IEditor
{
///
/// Gets or sets the contetnts of the editor.
///
/// All the text in the window.
string AllText { get; set; }
///
/// Gets the file filter for this editor (e.g. "SQL Files (*.sql)|*.sql|All Files (*.*)|*.*").
///
/// The file filter.
string FileFilter { get; }
///
/// Gets or sets the filename of the docuemnt being edited (can be null, as in not saved yet).
///
/// The file name.
string FileName { get; set; }
///
/// Gets a value indicating whether this instance is dirty or not.
///
/// The value of true if this instance is dirty; otherwise, false.
bool IsDirty { get; }
///
/// Gets the currently selected text (if any) in the editor.
///
/// The selected text.
string SelectedText { get; }
///
/// Clears the selection (deletes selected text if any).
///
void ClearSelection();
///
/// Highlights the string starting at for characters.
///
/// The offset to start at.
/// The length.
void HighlightString(int offset, int length);
///
/// Inserts at the current cursor position (selected text is overwritten).
///
/// The text to insert at the current position.
void InsertText(string text);
///
/// Loads the file by the path in .
///
void LoadFile();
///
/// Saves the file by the path in .
///
void SaveFile();
///
/// Sets the syntax mode off the editor.
///
/// The mode, e.g. "sql", "cs", "txt" etc.
void SetSyntax(string syntaxName);
}
}