Skip to content

Commit bb5e1d3

Browse files
committed
more documentation in Plugin package
1 parent 6ebac4e commit bb5e1d3

File tree

5 files changed

+62
-6
lines changed

5 files changed

+62
-6
lines changed

Flow.Launcher.Plugin/ActionContext.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,47 @@
22

33
namespace Flow.Launcher.Plugin
44
{
5+
/// <summary>
6+
/// Context provided as a parameter when invoking a
7+
/// <see cref="Result.Action"/> or <see cref="Result.AsyncAction"/>
8+
/// </summary>
59
public class ActionContext
610
{
11+
/// <summary>
12+
/// Contains the press state of certain special keys.
13+
/// </summary>
714
public SpecialKeyState SpecialKeyState { get; set; }
815
}
916

17+
/// <summary>
18+
/// Contains the press state of certain special keys.
19+
/// </summary>
1020
public class SpecialKeyState
1121
{
22+
/// <summary>
23+
/// True if the Ctrl key is pressed.
24+
/// </summary>
1225
public bool CtrlPressed { get; set; }
26+
27+
/// <summary>
28+
/// True if the Shift key is pressed.
29+
/// </summary>
1330
public bool ShiftPressed { get; set; }
31+
32+
/// <summary>
33+
/// True if the Alt key is pressed.
34+
/// </summary>
1435
public bool AltPressed { get; set; }
36+
37+
/// <summary>
38+
/// True if the Windows key is pressed.
39+
/// </summary>
1540
public bool WinPressed { get; set; }
1641

42+
/// <summary>
43+
/// Get this object represented as a <see cref="ModifierKeys"/> flag combination.
44+
/// </summary>
45+
/// <returns></returns>
1746
public ModifierKeys ToModifierKeys()
1847
{
1948
return (CtrlPressed ? ModifierKeys.Control : ModifierKeys.None) |
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22

33
namespace Flow.Launcher.Plugin
44
{
5+
/// <summary>
6+
/// Adds support for presenting additional options for a given <see cref="Result"/> from a context menu.
7+
/// </summary>
58
public interface IContextMenu : IFeatures
69
{
10+
/// <summary>
11+
/// Load context menu items for the given result.
12+
/// </summary>
13+
/// <param name="selectedResult">
14+
/// The <see cref="Result"/> for which the user has activated the context menu.
15+
/// </param>
716
List<Result> LoadContextMenus(Result selectedResult);
817
}
918
}

Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Globalization;
1+
using System.Globalization;
22

33
namespace Flow.Launcher.Plugin
44
{
@@ -7,8 +7,14 @@ namespace Flow.Launcher.Plugin
77
/// </summary>
88
public interface IPluginI18n : IFeatures
99
{
10+
/// <summary>
11+
/// Get a localised version of the plugin's title
12+
/// </summary>
1013
string GetTranslatedPluginTitle();
1114

15+
/// <summary>
16+
/// Get a localised version of the plugin's description
17+
/// </summary>
1218
string GetTranslatedPluginDescription();
1319

1420
/// <summary>
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
namespace Flow.Launcher.Plugin
1+
namespace Flow.Launcher.Plugin
22
{
33
/// <summary>
4-
/// Save addtional plugin data. Inherit this interface if additional data e.g. cache needs to be saved,
5-
/// Otherwise if LoadSettingJsonStorage or SaveSettingJsonStorage has been callded,
6-
/// plugin settings will be automatically saved (see Flow.Launcher/PublicAPIInstance.SavePluginSettings) by Flow
4+
/// Inherit this interface if additional data e.g. cache needs to be saved.
75
/// </summary>
6+
/// <remarks>
7+
/// For storing plugin settings, prefer <see cref="IPublicAPI.LoadSettingJsonStorage{T}"/>
8+
/// or <see cref="IPublicAPI.SaveSettingJsonStorage{T}"/>.
9+
/// Once called, your settings will be automatically saved by Flow.
10+
/// </remarks>
811
public interface ISavable : IFeatures
912
{
13+
/// <summary>
14+
/// Save additional plugin data, such as cache.
15+
/// </summary>
1016
void Save();
1117
}
1218
}

Flow.Launcher.Plugin/PluginInitContext.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
namespace Flow.Launcher.Plugin
22
{
3+
/// <summary>
4+
/// Carries data passed to a plugin when it gets initialized.
5+
/// </summary>
36
public class PluginInitContext
47
{
58
public PluginInitContext()
@@ -12,6 +15,9 @@ public PluginInitContext(PluginMetadata currentPluginMetadata, IPublicAPI api)
1215
API = api;
1316
}
1417

18+
/// <summary>
19+
/// The metadata of the plugin being initialized.
20+
/// </summary>
1521
public PluginMetadata CurrentPluginMetadata { get; internal set; }
1622

1723
/// <summary>

0 commit comments

Comments
 (0)