kodi
FileBrowser.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h"
12 
13 #include <string>
14 #include <vector>
15 
16 class CMediaSource;
17 
18 typedef std::vector<CMediaSource> VECSOURCES;
19 
20 extern "C"
21 {
22 
23  struct AddonGlobalInterface;
24 
25  namespace ADDON
26  {
27 
37  {
38  static void Init(AddonGlobalInterface* addonInterface);
39  static void DeInit(AddonGlobalInterface* addonInterface);
40 
52  static bool show_and_get_directory(KODI_HANDLE kodiBase,
53  const char* shares,
54  const char* heading,
55  const char* path_in,
56  char** path_out,
57  bool write_only);
58 
59  static bool show_and_get_file(KODI_HANDLE kodiBase,
60  const char* shares,
61  const char* mask,
62  const char* heading,
63  const char* path_in,
64  char** path_out,
65  bool use_thumbs,
66  bool use_file_directories);
67 
68  static bool show_and_get_file_from_dir(KODI_HANDLE kodiBase,
69  const char* directory,
70  const char* mask,
71  const char* heading,
72  const char* path_in,
73  char** path_out,
74  bool use_thumbs,
75  bool use_file_directories,
76  bool singleList);
77 
78  static bool show_and_get_file_list(KODI_HANDLE kodiBase,
79  const char* shares,
80  const char* mask,
81  const char* heading,
82  char*** file_list,
83  unsigned int* entries,
84  bool use_thumbs,
85  bool use_file_directories);
86 
87  static bool show_and_get_source(KODI_HANDLE kodiBase,
88  const char* path_in,
89  char** path_out,
90  bool allow_network_shares,
91  const char* additional_share,
92  const char* type);
93 
94  static bool show_and_get_image(KODI_HANDLE kodiBase,
95  const char* shares,
96  const char* heading,
97  const char* path_in,
98  char** path_out);
99 
100  static bool show_and_get_image_list(KODI_HANDLE kodiBase,
101  const char* shares,
102  const char* heading,
103  char*** file_list,
104  unsigned int* entries);
105 
106  static void clear_file_list(KODI_HANDLE kodiBase, char*** file_list, unsigned int entries);
108 
109  private:
110  static void GetVECShares(VECSOURCES& vecShares,
111  const std::string& strShares,
112  const std::string& strPath);
113  };
114 
115  } /* namespace ADDON */
116 } /* extern "C" */
Global gui Add-on to Kodi callback functions.
Definition: FileBrowser.h:36
static bool show_and_get_directory(KODI_HANDLE kodiBase, const char *shares, const char *heading, const char *path_in, char **path_out, bool write_only)
callback functions from add-on to kodi
Definition: FileBrowser.cpp:47
Represents a share.
Definition: MediaSource.h:22
Main structure passed from kodi to addon with basic information needed to create add-on.
Definition: addon_base.h:378
std::vector< CMediaSource > VECSOURCES
A vector to hold CMediaSource objects.
Definition: MediaSource.h:98
Definition: Addon.cpp:39