1// qbluetoothserver.sip generated by MetaSIP
2//
3// This file is part of the QtBluetooth Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
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
22
23%If (Qt_5_2_0 -)
24
25class QBluetoothServer : QObject
26{
27%TypeHeaderCode
28#include <qbluetoothserver.h>
29%End
30
31%ConvertToSubClassCode
32    static struct class_graph {
33        const char *name;
34        sipTypeDef **type;
35        int yes, no;
36    } graph[] = {
37        {sipName_QBluetoothDeviceDiscoveryAgent, &sipType_QBluetoothDeviceDiscoveryAgent, -1, 1},
38        {sipName_QBluetoothServiceDiscoveryAgent, &sipType_QBluetoothServiceDiscoveryAgent, -1, 2},
39    #if QT_VERSION >= 0x050400
40        {sipName_QLowEnergyService, &sipType_QLowEnergyService, -1, 3},
41    #else
42        {0, 0, -1, 3},
43    #endif
44        {sipName_QBluetoothTransferReply, &sipType_QBluetoothTransferReply, -1, 4},
45        {sipName_QBluetoothTransferManager, &sipType_QBluetoothTransferManager, -1, 5},
46        {sipName_QBluetoothServer, &sipType_QBluetoothServer, -1, 6},
47    #if QT_VERSION >= 0x050400
48        {sipName_QLowEnergyController, &sipType_QLowEnergyController, -1, 7},
49    #else
50        {0, 0, -1, 7},
51    #endif
52        {sipName_QBluetoothSocket, &sipType_QBluetoothSocket, -1, 8},
53        {sipName_QBluetoothLocalDevice, &sipType_QBluetoothLocalDevice, -1, -1},
54    };
55
56    int i = 0;
57
58    sipType = NULL;
59
60    do
61    {
62        struct class_graph *cg = &graph[i];
63
64        if (cg->name != NULL && sipCpp->inherits(cg->name))
65        {
66            sipType = *cg->type;
67            i = cg->yes;
68        }
69        else
70            i = cg->no;
71    }
72    while (i >= 0);
73%End
74
75public:
76    enum Error
77    {
78        NoError,
79        UnknownError,
80        PoweredOffError,
81        InputOutputError,
82        ServiceAlreadyRegisteredError,
83        UnsupportedProtocolError,
84    };
85
86    QBluetoothServer(QBluetoothServiceInfo::Protocol serverType, QObject *parent /TransferThis/ = 0);
87    virtual ~QBluetoothServer();
88    void close() /ReleaseGIL/;
89    bool listen(const QBluetoothAddress &address = QBluetoothAddress(), quint16 port = 0) /ReleaseGIL/;
90    QBluetoothServiceInfo listen(const QBluetoothUuid &uuid, const QString &serviceName = QString()) /ReleaseGIL/;
91    bool isListening() const;
92    void setMaxPendingConnections(int numConnections);
93    int maxPendingConnections() const;
94    bool hasPendingConnections() const;
95    QBluetoothSocket *nextPendingConnection() /Factory/;
96    QBluetoothAddress serverAddress() const;
97    quint16 serverPort() const;
98    void setSecurityFlags(QBluetooth::SecurityFlags security);
99    QBluetooth::SecurityFlags securityFlags() const;
100    QBluetoothServiceInfo::Protocol serverType() const;
101    QBluetoothServer::Error error() const;
102
103signals:
104    void newConnection();
105    void error(QBluetoothServer::Error);
106};
107
108%End
109