forked from dalyIsaac/Whim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRouterManager.cs
127 lines (111 loc) · 4.39 KB
/
IRouterManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
using System;
namespace Whim;
/// <summary>
/// Delegate which is called to route a <see cref="IWindow"/>.
/// </summary>
public delegate IWorkspace? Router(IWindow window);
/// <summary>
/// Manages routers for <see cref="IWindow"/>s.
/// </summary>
public interface IRouterManager
{
/// <summary>
/// When <see langword="true"/>, windows are routed to the active workspace.
/// When <see langword="false"/>, windows are routed to the active workspace on the monitor they are on.
/// Defaults to <see langword="false"/>.
/// This is overridden by any other routers in this <see cref="IRouterManager"/>.
/// </summary>
bool RouteToActiveWorkspace { get; set; }
/// <summary>
/// Routes a window to a workspace.
/// </summary>
/// <param name="window"></param>
/// <returns>
/// <see langword="null"/> when the window should be ignored, otherwise the
/// <see cref="IWorkspace"/> to route the window to.
/// </returns>
IWorkspace? RouteWindow(IWindow window);
/// <summary>
/// Clear all the routes.
/// </summary>
void Clear();
/// <summary>
/// Add a router.
/// </summary>
/// <param name="router"></param>
void Add(Router router);
#region Routers helper methods
/// <summary>
/// Adds a router which moves windows matching <paramref name="windowClass"/> to the workspace
/// with the name <paramref name="workspaceName"/>.
/// </summary>
/// <param name="windowClass"></param>
/// <param name="workspaceName"></param>
IRouterManager AddWindowClassRoute(string windowClass, string workspaceName);
/// <summary>
/// Adds a router which moves windows matching <paramref name="windowClass"/> to the
/// <paramref name="workspace"/>.
/// </summary>
/// <param name="windowClass"></param>
/// <param name="workspace"></param>
IRouterManager AddWindowClassRoute(string windowClass, IWorkspace workspace);
/// <summary>
/// Adds a router which moves processes matching <see cref="IWindow.ProcessName"/> to the
/// <paramref name="workspaceName"/>.
/// </summary>
/// <param name="processName"></param>
/// <param name="workspaceName"></param>
[Obsolete("Use AddProcessFileNameRoute instead")]
IRouterManager AddProcessNameRoute(string processName, string workspaceName);
/// <summary>
/// Adds a router which moves processes matching <see cref="IWindow.ProcessName"/> to the
/// <paramref name="workspace"/>.
/// </summary>
/// <param name="processName"></param>
/// <param name="workspace"></param>
[Obsolete("Use AddProcessFileNameRoute instead")]
IRouterManager AddProcessNameRoute(string processName, IWorkspace workspace);
/// <summary>
/// Adds a router which moves windows matching <see cref="IWindow.ProcessFileName"/> to the
/// <paramref name="workspaceName"/>.
/// </summary>
/// <param name="processFileName"></param>
/// <param name="workspaceName"></param>
IRouterManager AddProcessFileNameRoute(string processFileName, string workspaceName);
/// <summary>
/// Adds a router which moves windows matching <see cref="IWindow.ProcessFileName"/> to the
/// <paramref name="workspace"/>.
/// </summary>
/// <param name="processFileName"></param>
/// <param name="workspace"></param>
IRouterManager AddProcessFileNameRoute(string processFileName, IWorkspace workspace);
/// <summary>
/// Adds a router which moves windows matching <paramref name="title"/> to the workspace
/// with the name <paramref name="workspaceName"/>.
/// </summary>
/// <param name="title"></param>
/// <param name="workspaceName"></param>
IRouterManager AddTitleRoute(string title, string workspaceName);
/// <summary>
/// Adds a router which moves windows matching <paramref name="title"/> to the
/// <paramref name="workspace"/>.
/// </summary>
/// <param name="title"></param>
/// <param name="workspace"></param>
IRouterManager AddTitleRoute(string title, IWorkspace workspace);
/// <summary>
/// Adds a router which moves windows matching regex <paramref name="match"/> string to the
/// <paramref name="workspaceName"/>.
/// </summary>
/// <param name="match"></param>
/// <param name="workspaceName"></param>
IRouterManager AddTitleMatchRoute(string match, string workspaceName);
/// <summary>
/// Adds a router which moves windows matching regex <paramref name="match"/> string to the
/// <paramref name="workspace"/>.
/// </summary>
/// <param name="match"></param>
/// <param name="workspace"></param>
IRouterManager AddTitleMatchRoute(string match, IWorkspace workspace);
#endregion
}