2023-04-25 12:04:08 +00:00
|
|
|
|
using System.Collections.Generic;
|
2016-01-06 06:45:08 +00:00
|
|
|
|
using System.IO;
|
2020-12-30 05:40:42 +00:00
|
|
|
|
using System.Text.Json.Serialization;
|
2020-01-14 19:10:54 +00:00
|
|
|
|
|
2020-04-21 09:12:17 +00:00
|
|
|
|
namespace Flow.Launcher.Plugin
|
2013-12-20 11:38:10 +00:00
|
|
|
|
{
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin metadata
|
|
|
|
|
|
/// </summary>
|
2016-05-23 21:08:13 +00:00
|
|
|
|
public class PluginMetadata : BaseModel
|
2013-12-20 11:38:10 +00:00
|
|
|
|
{
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin ID.
|
|
|
|
|
|
/// </summary>
|
2014-03-01 07:42:33 +00:00
|
|
|
|
public string ID { get; set; }
|
2025-02-23 13:28:03 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin name.
|
|
|
|
|
|
/// </summary>
|
2013-12-20 11:38:10 +00:00
|
|
|
|
public string Name { get; set; }
|
2025-02-23 13:28:03 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin author.
|
|
|
|
|
|
/// </summary>
|
2013-12-20 11:38:10 +00:00
|
|
|
|
public string Author { get; set; }
|
2025-02-23 13:28:03 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin version.
|
|
|
|
|
|
/// </summary>
|
2013-12-20 11:38:10 +00:00
|
|
|
|
public string Version { get; set; }
|
2025-02-23 13:28:03 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin language.
|
|
|
|
|
|
/// See <see cref="AllowedLanguage"/>
|
|
|
|
|
|
/// </summary>
|
2013-12-20 11:38:10 +00:00
|
|
|
|
public string Language { get; set; }
|
2025-02-23 13:28:03 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin description.
|
|
|
|
|
|
/// </summary>
|
2013-12-20 11:38:10 +00:00
|
|
|
|
public string Description { get; set; }
|
2025-02-23 13:28:03 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin website.
|
|
|
|
|
|
/// </summary>
|
2014-06-01 15:23:48 +00:00
|
|
|
|
public string Website { get; set; }
|
2025-02-23 13:28:03 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether plugin is disabled.
|
|
|
|
|
|
/// </summary>
|
2016-05-22 04:30:38 +00:00
|
|
|
|
public bool Disabled { get; set; }
|
2014-03-01 07:42:33 +00:00
|
|
|
|
|
2025-05-03 14:34:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether plugin is disabled in home query.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool HomeDisabled { get; set; }
|
|
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin execute file path.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string ExecuteFilePath { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin execute file name.
|
|
|
|
|
|
/// </summary>
|
2013-12-23 15:53:38 +00:00
|
|
|
|
public string ExecuteFileName { get; set; }
|
2015-02-05 14:20:42 +00:00
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin assembly name.
|
|
|
|
|
|
/// Only available for .Net plugins.
|
|
|
|
|
|
/// </summary>
|
2025-02-23 13:01:53 +00:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public string AssemblyName { get; internal set; }
|
|
|
|
|
|
|
2025-02-25 02:22:39 +00:00
|
|
|
|
private string _pluginDirectory;
|
|
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin source directory.
|
|
|
|
|
|
/// </summary>
|
2016-05-03 20:18:26 +00:00
|
|
|
|
public string PluginDirectory
|
|
|
|
|
|
{
|
2025-02-23 13:01:53 +00:00
|
|
|
|
get => _pluginDirectory;
|
2020-03-03 22:25:59 +00:00
|
|
|
|
internal set
|
2016-05-03 20:18:26 +00:00
|
|
|
|
{
|
|
|
|
|
|
_pluginDirectory = value;
|
|
|
|
|
|
ExecuteFilePath = Path.Combine(value, ExecuteFileName);
|
|
|
|
|
|
IcoPath = Path.Combine(value, IcoPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2014-08-17 14:35:46 +00:00
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The first action keyword of plugin.
|
|
|
|
|
|
/// </summary>
|
2013-12-20 17:20:17 +00:00
|
|
|
|
public string ActionKeyword { get; set; }
|
2014-03-28 14:42:28 +00:00
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// All action keywords of plugin.
|
|
|
|
|
|
/// </summary>
|
2015-11-06 02:29:32 +00:00
|
|
|
|
public List<string> ActionKeywords { get; set; }
|
2025-03-30 01:38:59 +00:00
|
|
|
|
|
2025-03-20 06:00:07 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Hide plugin keyword setting panel.
|
|
|
|
|
|
/// </summary>
|
2025-02-28 01:25:20 +00:00
|
|
|
|
public bool HideActionKeywordPanel { get; set; }
|
2015-11-04 22:49:40 +00:00
|
|
|
|
|
2025-03-30 01:38:59 +00:00
|
|
|
|
/// <summary>
|
2025-04-07 06:16:17 +00:00
|
|
|
|
/// Plugin search delay time in ms. Null means use default search delay time.
|
2025-03-30 01:38:59 +00:00
|
|
|
|
/// </summary>
|
2025-04-07 06:16:17 +00:00
|
|
|
|
public int? SearchDelayTime { get; set; } = null;
|
2025-03-18 01:11:15 +00:00
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin icon path.
|
|
|
|
|
|
/// </summary>
|
2016-05-03 20:18:26 +00:00
|
|
|
|
public string IcoPath { get; set;}
|
2021-01-06 09:51:55 +00:00
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Plugin priority.
|
|
|
|
|
|
/// </summary>
|
2021-01-05 08:11:38 +00:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public int Priority { get; set; }
|
|
|
|
|
|
|
2020-02-21 21:12:58 +00:00
|
|
|
|
/// <summary>
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// Init time include both plugin load time and init time.
|
2020-02-21 21:12:58 +00:00
|
|
|
|
/// </summary>
|
2016-05-22 04:30:38 +00:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public long InitTime { get; set; }
|
2025-02-23 13:01:53 +00:00
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Average query time.
|
|
|
|
|
|
/// </summary>
|
2016-05-22 04:30:38 +00:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public long AvgQueryTime { get; set; }
|
2025-02-23 13:01:53 +00:00
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Query count.
|
|
|
|
|
|
/// </summary>
|
2016-05-22 04:30:38 +00:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public int QueryCount { get; set; }
|
2025-02-23 13:01:53 +00:00
|
|
|
|
|
2026-02-27 10:30:29 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The minimum Flow Launcher version required for this plugin. Default is "".
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string MinimumAppVersion { get; set; } = string.Empty;
|
|
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
2025-02-24 06:14:19 +00:00
|
|
|
|
/// The path to the plugin settings directory which is not validated.
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// It is used to store plugin settings files and data files.
|
|
|
|
|
|
/// When plugin is deleted, FL will ask users whether to keep its settings.
|
|
|
|
|
|
/// If users do not want to keep, this directory will be deleted.
|
|
|
|
|
|
/// </summary>
|
2025-02-23 13:01:53 +00:00
|
|
|
|
public string PluginSettingsDirectoryPath { get; internal set; }
|
|
|
|
|
|
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// <summary>
|
2025-02-24 06:14:19 +00:00
|
|
|
|
/// The path to the plugin cache directory which is not validated.
|
2025-02-23 13:28:03 +00:00
|
|
|
|
/// It is used to store cache files.
|
|
|
|
|
|
/// When plugin is deleted, this directory will be deleted as well.
|
|
|
|
|
|
/// </summary>
|
2025-02-23 13:01:53 +00:00
|
|
|
|
public string PluginCacheDirectoryPath { get; internal set; }
|
2025-02-23 13:28:03 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Convert <see cref="PluginMetadata"/> to string.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Name;
|
|
|
|
|
|
}
|
2013-12-20 11:38:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|