using System.Diagnostics.CodeAnalysis; using VersOne.Epub.Environment; namespace VersOne.Epub.Options { /// /// Various options to configure the behavior of the EPUB content downloader which is used for downloading remote content files. /// public class ContentDownloaderOptions { /// /// Initializes a new instance of the class. /// /// An optional preset to initialize the class with a predefined set of options. [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Temporarily ignore unused 'preset' parameter.")] public ContentDownloaderOptions(EpubReaderOptionsPreset? preset = null) { DownloadContent = false; DownloaderUserAgent = null; CustomContentDownloader = null; } /// /// Gets or sets a value indicating whether the content downloader should download remote resources specified in the EPUB manifest. /// If it's set to false, then and will always be null /// and will throw a "Downloading remote content is prohibited by the ContentDownloaderOptions.DownloadContent option" exception. /// Default value is false. /// public bool DownloadContent { get; set; } /// /// Gets or sets the user agent presented by the content downloader. This value is used by the built-in downloader to set the User-Agent header of the HTTP request. /// If this value is set to null, then the following user agent value will be used: "EpubReader/version" where "version" is the current version of the EpubReader library. /// Default value is null. /// public string? DownloaderUserAgent { get; set; } /// /// Gets or sets a reference to the custom content downloader. /// If it's set to null, the built-in content downloader will be used to download remote content files. /// Default value is null. /// public IContentDownloader? CustomContentDownloader { get; set; } } }