QEverCloud
Unofficial Evernote Cloud API for Qt
Public Types | Public Member Functions | List of all members
qevercloud::EvernoteOAuthDialog Class Reference

Authorizes your app with the Evernote service by means of OAuth authentication. More...

Inherits QDialog.

Public Types

typedef
EvernoteOAuthWebView::OAuthResult 
OAuthResult
 

Public Member Functions

 EvernoteOAuthDialog (QString consumerKey, QString consumerSecret, QString host=QStringLiteral("www.evernote.com"), QWidget *parent=0)
 Constructs the dialog. More...
 
int exec () Q_DECL_OVERRIDE
 
bool isSucceeded ()
 
QString oauthError ()
 
OAuthResult oauthResult ()
 
void open () Q_DECL_OVERRIDE
 Shows the dialog as a window modal dialog, returning immediately.
 
void setWebViewSizeHint (QSize sizeHint)
 The dialog adjusts its initial size automatically based on the conatined QWebView preffered size. More...
 

Detailed Description

Authorizes your app with the Evernote service by means of OAuth authentication.

Intended usage:

#include <QEverCloudOAuth.h>
OAuthDialog d(myConsumerKey, myConsumerSecret);
if(d.exec() == QDialog::Accepted) {
OAuthDialog::OAuthResult res = d.oauthResult();
// Connect to Evernote
...
} else {
QString errorText = d.oauthError();
// handle an authentication error
...
}

Note that you have to include QEverCloudOAuth.h header.

By deafult EvernoteOAuthDialog 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

qevercloud::EvernoteOAuthDialog::EvernoteOAuthDialog ( QString  consumerKey,
QString  consumerSecret,
QString  host = QStringLiteral("www.evernote.com"),
QWidget *  parent = 0 
)

Constructs the dialog.

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

Member Function Documentation

int qevercloud::EvernoteOAuthDialog::exec ( )
Returns
QDialog::Accepted on a succesful authentication.
bool qevercloud::EvernoteOAuthDialog::isSucceeded ( )
inline
Returns
true in case of a succesful authentication. You probably better chech exec() return value instead.
QString qevercloud::EvernoteOAuthDialog::oauthError ( )
inline
Returns
In case of an authentification error may return some information about the error.
OAuthResult qevercloud::EvernoteOAuthDialog::oauthResult ( )
inline
Returns
the result of a succesful authentication.
void qevercloud::EvernoteOAuthDialog::setWebViewSizeHint ( QSize  sizeHint)
inline

The dialog adjusts its initial size automatically based on the conatined QWebView preffered size.

Use this method to set the size.

Parameters
sizeHintwill be used as the preffered size of the contained QWebView.