Flow.Launcher/Flow.Launcher.Plugin/IPublicAPI.cs

96 lines
3.2 KiB
C#
Raw Normal View History

using Flow.Launcher.Plugin.SharedModel;
using System;
using System.Collections.Generic;
2014-07-05 15:10:34 +00:00
2020-04-21 09:12:17 +00:00
namespace Flow.Launcher.Plugin
2014-07-05 15:10:34 +00:00
{
2015-01-19 11:14:02 +00:00
/// <summary>
/// Public APIs that plugin can use
/// </summary>
2014-07-05 15:10:34 +00:00
public interface IPublicAPI
{
2015-01-19 11:14:02 +00:00
/// <summary>
2020-04-21 09:12:17 +00:00
/// Change Flow.Launcher query
2015-01-19 11:14:02 +00:00
/// </summary>
/// <param name="query">query text</param>
/// <param name="requery">
2020-04-22 10:26:09 +00:00
/// force requery By default, Flow Launcher will not fire query if your query is same with existing one.
/// Set this to true to force Flow Launcher requerying
2015-01-19 11:14:02 +00:00
/// </param>
2014-07-05 15:10:34 +00:00
void ChangeQuery(string query, bool requery = false);
/// <summary>
2020-04-22 10:26:09 +00:00
/// Restart Flow Launcher
/// </summary>
void RestartApp();
/// <summary>
2020-04-22 10:26:09 +00:00
/// Save all Flow Launcher settings
/// </summary>
void SaveAppAllSettings();
2019-10-06 02:44:38 +00:00
/// <summary>
/// Reloads any Plugins that have the
/// IReloadable implemented. It refeshes
/// Plugin's in memory data with new content
/// added by user.
/// </summary>
2019-10-06 02:47:52 +00:00
void ReloadAllPluginData();
2019-10-06 02:44:38 +00:00
/// <summary>
2020-04-22 10:26:09 +00:00
/// Check for new Flow Launcher update
/// </summary>
void CheckForNewUpdate();
2015-01-19 11:14:02 +00:00
/// <summary>
/// Show message box
/// </summary>
/// <param name="title">Message title</param>
/// <param name="subTitle">Message subtitle</param>
/// <param name="iconPath">Message icon path (relative path to your plugin folder)</param>
void ShowMsg(string title, string subTitle = "", string iconPath = "");
/// <summary>
/// Show message box
/// </summary>
/// <param name="title">Message title</param>
/// <param name="subTitle">Message subtitle</param>
/// <param name="iconPath">Message icon path (relative path to your plugin folder)</param>
/// <param name="useMainWindowAsOwner">when true will use main windows as the owner</param>
void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true);
2014-07-05 15:10:34 +00:00
2015-01-19 11:14:02 +00:00
/// <summary>
/// Open setting dialog
/// </summary>
2016-05-22 18:16:39 +00:00
void OpenSettingDialog();
2015-02-04 15:16:41 +00:00
2015-01-19 11:14:02 +00:00
/// <summary>
2020-04-22 10:26:09 +00:00
/// Install Flow Launcher plugin
2015-01-19 11:14:02 +00:00
/// </summary>
2020-04-21 12:54:41 +00:00
/// <param name="path">Plugin path (ends with .flowlauncher)</param>
2014-07-05 15:10:34 +00:00
void InstallPlugin(string path);
2015-01-19 11:14:02 +00:00
/// <summary>
/// Get translation of current language
/// You need to implement IPluginI18n if you want to support multiple languages for your plugin
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
2015-01-06 15:24:11 +00:00
string GetTranslation(string key);
2015-01-19 11:14:02 +00:00
/// <summary>
/// Get all loaded plugins
/// </summary>
/// <returns></returns>
2014-07-05 15:10:34 +00:00
List<PluginPair> GetAllPlugins();
2014-07-19 02:12:11 +00:00
2015-01-19 11:14:02 +00:00
/// <summary>
/// Fired after global keyboard events
/// if you want to hook something like Ctrl+R, you should use this event
/// </summary>
2020-04-21 12:16:10 +00:00
event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
public MatchResult FuzzySearch(string query, string stringToCompare);
2014-07-05 15:10:34 +00:00
}
}