kodi
IGUIContainer.h
1 /*
2  * Copyright (C) 2005-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 "GUIControl.h"
12 
13 #include <memory>
14 
20 class IGUIContainer : public CGUIControl
21 {
22 protected:
23  VIEW_TYPE m_type = VIEW_TYPE_NONE;
24  std::string m_label;
25 public:
26  IGUIContainer(int parentID, int controlID, float posX, float posY, float width, float height)
27  : CGUIControl(parentID, controlID, posX, posY, width, height)
28  {
29  }
30 
31  bool IsContainer() const override { return true; }
32 
33  VIEW_TYPE GetType() const { return m_type; }
34  const std::string& GetLabel() const { return m_label; }
35  void SetType(VIEW_TYPE type, const std::string &label)
36  {
37  m_type = type;
38  m_label = label;
39  }
40 
41  virtual std::shared_ptr<CGUIListItem> GetListItem(int offset, unsigned int flag = 0) const = 0;
42  virtual std::string GetLabel(int info) const = 0;
43 };
Base class for controls.
Definition: GUIControl.h:83
Definition: IGUIContainer.h:20