2016-03-28 08:09:40 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2014-07-05 23:10:34 +08:00
|
|
|
|
|
|
|
|
|
namespace Wox.Plugin
|
|
|
|
|
{
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Public APIs that plugin can use
|
|
|
|
|
/// </summary>
|
2014-07-05 23:10:34 +08:00
|
|
|
|
public interface IPublicAPI
|
|
|
|
|
{
|
2014-12-26 22:51:04 +08:00
|
|
|
|
/// <summary>
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// Push result to query box
|
2014-12-26 22:51:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query"></param>
|
|
|
|
|
/// <param name="plugin"></param>
|
|
|
|
|
/// <param name="results"></param>
|
2016-03-28 08:09:40 +08:00
|
|
|
|
[Obsolete("This method will be removed in Wox 1.3")]
|
2015-02-04 23:16:41 +08:00
|
|
|
|
void PushResults(Query query, PluginMetadata plugin, List<Result> results);
|
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Change Wox query
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">query text</param>
|
|
|
|
|
/// <param name="requery">
|
|
|
|
|
/// force requery By default, Wox will not fire query if your query is same with existing one.
|
|
|
|
|
/// Set this to true to force Wox requerying
|
|
|
|
|
/// </param>
|
2014-07-05 23:10:34 +08:00
|
|
|
|
void ChangeQuery(string query, bool requery = false);
|
|
|
|
|
|
2015-02-07 16:53:33 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Just change the query text, this won't raise search
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query"></param>
|
2016-05-25 08:00:10 +08:00
|
|
|
|
[Obsolete]
|
2015-02-09 19:16:13 +08:00
|
|
|
|
void ChangeQueryText(string query, bool selectAll = false);
|
2015-02-07 16:53:33 +08:00
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Close Wox
|
|
|
|
|
/// </summary>
|
2016-05-25 08:00:10 +08:00
|
|
|
|
[Obsolete]
|
2014-07-05 23:10:34 +08:00
|
|
|
|
void CloseApp();
|
|
|
|
|
|
2015-11-26 10:04:44 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Restart Wox
|
|
|
|
|
/// </summary>
|
|
|
|
|
void RestarApp();
|
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Hide Wox
|
|
|
|
|
/// </summary>
|
2016-05-25 08:00:10 +08:00
|
|
|
|
[Obsolete]
|
2014-07-05 23:10:34 +08:00
|
|
|
|
void HideApp();
|
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Show Wox
|
|
|
|
|
/// </summary>
|
2016-05-25 08:00:10 +08:00
|
|
|
|
[Obsolete]
|
2014-07-05 23:10:34 +08:00
|
|
|
|
void ShowApp();
|
|
|
|
|
|
2015-01-19 19:14:02 +08: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>
|
2015-02-07 16:53:33 +08:00
|
|
|
|
void ShowMsg(string title, string subTitle = "", string iconPath = "");
|
2014-07-05 23:10:34 +08:00
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Open setting dialog
|
|
|
|
|
/// </summary>
|
2016-05-23 02:16:39 +08:00
|
|
|
|
void OpenSettingDialog();
|
2015-02-04 23:16:41 +08:00
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Show loading animation
|
|
|
|
|
/// </summary>
|
2016-05-25 08:00:10 +08:00
|
|
|
|
[Obsolete("automatically start")]
|
2014-07-05 23:10:34 +08:00
|
|
|
|
void StartLoadingBar();
|
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Stop loading animation
|
|
|
|
|
/// </summary>
|
2016-05-25 08:00:10 +08:00
|
|
|
|
[Obsolete("automatically stop")]
|
2014-07-05 23:10:34 +08:00
|
|
|
|
void StopLoadingBar();
|
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Install Wox plugin
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="path">Plugin path (ends with .wox)</param>
|
2014-07-05 23:10:34 +08:00
|
|
|
|
void InstallPlugin(string path);
|
|
|
|
|
|
2015-01-19 19:14:02 +08: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 23:24:11 +08:00
|
|
|
|
string GetTranslation(string key);
|
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get all loaded plugins
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2014-07-05 23:10:34 +08:00
|
|
|
|
List<PluginPair> GetAllPlugins();
|
2014-07-19 10:12:11 +08:00
|
|
|
|
|
2015-01-19 19:14:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Fired after global keyboard events
|
|
|
|
|
/// if you want to hook something like Ctrl+R, you should use this event
|
|
|
|
|
/// </summary>
|
2015-01-08 22:49:42 +08:00
|
|
|
|
event WoxGlobalKeyboardEventHandler GlobalKeyboardEvent;
|
2014-07-05 23:10:34 +08:00
|
|
|
|
}
|
|
|
|
|
}
|