2024-05-28 11:27:48 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Flow.Launcher.Plugin
|
|
|
|
|
|
{
|
2024-05-30 11:49:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This interface is for plugins that wish to provide file preview (external preview)
|
|
|
|
|
|
/// via a third party app instead of the default preview.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public interface IAsyncExternalPreview : IFeatures
|
2024-05-28 11:27:48 +00:00
|
|
|
|
{
|
2024-05-30 11:49:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Method for opening/showing the preview.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="path">The file path to open the preview for</param>
|
|
|
|
|
|
/// <param name="sendFailToast">Whether to send a toast message notification on failure for the user</param>
|
2024-05-28 11:27:48 +00:00
|
|
|
|
public Task OpenPreviewAsync(string path, bool sendFailToast = true);
|
|
|
|
|
|
|
2024-05-30 11:49:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Method for closing/hiding the preview.
|
|
|
|
|
|
/// </summary>
|
2024-05-28 11:27:48 +00:00
|
|
|
|
public Task ClosePreviewAsync();
|
|
|
|
|
|
|
2024-05-30 11:49:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Method for switching the preview to the next file result.
|
|
|
|
|
|
/// This requires the external preview be already open/showing
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="path">The file path to switch the preview for</param>
|
|
|
|
|
|
/// <param name="sendFailToast">Whether to send a toast message notification on failure for the user</param>
|
2024-05-28 11:27:48 +00:00
|
|
|
|
public Task SwitchPreviewAsync(string path, bool sendFailToast = true);
|
2024-06-12 04:14:25 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Allows the preview plugin to override the AlwaysPreview setting. Typically useful if plugin's preview does not
|
|
|
|
|
|
/// fully work well with being shown together when the query window appears with results.
|
|
|
|
|
|
/// When AlwaysPreview setting is on and this is set to false, the preview will not be shown when query
|
|
|
|
|
|
/// window appears with results, instead the internal preview will be shown.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool AllowAlwaysPreview();
|
2024-05-28 11:27:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|