Audacity 3.2.0
UserPanel.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 UserPanel.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11#pragma once
12
13#include "NetworkUtils.h"
14#include "Observer.h"
15#include "wxPanelWrapper.h"
16
17class wxStaticText;
18class wxButton;
19enum class AudiocomTrace;
20
22{
23class ServiceConfig;
24class OAuthService;
25class UserService;
26class UserImage;
27
29{
31};
32
33class UserPanel final
34 : public wxPanelWrapper
35 , public Observer::Publisher<UserPanelStateChangedMessage>
36{
37public:
39 const ServiceConfig& serviceConfig, OAuthService& authService,
40 UserService& userService, bool hasLinkButton, AudiocomTrace,
41 wxWindow* parent = nullptr, const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize);
43
44 ~UserPanel() override;
45
46 bool IsAuthorized() const;
47
48private:
49 void OnStateChaged(bool isAuthorized);
50 void UpdateUserData();
52 void SetAnonymousState();
53
58
60 wxStaticText* mUserName {};
61 wxButton* mLinkButton {};
62
64
65 bool mIsAuthorized { false };
66}; // class UserPanel
67
68} // namespace audacity::cloud::audiocom
AudiocomTrace
Definition: ExportUtils.h:27
An object that sends messages to an open-ended list of subscribed callbacks.
Definition: Observer.h:108
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
Service responsible for OAuth authentication against the audio.com service.
Definition: OAuthService.h:43
Configuration for the audio.com.
Definition: ServiceConfig.h:25
void OnStateChaged(bool isAuthorized)
Definition: UserPanel.cpp:91
const ServiceConfig & mServiceConfig
Definition: UserPanel.h:54
Observer::Subscription mUserDataChangedSubscription
Definition: UserPanel.h:63
UserPanel(const ServiceConfig &serviceConfig, OAuthService &authService, UserService &userService, bool hasLinkButton, AudiocomTrace, wxWindow *parent=nullptr, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
Definition: UserPanel.cpp:51
const AudiocomTrace mAudiocomTrace
Definition: UserPanel.h:57
Service for providing information about the user profile.
Definition: UserService.h:28