]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/FileExplorer.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / FileExplorer.h
1 /** @file
2
3 This file explorer protocol defines defines a set of interfaces for
4 how to do file explorer.
5
6 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef __FILE_EXPLORER_H__
12 #define __FILE_EXPLORER_H__
13
14 #define EFI_FILE_EXPLORER_PROTOCOL_GUID \
15 { 0x2C03C536, 0x4594, 0x4515, { 0x9E, 0x7A, 0xD3, 0xD2, 0x04, 0xFE, 0x13, 0x63 } }
16
17 //
18 // Forward reference for pure ANSI compatability
19 //
20 typedef struct _EFI_FILE_EXPLORER_PROTOCOL EFI_FILE_EXPLORER_PROTOCOL;
21
22 /**
23 Prototype for the next process after user chosed one file.
24
25 @param[in] FilePath The device path of the find file.
26
27 @retval TRUE Need exit file explorer after do the extra task.
28 @retval FALSE Not need to exit file explorer after do the extra task.
29
30 **/
31 typedef
32 BOOLEAN
33 (EFIAPI *CHOOSE_HANDLER)(
34 IN EFI_DEVICE_PATH_PROTOCOL *FilePath
35 );
36
37 /**
38 Choose a file in the specified directory.
39
40 If user input NULL for the RootDirectory, will choose file in the system.
41
42 If user input *File != NULL, function will return the allocate device path
43 info for the choosed file, caller has to free the memory after use it.
44
45 @param RootDirectory Pointer to the root directory.
46 @param FileType The file type need to choose.
47 @param ChooseHandler Function pointer to the extra task need to do
48 after choose one file.
49 @param File Return the device path for the last time chosed file.
50
51 @retval EFI_SUCESS Choose the file success.
52 @retval Other errors Choose the file failed.
53 **/
54 typedef
55 EFI_STATUS
56 (EFIAPI *CHOOSE_FILE) (
57 IN EFI_DEVICE_PATH_PROTOCOL *RootDirectory,
58 IN CHAR16 *FileType, OPTIONAL
59 IN CHOOSE_HANDLER ChooseHandler, OPTIONAL
60 OUT EFI_DEVICE_PATH_PROTOCOL **File OPTIONAL
61 );
62
63 struct _EFI_FILE_EXPLORER_PROTOCOL {
64 CHOOSE_FILE ChooseFile;
65 };
66
67 extern EFI_GUID gEfiFileExplorerProtocolGuid;
68
69 #endif