Debian Codegraph @

xbmc/events/IEvent.h

raw
1 /*
2 * Copyright (C) 2015-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 "utils/ISortable.h"
12
13 #include <memory>
14 #include <string>
15
16 class CDateTime;
17
18 enum class EventLevel
19 {
20 Basic = 0,
21 Information = 1,
22 Warning = 2,
23 Error = 3,
24 };
25
26 class IEvent : public ISortable
27 {
28 public:
29 virtual ~IEvent() = default;
30
31 virtual const char* GetType() const = 0;
32 virtual std::string GetIdentifier() const = 0;
33 virtual EventLevel GetLevel() const = 0;
34 virtual std::string GetLabel() const = 0;
35 virtual std::string GetIcon() const = 0;
36 virtual std::string GetDescription() const = 0;
37 virtual std::string GetDetails() const = 0;
38 virtual std::string GetExecutionLabel() const = 0;
39 virtual CDateTime GetDateTime() const = 0;
40
41 virtual bool CanExecute() const = 0;
42 virtual bool Execute() const = 0;
43
44 void ToSortable(SortItem& sortable, Field field) const override = 0;
45 };
46
47 typedef std::shared_ptr<const IEvent> EventPtr;