summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/quick/image-gallery/doc/src/image-gallery.qdoc2
-rw-r--r--examples/quick/users/doc/src/users.qdoc4
-rw-r--r--src/enginio_client/enginio.qdoc6
-rw-r--r--src/enginio_client/enginioclient.cpp10
-rw-r--r--src/enginio_client/enginioclientconnection.h7
-rw-r--r--src/enginio_client/enginiomodel.cpp4
-rw-r--r--src/enginio_client/enginiomodel.h19
-rw-r--r--src/enginio_client/enginioreply.cpp36
-rw-r--r--src/enginio_client/enginioreply.h38
-rw-r--r--src/enginio_plugin/enginioqmlmodel.cpp6
-rw-r--r--src/enginio_plugin/enginioqmlreply.cpp2
11 files changed, 108 insertions, 26 deletions
diff --git a/examples/quick/image-gallery/doc/src/image-gallery.qdoc b/examples/quick/image-gallery/doc/src/image-gallery.qdoc
index c86d199..56816b0 100644
--- a/examples/quick/image-gallery/doc/src/image-gallery.qdoc
+++ b/examples/quick/image-gallery/doc/src/image-gallery.qdoc
@@ -64,7 +64,7 @@
\section1 The example code
- The first step is to set up the \l Enginio client.
+ The first step is to set up the \l Enginio1::EnginioClient client.
\snippet image-gallery/image-gallery.qml client
The model gets initialized with the client declared above.
diff --git a/examples/quick/users/doc/src/users.qdoc b/examples/quick/users/doc/src/users.qdoc
index ce97e3b..f5436c5 100644
--- a/examples/quick/users/doc/src/users.qdoc
+++ b/examples/quick/users/doc/src/users.qdoc
@@ -63,7 +63,7 @@
This example uses QtEnginio library together with QtQuickControls, therefore both have
to be imported.
\snippet users/Browse.qml imports
- We will also use a common \l{Enginio}{Enginio} connection as shown here:
+ We will also use a common \l {Enginio1::EnginioClient}{EnginioClient} connection as shown here:
\snippet users/users.qml client
The example is organized into separate tabs by using \l TabView. Each tab shows different
@@ -72,7 +72,7 @@
\section1 Browsing users' data
The most convenient method to browse users is to use \l{Enginio1::EnginioModel}{EnginioModel}. The model can
automatically download all data that we need. It is sufficient to set three properties:
- \l{Enginio1::EnginioModel::enginio}{enginio}, \l{Enginio1::EnginioModel::query}{query}
+ \l{Enginio1::EnginioModel::client}{client}, \l{Enginio1::EnginioModel::query}{query}
and \l{Enginio1::EnginioModel::operation}{operation} as shown below:
\snippet users/Browse.qml browse
diff --git a/src/enginio_client/enginio.qdoc b/src/enginio_client/enginio.qdoc
index 084a80f..5bf55d7 100644
--- a/src/enginio_client/enginio.qdoc
+++ b/src/enginio_client/enginio.qdoc
@@ -92,7 +92,7 @@ To operate on objects of any type, the basic operations are:
\endlist
For a detailed description of the operations see the functions
-in the \l {EnginioClient}{EnginioClient Class} in C++ or \l {Enginio1::Enginio}{Enginio type} in QML.
+in the \l {EnginioClient}{EnginioClient Class} in C++ or \l {Enginio1::EnginioClient}{EnginioClient type} in QML.
\note User management and access control lists are conveniently done by the same functions.
@@ -180,12 +180,12 @@ To use Enginio's QML API, you have to import the library.
import Enginio 1.0
\endcode
-Initialize the \l{Enginio}{enginio client} with the \l{EnginioClient::backendId}{Backend Id} value, which can be copied from the Dashboard.
+Initialize the \l{Enginio1::EnginioClient}{enginio client} with the \l{EnginioClient::backendId}{Backend Id} value, which can be copied from the Dashboard.
Go to Dashboard ⇒ Your Backend home-view ⇒ See ’Keys box’ ⇒ Copy Backend Id value.
\code
-Enginio {
+EnginioClient {
id: enginio
backendId: "YOUR_OWN_BACKEND_ID"
}
diff --git a/src/enginio_client/enginioclient.cpp b/src/enginio_client/enginioclient.cpp
index 57a1c8c..f83095f 100644
--- a/src/enginio_client/enginioclient.cpp
+++ b/src/enginio_client/enginioclient.cpp
@@ -100,6 +100,12 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \namespace Enginio
+ \inmodule enginio-qt
+ \brief The Enginio namespace provides enums used throughout Enginio.
+*/
+
+/*!
\fn void EnginioClient::error(EnginioReply *reply)
\brief This signal is emitted when a request to the backend returns an error.
@@ -178,7 +184,7 @@ QT_BEGIN_NAMESPACE
\value Authenticated Authentication was successful
\value AuthenticationFailure Authentication failed
- \sa authenticationState
+ \sa EnginioClient::authenticationState
*/
ENGINIOCLIENT_EXPORT bool gEnableEnginioDebugInfo = !qEnvironmentVariableIsSet("ENGINIO_DEBUG_INFO");
@@ -454,7 +460,7 @@ EnginioReply *EnginioClient::fullTextSearch(const QJsonObject &query)
\snippet enginioclient/tst_enginioclient.cpp query-todo
\return EnginioReply containing the status and the result once it is finished.
- \sa EnginioReply, create(), update(), remove(), Enginio::Operation
+ \sa EnginioReply, create(), update(), remove(), EnginioClient::operation
*/
EnginioReply* EnginioClient::query(const QJsonObject &query, const Enginio::Operation operation)
{
diff --git a/src/enginio_client/enginioclientconnection.h b/src/enginio_client/enginioclientconnection.h
index f1497c7..2f999c5 100644
--- a/src/enginio_client/enginioclientconnection.h
+++ b/src/enginio_client/enginioclientconnection.h
@@ -55,12 +55,19 @@ class QNetworkAccessManager;
class EnginioIdentity;
class EnginioClientConnectionPrivate;
+#ifndef Q_QDOC
class ENGINIOCLIENT_EXPORT Enginio
{
Q_GADGET
+#else
+namespace Enginio {
+#endif
Q_ENUMS(AuthenticationState)
Q_ENUMS(Operation)
+
+#ifndef Q_QDOC
public:
+#endif
enum AuthenticationState {
NotAuthenticated,
Authenticating,
diff --git a/src/enginio_client/enginiomodel.cpp b/src/enginio_client/enginiomodel.cpp
index 346f55c..8409b90 100644
--- a/src/enginio_client/enginiomodel.cpp
+++ b/src/enginio_client/enginiomodel.cpp
@@ -91,7 +91,7 @@ const int EnginioModelBasePrivate::IncrementalModelUpdate = -2;
because of insufficient access rights, in that case the operation will be reverted.
There are two, ways of tracking if an item state is the same in the model and backend.
- Each item has a role that returns a boolean \l{Enginio::SyncedRole}{SyncedRole}, role name "_synced" which
+ Each item has a role that returns a boolean \l{EnginioModel::SyncedRole}{SyncedRole}, role name "_synced" which
indicates whether the item is successfully updated on the server.
This role can for example meant to be used for a busy indicator while a property is being updated.
Alternatively the status of each \l{EnginioReply}{EnginioReply} returned by EnginioModel can be tracked.
@@ -448,7 +448,7 @@ void EnginioModel::setQuery(const QJsonObject &query)
}
/*!
- \property EnginioModelBase::operation
+ \property EnginioModel::operation
\brief The operation type of the query
\sa Enginio::Operation, query()
\return returns the Operation
diff --git a/src/enginio_client/enginiomodel.h b/src/enginio_client/enginiomodel.h
index a13a9ae..856565e 100644
--- a/src/enginio_client/enginiomodel.h
+++ b/src/enginio_client/enginiomodel.h
@@ -51,7 +51,12 @@
QT_BEGIN_NAMESPACE
class EnginioModelPrivate;
-class ENGINIOCLIENT_EXPORT EnginioModel : public EnginioModelBase
+class ENGINIOCLIENT_EXPORT EnginioModel
+#ifdef Q_QDOC
+ : public QAbstractListModel
+#else
+ : public EnginioModelBase
+#endif
{
Q_OBJECT
Q_PROPERTY(EnginioClient *client READ client WRITE setClient NOTIFY clientChanged)
@@ -76,6 +81,18 @@ Q_SIGNALS:
void queryChanged(const QJsonObject &query);
void clientChanged(EnginioClient *client);
+#ifdef Q_QDOC
+ // Defined in EnginioModelBase
+public:
+ Q_ENUMS(Enginio::Operation) // TODO remove me QTBUG-33577
+ Q_PROPERTY(Enginio::Operation operation READ operation WRITE setOperation NOTIFY operationChanged)
+
+ Enginio::Operation operation() const Q_REQUIRED_RESULT;
+ void setOperation(Enginio::Operation operation);
+Q_SIGNALS:
+ void operationChanged(Enginio::Operation operation);
+#endif
+
private:
Q_DISABLE_COPY(EnginioModel)
Q_DECLARE_PRIVATE(EnginioModel)
diff --git a/src/enginio_client/enginioreply.cpp b/src/enginio_client/enginioreply.cpp
index 32b5c1f..84ac107 100644
--- a/src/enginio_client/enginioreply.cpp
+++ b/src/enginio_client/enginioreply.cpp
@@ -65,7 +65,12 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \enum EnginioReplyBase::ErrorTypes
+ \class EnginioReplyBase
+ \internal
+*/
+
+/*!
+ \enum EnginioReply::ErrorTypes
Describes the type of error that occured when making a request to the Enginio backend.
\value NoError The reply returned without errors
\value NetworkError The error was a networking problem
@@ -75,12 +80,12 @@ QT_BEGIN_NAMESPACE
/*!
\fn EnginioReply::finished(EnginioReply *reply)
This signal is emitted when the EnginioReply \a reply is finished.
- After the network operation, use the \l{EnginioReplyBase::isError()}{isError()} function to check for
+ After the network operation, use the \l{EnginioReply::isError()}{isError()} function to check for
potential problems and then use the \l data property to access the returned data.
*/
/*!
- \fn EnginioReplyBase::progress(qint64 bytesSent, qint64 bytesTotal)
+ \fn EnginioReply::progress(qint64 bytesSent, qint64 bytesTotal)
This signal is emitted for file operations, indicating the progress of up or downloads.
The \a bytesSent is the current progress relative to the total \a bytesTotal.
*/
@@ -110,9 +115,10 @@ EnginioReply::~EnginioReply()
{}
/*!
- \property EnginioReplyBase::networkError
+ \property EnginioReply::networkError
This property holds the network error for the request.
*/
+
QNetworkReply::NetworkError EnginioReplyBase::networkError() const
{
Q_D(const EnginioReplyBase);
@@ -120,10 +126,11 @@ QNetworkReply::NetworkError EnginioReplyBase::networkError() const
}
/*!
- \property EnginioReplyBase::errorString
+ \property EnginioReply::errorString
This property holds the error for the request as human readable string.
- Check \l{EnginioReplyBase::isError()}{isError()} first to check if the reply is an error.
+ Check \l{EnginioReply::isError()}{isError()} first to check if the reply is an error.
*/
+
QString EnginioReplyBase::errorString() const
{
Q_D(const EnginioReplyBase);
@@ -131,7 +138,7 @@ QString EnginioReplyBase::errorString() const
}
/*!
- \property EnginioReplyBase::requestId
+ \property EnginioReply::requestId
This property holds the API request ID for the request.
The request ID is useful for end-to-end tracking of requests and to identify
the origin of notifications.
@@ -220,6 +227,9 @@ void EnginioReplyBasePrivate::swapNetworkReply(EnginioReplyBasePrivate *other)
_client->registerReply(other->_nreply, other->q_func());
}
+/*!
+ \internal
+*/
void EnginioReplyBase::dumpDebugInfo() const
{
Q_D(const EnginioReplyBase);
@@ -251,9 +261,11 @@ bool EnginioReplyBase::delayFinishedSignal()
}
/*!
+ \fn bool EnginioReply::isError() const
\brief EnginioReplyBase::isError returns whether this reply was unsuccessful
\return true if the reply did not succeed
*/
+
bool EnginioReplyBase::isError() const
{
Q_D(const EnginioReplyBase);
@@ -261,9 +273,11 @@ bool EnginioReplyBase::isError() const
}
/*!
- \brief EnginioReplyBase::isFinished returns whether this reply was finished or not
+ \fn bool EnginioReply::isFinished() const
+ \brief Returns whether this reply was finished or not
\return true if the reply was finished, false otherwise.
*/
+
bool EnginioReplyBase::isFinished() const
{
Q_D(const EnginioReplyBase);
@@ -271,10 +285,11 @@ bool EnginioReplyBase::isFinished() const
}
/*!
- \property EnginioReplyBase::backendStatus
+ \property EnginioReply::backendStatus
\return the backend return status for this reply.
\sa EnginioReplyBase::ErrorTypes
*/
+
int EnginioReplyBase::backendStatus() const
{
Q_D(const EnginioReplyBase);
@@ -282,10 +297,11 @@ int EnginioReplyBase::backendStatus() const
}
/*!
- \property EnginioReplyBase::errorType
+ \property EnginioReply::errorType
\return the type of the error
\sa EnginioReplyBase::ErrorTypes
*/
+
EnginioReplyBase::ErrorTypes EnginioReplyBase::errorType() const
{
Q_D(const EnginioReplyBase);
diff --git a/src/enginio_client/enginioreply.h b/src/enginio_client/enginioreply.h
index ee03ca7..ea0faa5 100644
--- a/src/enginio_client/enginioreply.h
+++ b/src/enginio_client/enginioreply.h
@@ -53,7 +53,12 @@ class EnginioClient;
class EnginioReplyPrivate;
class EnginioClientConnectionPrivate;
-class ENGINIOCLIENT_EXPORT EnginioReply : public EnginioReplyBase
+class ENGINIOCLIENT_EXPORT EnginioReply
+#ifdef Q_QDOC
+ : public QObject
+#else
+ : public EnginioReplyBase
+#endif
{
Q_OBJECT
Q_PROPERTY(QJsonObject data READ data NOTIFY dataChanged)
@@ -68,6 +73,37 @@ Q_SIGNALS:
void finished(EnginioReply *reply);
void dataChanged();
+
+#ifdef Q_QDOC
+public:
+ Q_PROPERTY(ErrorTypes errorType READ errorType NOTIFY dataChanged)
+ Q_PROPERTY(QNetworkReply::NetworkError networkError READ networkError NOTIFY dataChanged)
+ Q_PROPERTY(QString errorString READ errorString NOTIFY dataChanged)
+ Q_PROPERTY(int backendStatus READ backendStatus NOTIFY dataChanged)
+ Q_PROPERTY(QString requestId READ requestId CONSTANT)
+ Q_ENUMS(ErrorTypes)
+ enum ErrorTypes {
+ NoError,
+ NetworkError,
+ BackendError
+ };
+
+ ErrorTypes errorType() const Q_REQUIRED_RESULT;
+ QNetworkReply::NetworkError networkError() const Q_REQUIRED_RESULT;
+ QString errorString() const Q_REQUIRED_RESULT;
+ int backendStatus() const Q_REQUIRED_RESULT;
+
+ bool isError() const Q_REQUIRED_RESULT;
+ bool isFinished() const Q_REQUIRED_RESULT;
+
+ QJsonObject data() const Q_REQUIRED_RESULT;
+
+Q_SIGNALS:
+ void dataChanged();
+ void progress(qint64 bytesSent, qint64 bytesTotal);
+
+#endif
+
protected:
virtual void emitFinished();
diff --git a/src/enginio_plugin/enginioqmlmodel.cpp b/src/enginio_plugin/enginioqmlmodel.cpp
index dc55ef5..651d556 100644
--- a/src/enginio_plugin/enginioqmlmodel.cpp
+++ b/src/enginio_plugin/enginioqmlmodel.cpp
@@ -83,12 +83,12 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty Enginio Enginio1::EnginioModel::enginio
- The instance of \l Enginio used for this model.
+ \qmlproperty Enginio1::EnginioClient Enginio1::EnginioModel::client
+ The instance of \l Enginio1::EnginioClient used for this model.
*/
/*!
- \qmlproperty Enginio::Operation Enginio1::EnginioModelBase::operation
+ \qmlproperty Enginio::Operation Enginio1::EnginioModel::operation
The operation used for the \l query.
*/
diff --git a/src/enginio_plugin/enginioqmlreply.cpp b/src/enginio_plugin/enginioqmlreply.cpp
index f263117..6bb3e8d 100644
--- a/src/enginio_plugin/enginioqmlreply.cpp
+++ b/src/enginio_plugin/enginioqmlreply.cpp
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
\ingroup engino-qml
\target EnginioModelQml
- \brief A reply to any \l Enginio request.
+ \brief A reply to any \l EnginioClient request.
*/
/*!