[ExecString] combine SplitParameters with identical function of CUtil
[xbmc.git] / xbmc / dialogs / GUIDialogColorPicker.h
blobfba8ebcb467d340f46e14778d825e1ff33456405
1 /*
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.
7 */
9 #pragma once
11 #include "GUIDialogBoxBase.h"
12 #include "view/GUIViewControl.h"
14 #include <string>
16 class CFileItem;
17 class CFileItemList;
19 class CGUIDialogColorPicker : public CGUIDialogBoxBase
21 public:
22 CGUIDialogColorPicker();
23 ~CGUIDialogColorPicker() override;
24 bool OnMessage(CGUIMessage& message) override;
25 bool OnBack(int actionID) override;
26 void Reset();
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 */
36 void LoadColors();
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);
48 protected:
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);
57 private:
58 int GetSelectedItem() const;
60 CGUIViewControl m_viewControl;
61 CFileItemList* m_vecList;
62 bool m_focusToButton = false;
63 std::string m_selectedColor;