31
|
1 |
/*
|
42
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
31
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0""
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef BTCPUIDEVICEVIEW_H
|
|
19 |
#define BTCPUIDEVICEVIEW_H
|
|
20 |
|
|
21 |
#include <hbaction.h>
|
|
22 |
#include <hbtoolbar.h>
|
|
23 |
#include "btcpuibaseview.h"
|
|
24 |
|
|
25 |
class HbGroupBox;
|
|
26 |
class HbLabel;
|
42
|
27 |
class HbLineEdit;
|
31
|
28 |
class HbPushButton;
|
|
29 |
class HbIcon;
|
|
30 |
class HbDocumentLoader;
|
70
|
31 |
class HbComboBox;
|
31
|
32 |
class CpSettingFormItemData;
|
|
33 |
class BtAbstractDelegate;
|
42
|
34 |
class BtCpUiDeviceDetail;
|
31
|
35 |
|
57
|
36 |
class BtcpuiDeviceView : public BtcpuiBaseView
|
31
|
37 |
{
|
|
38 |
Q_OBJECT
|
|
39 |
|
|
40 |
public:
|
57
|
41 |
explicit BtcpuiDeviceView(BtSettingModel &settingModel,
|
31
|
42 |
BtDeviceModel &deviceModel,
|
|
43 |
QGraphicsItem *parent = 0);
|
57
|
44 |
|
|
45 |
virtual ~BtcpuiDeviceView();
|
|
46 |
virtual void activateView( const QVariant& value, bool backNavi);
|
31
|
47 |
virtual void deactivateView();
|
42
|
48 |
|
31
|
49 |
public slots:
|
|
50 |
|
57
|
51 |
void backToPreviousView();
|
42
|
52 |
void changeOrientation( Qt::Orientation orientation );
|
31
|
53 |
void updateDeviceData();
|
|
54 |
void changeBtDeviceName();
|
57
|
55 |
void pairDevice();
|
|
56 |
void unpairDevice();
|
|
57 |
void connectDevice();
|
|
58 |
void disconnectDevice();
|
31
|
59 |
void pairDelegateCompleted(int status);
|
|
60 |
void unpairDelegateCompleted(int status);
|
|
61 |
void connectDelegateCompleted(int status);
|
|
62 |
void disconnectDelegateCompleted(int status);
|
57
|
63 |
void changeDevNameDelegateCompleted(int status);
|
42
|
64 |
void handleDeviceSetting();
|
|
65 |
void handleDeviceSettingsChange(bool status);
|
57
|
66 |
void connectionPreferenceChanged(int index);
|
42
|
67 |
|
31
|
68 |
private:
|
57
|
69 |
enum connectionSelection {
|
|
70 |
ConnectionAutomatic = 0,
|
|
71 |
ConnectionAlwaysAsk,
|
|
72 |
ConnectionBlocked
|
|
73 |
};
|
31
|
74 |
void clearViewData();
|
42
|
75 |
void setDeviceCategory(int cod, int majorRole);//cod:class of device
|
31
|
76 |
void setDeviceStatus(int majorRole);
|
70
|
77 |
|
57
|
78 |
void setTextAndVisibilityOfButtons(int majorProperty);
|
47
|
79 |
void loadDeviceDetails();
|
|
80 |
void unloadDeviceDetails();
|
|
81 |
void setPrevBtDeviceName();
|
57
|
82 |
void setDeviceAuthorised();
|
|
83 |
void setDeviceAlwaysAsk();
|
|
84 |
void setDeviceBlocked();
|
|
85 |
void updateButton(HbPushButton *button, const QString &iconName, const QString &text);
|
47
|
86 |
|
31
|
87 |
private:
|
|
88 |
HbDocumentLoader *mLoader;
|
|
89 |
HbLabel *mDeviceIcon;
|
42
|
90 |
HbLineEdit *mDeviceName;
|
31
|
91 |
HbLabel *mDeviceCategory;
|
|
92 |
HbLabel *mDeviceStatus;
|
|
93 |
|
70
|
94 |
HbComboBox *mCombobox;
|
42
|
95 |
|
31
|
96 |
HbPushButton *mPair_Unpair;
|
|
97 |
HbPushButton *mConnect_Disconnect;
|
|
98 |
HbPushButton *mDeviceSetting;
|
|
99 |
|
|
100 |
QModelIndex mDeviceIndex;
|
|
101 |
QVariant mDeviceBdAddr;
|
42
|
102 |
|
57
|
103 |
int mComboboxIndex;
|
31
|
104 |
|
|
105 |
BtAbstractDelegate* mAbstractDelegate;
|
|
106 |
|
42
|
107 |
BtCpUiDeviceDetail* mDeviceDetail;
|
31
|
108 |
|
|
109 |
};
|
|
110 |
|
|
111 |
#endif
|