11#include "../../AddonBase.h"
12#include "../../c-api/gui/dialogs/filebrowser.h"
71 const std::string& heading,
73 bool writeOnly =
false)
75 using namespace ::kodi::addon;
76 char* retString =
nullptr;
77 bool ret = CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_directory(
78 CPrivateBase::m_interface->toKodi->kodiBase, shares.c_str(), heading.c_str(), path.c_str(),
79 &retString, writeOnly);
80 if (retString !=
nullptr)
82 if (std::strlen(retString))
84 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
106 const std::string& mask,
107 const std::string& heading,
109 bool useThumbs =
false,
110 bool useFileDirectories =
false)
112 using namespace ::kodi::addon;
113 char* retString =
nullptr;
114 bool ret = CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_file(
115 CPrivateBase::m_interface->toKodi->kodiBase, shares.c_str(), mask.c_str(), heading.c_str(),
116 path.c_str(), &retString, useThumbs, useFileDirectories);
117 if (retString !=
nullptr)
119 if (std::strlen(retString))
121 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
145 const std::string& mask,
146 const std::string& heading,
148 bool useThumbs =
false,
149 bool useFileDirectories =
false,
150 bool singleList =
false)
152 using namespace ::kodi::addon;
153 char* retString =
nullptr;
155 CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_file_from_dir(
156 CPrivateBase::m_interface->toKodi->kodiBase, directory.c_str(), mask.c_str(),
157 heading.c_str(), path.c_str(), &retString, useThumbs, useFileDirectories, singleList);
158 if (retString !=
nullptr)
160 if (std::strlen(retString))
162 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
183 const std::string& mask,
184 const std::string& heading,
185 std::vector<std::string>& fileList,
186 bool useThumbs =
false,
187 bool useFileDirectories =
false)
189 using namespace ::kodi::addon;
190 char** list =
nullptr;
191 unsigned int listSize = 0;
192 bool ret = CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_file_list(
193 CPrivateBase::m_interface->toKodi->kodiBase, shares.c_str(), mask.c_str(), heading.c_str(),
194 &list, &listSize, useThumbs, useFileDirectories);
197 for (
unsigned int i = 0; i < listSize; ++i)
198 fileList.emplace_back(list[i]);
199 CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->clear_file_list(
200 CPrivateBase::m_interface->toKodi->kodiBase, &list, listSize);
219 bool allowNetworkShares,
220 const std::string& additionalShare =
"",
221 const std::string& type =
"")
223 using namespace ::kodi::addon;
224 char* retString =
nullptr;
225 bool ret = CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_source(
226 CPrivateBase::m_interface->toKodi->kodiBase, path.c_str(), &retString, allowNetworkShares,
227 additionalShare.c_str(), type.c_str());
228 if (retString !=
nullptr)
230 if (std::strlen(retString))
232 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
249 const std::string& heading,
252 using namespace ::kodi::addon;
253 char* retString =
nullptr;
254 bool ret = CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_image(
255 CPrivateBase::m_interface->toKodi->kodiBase, shares.c_str(), heading.c_str(), path.c_str(),
257 if (retString !=
nullptr)
259 if (std::strlen(retString))
261 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
278 const std::string& heading,
279 std::vector<std::string>& file_list)
281 using namespace ::kodi::addon;
282 char** list =
nullptr;
283 unsigned int listSize = 0;
285 CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_image_list(
286 CPrivateBase::m_interface->toKodi->kodiBase, shares.c_str(), heading.c_str(), &list,
290 for (
unsigned int i = 0; i < listSize; ++i)
291 file_list.emplace_back(list[i]);
292 CPrivateBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->clear_file_list(
293 CPrivateBase::m_interface->toKodi->kodiBase, &list, listSize);
bool ATTR_DLL_LOCAL ShowAndGetFile(const std::string &shares, const std::string &mask, const std::string &heading, std::string &path, bool useThumbs=false, bool useFileDirectories=false)
File selection dialog.
Definition FileBrowser.h:105
bool ATTR_DLL_LOCAL ShowAndGetImageList(const std::string &shares, const std::string &heading, std::vector< std::string > &file_list)
Image selection dialog to get several in to a list.
Definition FileBrowser.h:277
bool ATTR_DLL_LOCAL ShowAndGetImage(const std::string &shares, const std::string &heading, std::string &path)
Image selection dialog.
Definition FileBrowser.h:248
bool ATTR_DLL_LOCAL ShowAndGetDirectory(const std::string &shares, const std::string &heading, std::string &path, bool writeOnly=false)
Directory selection dialog.
Definition FileBrowser.h:70
bool ATTR_DLL_LOCAL ShowAndGetFileList(const std::string &shares, const std::string &mask, const std::string &heading, std::vector< std::string > &fileList, bool useThumbs=false, bool useFileDirectories=false)
File selection dialog to get several in to a list.
Definition FileBrowser.h:182
bool ATTR_DLL_LOCAL 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)
File selection from a directory.
Definition FileBrowser.h:144
bool ATTR_DLL_LOCAL ShowAndGetSource(std::string &path, bool allowNetworkShares, const std::string &additionalShare="", const std::string &type="")
Source selection dialog.
Definition FileBrowser.h:218