PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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