using NTwain.Data; using NTwain.Triplets; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; namespace NTwain { /// /// General interface for a TWAIN session. /// public interface ITwainSession : INotifyPropertyChanged { /// /// Gets the currently open source. /// /// /// The current source. /// TwainSource CurrentSource { get; } /// /// Gets or sets the default source for this application. /// While this can be get as long as the session is open, /// it can only be set at State 3. /// /// /// The default source. /// TwainSource DefaultSource { get; set; } /// /// Gets the current state number as defined by the TWAIN spec. /// /// The state. int State { get; } /// /// Try to show the built-in source selector dialog and return the selected source. /// This is not recommended and is only included for completeness. /// /// TwainSource ShowSourceSelector(); /// /// Opens the data source manager. This must be the first method used /// before using other TWAIN functions. Calls to this must be followed by /// when done with a TWAIN session. /// /// ReturnCode Open(); /// /// Opens the data source manager. This must be the first method used /// before using other TWAIN functions. Calls to this must be followed by /// when done with a TWAIN session. /// /// The message loop hook. /// ReturnCode Open(MessageLoopHook messageLoopHook); /// /// Closes the data source manager. /// /// ReturnCode Close(); /// /// Forces the stepping down of an opened source when things gets out of control. /// Used when session state and source state become out of sync. /// /// State of the target. void ForceStepDown(int targetState); /// /// Gets list of sources available in the system. /// /// IEnumerable GetSources(); /// /// Quick shortcut to open a source. /// /// Name of the source. /// ReturnCode OpenSource(string sourceName); /// /// Gets the manager status. Only call this at state 2 or higher. /// /// TWStatus GetStatus(); /// /// Gets the manager status. Only call this at state 3 or higher. /// /// TWStatusUtf8 GetStatusUtf8(); } }