summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/bluebase.h
blob: 48883d21fb331aaf63a288cc95a6b9e03c3bc6a6 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

#ifndef BLUEBASE_H
#define BLUEBASE_H

#include <qvariant.h>
#include <qwidget.h>
#include <qscrollview.h>
#include <qsplitter.h>
#include <qlist.h>
#include <qpixmap.h>

#include "bluetoothbase.h"

#include "btserviceitem.h"
#include "btdeviceitem.h"

#include "popuphelper.h"

#include "bticonloader.h"

#include <remotedevice.h>
#include <manager.h>

class QVBox;
class QHBoxLayout;
class QGridLayout;
class QFrame;
class QLabel;
class QPushButton;
class QTabWidget;
class QCheckBox;
class BTConnectionItem;


namespace OpieTooth {

    class BlueBase : public BluetoothBase {
        Q_OBJECT

    public:
        BlueBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
        ~BlueBase();

       static QString appName() { return QString::fromLatin1("bluetooth-manager"); }

    protected:


    private slots:
        void startScan();


    private:
        bool find( const RemoteDevice& device );
	void readConfig();
	void writeConfig();
        void readSavedDevices();
        void writeSavedDevices();
        void writeToHciConfig();
	QString status()const;
	void initGui();
        void setInfo();

        PopupHelper m_popHelper;
        Manager *m_localDevice;
        QMap<QString,BTDeviceItem*> m_deviceList;

        void deviceActive( const RemoteDevice &device );

	QString m_deviceName;
	QString m_defaultPasskey;
	bool m_useEncryption;
	bool m_enableAuthentification;
	bool m_enablePagescan;
	bool m_enableInquiryscan;

        QPixmap m_offPix;
        QPixmap m_onPix;
        QPixmap m_findPix;

        BTIconLoader *m_iconLoader;

	private slots:
        void addSearchedDevices( const QValueList<RemoteDevice> &newDevices );
        void addServicesToDevices();
        void addServicesToDevice( BTDeviceItem *item );
        void addServicesToDevice( const QString& device, Services::ValueList );
        void addConnectedDevices();
        void addConnectedDevices( ConnectionState::ValueList );
        void startServiceActionClicked( QListViewItem *item );
        void startServiceActionHold( QListViewItem *, const QPoint &, int );
        void deviceActive( const QString& mac, bool connected  );
        void applyConfigChanges();
	void addSignalStrength();
	void addSignalStrength( const QString& mac, const QString& strengh );
	void rfcommDialog();

    };

}

#endif