QEverCloud
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...

Inherits QWebView.

Classes

struct  OAuthResult
 Holds data that is returned by Evernote on a succesful authentication. More...
 

Signals

void authenticationFailed ()
 Emitted when the OAuth sequence is finished with a failure. More...
 
void authenticationFinished (bool success)
 Emitted when the OAuth sequence started with authenticate() call is finished.
 
void authenticationSuceeded ()
 Emitted when the OAuth sequence is succesfully finished. More...
 

Public Member Functions

 EvernoteOAuthWebView (QWidget *parent=0)
 
void authenticate (QString host, QString consumerKey, QString consumerSecret)
 This function starts the OAuth sequence. More...
 
bool isSucceeded ()
 
QString oauthError ()
 
OAuthResult oauthResult ()
 
void setSizeHint (QSize sizeHint)
 The method is useful to specify default size for a EverOAuthWebView. More...
 
QSize sizeHint () const
 

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 deafult 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.

Member Function Documentation

void qevercloud::EvernoteOAuthWebView::authenticate ( QString  host,
QString  consumerKey,
QString  consumerSecret 
)

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
void qevercloud::EvernoteOAuthWebView::authenticationFailed ( )
signal

Emitted when the OAuth sequence is finished with a failure.

Some error info may be availabe with errorText().

void qevercloud::EvernoteOAuthWebView::authenticationSuceeded ( )
signal

Emitted when the OAuth sequence is succesfully finished.

Call oauthResult() to get the data.

bool qevercloud::EvernoteOAuthWebView::isSucceeded ( )
inline
Returns
true if the last call to authenticate resulted in a successful authentication.
QString qevercloud::EvernoteOAuthWebView::oauthError ( )
inline
Returns
error message resulted from the last call to authenticate
OAuthResult qevercloud::EvernoteOAuthWebView::oauthResult ( )
inline
Returns
the result of the last authentication, i.e. authenticate() call.
void qevercloud::EvernoteOAuthWebView::setSizeHint ( QSize  sizeHint)

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