qremoteobjectnode.sip 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. // qremoteobjectnode.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtRemoteObjects Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. %If (Qt_6_2_0 -)
  22. class QRemoteObjectAbstractPersistedStore : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qremoteobjectnode.h>
  26. %End
  27. public:
  28. QRemoteObjectAbstractPersistedStore(QObject *parent /TransferThis/ = 0);
  29. virtual ~QRemoteObjectAbstractPersistedStore();
  30. virtual void saveProperties(const QString &repName, const QByteArray &repSig, const QVariantList &values) = 0;
  31. virtual QVariantList restoreProperties(const QString &repName, const QByteArray &repSig) = 0;
  32. };
  33. %End
  34. %If (Qt_6_2_0 -)
  35. class QRemoteObjectNode : public QObject
  36. {
  37. %TypeHeaderCode
  38. #include <qremoteobjectnode.h>
  39. %End
  40. %ConvertToSubClassCode
  41. static struct class_graph {
  42. const char *name;
  43. sipTypeDef **type;
  44. int yes, no;
  45. } graph[] = {
  46. {sipName_QAbstractItemModelReplica, &sipType_QAbstractItemModelReplica, -1, 1},
  47. {sipName_QRemoteObjectAbstractPersistedStore, &sipType_QRemoteObjectAbstractPersistedStore, -1, 2},
  48. {sipName_QRemoteObjectReplica, &sipType_QRemoteObjectReplica, 4, 3},
  49. {sipName_QRemoteObjectNode, &sipType_QRemoteObjectNode, 6, -1},
  50. {sipName_QRemoteObjectDynamicReplica, &sipType_QRemoteObjectDynamicReplica, -1, 5},
  51. {sipName_QRemoteObjectRegistry, &sipType_QRemoteObjectRegistry, -1, -1},
  52. {sipName_QRemoteObjectHostBase, &sipType_QRemoteObjectHostBase, 7, -1},
  53. {sipName_QRemoteObjectHost, &sipType_QRemoteObjectHost, -1, 8},
  54. {sipName_QRemoteObjectRegistryHost, &sipType_QRemoteObjectRegistryHost, -1, -1},
  55. };
  56. int i = 0;
  57. sipType = NULL;
  58. do
  59. {
  60. struct class_graph *cg = &graph[i];
  61. if (cg->name != NULL && sipCpp->inherits(cg->name))
  62. {
  63. sipType = *cg->type;
  64. i = cg->yes;
  65. }
  66. else
  67. i = cg->no;
  68. }
  69. while (i >= 0);
  70. %End
  71. public:
  72. enum ErrorCode
  73. {
  74. NoError,
  75. RegistryNotAcquired,
  76. RegistryAlreadyHosted,
  77. NodeIsNoServer,
  78. ServerAlreadyCreated,
  79. UnintendedRegistryHosting,
  80. OperationNotValidOnClientNode,
  81. SourceNotRegistered,
  82. MissingObjectName,
  83. HostUrlInvalid,
  84. ProtocolMismatch,
  85. ListenFailed,
  86. %If (Qt_6_7_0 -)
  87. SocketAccessError,
  88. %End
  89. };
  90. QRemoteObjectNode(QObject *parent /TransferThis/ = 0);
  91. QRemoteObjectNode(const QUrl &registryAddress, QObject *parent /TransferThis/ = 0);
  92. virtual ~QRemoteObjectNode();
  93. bool connectToNode(const QUrl &address);
  94. void addClientSideConnection(QIODevice *ioDevice);
  95. virtual void setName(const QString &name);
  96. QStringList instances(QStringView typeName) const;
  97. QRemoteObjectDynamicReplica *acquireDynamic(const QString &name) /Factory/;
  98. QAbstractItemModelReplica *acquireModel(const QString &name, QtRemoteObjects::InitialAction action = QtRemoteObjects::FetchRootSize, const QList<int> &rolesHint = {});
  99. QUrl registryUrl() const;
  100. virtual bool setRegistryUrl(const QUrl &registryAddress);
  101. bool waitForRegistry(int timeout = 30000) /ReleaseGIL/;
  102. const QRemoteObjectRegistry *registry() const;
  103. QRemoteObjectAbstractPersistedStore *persistedStore() const;
  104. void setPersistedStore(QRemoteObjectAbstractPersistedStore *persistedStore);
  105. QRemoteObjectNode::ErrorCode lastError() const;
  106. int heartbeatInterval() const;
  107. void setHeartbeatInterval(int interval);
  108. signals:
  109. void remoteObjectAdded(const QRemoteObjectSourceLocation &);
  110. void remoteObjectRemoved(const QRemoteObjectSourceLocation &);
  111. void error(QRemoteObjectNode::ErrorCode errorCode);
  112. void heartbeatIntervalChanged(int heartbeatInterval);
  113. protected:
  114. virtual void timerEvent(QTimerEvent *);
  115. };
  116. %End
  117. %If (Qt_6_2_0 -)
  118. class QRemoteObjectHostBase : public QRemoteObjectNode /NoDefaultCtors/
  119. {
  120. %TypeHeaderCode
  121. #include <qremoteobjectnode.h>
  122. %End
  123. public:
  124. enum AllowedSchemas
  125. {
  126. BuiltInSchemasOnly,
  127. AllowExternalRegistration,
  128. };
  129. virtual ~QRemoteObjectHostBase();
  130. virtual void setName(const QString &name);
  131. bool enableRemoting(QObject *object, const QString &name = QString());
  132. bool enableRemoting(QAbstractItemModel *model, const QString &name, const QList<int> roles, QItemSelectionModel *selectionModel = 0);
  133. bool disableRemoting(QObject *remoteObject);
  134. void addHostSideConnection(QIODevice *ioDevice);
  135. bool proxy(const QUrl &registryUrl, const QUrl &hostUrl /TypeHintValue="QUrl()"/ = {});
  136. bool reverseProxy();
  137. };
  138. %End
  139. %If (Qt_6_2_0 -)
  140. class QRemoteObjectHost : public QRemoteObjectHostBase
  141. {
  142. %TypeHeaderCode
  143. #include <qremoteobjectnode.h>
  144. %End
  145. public:
  146. QRemoteObjectHost(QObject *parent /TransferThis/ = 0);
  147. QRemoteObjectHost(const QUrl &address, const QUrl &registryAddress = QUrl(), QRemoteObjectHostBase::AllowedSchemas allowedSchemas = QRemoteObjectHostBase::BuiltInSchemasOnly, QObject *parent /TransferThis/ = 0);
  148. QRemoteObjectHost(const QUrl &address, QObject *parent /TransferThis/);
  149. virtual ~QRemoteObjectHost();
  150. virtual QUrl hostUrl() const;
  151. virtual bool setHostUrl(const QUrl &hostAddress, QRemoteObjectHostBase::AllowedSchemas allowedSchemas = QRemoteObjectHostBase::BuiltInSchemasOnly);
  152. signals:
  153. void hostUrlChanged();
  154. public:
  155. %If (Qt_6_7_0 -)
  156. static void setLocalServerOptions(QLocalServer::SocketOptions options);
  157. %End
  158. };
  159. %End
  160. %If (Qt_6_2_0 -)
  161. class QRemoteObjectRegistryHost : public QRemoteObjectHostBase
  162. {
  163. %TypeHeaderCode
  164. #include <qremoteobjectnode.h>
  165. %End
  166. public:
  167. QRemoteObjectRegistryHost(const QUrl &registryAddress = QUrl(), QObject *parent /TransferThis/ = 0);
  168. virtual ~QRemoteObjectRegistryHost();
  169. virtual bool setRegistryUrl(const QUrl &registryUrl);
  170. };
  171. %End