29
|
1 |
/*
|
42
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
29
|
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: Main View of BT Application
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef BTCPUIMAINVIEW_H
|
|
19 |
#define BTCPUIMAINVIEW_H
|
|
20 |
|
|
21 |
#include "btcpuibaseview.h"
|
|
22 |
#include <btqtconstants.h>
|
57
|
23 |
#include <btdelegateconsts.h>
|
|
24 |
#include "btcpuiviewmgr.h"
|
29
|
25 |
|
|
26 |
class HbLabel;
|
|
27 |
class HbLineEdit;
|
|
28 |
class HbPushButton;
|
|
29 |
class HbIcon;
|
|
30 |
class HbComboBox;
|
|
31 |
class HbDocumentLoader;
|
|
32 |
class HbGridView;
|
|
33 |
class BtAbstractDelegate;
|
31
|
34 |
class HbListView;
|
42
|
35 |
class HbGroupBox;
|
47
|
36 |
class HbDataForm;
|
29
|
37 |
|
57
|
38 |
class BtcpuiMainView : public BtcpuiBaseView, public BtcpuiViewMgr
|
29
|
39 |
{
|
|
40 |
Q_OBJECT
|
|
41 |
|
|
42 |
public:
|
57
|
43 |
|
|
44 |
explicit BtcpuiMainView(QGraphicsItem *parent = 0 );
|
|
45 |
|
|
46 |
explicit BtcpuiMainView(BtSettingModel &settingModel,
|
31
|
47 |
BtDeviceModel &deviceModel,
|
|
48 |
QGraphicsItem *parent = 0 );
|
57
|
49 |
|
|
50 |
~BtcpuiMainView();
|
29
|
51 |
|
57
|
52 |
// from base class BtcpuiBaseView
|
|
53 |
virtual void activateView( const QVariant& value, bool backNavi);
|
|
54 |
|
29
|
55 |
virtual void deactivateView();
|
|
56 |
|
57
|
57 |
virtual void createContextMenuActions(int majorRole);
|
|
58 |
|
29
|
59 |
public slots:
|
|
60 |
void changeOrientation( Qt::Orientation orientation );
|
|
61 |
void changePowerState();
|
57
|
62 |
void changeVisibility(int index);
|
42
|
63 |
void changeBtLocalName();
|
29
|
64 |
void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
57
|
65 |
void launchDeviceDiscovery();
|
|
66 |
void goToSearchView();
|
42
|
67 |
|
29
|
68 |
//from delegate classes
|
70
|
69 |
void powerDelegateCompleted(int status);
|
29
|
70 |
void visibilityDelegateCompleted(int status);
|
57
|
71 |
void btNameDelegateCompleted(int status);
|
42
|
72 |
void allActionTriggered();
|
57
|
73 |
void pairActionTriggered();
|
|
74 |
void menuActionTriggered(HbAction *action);
|
|
75 |
virtual void viewByDialogClosed(HbAction* action);
|
|
76 |
|
|
77 |
void disconnectAllDelegateCompleted(int status);
|
|
78 |
void onRemoveQuestionDialogClosed(int action);
|
|
79 |
void aboutToShowOptionsMenu();
|
29
|
80 |
|
57
|
81 |
// returns the search view instance.
|
|
82 |
BtcpuiBaseView *searchView();
|
|
83 |
|
|
84 |
// From BtcpuiViewMgr
|
|
85 |
BtcpuiBaseView *deviceView();
|
|
86 |
|
|
87 |
void switchView(BtcpuiBaseView *from, BtcpuiBaseView *destination,
|
|
88 |
const QVariant &init, bool backNavi);
|
|
89 |
|
42
|
90 |
private:
|
|
91 |
enum filterType {
|
|
92 |
BtuiAll = 0,
|
|
93 |
BtuiPaired
|
|
94 |
};
|
29
|
95 |
|
|
96 |
private:
|
57
|
97 |
|
|
98 |
void loadDocument();
|
|
99 |
|
29
|
100 |
VisibilityMode indexToVisibilityMode(int index);
|
|
101 |
int visibilityModeToIndex(VisibilityMode mode);
|
|
102 |
|
|
103 |
//Functions to set the Previous Local settings in case of error
|
|
104 |
void setPrevBtLocalName();
|
|
105 |
void setPrevVisibilityMode();
|
57
|
106 |
void removeRegistryDevices(BtDelegate::EditorType type);
|
29
|
107 |
|
57
|
108 |
void updateDeviceListFilter(BtcpuiMainView::filterType filter);
|
|
109 |
|
|
110 |
void updateOptionsMenu();
|
42
|
111 |
|
67
|
112 |
|
29
|
113 |
private:
|
42
|
114 |
|
57
|
115 |
// search view. Owned
|
|
116 |
BtcpuiBaseView *mSearchView;
|
|
117 |
// device view. Owned.
|
|
118 |
BtcpuiBaseView *mDeviceView;
|
|
119 |
|
29
|
120 |
HbDocumentLoader *mLoader;
|
42
|
121 |
|
29
|
122 |
HbLineEdit *mDeviceNameEdit;
|
|
123 |
HbPushButton *mPowerButton;
|
|
124 |
HbComboBox *mVisibilityMode;
|
57
|
125 |
HbGridView *mDeviceList;
|
42
|
126 |
|
29
|
127 |
Qt::Orientation mOrientation;
|
|
128 |
|
42
|
129 |
HbAction *mAllAction;
|
|
130 |
HbAction *mPairAction;
|
47
|
131 |
HbDataForm *mDataForm;
|
|
132 |
HbAction* mRemovePairedDevices;
|
|
133 |
HbAction* mRemoveDevices;
|
|
134 |
HbMenu* mSubMenu;
|
57
|
135 |
BtDelegate::EditorType mRemoveDevDelegateType;
|
|
136 |
|
29
|
137 |
};
|
|
138 |
#endif // BTCPUIMAINVIEW_H
|