/* IQueueManager.cs $ This file is part of the HandBrake source code. Homepage: . It may be used under the terms of the GNU General Public License. */ namespace HandBrake.ApplicationServices.Services.Interfaces { using System; using System.Collections.ObjectModel; using HandBrake.ApplicationServices.Model; /// /// The Queue Manager Interface /// public interface IQueueManager { /// /// Fires when a job is Added, Removed or Re-Ordered. /// Should be used for triggering an update of the Queue Window. /// event EventHandler QueueChanged; /// /// Gets or sets Last Processed Job. /// This is set when the job is poped of the queue by GetNextJobForProcessing(); /// QueueTask LastProcessedJob { get; set; } /// /// Gets The current queue. /// ReadOnlyCollection Queue { get; } /// /// Gets the number of jobs in the queue /// int Count { get; } /// /// Add a job to the Queue. /// This method is Thread Safe. /// /// /// The encode Job object. /// void Add(QueueTask job); /// /// Remove a job from the Queue. /// This method is Thread Safe /// /// /// The job. /// void Remove(QueueTask job); /// /// Reset a Queued Item from Error or Completed to Waiting /// /// /// The job. /// void ResetJobStatusToWaiting(QueueTask job); /// /// Clear down the Queue´s completed items /// void ClearCompleted(); /// /// Clear down all Queue Items /// void Clear(); /// /// Get the first job on the queue for processing. /// This also removes the job from the Queue and sets the LastProcessedJob /// /// /// An encode Job object. /// QueueTask GetNextJobForProcessing(); /// /// Moves an item up one position in the queue. /// /// The zero-based location of the job in the queue. void MoveUp(int index); /// /// Moves an item down one position in the queue. /// /// The zero-based location of the job in the queue. void MoveDown(int index); /// /// Backup any changes to the queue file /// /// /// If this is not null or empty, this will be used instead of the standard backup location. /// void BackupQueue(string exportPath); /// /// Restore a Queue from file or from the queue backup file. /// /// /// The import path. String.Empty or null will result in the default file being loaded. /// void RestoreQueue(string importPath); /// /// Checks the current queue for an existing instance of the specified destination. /// /// The destination of the encode. /// Whether or not the supplied destination is already in the queue. bool CheckForDestinationPathDuplicates(string destination); /// /// Create a batch script from the queue /// /// /// The path to the location for the script to be saved. /// /// /// True if sucessful /// bool WriteBatchScriptToFile(string path); } }