summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/darwin/btgcdtimer_p.h
blob: b927336be1a61060aedfd249999200e7c3257a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef BTGCDTIMER_P_H
#define BTGCDTIMER_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include "btutility_p.h"

#include <QtCore/private/qcore_mac_p.h>

#include <QtCore/qglobal.h>

#include <Foundation/Foundation.h>

QT_BEGIN_NAMESPACE

namespace DarwinBluetooth {

enum class OperationTimeout
{
    none,
    serviceDiscovery,
    includedServicesDiscovery,
    characteristicsDiscovery,
    characteristicRead,
    descriptorsDiscovery,
    descriptorRead,
    characteristicWrite
};

} // namespace DarwinBluetooth

QT_END_NAMESPACE

@protocol QT_MANGLE_NAMESPACE(GCDTimerDelegate)
@required
- (void)timeout:(id)sender;
@end

@interface QT_MANGLE_NAMESPACE(DarwinBTGCDTimer) : NSObject
- (instancetype)initWithDelegate:(id<QT_MANGLE_NAMESPACE(GCDTimerDelegate)>)delegate;
- (void)watchAfter:(id)object withTimeoutType:(QT_PREPEND_NAMESPACE(DarwinBluetooth)::OperationTimeout)type;
- (void)startWithTimeout:(qint64)ms step:(qint64)stepMS;
- (void)handleTimeout;
- (void)cancelTimer;
- (id)objectUnderWatch;
- (QT_PREPEND_NAMESPACE(DarwinBluetooth)::OperationTimeout)timeoutType;
@end

QT_NAMESPACE_ALIAS_OBJC_CLASS(DarwinBTGCDTimer);

QT_BEGIN_NAMESPACE

namespace DarwinBluetooth {

using GCDTimer = ObjCStrongReference<DarwinBTGCDTimer>;

} // namespace DarwinBluetooth

QT_END_NAMESPACE

#endif // BTGCDTIMER_P_H