• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 - 2015, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials are licensed and made available under
8 the terms and conditions of the BSD License that accompanies this distribution.
9 The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
11 
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 
15 **/
16 
17 #ifndef __FILE_EXPLORER_H__
18 #define __FILE_EXPLORER_H__
19 
20 #define EFI_FILE_EXPLORER_PROTOCOL_GUID  \
21   { 0x2C03C536, 0x4594, 0x4515, { 0x9E, 0x7A, 0xD3, 0xD2, 0x04, 0xFE, 0x13, 0x63 } }
22 
23 //
24 // Forward reference for pure ANSI compatability
25 //
26 typedef struct _EFI_FILE_EXPLORER_PROTOCOL  EFI_FILE_EXPLORER_PROTOCOL;
27 
28 /**
29   Prototype for the next process after user chosed one file.
30 
31   @param[in] FilePath     The device path of the find file.
32 
33   @retval    TRUE         Need exit file explorer after do the extra task.
34   @retval    FALSE        Not need to exit file explorer after do the extra task.
35 
36 **/
37 typedef
38 BOOLEAN
39 (EFIAPI *CHOOSE_HANDLER)(
40   IN EFI_DEVICE_PATH_PROTOCOL  *FilePath
41   );
42 
43 /**
44   Choose a file in the specified directory.
45 
46   If user input NULL for the RootDirectory, will choose file in the system.
47 
48   If user input *File != NULL, function will return the allocate device path
49   info for the choosed file, caller has to free the memory after use it.
50 
51   @param  RootDirectory    Pointer to the root directory.
52   @param  FileType         The file type need to choose.
53   @param  ChooseHandler    Function pointer to the extra task need to do
54                            after choose one file.
55   @param  File             Return the device path for the last time chosed file.
56 
57   @retval EFI_SUCESS       Choose the file success.
58   @retval Other errors     Choose the file failed.
59 **/
60 typedef
61 EFI_STATUS
62 (EFIAPI   *CHOOSE_FILE) (
63   IN  EFI_DEVICE_PATH_PROTOCOL  *RootDirectory,
64   IN  CHAR16                    *FileType,  OPTIONAL
65   IN  CHOOSE_HANDLER            ChooseHandler,  OPTIONAL
66   OUT EFI_DEVICE_PATH_PROTOCOL  **File  OPTIONAL
67   );
68 
69 struct _EFI_FILE_EXPLORER_PROTOCOL {
70   CHOOSE_FILE                          ChooseFile;
71 };
72 
73 extern EFI_GUID gEfiFileExplorerProtocolGuid;
74 
75 #endif
76