2 * Copyright (C) 2005-2021 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 "GUIDialogBoxBase.h"
12 #include "view/GUIViewControl.h"
19 class CGUIDialogColorPicker
: public CGUIDialogBoxBase
22 CGUIDialogColorPicker();
23 ~CGUIDialogColorPicker() override
;
24 bool OnMessage(CGUIMessage
& message
) override
;
25 bool OnBack(int actionID
) override
;
27 /*! \brief Add a color item (Label property must be the color name, Label2 property must be the color hex)
28 \param item The CFileItem
30 void AddItem(const CFileItem
& item
);
31 /*! \brief Set a list of color items (Label property must be the color name, Label2 property must be the color hex)
32 \param pList The CFileItemList
34 void SetItems(const CFileItemList
& pList
);
35 /*! \brief Load a list of colors from the default xml */
37 /*! \brief Load a list of colors from the specified xml file path
38 \param filePath The xml file path
40 void LoadColors(const std::string
& filePath
);
41 /*! \brief Get the hex value of the selected color */
42 std::string
GetSelectedColor() const;
43 /*! \brief Set the selected color by hex value */
44 void SetSelectedColor(const std::string
& hexColor
);
45 /*! \brief Set the focus to the control button */
46 void SetButtonFocus(bool buttonFocus
);
49 CGUIControl
* GetFirstFocusableControl(int id
) override
;
50 void OnWindowLoaded() override
;
51 void OnInitWindow() override
;
52 void OnDeinitWindow(int nextWindowID
) override
;
53 void OnWindowUnload() override
;
55 virtual void OnSelect(int idx
);
58 int GetSelectedItem() const;
60 CGUIViewControl m_viewControl
;
61 CFileItemList
* m_vecList
;
62 bool m_focusToButton
= false;
63 std::string m_selectedColor
;