2 * Copyright (C) 2013-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 "IListProvider.h"
12 #include "threads/CriticalSection.h"
17 typedef std::unique_ptr
<IListProvider
> IListProviderPtr
;
22 \ingroup listproviders
23 \brief A listprovider that handles multiple individual providers.
25 class CMultiProvider
: public IListProvider
28 CMultiProvider(const TiXmlNode
*first
, int parentID
);
29 explicit CMultiProvider(const CMultiProvider
& other
);
31 // Implementation of IListProvider
32 std::unique_ptr
<IListProvider
> Clone() override
;
33 bool Update(bool forceRefresh
) override
;
34 void Fetch(std::vector
<std::shared_ptr
<CGUIListItem
>>& items
) override
;
35 bool IsUpdating() const override
;
36 void Reset() override
;
37 bool OnClick(const std::shared_ptr
<CGUIListItem
>& item
) override
;
38 bool OnInfo(const std::shared_ptr
<CGUIListItem
>& item
) override
;
39 bool OnContextMenu(const std::shared_ptr
<CGUIListItem
>& item
) override
;
42 typedef size_t item_key_type
;
43 static item_key_type
GetItemKey(std::shared_ptr
<CGUIListItem
> const& item
);
44 std::vector
<IListProviderPtr
> m_providers
;
45 std::map
<item_key_type
, IListProvider
*> m_itemMap
;
46 CCriticalSection m_section
; // protects m_itemMap