using NTwain.Data;
using NTwain.Triplets;
using System;
using System.ComponentModel;
namespace NTwain
{
///
/// Interface for keeping track of current TWAIN state with current app and source ids.
///
public interface ITwainState : INotifyPropertyChanged
{
///
/// Gets the source id used for the session.
///
/// The source id.
TWIdentity SourceId { get; }
///
/// Gets the current state number as defined by the TWAIN spec.
///
/// The state.
int State { get; }
}
///
/// Internal interface for state management.
///
interface ITwainStateInternal : ITwainState
{
///
/// Gets the app id used for the session.
///
///
TWIdentity GetAppId();
///
/// Gets or sets a value indicating whether calls to triplets will verify the current twain session state.
///
///
/// true if state value is enforced; otherwise, false.
///
bool EnforceState { get; set; }
///
/// Changes the state right away.
///
/// The new state.
/// if set to true to notify change.
void ChangeState(int newState, bool notifyChange);
///
/// Gets the pending state changer and tentatively changes the session state to the specified value.
/// Value will only stick if committed.
///
/// The new state.
///
ICommitable GetPendingStateChanger(int newState);
void ChangeSourceId(TWIdentity sourceId);
}
interface ICommitable : IDisposable
{
void Commit();
}
}