Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit b6cfbc6

Browse files
committed
added QML doc
1 parent bb61809 commit b6cfbc6

18 files changed

+543
-21
lines changed

doc/Doxyfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ ALIASES = "accessors{1}=<table><tr><th colspan= 2>Accessors</th><
250250
storedAc{1}=<tr><td><b>STORED</b></td><td>\1</td></tr> \
251251
userAc{1}=<tr><td><b>USER</b></td><td>\1</td></tr> \
252252
"constantAc=<tr><td colspan= 2><b>CONSTANT</b></td></tr>" \
253+
"readonlyAc=<tr><td colspan= 2><b>READ ONLY</b></td></tr>" \
253254
"finalAc=<tr><td colspan= 2><b>FINAL</b></td></tr>" \
254255
"default{1}=<b>Default:</b> \1 <br>" \
255256
"readAcFn{1}=READ accessor for \1" \
@@ -894,7 +895,6 @@ RECURSIVE = YES
894895
# run.
895896

896897
EXCLUDE = ../src/3rdparty \
897-
../src/imports \
898898
../src/plugins
899899

900900
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
@@ -929,6 +929,7 @@ EXCLUDE_PATTERNS = moc_* \
929929

930930
EXCLUDE_SYMBOLS = QtDataSync::__helpertypes::* \
931931
QtDataSync::JsonObject \
932+
QtDataSyncDeclarativeModule \
932933
\
933934
QAbstractAspect \
934935
QAbstractXmlReceiver \

doc/datastore.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ completed. This of course only applies to pointer classes, as gadgets are used a
3131
*/
3232

3333
/*!
34-
@fn QtDataSync::DataStore::setupName
34+
@fn QtDataSync::DataStore::setupName() const
3535
@returns The name of the setup
3636
@sa QtDataSync::Setup
3737
*/

doc/eventcursor.dox

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ EventCursor::isEventLogActive
188188
/*!
189189
@fn QtDataSync::EventCursor::first(const QString &, QObject*)
190190
@param setupName The name of the setup to create the cursor for
191-
@copydetails EventCursor::first(QObject*)
191+
@copydetails QtDataSync::EventCursor::first(QObject*)
192192
*/
193193

194194
/*!
@@ -208,7 +208,7 @@ EventCursor::isEventLogActive
208208
/*!
209209
@fn QtDataSync::EventCursor::last(const QString &, QObject*)
210210
@param setupName The name of the setup to create the cursor for
211-
@copydetails EventCursor::last(QObject*)
211+
@copydetails QtDataSync::EventCursor::last(QObject*)
212212
*/
213213

214214
/*!
@@ -229,7 +229,7 @@ EventCursor::isEventLogActive
229229
/*!
230230
@fn QtDataSync::EventCursor::create(quint64, const QString &, QObject*)
231231
@param setupName The name of the setup to create the cursor for
232-
@copydetails EventCursor::create(quint64, QObject*)
232+
@copydetails QtDataSync::EventCursor::create(quint64, QObject*)
233233
*/
234234

235235
/*!
@@ -260,7 +260,7 @@ EventCursor::isEventLogActive, EventCursor::save, EventCursor::skipObsolete
260260
/*!
261261
@fn QtDataSync::EventCursor::load(const QByteArray &, const QString &, QObject*)
262262
@param setupName The name of the setup to create the cursor for
263-
@copydetails EventCursor::load(const QByteArray &, QObject*)
263+
@copydetails QtDataSync::EventCursor::load(const QByteArray &, QObject*)
264264
*/
265265

266266
/*!

doc/qtdatasync.dox

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*!
2+
@namespace de::skycoder42::QtDataSync
3+
@brief The QML import for the QtDataSync QML module
4+
5+
<b>Current Version</b><br/>
6+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.2
7+
8+
<b>Available Types</b>
9+
- @ref QtDataSync::DeviceInfo "DeviceInfo" (uncreatable)
10+
- @ref QtDataSync::LoginRequest "LoginRequest" (uncreatable)
11+
- @ref QtDataSync::UserInfo "UserInfo" (uncreatable)
12+
- @ref QtDataSync::EventCursor "EventCursor" (uncreatable)
13+
- DataStore
14+
- DataStoreModel
15+
- SyncManager
16+
- AccountManager
17+
- UserExchangeManager
18+
- EventLog (singleton)
19+
- @ref QtDataSync::AndroidSyncControl "AndroidSyncControl"
20+
- @ref QtDataSync::IosSyncDelegate "IosSyncDelegate" (uncreatable)
21+
- IosSyncSingleton (singleton)
22+
*/

doc/syncmanager.dox

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ information about it's state etc.
116116
*/
117117

118118
/*!
119-
@fn QtDataSync::SyncManager::runOnDownloaded
119+
@fn QtDataSync::SyncManager::runOnDownloaded(const std::function<void(SyncState)> &, bool)
120120

121121
@param resultFn The function to be called as soon as a target state is reached
122122
@param triggerSync Trigger a synchronisation in case the engine is currently synchronized
@@ -133,7 +133,7 @@ of waiting for the uploads as well.
133133
*/
134134

135135
/*!
136-
@fn QtDataSync::SyncManager::runOnSynchronized
136+
@fn QtDataSync::SyncManager::runOnSynchronized(const std::function<void(SyncState)> &, bool)
137137

138138
@param resultFn The function to be called as soon as a target state is reached
139139
@param triggerSync Trigger a synchronisation in case the engine is currently synchronized

doc/userexchangemanager.dox

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ UserExchangeManager::exportTo, AccountManager::exportAccountTrusted
196196
*/
197197

198198
/*!
199-
@fn QtDataSync::UserExchangeManager::importFrom
199+
@fn QtDataSync::UserExchangeManager::importFrom(const QtDataSync::UserInfo &, const std::function<void(bool,QString)> &, bool)
200200

201201
@param userInfo The user to that sent the data to import
202202
@param completedFn A function that is called once the import has been finished
@@ -214,7 +214,7 @@ UserExchangeManager::importTrustedFrom, AccountManager::importAccount
214214
*/
215215

216216
/*!
217-
@fn QtDataSync::UserExchangeManager::importTrustedFrom
217+
@fn QtDataSync::UserExchangeManager::importTrustedFrom(const QtDataSync::UserInfo &, const QString &, const std::function<void(bool,QString)> &, bool)
218218

219219
@param userInfo The user to that sent the data to import
220220
@param password The password used to decrypt the imported data with. Must be the same as used

src/datasync/eventcursor.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ class Q_DATASYNC_EXPORT EventCursor : public QObject
4545

4646
//! Create a cursor positioned on the oldest change event
4747
static EventCursor *first(QObject *parent = nullptr);
48-
//! @copybrief EventCursor::first(QObject*)
48+
//! @copybrief QtDataSync::EventCursor::first(QObject*)
4949
static EventCursor *first(const QString &setupName, QObject *parent = nullptr);
5050
//! Create a cursor positioned on the newest change event
5151
static EventCursor *last(QObject *parent = nullptr);
52-
//! @copybrief EventCursor::last(QObject*)
52+
//! @copybrief QtDataSync::EventCursor::last(QObject*)
5353
static EventCursor *last(const QString &setupName, QObject *parent = nullptr);
5454
//! Create a cursor positioned on the given index, if it is a valid index
5555
static EventCursor *create(quint64 index, QObject *parent = nullptr);
56-
//! @copybrief EventCursor::create(quint64, QObject*)
56+
//! @copybrief QtDataSync::EventCursor::create(quint64, QObject*)
5757
static EventCursor *create(quint64 index, const QString &setupName, QObject *parent = nullptr);
5858
//! Create a cursor positioned on the index provided by the previously stored data, if still valid
5959
static EventCursor *load(const QByteArray &data, QObject *parent = nullptr);
60-
//! @copybrief EventCursor::load(const QByteArray &, QObject*)
60+
//! @copybrief QtDataSync::EventCursor::load(const QByteArray &, QObject*)
6161
static EventCursor *load(const QByteArray &data, const QString &setupName, QObject *parent = nullptr);
6262
//! Returns encoded position data of the cursor to be loaded again
6363
Q_INVOKABLE QByteArray save() const;

src/imports/datasync/plugins.qmltypes

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import QtQuick.tooling 1.2
77
// 'qmlplugindump -nonrelocatable de.skycoder42.QtDataSync 4.2'
88

99
Module {
10-
dependencies: ["QtQuick 2.8"]
10+
dependencies: ["QtQml 2.2", "QtQml.Models 2.2"]
1111
Component { name: "QAbstractTableModel"; prototype: "QAbstractItemModel" }
1212
Component {
1313
name: "QtDataSync::AccountManager"
@@ -337,6 +337,13 @@ Module {
337337
type: "QVariantList"
338338
Parameter { name: "typeName"; type: "string" }
339339
}
340+
Method {
341+
name: "contains"
342+
revision: 2
343+
type: "bool"
344+
Parameter { name: "typeName"; type: "string" }
345+
Parameter { name: "key"; type: "string" }
346+
}
340347
Method {
341348
name: "load"
342349
type: "QVariant"

src/imports/datasync/qmldir

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ module de.skycoder42.QtDataSync
22
plugin declarative_datasync
33
classname QtDataSyncDeclarativeModule
44
typeinfo plugins.qmltypes
5+
depends QtQml 2.2
6+
depends QtQml.Models 2.2

src/imports/datasync/qqmlaccountmanager.h

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,117 @@
88

99
#include <QtDataSync/accountmanager.h>
1010

11+
#ifdef DOXYGEN_RUN
12+
namespace de::skycoder42::QtDataSync {
13+
14+
/*! @brief The QML binding of ::QtDataSync::AccountManager
15+
*
16+
* @since 4.0
17+
*
18+
* @sa QtDataSync::AccountManager
19+
*/
20+
class AccountManager : public ::QtDataSync::AccountManager
21+
#else
1122
namespace QtDataSync {
1223

1324
class QQmlAccountManager : public AccountManager, public QQmlParserStatus
25+
#endif
1426
{
1527
Q_OBJECT
1628
Q_DISABLE_COPY(QQmlAccountManager)
1729
Q_INTERFACES(QQmlParserStatus)
1830

31+
/*! @brief Holds the name of the setup this manager operates on.
32+
*
33+
* @default{`QtDataSync::DefaultSetup`}
34+
*
35+
* Allows you to specify the name of the setup that this manager should use
36+
*
37+
* @warning This property must only ever be set on construction of the object
38+
* and must not be changed afterwards. Do not set both, this property and node
39+
*
40+
* @accessors{
41+
* @memberAc{setupName}
42+
* @notifyAc{setupNameChanged()}
43+
* }
44+
*
45+
* @sa ::QtDataSync::AccountManager::setupName, AccountManager::node, AccountManager::valid
46+
*/
1947
Q_PROPERTY(QString setupName READ setupName WRITE setSetupName NOTIFY setupNameChanged)
48+
/*! @brief Allows to directly set the remote object node to use
49+
*
50+
* @default{`nullptr`}
51+
*
52+
* Instead of a setup name, you can directly specify the remote object node via this property.
53+
*
54+
* @warning This property must only ever be set on construction of the object
55+
* and must not be changed afterwards. Do not set both, this property and setupName
56+
*
57+
* @accessors{
58+
* @memberAc{node}
59+
* @notifyAc{nodeChanged()}
60+
* }
61+
*
62+
* @sa AccountManager::setupName, AccountManager::valid
63+
*/
2064
Q_PROPERTY(QRemoteObjectNode* node READ node WRITE setNode NOTIFY nodeChanged)
65+
/*! @brief Specifies if the object was correctly initialized
66+
*
67+
* @default{`false`}
68+
*
69+
* Only becomes true if the given setup name resolves to a valid datasync
70+
* instance or if the given node is valid
71+
*
72+
* @accessors{
73+
* @memberAc{valid}
74+
* @notifyAc{validChanged()}
75+
* @readonlyAc
76+
* }
77+
*
78+
* @sa AccountManager::setupName, AccountManager::node
79+
*/
2180
Q_PROPERTY(bool valid READ valid NOTIFY validChanged)
2281

2382
public:
83+
//! @private
2484
explicit QQmlAccountManager(QObject *parent = nullptr);
2585

86+
//! @private
2687
void classBegin() override;
88+
//! @private
2789
void componentComplete() override;
2890

91+
//! @private
2992
QString setupName() const;
93+
//! @private
3094
QRemoteObjectNode* node() const;
95+
//! @private
3196
bool valid() const;
3297

98+
//! @copydoc ::QtDataSync::AccountManager::isTrustedImport(const QJsonObject &)
3399
Q_INVOKABLE bool isTrustedImport(const QJsonObject &importData) const;
34100

101+
//! @copydoc ::QtDataSync::AccountManager::exportAccount(bool, const std::function<void(QJsonObject)> &, const std::function<void(QString)> &)
35102
Q_INVOKABLE void exportAccount(bool includeServer, const QJSValue &completedFn, const QJSValue &errorFn = {});
103+
//! @copydoc ::QtDataSync::AccountManager::exportAccountTrusted(bool, const QString &, const std::function<void(QJsonObject)> &, const std::function<void(QString)> &)
36104
Q_INVOKABLE void exportAccountTrusted(bool includeServer, const QString &password, const QJSValue &completedFn, const QJSValue &errorFn = {});
105+
//! @copydoc ::QtDataSync::AccountManager::importAccount(const QJsonObject &, const std::function<void(bool,QString)> &, bool)
37106
Q_INVOKABLE void importAccount(const QJsonObject &importData, const QJSValue &completedFn, bool keepData = false);
107+
//! @copydoc ::QtDataSync::AccountManager::importAccountTrusted(const QJsonObject &, const QString &, const std::function<void(bool,QString)> &, bool)
38108
Q_INVOKABLE void importAccountTrusted(const QJsonObject &importData, const QString &password, const QJSValue &completedFn, bool keepData = false);
39109

40110
public Q_SLOTS:
111+
//! @private
41112
void setSetupName(QString setupName);
113+
//! @private
42114
void setNode(QRemoteObjectNode* node);
43115

44116
Q_SIGNALS:
45-
void setupNameChanged(QString setupName);
117+
//! @notifyAcFn{AccountManager::setupName}
118+
void setupNameChanged(const QString &setupName);
119+
//! @notifyAcFn{AccountManager::node}
46120
void nodeChanged(QRemoteObjectNode* node);
121+
//! @notifyAcFn{AccountManager::valid}
47122
void validChanged(bool valid);
48123

49124
private:

0 commit comments

Comments
 (0)