/xbmc/dialogs/GUIDialogSlider.h

http://github.com/xbmc/xbmc · C Header · 57 lines · 19 code · 8 blank · 30 comment · 0 complexity · 01afdb043de9b3059f18ce9dc16a3d52 MD5 · raw file

  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. #pragma once
  9. #include "guilib/GUIDialog.h"
  10. #include "guilib/ISliderCallback.h"
  11. class CGUIDialogSlider : public CGUIDialog
  12. {
  13. public:
  14. CGUIDialogSlider();
  15. ~CGUIDialogSlider(void) override;
  16. bool OnMessage(CGUIMessage& message) override;
  17. bool OnAction(const CAction &action) override;
  18. void SetModalityType(DialogModalityType type);
  19. /*! \brief Show the slider dialog and wait for the user to change the value
  20. Shows the slider until the user is happy with the adjusted value. Calls back with each change to the callback function
  21. allowing changes to take place immediately.
  22. \param label description of what is being changed by the slider
  23. \param value start value of the slider
  24. \param min minimal value the slider may take
  25. \param delta amount the slider advances for a single click
  26. \param max maximal value the slider may take
  27. \param callback callback class that implements ISliderCallback::OnSliderChange
  28. \param callbackData pointer to callback-specific data (defaults to NULL)
  29. \sa ISliderCallback, Display
  30. */
  31. static void ShowAndGetInput(const std::string &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData = NULL);
  32. /*! \brief Show the slider dialog as a response to user input
  33. Shows the slider with the given values for a short period of time, used for UI feedback of a set user action.
  34. This function is asynchronous.
  35. \param label id of the description label for the slider
  36. \param value start value of the slider
  37. \param min minimal value the slider may take
  38. \param delta amount the slider advances for a single click
  39. \param max maximal value the slider may take
  40. \param callback callback class that implements ISliderCallback::OnSliderChange
  41. \sa ISliderCallback, ShowAndGetInput
  42. */
  43. static void Display(int label, float value, float min, float delta, float max, ISliderCallback *callback);
  44. protected:
  45. void SetSlider(const std::string &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData);
  46. void OnWindowLoaded() override;
  47. ISliderCallback *m_callback;
  48. void *m_callbackData;
  49. };