[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / dialogs / GUIDialogYesNo.h
blobfb8ff5f506f6efbbced68095e1a1d6180072b6d9
1 /*
2 * Copyright (C) 2005-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.
7 */
9 #pragma once
11 #include "GUIDialogBoxBase.h"
12 #include "utils/Variant.h"
14 namespace KODI
16 namespace MESSAGING
18 namespace HELPERS
20 struct DialogYesNoMessage;
25 class CGUIDialogYesNo :
26 public CGUIDialogBoxBase
28 public:
29 explicit CGUIDialogYesNo(int overrideId = -1);
30 ~CGUIDialogYesNo(void) override;
31 bool OnMessage(CGUIMessage& message) override;
32 bool OnBack(int actionID) override;
34 void Reset();
36 enum DialogResult
38 DIALOG_RESULT_CANCEL = -1,
39 DIALOG_RESULT_NO = 0,
40 DIALOG_RESULT_YES = 1,
41 DIALOG_RESULT_CUSTOM = 2,
44 DialogResult GetResult() const;
46 enum TimeOut
48 NO_TIMEOUT = 0
51 /*! \brief Show a yes-no dialog, then wait for user to dismiss it.
52 \param heading Localized label id or string for the heading of the dialog
53 \param line0 Localized label id or string for line 1 of the dialog message
54 \param line1 Localized label id or string for line 2 of the dialog message
55 \param line2 Localized label id or string for line 3 of the dialog message
56 \param bCanceled Holds true if the dialog was canceled otherwise false
57 \return true if user selects Yes, otherwise false if user selects No.
59 static bool ShowAndGetInput(const CVariant& heading,
60 const CVariant& line0,
61 const CVariant& line1,
62 const CVariant& line2,
63 bool& bCanceled);
65 /*! \brief Show a yes-no dialog, then wait for user to dismiss it.
66 \param heading Localized label id or string for the heading of the dialog
67 \param line0 Localized label id or string for line 1 of the dialog message
68 \param line1 Localized label id or string for line 2 of the dialog message
69 \param line2 Localized label id or string for line 3 of the dialog message
70 \param iNoLabel Localized label id or string for the no button
71 \param iYesLabel Localized label id or string for the yes button
72 \return true if user selects Yes, otherwise false if user selects No.
74 static bool ShowAndGetInput(const CVariant& heading,
75 const CVariant& line0,
76 const CVariant& line1,
77 const CVariant& line2,
78 const CVariant& noLabel = "",
79 const CVariant& yesLabel = "");
81 /*! \brief Show a yes-no dialog, then wait for user to dismiss it.
82 \param heading Localized label id or string for the heading of the dialog
83 \param line0 Localized label id or string for line 1 of the dialog message
84 \param line1 Localized label id or string for line 2 of the dialog message
85 \param line2 Localized label id or string for line 3 of the dialog message
86 \param bCanceled Holds true if the dialog was canceled otherwise false
87 \param iNoLabel Localized label id or string for the no button
88 \param iYesLabel Localized label id or string for the yes button
89 \param autoCloseTime Time in ms before the dialog becomes automatically closed
90 \return true if user selects Yes, otherwise false if user selects No.
92 static bool ShowAndGetInput(const CVariant& heading,
93 const CVariant& line0,
94 const CVariant& line1,
95 const CVariant& line2,
96 bool& bCanceled,
97 const CVariant& noLabel,
98 const CVariant& yesLabel,
99 unsigned int autoCloseTime);
101 /*! \brief Show a yes-no dialog, then wait for user to dismiss it.
102 \param heading Localized label id or string for the heading of the dialog
103 \param text Localized label id or string for the dialog message
104 \return true if user selects Yes, otherwise false if user selects No.
106 static bool ShowAndGetInput(const CVariant& heading, const CVariant& text);
108 /*! \brief Show a yes-no dialog, then wait for user to dismiss it.
109 \param heading Localized label id or string for the heading of the dialog
110 \param text Localized label id or string for the dialog message
111 \param bCanceled Holds true if the dialog was canceled otherwise false
112 \param iNoLabel Localized label id or string for the no button
113 \param iYesLabel Localized label id or string for the yes button
114 \param autoCloseTime Time in ms before the dialog becomes automatically closed
115 \param defaultButtonId Specifies the default focused button
116 \return true if user selects Yes, otherwise false if user selects No.
118 static bool ShowAndGetInput(const CVariant& heading,
119 const CVariant& text,
120 bool& bCanceled,
121 const CVariant& noLabel,
122 const CVariant& yesLabel,
123 unsigned int autoCloseTime,
124 int defaultButtonId = CONTROL_NO_BUTTON);
126 /*! \brief Show a yes-no dialog with 3rd custom button, then wait for user to dismiss it.
127 \param heading Localized label id or string for the heading of the dialog
128 \param text Localized label id or string for the dialog message
129 \param noLabel Localized label id or string for the no button
130 \param yesLabel Localized label id or string for the yes button
131 \param customLabel Localized label id or string for the custom button
132 \param autoCloseTime Time in ms before the dialog becomes automatically closed
133 \param defaultButtonId Specifies the default focused button
134 \return action that closed the dialog
136 static DialogResult ShowAndGetInput(const CVariant& heading,
137 const CVariant& text,
138 const CVariant& noLabel,
139 const CVariant& yesLabel,
140 const CVariant& customLabel,
141 unsigned int autoCloseTime,
142 int defaultButtonId = CONTROL_NO_BUTTON);
145 \brief Open a Yes/No dialog and wait for input
147 \param[in] options a struct of type DialogYesNoMessage containing
148 the options to set for this dialog.
150 \returns action that closed the dialog
151 \sa KODI::MESSAGING::HELPERS::DialogYesNoMessage
153 DialogResult ShowAndGetInput(const KODI::MESSAGING::HELPERS::DialogYesNoMessage& options);
155 protected:
156 void OnInitWindow() override;
157 int GetDefaultLabelID(int controlId) const override;
159 bool m_bCanceled;
160 bool m_bCustom;
161 int m_defaultButtonId;