Audacity  3.0.3
Classes | Namespaces | Functions
BasicUI.h File Reference

Toolkit-neutral facade for basic user interface services. More...

#include <functional>
#include <memory>
#include "Identifier.h"
#include "Internat.h"
Include dependency graph for BasicUI.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  BasicUI::WindowPlacement
 Subclasses may hold information such as a parent window pointer for a dialog. More...
struct  BasicUI::ErrorDialogOptions
 Options for variations of error dialogs; the default is for modal dialogs. More...
struct  BasicUI::MessageBoxOptions
class  BasicUI::ProgressDialog
 Abstraction of a progress dialog with well defined time-to-completion estimate. More...
class  BasicUI::GenericProgressDialog
 Abstraction of a progress dialog with undefined time-to-completion estimate. More...
class  BasicUI::Services
 Abstract class defines a few user interface services, not mentioning particular toolkits. More...




Services * BasicUI::Get ()
 Fetch the global instance, or nullptr if none is yet installed. More...
Services * BasicUI::Install (Services *pInstance)
 Install an implementation; return the previously installed instance. More...
Functions that invoke global Services

These dispatch to the global Services, if supplied. If none was supplied, they are mostly no-ops, with exceptions as noted. All should be called on the main thread only, except as noted.

void BasicUI::CallAfter (Action action)
 Schedule an action to be done later, and in the main thread. More...
void BasicUI::Yield ()
 Dispatch waiting events, including actions enqueued by CallAfter. More...
void BasicUI::ShowErrorDialog (const WindowPlacement &placement, const TranslatableString &dlogTitle, const TranslatableString &message, const ManualPageID &helpPage, const ErrorDialogOptions &options={})
 Show an error dialog with a link to the manual for further help. More...
MessageBoxResult BasicUI::ShowMessageBox (const TranslatableString &message, MessageBoxOptions options={})
 Show a modal message box with either Ok or Yes and No, and optionally Cancel. More...
std::unique_ptr< ProgressDialogBasicUI::MakeProgress (const TranslatableString &title, const TranslatableString &message, unsigned flags=(ProgressShowStop|ProgressShowCancel), const TranslatableString &remainingLabelText={})
 Create and display a progress dialog. More...
std::unique_ptr< GenericProgressDialog > BasicUI::MakeGenericProgress (const WindowPlacement &placement, const TranslatableString &title, const TranslatableString &message)
 Create and display a progress dialog (return nullptr if Services not installed) More...

Types used in the Services interface

enum  BasicUI::ErrorDialogType { BasicUI::ErrorDialogType::ModelessError, BasicUI::ErrorDialogType::ModalError, BasicUI::ErrorDialogType::ModalErrorReport }
enum  BasicUI::Icon {
  BasicUI::Icon::None, BasicUI::Icon::Warning, BasicUI::Icon::Error, BasicUI::Icon::Question,
enum  BasicUI::Button { BasicUI::Button::Default, BasicUI::Button::Ok, BasicUI::Button::YesNo }
enum  BasicUI::MessageBoxResult : int {
  BasicUI::MessageBoxResult::None, BasicUI::MessageBoxResult::Yes, BasicUI::MessageBoxResult::No, BasicUI::MessageBoxResult::Ok,
enum  BasicUI::ProgressDialogOptions : unsigned { BasicUI::ProgressShowStop = (1 << 0), BasicUI::ProgressShowCancel = (1 << 1), BasicUI::ProgressHideTime = (1 << 2), BasicUI::ProgressConfirmStopOrCancel = (1 << 3) }
enum  BasicUI::ProgressResult : unsigned { BasicUI::ProgressResult::Cancelled = 0, BasicUI::ProgressResult::Success, BasicUI::ProgressResult::Failed, BasicUI::ProgressResult::Stopped }
using BasicUI::Action = std::function< void()>
TranslatableString BasicUI::DefaultCaption ()
 "Message", suitably translated More...

Detailed Description

Toolkit-neutral facade for basic user interface services.

Audacity: A Digital Audio Editor

Paul Licameli

Definition in file BasicUI.h.