xbmc
DialogGameVideoSelect.h
1 /*
2  * Copyright (C) 2017-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 <memory>
14 
15 class CFileItemList;
16 class CGUIViewControl;
17 
18 namespace KODI
19 {
20 namespace RETRO
21 {
22 class CGUIGameVideoHandle;
23 }
24 
25 namespace GAME
26 {
28 {
29 public:
30  ~CDialogGameVideoSelect() override;
31 
32  // implementation of CGUIControl via CGUIDialog
33  bool OnMessage(CGUIMessage& message) override;
34 
35  // implementation of CGUIWindow via CGUIDialog
36  void FrameMove() override;
37  void OnDeinitWindow(int nextWindowID) override;
38 
39 protected:
40  CDialogGameVideoSelect(int windowId);
41 
42  // implementation of CGUIWindow via CGUIDialog
43  void OnWindowUnload() override;
44  void OnWindowLoaded() override;
45  void OnInitWindow() override;
46 
47  // Video select interface
48  virtual std::string GetHeading() = 0;
49  virtual void PreInit() = 0;
50  virtual void GetItems(CFileItemList& items) = 0;
51  virtual void OnItemFocus(unsigned int index) = 0;
52  virtual unsigned int GetFocusedItem() const = 0;
53  virtual void PostExit() = 0;
54  // override this to do something when an item is selected
55  virtual bool OnClickAction() { return false; }
56  // override this to do something when an item's context menu is opened
57  virtual bool OnMenuAction() { return false; }
58  // override this to do something when an item is overwritten with a new savestate
59  virtual bool OnOverwriteAction() { return false; }
60  // override this to do something when an item is renamed
61  virtual bool OnRenameAction() { return false; }
62  // override this to do something when an item is deleted
63  virtual bool OnDeleteAction() { return false; }
64 
65  // GUI functions
66  void RefreshList();
67  void OnDescriptionChange(const std::string& description);
68 
69  std::shared_ptr<RETRO::CGUIGameVideoHandle> m_gameVideoHandle;
70 
71 private:
72  void Update();
73  void Clear();
74 
75  void SaveSettings();
76 
77  void RegisterDialog();
78  void UnregisterDialog();
79 
80  std::unique_ptr<CGUIViewControl> m_viewControl;
81  std::unique_ptr<CFileItemList> m_vecItems;
82 };
83 } // namespace GAME
84 } // namespace KODI
Definition: GUIViewControl.h:19
Definition: DialogGameVideoSelect.h:27
Represents a list of files.
Definition: FileItem.h:713
Definition: GUIDialog.h:35
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: GUIMessage.h:365