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