Debian Codegraph @

xbmc/video/guilib/VideoPlayActionProcessor.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2023 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 "video/guilib/VideoAction.h"
12
13 #include <memory>
14
15 class CFileItem;
16
17 namespace VIDEO
18 {
19 namespace GUILIB
20 {
21 class CVideoPlayActionProcessorBase
22 {
23 public:
24 explicit CVideoPlayActionProcessorBase(const std::shared_ptr<CFileItem>& item) : m_item(item) {}
25 virtual ~CVideoPlayActionProcessorBase() = default;
26
27 bool ProcessDefaultAction();
28 bool ProcessAction(Action action);
29
30 bool UserCancelled() const { return m_userCancelled; }
31
32 static Action ChoosePlayOrResume(const CFileItem& item);
33
34 protected:
35 virtual Action GetDefaultAction();
36 virtual bool Process(Action action);
37
38 virtual bool OnResumeSelected() = 0;
39 virtual bool OnPlaySelected() = 0;
40
41 std::shared_ptr<CFileItem> m_item;
42 bool m_userCancelled{false};
43
44 private:
45 CVideoPlayActionProcessorBase() = delete;
46 };
47 } // namespace GUILIB
48 } // namespace VIDEO