QEverCloud 6.1.0
Unofficial Evernote Cloud API for Qt
Loading...
Searching...
No Matches
qevercloud::EvernoteOAuthDialog Class Reference

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

#include <OAuth.h>

Inheritance diagram for qevercloud::EvernoteOAuthDialog:

Public Types

using OAuthResult = EvernoteOAuthWebView::OAuthResult

Public Member Functions

 EvernoteOAuthDialog (QString consumerKey, QString consumerSecret, QString host=QStringLiteral("www.evernote.com"), QWidget *parent=Q_NULLPTR)
virtual ~EvernoteOAuthDialog () override
void setWebViewSizeHint (QSize sizeHint)
bool isSucceeded () const
QString oauthError () const
OAuthResult oauthResult () const
virtual int exec () override
virtual void open () override

Detailed Description

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

Intended usage:

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

Member Typedef Documentation

◆ OAuthResult

Constructor & Destructor Documentation

◆ EvernoteOAuthDialog()

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

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

◆ ~EvernoteOAuthDialog()

virtual qevercloud::EvernoteOAuthDialog::~EvernoteOAuthDialog ( )
overridevirtual

Member Function Documentation

◆ exec()

virtual int qevercloud::EvernoteOAuthDialog::exec ( )
overridevirtual
Returns
QDialog::Accepted on a successful authentication.

◆ isSucceeded()

bool qevercloud::EvernoteOAuthDialog::isSucceeded ( ) const
Returns
true in case of a successful authentication. You probably better check exec() return value instead.

◆ oauthError()

QString qevercloud::EvernoteOAuthDialog::oauthError ( ) const
Returns
In case of an authentification error may return some information about the error.

◆ oauthResult()

OAuthResult qevercloud::EvernoteOAuthDialog::oauthResult ( ) const
Returns
the result of a successful authentication.

◆ open()

virtual void qevercloud::EvernoteOAuthDialog::open ( )
overridevirtual

Shows the dialog as a window modal dialog, returning immediately.

◆ setWebViewSizeHint()

void qevercloud::EvernoteOAuthDialog::setWebViewSizeHint ( QSize sizeHint)

The dialog adjusts its initial size automatically based on the contained QWebView preffered size. Use this method to set the size.

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