Merge branch 'mr'
[profile/ivi/bluetooth-qt.git] / asyncagent.h
1 /*  -*- Mode: C++ -*-
2  *
3  * meego handset bluetooth
4  * Copyright © 2010, Intel Corporation.
5  *
6  * This program is licensed under the terms and conditions of the
7  * Apache License, version 2.0.  The full text of the Apache License is at
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  */
11
12 #ifndef ASYNCAGENT_H
13 #define ASYNCAGENT_H
14
15 #include "bluetoothbaseagent.h"
16 #include "bluetoothdevice.h"
17
18 class AsyncAgent : public BluetoothBaseAgent
19 {
20     Q_OBJECT
21 public:
22         explicit AsyncAgent(QString path, QObject *parent = 0);
23
24         BluetoothDevice* device() { return deviceToPair; }
25
26         void requestConfirmation(OrgBluezDeviceInterface &device, uint key);
27         uint requestPasskey(OrgBluezDeviceInterface &device);
28         QString requestPidCode(OrgBluezDeviceInterface &device);
29         void release();
30
31 signals:
32
33 public slots:
34         void replyRequestConfirmation(bool confirmed);
35         void replyPasskey(uint passkey);
36         void replyRequestPidCode(QString pidCode);
37
38 private:
39         QDBusMessage pendingMessage;
40         QDBusConnection m_connection;
41
42         BluetoothDevice* deviceToPair;
43
44 };
45
46 #endif // ASYNCAGENT_H