2 * Copyright (C) 2015-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "XBDateTime.h"
12 #include "events/IEvent.h"
13 #include "utils/Variant.h"
15 class CBaseEvent
: public IEvent
18 ~CBaseEvent() override
= default;
20 std::string
GetIdentifier() const override
{ return m_identifier
; }
21 EventLevel
GetLevel() const override
{ return m_level
; }
22 std::string
GetLabel() const override
;
23 std::string
GetIcon() const override
{ return m_icon
; }
24 std::string
GetDescription() const override
;
25 std::string
GetDetails() const override
;
26 std::string
GetExecutionLabel() const override
;
27 CDateTime
GetDateTime() const override
{ return m_dateTime
; }
29 bool CanExecute() const override
{ return !GetExecutionLabel().empty(); }
31 void ToSortable(SortItem
& sortable
, Field field
) const override
;
34 CBaseEvent(const std::string
& identifier
, const CVariant
& label
, const CVariant
& description
, EventLevel level
= EventLevel::Information
);
35 CBaseEvent(const std::string
& identifier
, const CVariant
& label
, const CVariant
& description
, const std::string
& icon
, EventLevel level
= EventLevel::Information
);
36 CBaseEvent(const std::string
& identifier
, const CVariant
& label
, const CVariant
& description
, const std::string
& icon
, const CVariant
& details
, EventLevel level
= EventLevel::Information
);
37 CBaseEvent(const std::string
& identifier
, const CVariant
& label
, const CVariant
& description
, const std::string
& icon
, const CVariant
& details
, const CVariant
& executionLabel
, EventLevel level
= EventLevel::Information
);
40 std::string m_identifier
;
43 CVariant m_description
;
45 CVariant m_executionLabel
;
48 static std::string
VariantToLocalizedString(const CVariant
& variant
);
49 static uint64_t GetInternalTimestamp();
51 uint64_t m_timestamp
; // high res internal time stamp
52 CDateTime m_dateTime
; // user interface time stamp