Audacity 3.2.0
LoginDialog.h
Go to the documentation of this file.
1#pragma once
2#include "Observer.h"
3#include "wxPanelWrapper.h"
4
6{
7 struct AuthStateChangedMessage;
8}
9
10class wxHyperlinkEvent;
11class wxTextCtrl;
12
13class LoginDialog final : public wxDialogWrapper
14{
15public:
16
17 enum class Mode
18 {
19 Create,
20 SignIn,
21 };
22
23 static bool SignIn(wxWindow* parent, Mode mode = Mode::SignIn);
24
25private:
26
27 LoginDialog(wxWindow* parent, wxWindowID id = wxID_ANY, Mode mode = Mode::SignIn);
28
29 void LayoutControls();
30
31 void OnSignIn(wxHyperlinkEvent&);
32 void OnCreateAccount(wxHyperlinkEvent&);
33 void OnContinue(wxCommandEvent&);
34 void OnContinueWithGoogle(wxCommandEvent&);
35 void OnContinueWithFacebook(wxCommandEvent&);
36 void onUserCredentialsChange(wxCommandEvent&);
37
39 void ContinueSignIn();
40
42
43 static void ContinueAuthorize(std::string_view authClientId);
44
45 const Mode mMode;
46 wxTextCtrl* mEmail{};
47 wxTextCtrl* mPassword{};
48 wxButton* mContinue{};
49
51
52 DECLARE_EVENT_TABLE()
53};
Observer::Subscription mOAuthStateSubscription
Definition: LoginDialog.h:50
wxTextCtrl * mPassword
Definition: LoginDialog.h:47
void OnContinue(wxCommandEvent &)
void LayoutControls()
void OnContinueWithFacebook(wxCommandEvent &)
void OnContinueWithGoogle(wxCommandEvent &)
void onUserCredentialsChange(wxCommandEvent &)
void OnSignIn(wxHyperlinkEvent &)
const Mode mMode
Definition: LoginDialog.h:45
void ContinueCreateAccount()
wxButton * mContinue
Definition: LoginDialog.h:48
void OnOAuthStateChanged(audacity::cloud::audiocom::AuthStateChangedMessage)
void OnCreateAccount(wxHyperlinkEvent &)
static void ContinueAuthorize(std::string_view authClientId)
LoginDialog(wxWindow *parent, wxWindowID id=wxID_ANY, Mode mode=Mode::SignIn)
Definition: LoginDialog.cpp:97
static bool SignIn(wxWindow *parent, Mode mode=Mode::SignIn)
wxTextCtrl * mEmail
Definition: LoginDialog.h:46
void ContinueSignIn()
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
bool Create(wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
Message that is sent when authorization state changes.
Definition: OAuthService.h:29