Audacity 3.2.0
AudioComDialogBase.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 AudioComDialogBase.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11#pragma once
12
13#include <functional>
14#include <string>
15#include <vector>
16
17#include "Identifier.h"
18#include "TranslatableString.h"
19#include "wxPanelWrapper.h"
20
21class AudacityProject;
22
23class wxBoxSizer;
24
26{
28{
29};
31
33{
34};
36
38{
39public:
41 ShowDialog(std::function<DialogButtonIdentifier()> poller = {});
42
44
45protected:
46 enum class DialogMode
47 {
48 Opening,
49 Saving,
50 };
51
54 const DialogIdentifier& optionalPrefsIdentifier = {},
55 DialogMode dialogMode = DialogMode::Saving);
56
57 virtual ~AudioComDialogBase() = default;
58
60 void AddParagraph(const TranslatableString& paragraph);
61
63 {
64 None = 0,
67 };
68
69 void AddButton(
70 DialogButtonIdentifier identifier, const TranslatableString& text,
71 int type = None);
72
73 void SetDialogTitle(const TranslatableString& dialog);
74
75 virtual bool HasSeparator() const;
76
77 void EndDialog(DialogButtonIdentifier identifier);
78
79private:
82
83 wxBoxSizer* mDialogSizer;
84 wxBoxSizer* mButtonSizer;
85
88}; // class AudioComDialogBase
89
90void ShowDialogOn(
91 std::function<bool()> condition, std::function<void()> dialogFactory);
92} // namespace audacity::cloud::audiocom::sync
static const auto title
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Holds a msgid for the translation catalog; may also bind format arguments.
void AddTitle(const TranslatableString &title)
void AddButton(DialogButtonIdentifier identifier, const TranslatableString &text, int type=None)
DialogButtonIdentifier ShowDialog(std::function< DialogButtonIdentifier()> poller={})
AudioComDialogBase(const AudacityProject *project, const DialogIdentifier &optionalPrefsIdentifier={}, DialogMode dialogMode=DialogMode::Saving)
void AddParagraph(const TranslatableString &paragraph)
void SetDialogTitle(const TranslatableString &dialog)
void EndDialog(DialogButtonIdentifier identifier)
TaggedIdentifier< DialogButtonIdentifierTag > DialogButtonIdentifier
void ShowDialogOn(std::function< bool()> condition, std::function< void()> dialogFactory)