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 <cpbasesettingview.h>
|
|
22 |
#include <hbaction.h>
|
|
23 |
#include <hbtoolbar.h>
|
|
24 |
#include "btcpuibaseview.h"
|
|
25 |
|
|
26 |
class HbGroupBox;
|
|
27 |
class HbLabel;
|
42
|
28 |
class HbLineEdit;
|
31
|
29 |
class HbPushButton;
|
|
30 |
class HbIcon;
|
|
31 |
class HbDocumentLoader;
|
42
|
32 |
class HbDataForm;
|
|
33 |
|
31
|
34 |
class HbDataFormModel;
|
42
|
35 |
//class HbDataFormModelItem;
|
31
|
36 |
class CpSettingFormItemData;
|
|
37 |
class BtAbstractDelegate;
|
42
|
38 |
class BtCpUiDeviceDetail;
|
31
|
39 |
|
|
40 |
class BtCpUiDeviceView : public BtCpUiBaseView
|
|
41 |
{
|
|
42 |
Q_OBJECT
|
|
43 |
|
|
44 |
public:
|
|
45 |
explicit BtCpUiDeviceView(
|
|
46 |
BtSettingModel &settingModel,
|
|
47 |
BtDeviceModel &deviceModel,
|
|
48 |
QGraphicsItem *parent = 0);
|
|
49 |
virtual ~BtCpUiDeviceView();
|
42
|
50 |
virtual void activateView( const QVariant& value, bool fromBackButton );
|
31
|
51 |
virtual void deactivateView();
|
|
52 |
virtual void setSoftkeyBack();
|
42
|
53 |
|
31
|
54 |
public slots:
|
|
55 |
|
|
56 |
virtual void switchToPreviousView();
|
42
|
57 |
void changeOrientation( Qt::Orientation orientation );
|
31
|
58 |
void updateDeviceData();
|
|
59 |
void changeBtDeviceName();
|
|
60 |
void pairUnpair();
|
|
61 |
void connectDisconnect();
|
|
62 |
void pairDelegateCompleted(int status);
|
|
63 |
void unpairDelegateCompleted(int status);
|
|
64 |
void connectDelegateCompleted(int status);
|
|
65 |
void disconnectDelegateCompleted(int status);
|
42
|
66 |
void changeDevNameDelegateCompleted(int status, QVariant param);
|
|
67 |
void handleDeviceSetting();
|
|
68 |
void handleDeviceSettingsChange(bool status);
|
|
69 |
|
31
|
70 |
private:
|
|
71 |
void clearViewData();
|
|
72 |
void pairDevice();
|
|
73 |
void unpairDevice();
|
|
74 |
void connectDevice();
|
|
75 |
void disconnectDevice();
|
42
|
76 |
void setDeviceCategory(int cod, int majorRole);//cod:class of device
|
31
|
77 |
void setDeviceStatus(int majorRole);
|
42
|
78 |
void setConnectionCombobox();
|
31
|
79 |
void setTextAndVisibilityOfButtons();
|
42
|
80 |
void updateStatusVariables(int majorRole);
|
47
|
81 |
void loadDeviceDetails();
|
|
82 |
void unloadDeviceDetails();
|
|
83 |
void setPrevBtDeviceName();
|
|
84 |
|
31
|
85 |
private:
|
|
86 |
HbDocumentLoader *mLoader;
|
42
|
87 |
//HbGroupBox *mGroupBox;
|
31
|
88 |
HbLabel *mDeviceIcon;
|
42
|
89 |
HbLineEdit *mDeviceName;
|
31
|
90 |
HbLabel *mDeviceCategory;
|
|
91 |
HbLabel *mDeviceStatus;
|
|
92 |
|
42
|
93 |
HbDataForm *mConnectionCombobox;
|
|
94 |
HbDataFormModel *mConnectionComboboxModel;
|
|
95 |
|
31
|
96 |
HbPushButton *mPair_Unpair;
|
|
97 |
HbPushButton *mConnect_Disconnect;
|
|
98 |
HbPushButton *mDeviceSetting;
|
|
99 |
|
|
100 |
|
|
101 |
// data structures for switching between views
|
|
102 |
bool mEventFilterInstalled;
|
|
103 |
int mAutoCmdId;
|
|
104 |
Qt::Orientation mOrientation;
|
|
105 |
|
|
106 |
HbMainWindow* mMainWindow;
|
|
107 |
BtCpUiBaseView* mMainView;
|
|
108 |
//BtCpUiBaseView* mDeviceView;
|
|
109 |
HbAction *mSoftKeyBackAction;
|
|
110 |
|
|
111 |
QModelIndex mDeviceIndex;
|
|
112 |
QVariant mDeviceBdAddr;
|
|
113 |
|
|
114 |
//true -> device is paired; false -> device is unpaired
|
42
|
115 |
bool mPairedStatus;
|
31
|
116 |
|
|
117 |
//true-> device is connected; false -> device is disconnected
|
42
|
118 |
bool mConnectedStatus;
|
47
|
119 |
bool mPreviousConnectedStatus;
|
42
|
120 |
bool mTrustedStatus;
|
|
121 |
bool mBlockedStatus;
|
|
122 |
|
|
123 |
//true -> device is connectable
|
31
|
124 |
//e.g. not possible to connect to a phone, but possible to connect to a headset
|
|
125 |
bool mConnectable;
|
|
126 |
|
|
127 |
BtAbstractDelegate* mAbstractDelegate;
|
|
128 |
|
42
|
129 |
BtCpUiDeviceDetail* mDeviceDetail;
|
31
|
130 |
|
|
131 |
};
|
|
132 |
|
|
133 |
#endif
|