kodi
GUIDialogMediaSource.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 "guilib/GUIDialog.h"
12 
13 #include <string>
14 #include <vector>
15 
16 class CFileItemList;
17 class CMediaSource;
18 
20  public CGUIDialog
21 {
22 public:
24  ~CGUIDialogMediaSource(void) override;
25  bool OnMessage(CGUIMessage& message) override;
26  void OnDeinitWindow(int nextWindowID) override;
27  bool OnBack(int actionID) override;
28  static bool ShowAndAddMediaSource(const std::string &type);
29  static bool ShowAndEditMediaSource(const std::string &type, const CMediaSource &share);
30  static bool ShowAndEditMediaSource(const std::string &type, const std::string &share);
31 
32  bool IsConfirmed() const { return m_confirmed; }
33 
34  void SetShare(const CMediaSource &share);
35  void SetTypeOfMedia(const std::string &type, bool editNotAdd = false);
36 protected:
37  void OnPathBrowse(int item);
38  void OnPath(int item);
39  void OnPathAdd();
40  void OnPathRemove(int item);
41  void OnOK();
42  void OnCancel();
43  void UpdateButtons();
44  int GetSelectedItem();
45  void HighlightItem(int item);
46  std::string GetUniqueMediaSourceName();
47  static void OnMediaSourceChanged(const std::string& type, const std::string& oldName, const CMediaSource& share);
48 
49  std::vector<std::string> GetPaths() const;
50 
51  std::string m_type;
52  std::string m_name;
53  CFileItemList* m_paths;
54  bool m_confirmed = false;
55  bool m_bNameChanged = false;
56 };
Represents a list of files.
Definition: FileItem.h:702
Definition: GUIDialogMediaSource.h:19
Represents a share.
Definition: MediaSource.h:22
Definition: GUIDialog.h:35
Definition: GUIMessage.h:365