terminal/src/cascadia/TerminalApp/ShortcutActionDispatch.idl
Kaiyu Wang d7ae8e6db9 Search - add search box control and implement search experience (#3590)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
This is the PR for feature Search: #605 
This PR includes the newly introduced SearchBoxControl in TermControl dir, which is the search bar for the search experience. And the codes that enable Search in Windows Terminal. 

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
The PR that migrates the Conhost search module: https://github.com/microsoft/terminal/pull/3279
Spec (still actively updating): https://github.com/microsoft/terminal/pull/3299
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #605 
* [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
These functionalities are included in the search experience. 
1. Search in Terminal text buffer. 
2. Automatic wrap-around. 
3. Search up or down switch by clicking different buttons.
4. Search case sensitively/insensitively by clicking a button.                                                                                                                                                S. Move the search box to the top/bottom by clicking a button. 
6. Close by clicking 'X'. 
7. Open search by ctrl + F.

When the searchbox is open, the user could still interact with the terminal by clicking the terminal input area. 

While I already have the search functionalities, currently there are still some known to-do works and I will keep updating my PR:

1. Optimize the search box UI, this includes:
                                                  1) Theme adaptation. The search box background and font color 
                                                       should change according to the theme, 
                                                  2) Add background. Currently the elements in search box are all
                                                      transparent. However, we need a background. 
                                                  3) Move button should be highlighted once clicked. 
2. Accessibility: search process should be able to performed without mouse. Once the search box is focused, the user should be able to navigate between all interactive elements on the searchbox using keyboard. 

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->

To test:
1. checkout this branch.
2. Build the project. 
3. Start Windows Terminal and press Ctrl+F
4. The search box should appear on the top right corner.
2019-12-17 15:52:37 +00:00

106 lines
4.6 KiB
Plaintext

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "../ActionArgs.idl";
namespace TerminalApp
{
// TODO: GH#1069 - Many of these shortcut actions are "legacy" now that we
// have support for arbitrary args (#1142). We should remove them, and our
// legacy deserializers.
enum ShortcutAction
{
Invalid = 0,
CopyText,
CopyTextWithoutNewlines,
PasteText,
OpenNewTabDropdown,
DuplicateTab,
NewTab,
NewTabProfile0, // Legacy
NewTabProfile1, // Legacy
NewTabProfile2, // Legacy
NewTabProfile3, // Legacy
NewTabProfile4, // Legacy
NewTabProfile5, // Legacy
NewTabProfile6, // Legacy
NewTabProfile7, // Legacy
NewTabProfile8, // Legacy
NewWindow,
CloseWindow,
CloseTab,
ClosePane,
NextTab,
PrevTab,
SplitVertical,
SplitHorizontal,
SplitPane,
SwitchToTab,
SwitchToTab0, // Legacy
SwitchToTab1, // Legacy
SwitchToTab2, // Legacy
SwitchToTab3, // Legacy
SwitchToTab4, // Legacy
SwitchToTab5, // Legacy
SwitchToTab6, // Legacy
SwitchToTab7, // Legacy
SwitchToTab8, // Legacy
IncreaseFontSize,
DecreaseFontSize,
ResetFontSize,
ScrollUp,
ScrollDown,
ScrollUpPage,
ScrollDownPage,
ResizePane,
ResizePaneLeft, // Legacy
ResizePaneRight, // Legacy
ResizePaneUp, // Legacy
ResizePaneDown, // Legacy
MoveFocus,
MoveFocusLeft, // Legacy
MoveFocusRight, // Legacy
MoveFocusUp, // Legacy
MoveFocusDown, // Legacy
Find,
ToggleFullscreen,
OpenSettings
};
[default_interface] runtimeclass ActionAndArgs {
ActionAndArgs();
IActionArgs Args;
ShortcutAction Action;
};
[default_interface] runtimeclass ShortcutActionDispatch {
ShortcutActionDispatch();
Boolean DoAction(ActionAndArgs actionAndArgs);
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> CopyText;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> PasteText;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> NewTab;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> OpenNewTabDropdown;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> DuplicateTab;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> NewWindow;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> CloseWindow;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> CloseTab;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ClosePane;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> SwitchToTab;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> NextTab;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> PrevTab;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> SplitPane;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> AdjustFontSize;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ResetFontSize;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ScrollUp;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ScrollDown;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ScrollUpPage;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ScrollDownPage;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> OpenSettings;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ResizePane;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> Find;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> MoveFocus;
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ToggleFullscreen;
}
}