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 "wxPanelWrapper.h"
14#include "Observer.h"
15
16class wxStaticText;
17class wxButton;
18
20{
21class ServiceConfig;
22class OAuthService;
23class UserService;
24class UserImage;
25
27{
29};
30
31class UserPanel final
32 : public wxPanelWrapper
33 , public Observer::Publisher<UserPanelStateChangedMessage>
34{
35public:
37 const ServiceConfig& serviceConfig,
38 OAuthService& authService, UserService& userService,
39 bool hasLinkButton, wxWindow* parent = nullptr,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize);
42
43 ~UserPanel() override;
44
45 bool IsAuthorized() const;
46
47private:
48 void OnStateChaged(bool isAuthorized);
49 void UpdateUserData();
51 void SetAnonymousState();
52
56
58 wxStaticText* mUserName {};
59 wxButton* mLinkButton {};
60
62
63 bool mIsAuthorized { false };
64}; // class UserPanel
65
66} // namespace audacity::cloud::audiocom
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:40
Configuration for the audio.com.
Definition: ServiceConfig.h:23
void OnStateChaged(bool isAuthorized)
Definition: UserPanel.cpp:89
const ServiceConfig & mServiceConfig
Definition: UserPanel.h:53
Observer::Subscription mUserDataChangedSubscription
Definition: UserPanel.h:61
UserPanel(const ServiceConfig &serviceConfig, OAuthService &authService, UserService &userService, bool hasLinkButton, wxWindow *parent=nullptr, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
Definition: UserPanel.cpp:50
Service for providing information about the user profile.
Definition: UserService.h:28