Audacity 3.2.0
ImportExportPrefs.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ImportExportPrefs.h
6
7 Joshua Haberman
8 Dominic Mazzoni
9 James Crook
10
11**********************************************************************/
12
13#ifndef __AUDACITY_IMPORT_EXPORT_PREFS__
14#define __AUDACITY_IMPORT_EXPORT_PREFS__
15
16#include <wx/defs.h>
17
18#include "PrefsPanel.h"
19
20class ShuttleGui;
21
22#define IMPORT_EXPORT_PREFS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("IMPORT EXPORT") }
23
24template< typename Enum > class EnumSetting;
25
26class AUDACITY_DLL_API ImportExportPrefs final : public PrefsPanel
27{
28 struct PopulatorItem;
29 public:
30
32 using Populator = std::function<void(ShuttleGui&)>;
33
36 struct AUDACITY_DLL_API RegisteredControls
37 : public Registry::RegisteredItem<PopulatorItem>
38 {
39 // Whether any controls have been registered
40 static bool Any();
41
42 RegisteredControls(const Identifier &id, Populator populator,
43 const Registry::Placement &placement = { wxEmptyString, {} });
44
45 struct AUDACITY_DLL_API Init{ Init(); };
46 };
47
49
50 ImportExportPrefs(wxWindow * parent, wxWindowID winid);
52 ComponentInterfaceSymbol GetSymbol() const override;
53 TranslatableString GetDescription() const override;
54
55 bool Commit() override;
56 ManualPageID HelpPageName() override;
57 void PopulateOrExchange(ShuttleGui & S) override;
58
59 private:
62 };
63 struct AUDACITY_DLL_API PopulatorItem final : Registry::SingleItem {
65
66 PopulatorItem(const Identifier &id, Populator populator);
67
69 };
70 void Populate();
71};
72
73// Guarantees registry exists before attempts to use it
76
77#endif
static ImportExportPrefs::RegisteredControls::Init sInitRegisteredImpExpControls
#define S(N)
Definition: ToChars.cpp:64
virtual ComponentInterfaceSymbol GetSymbol() const =0
virtual TranslatableString GetDescription() const =0
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Adapts EnumSettingBase to a particular enumeration type.
Definition: Prefs.h:514
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
A PrefsPanel used to select import and export options.
static EnumSetting< bool > MusicFileImportSetting
std::function< void(ShuttleGui &)> Populator
Type of function that adds to the Import/Export preference page.
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
virtual ManualPageID HelpPageName()
If not empty string, the Help button is added below the panel.
Definition: PrefsPanel.cpp:60
virtual bool Commit()=0
virtual void PopulateOrExchange(ShuttleGui &WXUNUSED(S))
Definition: PrefsPanel.h:120
Generates classes whose instances register items at construction.
Definition: Registry.h:388
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Holds a msgid for the translation catalog; may also bind format arguments.
Common abstract base class for items that are not groups.
Definition: Registry.h:224
Primary template for a list of arbitrary types.
Definition: TypeList.h:61