Debian Codegraph @

xbmc/guilib/guiinfo/LibraryGUIInfo.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2012-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/guiinfo/GUIInfoProvider.h"
12
13 #include <string>
14 #include <utility>
15 #include <vector>
16
17 namespace KODI
18 {
19 namespace GUILIB
20 {
21 namespace GUIINFO
22 {
23
24 class CGUIInfo;
25
26 class CLibraryGUIInfo : public CGUIInfoProvider
27 {
28 public:
29 CLibraryGUIInfo();
30 ~CLibraryGUIInfo() override = default;
31
32 // KODI::GUILIB::GUIINFO::IGUIInfoProvider implementation
33 bool InitCurrentItem(CFileItem *item) override;
34 bool GetLabel(std::string& value, const CFileItem *item, int contextWindow, const CGUIInfo &info, std::string *fallback) const override;
35 bool GetInt(int& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override;
36 bool GetBool(bool& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override;
37
38 bool GetLibraryBool(int condition) const;
39 void SetLibraryBool(int condition, bool value);
40 void ResetLibraryBools();
41
42 private:
43 mutable int m_libraryHasMusic;
44 mutable int m_libraryHasMovies;
45 mutable int m_libraryHasTVShows;
46 mutable int m_libraryHasMusicVideos;
47 mutable int m_libraryHasMovieSets;
48 mutable int m_libraryHasSingles;
49 mutable int m_libraryHasCompilations;
50 mutable int m_libraryHasBoxsets;
51
52 //Count of artists in music library contributing to song by role e.g. composers, conductors etc.
53 //For checking visibility of custom nodes for a role.
54 mutable std::vector<std::pair<std::string, int>> m_libraryRoleCounts;
55 };
56
57 } // namespace GUIINFO
58 } // namespace GUILIB
59 } // namespace KODI