QEverCloud  6.1.0
Unofficial Evernote Cloud API for Qt
Classes | Signals | Public Member Functions | List of all members
qevercloud::EvernoteOAuthWebView Class Reference

The class is tailored specifically for OAuth authorization with Evernote. More...

#include <OAuth.h>

Inheritance diagram for qevercloud::EvernoteOAuthWebView:

Classes

struct  OAuthResult
 

Signals

void authenticationFinished (bool success)
 
void authenticationSuceeded ()
 
void authenticationFailed ()
 

Public Member Functions

 EvernoteOAuthWebView (QWidget *parent=Q_NULLPTR)
 
void authenticate (QString host, QString consumerKey, QString consumerSecret, const qint64 timeoutMsec=30000)
 
bool isSucceeded () const
 
QString oauthError () const
 
OAuthResult oauthResult () const
 
void setSizeHint (QSize sizeHint)
 
virtual QSize sizeHint () const override
 

Detailed Description

The class is tailored specifically for OAuth authorization with Evernote.

While it is functional by itself you probably will prefer to use EvernoteOAuthDialog.

Note that you have to include QEverCloudOAuth.h header.

By default EvernoteOAuthWebView uses qrand() for generating nonce so do not forget to call qsrand() in your application. See setNonceGenerator If you want more control over nonce generation.

Constructor & Destructor Documentation

◆ EvernoteOAuthWebView()

qevercloud::EvernoteOAuthWebView::EvernoteOAuthWebView ( QWidget *  parent = Q_NULLPTR)

Member Function Documentation

◆ authenticate()

void qevercloud::EvernoteOAuthWebView::authenticate ( QString  host,
QString  consumerKey,
QString  consumerSecret,
const qint64  timeoutMsec = 30000 
)

This function starts the OAuth sequence. In the end of the sequence will be emitted one of the signals: authenticationSuceeded or authenticationFailed.

Do not call the function while its call is in effect, i.e. one of the signals is not emitted.

Parameters
hostEvernote host to authorize with. You need one of this:
  • "www.evernote.com" - the production service. It's the default value.
  • "sandox.evernote.com" - the developers "sandbox" service
consumerKeyget it from the Evernote
consumerSecretalong with this
timeoutMsecTimeout for network requests in milliseconds

◆ authenticationFailed

void qevercloud::EvernoteOAuthWebView::authenticationFailed ( )
signal

Emitted when the OAuth sequence is finished with a failure. Some error info may be available with errorText().

◆ authenticationFinished

void qevercloud::EvernoteOAuthWebView::authenticationFinished ( bool  success)
signal

Emitted when the OAuth sequence started with authenticate() call is finished

◆ authenticationSuceeded

void qevercloud::EvernoteOAuthWebView::authenticationSuceeded ( )
signal

Emitted when the OAuth sequence is successfully finished. Call oauthResult() to get the data.

◆ isSucceeded()

bool qevercloud::EvernoteOAuthWebView::isSucceeded ( ) const
Returns
true if the last call to authenticate resulted in a successful authentication.

◆ oauthError()

QString qevercloud::EvernoteOAuthWebView::oauthError ( ) const
Returns
error message resulted from the last call to authenticate

◆ oauthResult()

OAuthResult qevercloud::EvernoteOAuthWebView::oauthResult ( ) const
Returns
the result of the last authentication, i.e. authenticate() call.

◆ setSizeHint()

void qevercloud::EvernoteOAuthWebView::setSizeHint ( QSize  sizeHint)

The method is useful to specify default size for a EverOAuthWebView.

◆ sizeHint()

virtual QSize qevercloud::EvernoteOAuthWebView::sizeHint ( ) const
overridevirtual