#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2023 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_PLATFORM_INTERACTION_EXTENDEDMESSAGESERVICE_H #define NUCLEX_PLATFORM_INTERACTION_EXTENDEDMESSAGESERVICE_H #include "Nuclex/Platform/Config.h" #include "Nuclex/Platform/Interaction/MessageService.h" #include // for std::initializer_list #include // for std::chrono::milliseconds namespace Nuclex { namespace Platform { namespace Interaction { // ------------------------------------------------------------------------------------------- // /// Allows multiple choice dialogs to be displayed for user interaction class NUCLEX_PLATFORM_TYPE ExtendedMessageService : MessageService { /// Frees all resources owned by the instance public: NUCLEX_PLATFORM_API virtual ~ExtendedMessageService() override = default; /// Requires the user to choose between a set of options /// Topic of the question (normally used as the window title) /// Basic question being asked (normally written in bold) /// Message text elaborating the question and choices /// Choices that are available for the user /// The index of the choice that the user has made public: virtual std::optional GiveChoices( const std::string &topic, const std::string &heading, const std::string &message, const std::initializer_list &choices ) = 0; /// Requests confirmation from the user for a dangerous action /// Topic of the question (normally used as the window title) /// Basic question being asked (normally written in bold) /// Message text elaborating what will happen /// /// Time for which the 'Ok' button will remain disabled after the dialog is displayed /// /// True if the user gave confirmation, false otherwise public: virtual bool RequestConfirmation( const std::string &topic, const std::string &heading, const std::string &message, std::chrono::milliseconds buttonEnableDelay = std::chrono::milliseconds(2000) ) = 0; /// Offers the user a chance to cancel an action for a limited time /// Topic of the action (normally used as the window title) /// Thing that can be cancelled (normally written in bold) /// Message text elaborating what will happen /// /// Time after which the dialog will automatically be confirmed /// /// True if the user gave confirmation, false otherwise public: virtual bool OfferCancellation( const std::string &topic, const std::string &heading, const std::string &message, std::chrono::milliseconds autoAcceptDelay = std::chrono::milliseconds(5000) ) = 0; }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Platform::Interaction #endif // NUCLEX_PLATFORM_INTERACTION_MESSAGESERVICE_H // Support native platform MessageBox // Support task bar notification // Support command line output