summaryrefslogtreecommitdiffstats
path: root/xbmc/messaging/helpers/DialogOKHelper.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /xbmc/messaging/helpers/DialogOKHelper.h
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/messaging/helpers/DialogOKHelper.h')
-rw-r--r--xbmc/messaging/helpers/DialogOKHelper.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/xbmc/messaging/helpers/DialogOKHelper.h b/xbmc/messaging/helpers/DialogOKHelper.h
new file mode 100644
index 0000000..574bed6
--- /dev/null
+++ b/xbmc/messaging/helpers/DialogOKHelper.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2005-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "utils/Variant.h"
+
+#include <array>
+#include <string>
+
+namespace KODI
+{
+namespace MESSAGING
+{
+namespace HELPERS
+{
+
+/*! \struct DialogOkMessage DialogHelper.h "messaging/helpers/DialogHelper.h"
+ \brief Payload sent for message TMSG_GUI_DIALOG_OK
+
+ \sa ShowOKDialogText
+ \sa ShowOKDialogLines
+*/
+struct DialogOKMessage
+{
+ CVariant heading; //!< Heading to be displayed in the dialog box
+ CVariant text; //!< Body text to be displayed, this is mutually exclusive with lines below
+ std::array<CVariant, 3> lines; //!< Body text to be displayed, specified as three lines. This is mutually exclusive with the text above
+ bool show = true; //!< bool to see if the dialog needs to be shown
+};
+
+/*!
+ \brief This is a helper method to send a threadmessage to update a Ok dialog text
+
+ \param[in] heading The text to display as the dialog box header
+ \param[in] text The text to display in the dialog body
+ \sa ShowOKDialogLines
+ \sa CGUIDialogOK::ShowAndGetInput
+ \sa DialogOKMessage
+*/
+void UpdateOKDialogText(CVariant heading, CVariant text);
+
+/*!
+ \brief This is a helper method to send a threadmessage to open a Ok dialog box
+
+ \param[in] heading The text to display as the dialog box header
+ \param[in] text The text to display in the dialog body
+ \return if it's confirmed
+ \sa UpdateOKDialogLines
+ \sa CGUIDialogOK::ShowAndGetInput
+ \sa DialogOKMessage
+*/
+bool ShowOKDialogText(CVariant heading, CVariant text);
+
+/*!
+ \brief This is a helper method to send a threadmessage to open a OK dialog box
+
+ \param[in] heading The text to display as the dialog box header
+ \param[in] line0 The text to display on the first line
+ \param[in] line1 The text to display on the second line
+ \param[in] line2 The text to display on the third line
+ \return if it's confirmed
+ \sa ShowOKDialogText
+ \sa CGUIDialogOK::ShowAndGetInput
+ \sa DialogOKMessage
+*/
+bool ShowOKDialogLines(CVariant heading, CVariant line0, CVariant line1 = CVariant(),
+ CVariant line2 = CVariant());
+
+}
+}
+}