EnginioClientConnection Class | Enginio C++ Classes and Examples 1.2

- Enginio Manual
- Enginio C++ Classes and Examples
- EnginioClientConnection
- Enginio 1.2.1 Reference Documentation

# EnginioClientConnection Class

EnginioClientConnection keeps track of the authenticated connection to the server. More...

Header: | #include <EnginioClientConnection>
Since: | Qt 5.3
Inherits: |
Inherited By: | EnginioClient

- List of all members, including inherited members

## Properties

- authenticationState : const Enginio::AuthenticationState
- backendId : QByteArray
- identity : EnginioIdentity *
- serviceUrl : QUrl

## Public Functions

| ~EnginioClientConnection()
Enginio::AuthenticationState | authenticationState() const
QByteArray | backendId() const
EnginioIdentity * | identity() const
QNetworkAccessManager * | networkManager() const
QUrl | serviceUrl() const
void | setBackendId(const QByteArray & backendId)
void | setIdentity(EnginioIdentity * identity)
void | setServiceUrl(const QUrl & serviceUrl)

## Signals

void | authenticationStateChanged(Enginio::AuthenticationState state)
void | backendIdChanged(const QByteArray & backendId)
void | identityChanged(EnginioIdentity * identity)
void | serviceUrlChanged(const QUrl & url)

## Detailed Description

EnginioClientConnection keeps track of the authenticated connection to the server.

You should never use EnginioClientConnection explicitly, instead use the derrived EnginioClient.

See also EnginioClient.

## Property Documentation

### authenticationState : const Enginio::AuthenticationState

This property holds the state of the authentication.

Enginio provides convenient user management. The authentication state reflects whether the current user is authenticated.

Access functions:

Enginio::AuthenticationState | authenticationState() const

Notifier signal:

void | authenticationStateChanged(Enginio::AuthenticationState state)

See also Enginio::AuthenticationState, identity, and EnginioOAuth2Authentication.

### backendId : QByteArray

This property holds the unique ID for the used Enginio backend.

The backend ID determines which Enginio backend is used by this instance of EnginioClient. The backend ID is required for Enginio to work. It is possible to use several Enginio backends simultaneously by having several instances of EnginioClient.

Access functions:

QByteArray | backendId() const
void | setBackendId(const QByteArray & backendId)

Notifier signal:

void | backendIdChanged(const QByteArray & backendId)

### identity : EnginioIdentity *

Property that represents a user. Setting the property will create an asynchronous authentication request, the result of it updates authenticationState EnginioClient does not take ownership of the identity object. The object has to be valid to keep the authenticated session alive. When the identity object is deleted the session is terminated. It is allowed to assign a null pointer to the property to terminate the session.

Access functions:

EnginioIdentity * | identity() const
void | setIdentity(EnginioIdentity * identity)

Notifier signal:

void | identityChanged(EnginioIdentity * identity)

See also EnginioIdentity and EnginioOAuth2Authentication.

### serviceUrl : QUrl

This property holds enginio backend URL.

The API URL determines the server used by Enginio.

Usually it is not needed to change the default URL, but if it has to be changed it should be done as a first operaion on this EnginioClientConnection, otherwise some request may be sent accidentally to the default url.

Access functions:

QUrl | serviceUrl() const
void | setServiceUrl(const QUrl & serviceUrl)

Notifier signal:

void | serviceUrlChanged(const QUrl & url)

## Member Function Documentation

### EnginioClientConnection::~EnginioClientConnection()

Destroys this instance.

### QNetworkAccessManager * EnginioClientConnection::networkManager() const

Get the QNetworkAccessManager used by the Enginio library.

Note: that this QNetworkAccessManager may be shared with other EnginioClient instances and it is owned by them.