Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
audacity::cloud::audiocom::AuthorizationHandler Class Referencefinal

#include <AuthorizationHandler.h>

Collaboration diagram for audacity::cloud::audiocom::AuthorizationHandler:
[legend]

Public Member Functions

 AuthorizationHandler ()
 
void PushSuppressDialogs ()
 
void PopSuppressDialogs ()
 

Private Member Functions

void OnAuthStateChanged (const AuthStateChangedMessage &message)
 

Private Attributes

Observer::Subscription mAuthStateChangedSubscription
 
size_t mSuppressed {}
 

Detailed Description

Definition at line 25 of file AuthorizationHandler.h.

Constructor & Destructor Documentation

◆ AuthorizationHandler()

audacity::cloud::audiocom::AuthorizationHandler::AuthorizationHandler ( )

Definition at line 137 of file AuthorizationHandler.cpp.

139 [this](const auto& message) { OnAuthStateChanged(message); }))
140{
141}
void OnAuthStateChanged(const AuthStateChangedMessage &message)
OAuthService & GetOAuthService()
Returns the instance of the OAuthService.

References OnAuthStateChanged().

Here is the call graph for this function:

Member Function Documentation

◆ OnAuthStateChanged()

void audacity::cloud::audiocom::AuthorizationHandler::OnAuthStateChanged ( const AuthStateChangedMessage message)
private

Definition at line 156 of file AuthorizationHandler.cpp.

158{
159 if (mSuppressed > 0 || message.silent)
160 return;
161
162 if (!message.errorMessage.empty())
163 {
164 LinkFailedDialog dialog { nullptr, message.trace };
165 dialog.ShowModal();
166 }
167 else if (message.authorised)
168 {
169 LinkSucceededDialog dialog { nullptr };
170 dialog.ShowModal();
171 }
172}

References audacity::cloud::audiocom::AuthStateChangedMessage::authorised, audacity::cloud::audiocom::AuthStateChangedMessage::errorMessage, mSuppressed, audacity::cloud::audiocom::AuthStateChangedMessage::silent, and audacity::cloud::audiocom::AuthStateChangedMessage::trace.

Referenced by AuthorizationHandler().

Here is the caller graph for this function:

◆ PopSuppressDialogs()

void audacity::cloud::audiocom::AuthorizationHandler::PopSuppressDialogs ( )

Definition at line 148 of file AuthorizationHandler.cpp.

149{
150 assert(mSuppressed > 0);
151
152 if (mSuppressed > 0)
153 --mSuppressed;
154}

References mSuppressed.

Referenced by audacity::cloud::audiocom::PerformBlockingAuth(), audacity::cloud::audiocom::sync::CloudProjectPropertiesDialog::~CloudProjectPropertiesDialog(), audacity::cloud::audiocom::LinkWithTokenDialog::~LinkWithTokenDialog(), and audacity::cloud::audiocom::ShareAudioDialog::~ShareAudioDialog().

Here is the caller graph for this function:

◆ PushSuppressDialogs()

void audacity::cloud::audiocom::AuthorizationHandler::PushSuppressDialogs ( )

Definition at line 143 of file AuthorizationHandler.cpp.

144{
145 ++mSuppressed;
146}

References mSuppressed.

Referenced by audacity::cloud::audiocom::sync::CloudProjectPropertiesDialog::CloudProjectPropertiesDialog(), and audacity::cloud::audiocom::PerformBlockingAuth().

Here is the caller graph for this function:

Member Data Documentation

◆ mAuthStateChangedSubscription

Observer::Subscription audacity::cloud::audiocom::AuthorizationHandler::mAuthStateChangedSubscription
private

Definition at line 36 of file AuthorizationHandler.h.

◆ mSuppressed

size_t audacity::cloud::audiocom::AuthorizationHandler::mSuppressed {}
private

The documentation for this class was generated from the following files: