mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-30 17:39:07 +08:00
Add more docs
This commit is contained in:
parent
89b022a5ad
commit
ad0011ee70
23
doc/devdocs/modules/FileActionsMenu/Enums.md
Normal file
23
doc/devdocs/modules/FileActionsMenu/Enums.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Enums
|
||||
|
||||
## `FileActionsMenu.Interfaces.IAction.ItemType`
|
||||
|
||||
Defines the type of an item in the menu.
|
||||
|
||||
### `SingleItem`
|
||||
|
||||
Is a single invokable item.
|
||||
|
||||
### `HasSubMenu`
|
||||
|
||||
The menu item has a sub menu.
|
||||
|
||||
### `Separator`
|
||||
|
||||
States that the item should act as separator. You can also use `FileActionsMenu.Interfaces.Seperator` to define a seperator.
|
||||
|
||||
### `Checkable`
|
||||
|
||||
The item is a checkable item. Don't use, use `FileActionsMenu.Interfaces.ICheckableAction`.
|
||||
|
||||
## `HashEnums.
|
@ -10,7 +10,7 @@ Returns the value if it's not null, otherwise throws an `ArgumentNullException`.
|
||||
|
||||
### `bool IsImage(this string fileName)`
|
||||
|
||||
Returns `true` if the file name has an image extension, otherwise `false`.
|
||||
Returns `true` if the file name has an image extension, otherwise `false`. This is the same list ImageResizer uses.
|
||||
|
||||
## File action progress
|
||||
|
||||
|
90
doc/devdocs/modules/FileActionsMenu/Interfaces.md
Normal file
90
doc/devdocs/modules/FileActionsMenu/Interfaces.md
Normal file
@ -0,0 +1,90 @@
|
||||
# Interfaces
|
||||
|
||||
## `IFileActionsMenuPlugin`
|
||||
|
||||
This interface is for defining a File Actions menu plugin. Currently there is no use to the properties (except for `TopLevelMenuActions`), but this will be added in the future.
|
||||
|
||||
### `string Name`
|
||||
|
||||
Name of the plugin.
|
||||
|
||||
### `string Description`
|
||||
|
||||
A short description about the capabilities of the plugin.
|
||||
|
||||
### `string Author`
|
||||
|
||||
The author/the company that developed the plugin.
|
||||
|
||||
### `IAction[] TopLevelMenuActions`
|
||||
|
||||
An array of actions shown at the top-level of the menu.
|
||||
|
||||
## `IAction`
|
||||
|
||||
This interface defines a single action, that you can invoke from the menu.
|
||||
|
||||
### `string[] SelectedItems`
|
||||
|
||||
When the action is invoked this array will contain the paths to the selected files and folders.
|
||||
|
||||
### `string Title`
|
||||
|
||||
The title of the action shown in the menu.
|
||||
|
||||
### `ItemType Type`
|
||||
|
||||
The type of the action.
|
||||
|
||||
### `IAction[]? SubMenuItems`
|
||||
|
||||
The actions displayed in the sub menu, when `ItemType` is `HasSubMenu`.
|
||||
|
||||
### `int Category`
|
||||
|
||||
The category number of the action. Different categories are seperated by a seperator in the top-level menu. Best practice is that third-party plugins use numbers between `100` and `998`.
|
||||
|
||||
### `IconElement? Icon`
|
||||
|
||||
An optional icon, that is displayed in the menu alongside the action.
|
||||
|
||||
### `bool IsVisible`
|
||||
|
||||
Determines whetever the action is visible in the menu or not.
|
||||
|
||||
### `Task Execute(object sender, RoutedEventArgs e)`
|
||||
|
||||
This function is called when the action is executed. `sender` is the `MenuItem` element that invoked the element. `e` are the event arguments of the click event. This function is only called if the `ItemType` is `SingleItem`.
|
||||
|
||||
Returned is a Task that when completed causes the menu to close.
|
||||
|
||||
## `ICheckabableAction`
|
||||
|
||||
Abstract class that defines a checkable action. You always have to have atleast two checkable actions. If you check one item of a group, all the other items will be unchecked.
|
||||
|
||||
Following abstract properties follow the same rules as the ones of the same name in `IAction`:
|
||||
|
||||
* `SelectedItems`
|
||||
* `Title`
|
||||
* `Icon`
|
||||
* `IsVisible`
|
||||
|
||||
### `bool IsChecked`
|
||||
|
||||
Get whetever the current element is checked or not.
|
||||
|
||||
### `bool IsCheckedByDefault`
|
||||
|
||||
Whetever the current item is checked by default. There must be exactly one item per group that has this property set to `true`.
|
||||
|
||||
### `string? CheckableGroupUUID`
|
||||
|
||||
A UUID that is exclusive to the current group of checkable items.
|
||||
|
||||
## `IActionAndRequestCheckedMenuItems`
|
||||
|
||||
The same as `IAction`, but you request access to all the checked menu items.
|
||||
|
||||
### `CheckedMenuItemsDictionary CheckedMenuItemsDictionary`
|
||||
|
||||
This dictionairy contains all the checkable menu items per group (defined by the group UUID).
|
5
doc/devdocs/modules/FileActionsMenu/Plugins.md
Normal file
5
doc/devdocs/modules/FileActionsMenu/Plugins.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Plugins
|
||||
|
||||
## Where are plugins saved
|
||||
|
||||
##
|
@ -0,0 +1,12 @@
|
||||
# Executable actions
|
||||
|
||||
This plugin adds actions for `.exe` and `.dll` files.
|
||||
|
||||
## Uninstall
|
||||
|
||||
If it finds an uninstaller associated with the file, it will launch the uninstaller.
|
||||
|
||||
### How does it find the uninstaller
|
||||
|
||||
This action resolves a shortcut (if applicable) and takes the destination path of the shortcut. Then it searches the registry key `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall` for a value `InstallLocation` that contains the path of the exe. When the action is invoked the corresponding registry key `UninstallString` in the command line.
|
||||
|
@ -0,0 +1,74 @@
|
||||
# File content actions
|
||||
|
||||
This plugin contains actions related to the content of files.
|
||||
|
||||
## Copy content as C string
|
||||
|
||||
This action replaces the following hex ascii values with the string in the right column.
|
||||
|
||||
| Hex value | Replace by string |
|
||||
| --------- | ----------------- |
|
||||
|5C|`\\`|
|
||||
|07|`\a`|
|
||||
|08|`\b`|
|
||||
|09|`\t`|
|
||||
|0A|`\n`|
|
||||
|0B|`\v`|
|
||||
|0C|`\f`|
|
||||
|0D|`\r`|
|
||||
|22|`\"`|
|
||||
|27|`\'`|
|
||||
|
||||
## Copy content as data url
|
||||
|
||||
Converts the content to a data url. The mime type is determined by the file extension.
|
||||
|
||||
| File extension | Mime type |
|
||||
| -------------- | --------- |
|
||||
| .jpg | image/jpeg |
|
||||
| .jpeg | image/jpeg |
|
||||
| .png | image/png |
|
||||
| .gif | image/gif |
|
||||
| .bmp | image/bmp |
|
||||
| .svg | image/svg+xml |
|
||||
| .heic | image/heic |
|
||||
| .heif | image/heif |
|
||||
| .svgz | image/svg+xml |
|
||||
| .ico | image/x-icon |
|
||||
| .cur | image/x-icon |
|
||||
| .tif | image/tiff |
|
||||
| .tiff | image/tiff |
|
||||
| .webp | image/webp |
|
||||
| .avif | image/avif |
|
||||
| .apng | image/apng |
|
||||
| .jxl | image/jxl |
|
||||
| .jpe | image/jpeg |
|
||||
| .jfif | image/jpeg |
|
||||
| .pjpeg | image/jpeg |
|
||||
| .pjp | image |
|
||||
|
||||
If the mime type could not be determined `application/octet-stream` will be used.
|
||||
|
||||
## Copy content as plaintext
|
||||
|
||||
> No further annotations
|
||||
|
||||
## Copy content as URI encoded string
|
||||
|
||||
> No further annotations
|
||||
|
||||
## Copy content as XML encoded string
|
||||
|
||||
> No further annotations
|
||||
|
||||
## Collapse folder structure
|
||||
|
||||
> No further annotations
|
||||
|
||||
## Copy directory tree
|
||||
|
||||
This action copies the tree of the selected directory. It does this by executing the `tree` command through `cmd.exe` with the parameter `/f`.
|
||||
|
||||
## Merge file contents
|
||||
|
||||
> No further annotations
|
@ -0,0 +1,7 @@
|
||||
# File properties
|
||||
|
||||
This plugin contains actions related to file properties.
|
||||
|
||||
## Unblock files
|
||||
|
||||
This action deletes the ":Zone.Identifier" NTFS file stream, that indicates that a file is blocked, for every file.
|
35
doc/devdocs/modules/FileActionsMenu/Plugins/Hashes.md
Normal file
35
doc/devdocs/modules/FileActionsMenu/Plugins/Hashes.md
Normal file
@ -0,0 +1,35 @@
|
||||
# Hashes
|
||||
|
||||
Plugin to generate and check file hashes.
|
||||
|
||||
Following hash types are supported:
|
||||
|
||||
* CRC32 Decimal
|
||||
* CRC32 Hex
|
||||
* CRC64 Decimal
|
||||
* CRC64 Hex
|
||||
* SHA1
|
||||
* SHA256
|
||||
* SHA384
|
||||
* SHA512
|
||||
* SHA3-256
|
||||
* SHA3-384
|
||||
* SHA3-512
|
||||
|
||||
Following different generation/validation types are available:
|
||||
|
||||
## Copy hash to clipboard / Verify hash with clipboard
|
||||
|
||||
> No further annotations
|
||||
|
||||
## Save to single file / Verify with file called "Checksums"
|
||||
|
||||
The hashes are saved in a file called "Checksums" (in English, other languages use other names) with the hash type as file extension.
|
||||
|
||||
## Save to multiple files / Verify with multiple files
|
||||
|
||||
The hashes are saved to files with the same filenames as the oriiginal files with the hash type as file extension.
|
||||
|
||||
## Save to filename / Verify with filename
|
||||
|
||||
The filename (without the extension) contains the hash for the file content.
|
@ -0,0 +1,11 @@
|
||||
# Image clipboard actions
|
||||
|
||||
Plugin that contains actions related to images in the clipboard.
|
||||
|
||||
## Copy image from clipboard to folder
|
||||
|
||||
Pastes a saved bitmap image from the clipboard to the selected folder.
|
||||
|
||||
## Copy image to the clipboard
|
||||
|
||||
Copies the selected image as bitmap image to the clipbaord.
|
@ -0,0 +1,19 @@
|
||||
# Move copy actions
|
||||
|
||||
This plugin contains actions related to moving and copying files and folders.
|
||||
|
||||
## Copy to
|
||||
|
||||
Copies the selected items to a folder selected by the user. If the destination of an item is the same as the origin it is ignored.
|
||||
|
||||
## Move to
|
||||
|
||||
Moves the selected items to a folder selected by the user. If the destination of an item is the same as the origin it is ignored.
|
||||
|
||||
## New folder with selection
|
||||
|
||||
Saves selected items to a folder called "New folder with selection" (in English, name varies based on the users language). If this folder is already present ` (n)` with `n` as a number is appended to the name.
|
||||
|
||||
## Save as
|
||||
|
||||
> No further annotations
|
29
doc/devdocs/modules/FileActionsMenu/Plugins/PathCopy.md
Normal file
29
doc/devdocs/modules/FileActionsMenu/Plugins/PathCopy.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Path copy
|
||||
|
||||
This plugin contains actions related to copying the path of files and folders.
|
||||
|
||||
The copy path items can either be executed by resolving the shortcut (if applicable) or by using the path of the selected shortcut file.
|
||||
|
||||
## Copy directory path
|
||||
|
||||
Copies the path of the directory of the selected item.
|
||||
|
||||
## Copy directory path (WSL)
|
||||
|
||||
Copies the path of the directory of the selected item in WSL format. To get the path in the WSL path format, the path is prepended with `/mnt/` and all backslashes are replaced with forward slashes. In addition ":/" is replaced with "/" and the drive letter is converted to lowercase.
|
||||
|
||||
## Copy file name
|
||||
|
||||
> No further annotations
|
||||
|
||||
## Copy full path with backslashes, double backslashes or forward backslash
|
||||
|
||||
> No further annotations
|
||||
|
||||
## Copy full path (WSL)
|
||||
|
||||
Copies the full path of the selected file or folder in WSL format. To get the path in the WSL path format, the path is prepended with `/mnt/` and all backslashes are replaced with forward slashes. In addition ":/" is replaced with "/" and the drive letter is converted to lowercase.
|
||||
|
||||
## Copy path separated by
|
||||
|
||||
> No further annotations
|
15
doc/devdocs/modules/FileActionsMenu/Plugins/PowerToys.md
Normal file
15
doc/devdocs/modules/FileActionsMenu/Plugins/PowerToys.md
Normal file
@ -0,0 +1,15 @@
|
||||
# PowerToys
|
||||
|
||||
This plugin contains actions to invoke PowerToys utilities.
|
||||
|
||||
## Image resizer
|
||||
|
||||
> No further annotations
|
||||
|
||||
## PowerRename
|
||||
|
||||
> No further annotations
|
||||
|
||||
## File Locksmith
|
||||
|
||||
> No further annotations
|
13
doc/devdocs/modules/FileActionsMenu/PublicTypes.md
Normal file
13
doc/devdocs/modules/FileActionsMenu/PublicTypes.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Public types (Relevant to plugins)
|
||||
|
||||
## `FileActionsMenu.Interfaces.Seperator`
|
||||
|
||||
One predefined action representing a seperator.
|
||||
|
||||
## `FileActionsMenu.Interfaces.CheckedMenuItemsDictionary`
|
||||
|
||||
An alias for `Dictionary<string, List<(MenuFlyoutItemBase, IAction)>>`.
|
||||
|
||||
The string represents the UUID of a group of checkable items.
|
||||
|
||||
The list contains the corresponding elements and action definitions.
|
@ -9,9 +9,9 @@ Following telemetry is sent by File Actions menu:
|
||||
|||
|
||||
| `IFileActionsMenuItemInvokedEvent` | Never, but is the base type for all the following events. | **ItemCount**: How many items are selected.<br/> **HasExecutableFilesSelected**: If any files ending in `.exe` or `.dll` are selected.<br/>**HasFilesSelected**: If the selection contains any files.<br/>**HasFolderSelected**: If the selection contains any folders.<br/>**HasImageSelected**: If the selection contains any image files.|
|
||||
| `FileActionsMenuUninstallActionInvoked` | When the uninstall action is called. | **IsCalledFromDesktop**: If the selected item was on the desktop.<br/> **IsCalledOnShortcut**: If the selected item is a shortcut (`.ink` file). |
|
||||
| `FileActionsMenuPowerRenameAction` | When PowerRename is launched via File Actions Menu | |
|
||||
| `FileActionsMenuImageResizerAction` | When Image Resizer is launched via File Actions Menu | |
|
||||
| `FileActionsMenuFileLocksmithAction` | When File Locksmith is launched via File Actions Menu | |
|
||||
| `FileActionsMenuPowerRenameAction` | When PowerRename is launched via File Actions menu | |
|
||||
| `FileActionsMenuImageResizerAction` | When Image Resizer is launched via File Actions menu | |
|
||||
| `FileActionsMenuFileLocksmithAction` | When File Locksmith is launched via File Actions menu | |
|
||||
| `FileActionsMenuCopyContentAsCEscapedStringActionInvokedEvent` | When the "Copy file content → As C escaped string" action is invoked | |
|
||||
| `FileActionsMenuCopyContentAsDataUrlActionInvokedEvent` | When the "Copy file content → As data url" action is invoked | |
|
||||
| `FileActionsMenuCopyContentAsPlaintextActionInvokedEvent` | When the "Copy file content → As plaintext" action is invoked | |
|
||||
|
@ -1,5 +1,16 @@
|
||||
# File Actions menu Developer Documentation
|
||||
|
||||
* [Interfaces](Interfaces.md)
|
||||
* [Telemetry](Telemetry.md)
|
||||
* [Helpers](Helpers.md)
|
||||
* [Public types](PublicTypes.md)
|
||||
* [Enums](Enums.md)
|
||||
* [Telemetry](Telemetry.md)
|
||||
* Plugin annotations
|
||||
* [Executable actions](Plugins/ExecutableActions.md)
|
||||
* [File content actions](Plugins/FileContentActions.md)
|
||||
* [File properties](Plugins/FileProperties.md)
|
||||
* [Hashes](Plugins/Hashes.md)
|
||||
* [Image clipboard actions](Plugins/ImageClipboardActions.md)
|
||||
* [Move copy actions](Plugins/MoveCopyActions.md)
|
||||
* [Path copy](Plugins/PathCopy.md)
|
||||
* [PowerToys](Plugins/PowerToys.md)
|
||||
|
Loading…
Reference in New Issue
Block a user