2014-05-21 12:53:32 +08:00
|
|
|
|
using System.Collections.Generic;
|
2014-01-15 22:45:02 +08:00
|
|
|
|
|
2014-05-21 12:53:32 +08:00
|
|
|
|
namespace Wox.Plugin.SystemPlugins {
|
2014-01-15 22:45:02 +08:00
|
|
|
|
|
2014-05-21 12:53:32 +08:00
|
|
|
|
public abstract class BaseSystemPlugin : ISystemPlugin {
|
|
|
|
|
public string PluginDirectory { get; set; }
|
|
|
|
|
public virtual string Name { get { return "System workflow"; } }
|
|
|
|
|
public virtual string Description { get { return "System workflow"; } }
|
|
|
|
|
public virtual string IcoPath { get { return null; } }
|
2014-05-25 09:57:02 +08:00
|
|
|
|
public virtual bool Enabled { get; set; }
|
2014-01-15 22:45:02 +08:00
|
|
|
|
|
2014-05-21 12:53:32 +08:00
|
|
|
|
protected abstract List<Result> QueryInternal(Query query);
|
|
|
|
|
protected abstract void InitInternal(PluginInitContext context);
|
2014-01-15 22:45:02 +08:00
|
|
|
|
|
2014-05-25 09:57:02 +08:00
|
|
|
|
|
|
|
|
|
|
2014-05-21 12:53:32 +08:00
|
|
|
|
public List<Result> Query(Query query) {
|
2014-05-25 09:57:02 +08:00
|
|
|
|
if (Enabled) {
|
|
|
|
|
if (string.IsNullOrEmpty(query.RawQuery)) return new List<Result>();
|
|
|
|
|
return QueryInternal(query);
|
|
|
|
|
}
|
2014-05-21 12:53:32 +08:00
|
|
|
|
}
|
2014-03-28 22:42:28 +08:00
|
|
|
|
|
2014-05-21 12:53:32 +08:00
|
|
|
|
public void Init(PluginInitContext context) {
|
|
|
|
|
InitInternal(context);
|
|
|
|
|
}
|
2014-05-25 09:57:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to save settings
|
|
|
|
|
/// </summary>
|
|
|
|
|
public virtual string PluginId {
|
|
|
|
|
get { return null; }
|
|
|
|
|
}
|
2014-05-21 12:53:32 +08:00
|
|
|
|
}
|
|
|
|
|
}
|