Namespace: kodi::gui::dialogs::FileBrowser
File browser dialog
The functions listed below of the class "FileBrowser" offer the possibility to select to a file by the user of the add-on.
It allows all the options that are possible in Kodi itself and offers all support file types.
It has the header #include <kodi/gui/dialogs/FileBrowser.h> be included to enjoy it.
◆ ShowAndGetDirectory()
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::FileBrowser::ShowAndGetDirectory |
( |
const std::string & |
shares, |
|
|
const std::string & |
heading, |
|
|
std::string & |
path, |
|
|
bool |
writeOnly = false |
|
) |
| |
|
inline |
Directory selection dialog.
- Parameters
-
[in] | shares | With Shares becomes the available start folders be set |
[in] | heading | Dialog header name |
[in,out] | path | As in the path to start and return value about selected directory |
[in] | writeOnly | [opt] If set only writeable folders are shown |
- Returns
- False if selection becomes canceled
Example:
#include <kodi/gui/dialogs/FileBrowser.h>
std::string directory;
"Test directory selection",
directory,
false);
fprintf(stderr, "Selected directory is : %s and was %s\n", directory.c_str(), ret ? "OK" : "Canceled");
bool ATTRIBUTE_HIDDEN ShowAndGetDirectory(const std::string &shares, const std::string &heading, std::string &path, bool writeOnly=false)
Directory selection dialog.
Definition: FileBrowser.h:70
◆ ShowAndGetFile()
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::FileBrowser::ShowAndGetFile |
( |
const std::string & |
shares, |
|
|
const std::string & |
mask, |
|
|
const std::string & |
heading, |
|
|
std::string & |
path, |
|
|
bool |
useThumbs = false , |
|
|
bool |
useFileDirectories = false |
|
) |
| |
|
inline |
File selection dialog.
- Parameters
-
[in] | shares | With Shares becomes the available start folders be set. |
[in] | mask | The mask to filter visible files, e.g. ".m3u|.pls|.b4s|.wpl" |
[in] | heading | Dialog header name |
[in,out] | path | As in the path to start and Return value about selected file |
[in] | useThumbs | [opt] If set show thumbs if possible on dialog |
[in] | useFileDirectories | [opt] If set also packages (e.g. *.zip) are handled as directories. |
- Returns
- False if selection becomes canceled
◆ ShowAndGetFileFromDir()
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::FileBrowser::ShowAndGetFileFromDir |
( |
const std::string & |
directory, |
|
|
const std::string & |
mask, |
|
|
const std::string & |
heading, |
|
|
std::string & |
path, |
|
|
bool |
useThumbs = false , |
|
|
bool |
useFileDirectories = false , |
|
|
bool |
singleList = false |
|
) |
| |
|
inline |
File selection from a directory.
- Parameters
-
[in] | directory | The directory name where the dialog start, possible are normal names and kodi's special names |
[in] | mask | The mask to filter visible files, e.g. ".m3u|.pls|.b4s|.wpl" |
[in] | heading | Dialog header name |
[in,out] | path | As in the path to start and Return value about selected file |
[in] | useThumbs | [opt] If set show thumbs if possible on dialog |
[in] | useFileDirectories | [opt] If set also packages (e.g. *.zip) are handled as directories |
[in] | singleList | [opt] |
- Returns
- False if selection becomes canceled
◆ ShowAndGetFileList()
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::FileBrowser::ShowAndGetFileList |
( |
const std::string & |
shares, |
|
|
const std::string & |
mask, |
|
|
const std::string & |
heading, |
|
|
std::vector< std::string > & |
fileList, |
|
|
bool |
useThumbs = false , |
|
|
bool |
useFileDirectories = false |
|
) |
| |
|
inline |
File selection dialog to get several in to a list.
- Parameters
-
[in] | shares | With Shares becomes the available start folders be set. |
[in] | mask | The mask to filter visible files, e.g. ".m3u|.pls|.b4s|.wpl" |
[in] | heading | Dialog header name |
[out] | fileList | Return value about selected files |
[in] | useThumbs | [opt] If set show thumbs if possible on dialog. |
[in] | useFileDirectories | [opt] If set also packages (e.g. *.zip) are handled as directories. |
- Returns
- False if selection becomes canceled.
◆ ShowAndGetSource()
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::FileBrowser::ShowAndGetSource |
( |
std::string & |
path, |
|
|
bool |
allowNetworkShares, |
|
|
const std::string & |
additionalShare = "" , |
|
|
const std::string & |
type = "" |
|
) |
| |
|
inline |
Source selection dialog.
- Parameters
-
[in,out] | path | As in the path to start and Return value about selected source |
[in] | allowNetworkShares | Allow also access to network |
[in] | additionalShare | [opt] With additionalShare becomes the available start folders be set. |
[in] | type | [opt] |
- Returns
- False if selection becomes canceled
◆ ShowAndGetImage()
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::FileBrowser::ShowAndGetImage |
( |
const std::string & |
shares, |
|
|
const std::string & |
heading, |
|
|
std::string & |
path |
|
) |
| |
|
inline |
Image selection dialog.
- Parameters
-
[in] | shares | With Shares becomes the available start folders be set |
[in] | heading | Dialog header name |
[out] | path | Return value about selected image |
- Returns
- False if selection becomes canceled
◆ ShowAndGetImageList()
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::FileBrowser::ShowAndGetImageList |
( |
const std::string & |
shares, |
|
|
const std::string & |
heading, |
|
|
std::vector< std::string > & |
file_list |
|
) |
| |
|
inline |
Image selection dialog to get several in to a list.
- Parameters
-
[in] | shares | With Shares becomes the available start folders be set |
[in] | heading | Dialog header name |
[out] | file_list | Return value about selected images |
- Returns
- False if selection becomes canceled