| 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 "utils/Variant.h" |
| 12 |
|
| 13 |
#include <array> |
| 14 |
#include <string> |
| 15 |
|
| 16 |
namespace KODI |
| 17 |
{ |
| 18 |
namespace MESSAGING |
| 19 |
{ |
| 20 |
namespace HELPERS |
| 21 |
{ |
| 22 |
|
| 23 |
/*! \struct DialogOkMessage DialogHelper.h "messaging/helpers/DialogHelper.h" |
| 24 |
\brief Payload sent for message TMSG_GUI_DIALOG_OK |
| 25 |
|
| 26 |
\sa ShowOKDialogText |
| 27 |
\sa ShowOKDialogLines |
| 28 |
*/ |
| 29 |
struct DialogOKMessage |
| 30 |
{ |
| 31 |
CVariant heading; //!< Heading to be displayed in the dialog box |
| 32 |
CVariant text; //!< Body text to be displayed, this is mutually exclusive with lines below |
| 33 |
std::array<CVariant, 3> lines; //!< Body text to be displayed, specified as three lines. This is mutually exclusive with the text above |
| 34 |
bool show = true; //!< bool to see if the dialog needs to be shown |
| 35 |
}; |
| 36 |
|
| 37 |
/*! |
| 38 |
\brief This is a helper method to send a threadmessage to update a Ok dialog text |
| 39 |
|
| 40 |
\param[in] heading The text to display as the dialog box header |
| 41 |
\param[in] text The text to display in the dialog body |
| 42 |
\sa ShowOKDialogLines |
| 43 |
\sa CGUIDialogOK::ShowAndGetInput |
| 44 |
\sa DialogOKMessage |
| 45 |
*/ |
| 46 |
void UpdateOKDialogText(CVariant heading, CVariant text); |
| 47 |
|
| 48 |
/*! |
| 49 |
\brief This is a helper method to send a threadmessage to open a Ok dialog box |
| 50 |
|
| 51 |
\param[in] heading The text to display as the dialog box header |
| 52 |
\param[in] text The text to display in the dialog body |
| 53 |
\return if it's confirmed |
| 54 |
\sa UpdateOKDialogLines |
| 55 |
\sa CGUIDialogOK::ShowAndGetInput |
| 56 |
\sa DialogOKMessage |
| 57 |
*/ |
| 58 |
bool ShowOKDialogText(CVariant heading, CVariant text); |
| 59 |
|
| 60 |
/*! |
| 61 |
\brief This is a helper method to send a threadmessage to open a OK dialog box |
| 62 |
|
| 63 |
\param[in] heading The text to display as the dialog box header |
| 64 |
\param[in] line0 The text to display on the first line |
| 65 |
\param[in] line1 The text to display on the second line |
| 66 |
\param[in] line2 The text to display on the third line |
| 67 |
\return if it's confirmed |
| 68 |
\sa ShowOKDialogText |
| 69 |
\sa CGUIDialogOK::ShowAndGetInput |
| 70 |
\sa DialogOKMessage |
| 71 |
*/ |
| 72 |
bool ShowOKDialogLines(CVariant heading, CVariant line0, CVariant line1 = CVariant(), |
| 73 |
CVariant line2 = CVariant()); |
| 74 |
|
| 75 |
} |
| 76 |
} |
| 77 |
} |