pyside6_qthttpserver_python.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. // Copyright (C) 2022 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. #ifndef SBK_QTHTTPSERVER_PYTHON_H
  4. #define SBK_QTHTTPSERVER_PYTHON_H
  5. #include <sbkpython.h>
  6. #include <sbkmodule.h>
  7. #include <sbkconverter.h>
  8. // Module Includes
  9. #include <pyside6_qtconcurrent_python.h>
  10. #include <pyside6_qtcore_python.h>
  11. #include <pyside6_qtwebsockets_python.h>
  12. #include <pyside6_qtnetwork_python.h>
  13. // Bound library includes
  14. #include <QtHttpServer/qhttpserverrequest.h>
  15. #include <QtHttpServer/qhttpserverresponder.h>
  16. #include <QtHttpServer/qhttpserverwebsocketupgraderesponse.h>
  17. #if QT_CONFIG(future)
  18. #include <QtCore/qfuture.h>
  19. #endif
  20. QT_BEGIN_NAMESPACE
  21. class QAbstractHttpServer;
  22. class QHttpServer;
  23. class QHttpServerResponse;
  24. class QHttpServerRouter;
  25. class QHttpServerRouterRule;
  26. QT_END_NAMESPACE
  27. // Type indices
  28. enum [[deprecated]] : int {
  29. SBK_QABSTRACTHTTPSERVER_IDX = 0,
  30. SBK_QFUTUREHTTPSERVERRESPONSE_IDX = 4,
  31. SBK_QFUTURE_QHTTPSERVERRESPONSE_IDX = 4,
  32. SBK_QHTTPSERVER_IDX = 6,
  33. SBK_QHTTPSERVERREQUEST_METHOD_IDX = 10,
  34. SBK_QFLAGS_QHTTPSERVERREQUEST_METHOD_IDX = 2,
  35. SBK_QHTTPSERVERREQUEST_IDX = 8,
  36. SBK_QHTTPSERVERRESPONDER_STATUSCODE_IDX = 14,
  37. SBK_QHTTPSERVERRESPONDER_IDX = 12,
  38. SBK_QHTTPSERVERRESPONSE_IDX = 16,
  39. SBK_QHTTPSERVERROUTER_IDX = 18,
  40. SBK_QHTTPSERVERROUTERRULE_IDX = 20,
  41. SBK_QHTTPSERVERWEBSOCKETUPGRADERESPONSE_RESPONSETYPE_IDX = 24,
  42. SBK_QHTTPSERVERWEBSOCKETUPGRADERESPONSE_IDX = 22,
  43. SBK_QTHTTPSERVER_IDX_COUNT = 26,
  44. };
  45. // Type indices
  46. enum : int {
  47. SBK_QAbstractHttpServer_IDX = 0,
  48. SBK_QFutureHttpServerResponse_IDX = 2,
  49. SBK_QFuture_QHttpServerResponse_IDX = 2,
  50. SBK_QHttpServer_IDX = 3,
  51. SBK_QHttpServerRequest_Method_IDX = 5,
  52. SBK_QFlags_QHttpServerRequest_Method_IDX = 1,
  53. SBK_QHttpServerRequest_IDX = 4,
  54. SBK_QHttpServerResponder_StatusCode_IDX = 7,
  55. SBK_QHttpServerResponder_IDX = 6,
  56. SBK_QHttpServerResponse_IDX = 8,
  57. SBK_QHttpServerRouter_IDX = 9,
  58. SBK_QHttpServerRouterRule_IDX = 10,
  59. SBK_QHttpServerWebSocketUpgradeResponse_ResponseType_IDX = 12,
  60. SBK_QHttpServerWebSocketUpgradeResponse_IDX = 11,
  61. SBK_QtHttpServer_IDX_COUNT = 13,
  62. };
  63. // This variable stores all Python types exported by this module.
  64. extern Shiboken::Module::TypeInitStruct *SbkPySide6_QtHttpServerTypeStructs;
  65. // This variable stores all Python types exported by this module in a backwards compatible way with identical indexing.
  66. [[deprecated]] extern PyTypeObject **SbkPySide6_QtHttpServerTypes;
  67. // This variable stores the Python module object exported by this module.
  68. extern PyObject *SbkPySide6_QtHttpServerModuleObject;
  69. // This variable stores all type converters exported by this module.
  70. extern SbkConverter **SbkPySide6_QtHttpServerTypeConverters;
  71. // Converter indices
  72. enum [[deprecated]] : int {
  73. SBK_QTHTTPSERVER_QLIST_INT_IDX = 0, // QList<int>
  74. SBK_QTHTTPSERVER_QHASH_QMETATYPE_QSTRING_IDX = 1, // QHash<QMetaType,QString>
  75. SBK_QTHTTPSERVER_QLIST_QHTTPHEADERS_WELLKNOWNHEADER_IDX = 2, // QList<QHttpHeaders::WellKnownHeader>
  76. SBK_QTHTTPSERVER_QLIST_QLOCALSERVERPTR_IDX = 3, // QList<QLocalServer*>
  77. SBK_QTHTTPSERVER_QLIST_QUINT16_IDX = 4, // QList<quint16>
  78. SBK_QTHTTPSERVER_QLIST_QTCPSERVERPTR_IDX = 5, // QList<QTcpServer*>
  79. SBK_QTHTTPSERVER_QLIST_QVARIANT_IDX = 6, // QList<QVariant>
  80. SBK_QTHTTPSERVER_QLIST_QSTRING_IDX = 7, // QList<QString>
  81. SBK_QTHTTPSERVER_QMAP_QSTRING_QVARIANT_IDX = 8, // QMap<QString,QVariant>
  82. SBK_QTHTTPSERVER_CONVERTERS_IDX_COUNT = 9,
  83. };
  84. // Converter indices
  85. enum : int {
  86. SBK_QtHttpServer_QList_int_IDX = 0, // QList<int>
  87. SBK_QtHttpServer_QHash_QMetaType_QString_IDX = 1, // QHash<QMetaType,QString>
  88. SBK_QtHttpServer_QList_QHttpHeaders_WellKnownHeader_IDX = 2, // QList<QHttpHeaders::WellKnownHeader>
  89. SBK_QtHttpServer_QList_QLocalServerPTR_IDX = 3, // QList<QLocalServer*>
  90. SBK_QtHttpServer_QList_quint16_IDX = 4, // QList<quint16>
  91. SBK_QtHttpServer_QList_QTcpServerPTR_IDX = 5, // QList<QTcpServer*>
  92. SBK_QtHttpServer_QList_QVariant_IDX = 6, // QList<QVariant>
  93. SBK_QtHttpServer_QList_QString_IDX = 7, // QList<QString>
  94. SBK_QtHttpServer_QMap_QString_QVariant_IDX = 8, // QMap<QString,QVariant>
  95. SBK_QtHttpServer_CONVERTERS_IDX_COUNT = 9,
  96. };
  97. // typedef entries
  98. using QFutureHttpServerResponse = QFuture<QHttpServerResponse>;
  99. // Macros for type check
  100. QT_WARNING_PUSH
  101. QT_WARNING_DISABLE_DEPRECATED
  102. namespace Shiboken
  103. {
  104. // PyType functions, to get the PyObjectType for a type T
  105. template<> inline PyTypeObject *SbkType< ::QAbstractHttpServer >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QAbstractHttpServer_IDX]); }
  106. #if QT_CONFIG(future)
  107. template<> inline PyTypeObject *SbkType< QFutureHttpServerResponse >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QFutureHttpServerResponse_IDX]); }
  108. #endif
  109. template<> inline PyTypeObject *SbkType< ::QHttpServer >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServer_IDX]); }
  110. template<> inline PyTypeObject *SbkType< ::QHttpServerRequest::Method >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerRequest_Method_IDX]); }
  111. template<> inline PyTypeObject *SbkType< ::QFlags<QHttpServerRequest::Method> >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QFlags_QHttpServerRequest_Method_IDX]); }
  112. template<> inline PyTypeObject *SbkType< ::QHttpServerRequest >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerRequest_IDX]); }
  113. template<> inline PyTypeObject *SbkType< ::QHttpServerResponder::StatusCode >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerResponder_StatusCode_IDX]); }
  114. template<> inline PyTypeObject *SbkType< ::QHttpServerResponder >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerResponder_IDX]); }
  115. template<> inline PyTypeObject *SbkType< ::QHttpServerResponse >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerResponse_IDX]); }
  116. template<> inline PyTypeObject *SbkType< ::QHttpServerRouter >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerRouter_IDX]); }
  117. template<> inline PyTypeObject *SbkType< ::QHttpServerRouterRule >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerRouterRule_IDX]); }
  118. template<> inline PyTypeObject *SbkType< ::QHttpServerWebSocketUpgradeResponse::ResponseType >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerWebSocketUpgradeResponse_ResponseType_IDX]); }
  119. template<> inline PyTypeObject *SbkType< ::QHttpServerWebSocketUpgradeResponse >() { return Shiboken::Module::get(SbkPySide6_QtHttpServerTypeStructs[SBK_QHttpServerWebSocketUpgradeResponse_IDX]); }
  120. } // namespace Shiboken
  121. QT_WARNING_POP
  122. #endif // SBK_QTHTTPSERVER_PYTHON_H