diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h index bb1065d..90da063 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/FileBrowser.h | |||
| @@ -71,17 +71,22 @@ namespace dialogs | |||
| 71 | /// fprintf(stderr, "Selected directory is : %s and was %s\n", directory.c_str(), ret ? "OK" : "Canceled"); | 71 | /// fprintf(stderr, "Selected directory is : %s and was %s\n", directory.c_str(), ret ? "OK" : "Canceled"); |
| 72 | /// ~~~~~~~~~~~~~ | 72 | /// ~~~~~~~~~~~~~ |
| 73 | /// | 73 | /// |
| 74 | inline bool ShowAndGetDirectory(const std::string& shares, const std::string& heading, std::string& path, bool writeOnly = false) | 74 | inline bool ATTRIBUTE_HIDDEN ShowAndGetDirectory(const std::string& shares, |
| 75 | const std::string& heading, | ||
| 76 | std::string& path, | ||
| 77 | bool writeOnly = false) | ||
| 75 | { | 78 | { |
| 76 | using namespace ::kodi::addon; | 79 | using namespace ::kodi::addon; |
| 77 | char* retString = nullptr; | 80 | char* retString = nullptr; |
| 78 | bool ret = CAddonBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_directory(CAddonBase::m_interface->toKodi->kodiBase, | 81 | bool ret = CAddonBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->show_and_get_directory( |
| 79 | shares.c_str(), heading.c_str(), path.c_str(), &retString, writeOnly); | 82 | CAddonBase::m_interface->toKodi->kodiBase, shares.c_str(), heading.c_str(), path.c_str(), |
| 83 | &retString, writeOnly); | ||
| 80 | if (retString != nullptr) | 84 | if (retString != nullptr) |
| 81 | { | 85 | { |
| 82 | if (std::strlen(retString)) | 86 | if (std::strlen(retString)) |
| 83 | path = retString; | 87 | path = retString; |
| 84 | CAddonBase::m_interface->toKodi->free_string(CAddonBase::m_interface->toKodi->kodiBase, retString); | 88 | CAddonBase::m_interface->toKodi->free_string(CAddonBase::m_interface->toKodi->kodiBase, |
| 89 | retString); | ||
| 85 | } | 90 | } |
| 86 | return ret; | 91 | return ret; |
| 87 | } | 92 | } |
| @@ -104,8 +109,12 @@ namespace dialogs | |||
| 104 | /// handled as directories. | 109 | /// handled as directories. |
| 105 | /// @return False if selection becomes canceled. | 110 | /// @return False if selection becomes canceled. |
| 106 | /// | 111 | /// |
| 107 | inline bool ShowAndGetFile(const std::string& shares, const std::string& mask, const std::string& heading, | 112 | inline bool ATTRIBUTE_HIDDEN ShowAndGetFile(const std::string& shares, |
| 108 | std::string& path, bool useThumbs = false, bool useFileDirectories = false) | 113 | const std::string& mask, |
| 114 | const std::string& heading, | ||
| 115 | std::string& path, | ||
| 116 | bool useThumbs = false, | ||
| 117 | bool useFileDirectories = false) | ||
| 109 | { | 118 | { |
| 110 | using namespace ::kodi::addon; | 119 | using namespace ::kodi::addon; |
| 111 | char* retString = nullptr; | 120 | char* retString = nullptr; |
| @@ -141,8 +150,13 @@ namespace dialogs | |||
| 141 | /// @param[in] singleList | 150 | /// @param[in] singleList |
| 142 | /// @return False if selection becomes canceled. | 151 | /// @return False if selection becomes canceled. |
| 143 | /// | 152 | /// |
| 144 | inline bool ShowAndGetFileFromDir(const std::string& directory, const std::string& mask, const std::string& heading, std::string& path, | 153 | inline bool ATTRIBUTE_HIDDEN ShowAndGetFileFromDir(const std::string& directory, |
| 145 | bool useThumbs = false, bool useFileDirectories = false, bool singleList = false) | 154 | const std::string& mask, |
| 155 | const std::string& heading, | ||
| 156 | std::string& path, | ||
| 157 | bool useThumbs = false, | ||
| 158 | bool useFileDirectories = false, | ||
| 159 | bool singleList = false) | ||
| 146 | { | 160 | { |
| 147 | using namespace ::kodi::addon; | 161 | using namespace ::kodi::addon; |
| 148 | char* retString = nullptr; | 162 | char* retString = nullptr; |
| @@ -176,8 +190,12 @@ namespace dialogs | |||
| 176 | /// handled as directories. | 190 | /// handled as directories. |
| 177 | /// @return False if selection becomes canceled. | 191 | /// @return False if selection becomes canceled. |
| 178 | /// | 192 | /// |
| 179 | inline bool ShowAndGetFileList(const std::string& shares, const std::string& mask, const std::string& heading, | 193 | inline bool ATTRIBUTE_HIDDEN ShowAndGetFileList(const std::string& shares, |
| 180 | std::vector<std::string>& fileList, bool useThumbs = false, bool useFileDirectories = false) | 194 | const std::string& mask, |
| 195 | const std::string& heading, | ||
| 196 | std::vector<std::string>& fileList, | ||
| 197 | bool useThumbs = false, | ||
| 198 | bool useFileDirectories = false) | ||
| 181 | { | 199 | { |
| 182 | using namespace ::kodi::addon; | 200 | using namespace ::kodi::addon; |
| 183 | char** list = nullptr; | 201 | char** list = nullptr; |
| @@ -188,7 +206,7 @@ namespace dialogs | |||
| 188 | if (ret) | 206 | if (ret) |
| 189 | { | 207 | { |
| 190 | for (unsigned int i = 0; i < listSize; ++i) | 208 | for (unsigned int i = 0; i < listSize; ++i) |
| 191 | fileList.push_back(list[i]); | 209 | fileList.emplace_back(list[i]); |
| 192 | CAddonBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->clear_file_list(CAddonBase::m_interface->toKodi->kodiBase, &list, listSize); | 210 | CAddonBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->clear_file_list(CAddonBase::m_interface->toKodi->kodiBase, &list, listSize); |
| 193 | } | 211 | } |
| 194 | return ret; | 212 | return ret; |
| @@ -208,7 +226,10 @@ namespace dialogs | |||
| 208 | /// @param[in] type | 226 | /// @param[in] type |
| 209 | /// @return False if selection becomes canceled. | 227 | /// @return False if selection becomes canceled. |
| 210 | /// | 228 | /// |
| 211 | inline bool ShowAndGetSource(std::string& path, bool allowNetworkShares, const std::string& additionalShare = "", const std::string& type = "") | 229 | inline bool ATTRIBUTE_HIDDEN ShowAndGetSource(std::string& path, |
| 230 | bool allowNetworkShares, | ||
| 231 | const std::string& additionalShare = "", | ||
| 232 | const std::string& type = "") | ||
| 212 | { | 233 | { |
| 213 | using namespace ::kodi::addon; | 234 | using namespace ::kodi::addon; |
| 214 | char* retString = nullptr; | 235 | char* retString = nullptr; |
| @@ -235,7 +256,9 @@ namespace dialogs | |||
| 235 | /// @param[out] path Return value about selected image | 256 | /// @param[out] path Return value about selected image |
| 236 | /// @return False if selection becomes canceled. | 257 | /// @return False if selection becomes canceled. |
| 237 | /// | 258 | /// |
| 238 | inline bool ShowAndGetImage(const std::string& shares, const std::string& heading, std::string& path) | 259 | inline bool ATTRIBUTE_HIDDEN ShowAndGetImage(const std::string& shares, |
| 260 | const std::string& heading, | ||
| 261 | std::string& path) | ||
| 239 | { | 262 | { |
| 240 | using namespace ::kodi::addon; | 263 | using namespace ::kodi::addon; |
| 241 | char* retString = nullptr; | 264 | char* retString = nullptr; |
| @@ -262,7 +285,9 @@ namespace dialogs | |||
| 262 | /// @param[out] file_list Return value about selected images | 285 | /// @param[out] file_list Return value about selected images |
| 263 | /// @return False if selection becomes canceled. | 286 | /// @return False if selection becomes canceled. |
| 264 | /// | 287 | /// |
| 265 | inline bool ShowAndGetImageList(const std::string& shares, const std::string& heading, std::vector<std::string>& file_list) | 288 | inline bool ATTRIBUTE_HIDDEN ShowAndGetImageList(const std::string& shares, |
| 289 | const std::string& heading, | ||
| 290 | std::vector<std::string>& file_list) | ||
| 266 | { | 291 | { |
| 267 | using namespace ::kodi::addon; | 292 | using namespace ::kodi::addon; |
| 268 | char** list = nullptr; | 293 | char** list = nullptr; |
| @@ -272,7 +297,7 @@ namespace dialogs | |||
| 272 | if (ret) | 297 | if (ret) |
| 273 | { | 298 | { |
| 274 | for (unsigned int i = 0; i < listSize; ++i) | 299 | for (unsigned int i = 0; i < listSize; ++i) |
| 275 | file_list.push_back(list[i]); | 300 | file_list.emplace_back(list[i]); |
| 276 | CAddonBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->clear_file_list(CAddonBase::m_interface->toKodi->kodiBase, &list, listSize); | 301 | CAddonBase::m_interface->toKodi->kodi_gui->dialogFileBrowser->clear_file_list(CAddonBase::m_interface->toKodi->kodiBase, &list, listSize); |
| 277 | } | 302 | } |
| 278 | return ret; | 303 | return ret; |
