2 * Copyright (C) 2017-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 "GUIControl.h"
13 class CGUIControlLookup
: public CGUIControl
16 CGUIControlLookup() = default;
17 CGUIControlLookup(int parentID
, int controlID
, float posX
, float posY
, float width
, float height
)
18 : CGUIControl(parentID
, controlID
, posX
, posY
, width
, height
) {}
19 explicit CGUIControlLookup(const CGUIControlLookup
& from
);
20 ~CGUIControlLookup(void) override
= default;
22 CGUIControl
*GetControl(int id
, std::vector
<CGUIControl
*> *idCollector
= nullptr) override
;
24 typedef std::multimap
<int, CGUIControl
*> LookupMap
;
27 \brief Check whether a given control is valid
28 Runs through controls and returns whether this control is valid. Only functional
29 for controls with non-zero id.
30 \param control to check
31 \return true if the control is valid, false otherwise.
33 bool IsValidControl(const CGUIControl
*control
) const;
34 std::pair
<LookupMap::const_iterator
, LookupMap::const_iterator
> GetLookupControls(int controlId
) const
36 return m_lookup
.equal_range(controlId
);
40 void AddLookup(CGUIControl
*control
);
41 void RemoveLookup(CGUIControl
*control
);
43 const LookupMap
&GetLookup() const { return m_lookup
; }
44 void ClearLookup() { m_lookup
.clear(); }