using System.Collections.Generic;

namespace AutoIngest.Engine
{
    /// <summary>
    /// Abstraction over "how do I list and remove photos on this device", so the import
    /// pipeline is identical for mass-storage devices (SD/USB, where photos are plain files
    /// and removal is File.Delete) and MTP phones (where photos live behind a COM namespace
    /// and removal is a shell verb). The pipeline never touches the device directly; it
    /// enumerates via <see cref="EnumeratePhotos"/> and reclaims source space via
    /// <see cref="RemoveSource"/>.
    /// </summary>
    public interface IPhotoProvider
    {
        /// <summary>
        /// Returns absolute local filesystem paths of every photo to import. For MTP devices
        /// the implementer is responsible for any staging copy to a temp path; the pipeline
        /// only ever sees local paths it can open.
        /// </summary>
        List<string> EnumeratePhotos();

        /// <summary>
        /// Reclaims the source copy of a file after it has been verified at the destination.
        /// For mass storage this is File.Delete (or File.Move, when the importer chooses to move
        /// rather than convert). For MTP it deletes the object via the shell namespace, or — for
        /// phones with delete-from-phone off — only the staged temp copy.
        /// Must be safe to call exactly once per path returned by <see cref="EnumeratePhotos"/>,
        /// and safe to call even when the import was skipped as a duplicate (the staged temp copy
        /// should always be reclaimed).
        ///
        /// Returns true if the device-side original was actually removed; false if it was kept
        /// (delete-from-phone off) or the removal failed (MTP driver didn't honor the delete verb).
        /// Callers use the return value to log accurately rather than claiming "removed" on failure.
        /// </summary>
        bool RemoveSource(string path);
    }
}
