|
1 /* |
|
2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
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: The view that handles paired devices. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef BTUIBLOCKEDDEVICESVIEW_H |
|
19 #define BTUIBLOCKEDDEVICESVIEW_H |
|
20 |
|
21 #include <aknview.h> |
|
22 #include <eikmenup.h> // Menu pane definitions |
|
23 #include <btengdevman.h> |
|
24 #include "BtuiPluginInterface.h" |
|
25 #include "BTUIListedDevicesView.h" |
|
26 #include <gstabbedview.h> |
|
27 |
|
28 |
|
29 class CGSTabHelper; |
|
30 class CBTUIMainView; //base view |
|
31 class CBTUiDeviceContainer; |
|
32 class CBTDevModel; |
|
33 |
|
34 /** |
|
35 * Blocked devicew view of the pluetooth application. |
|
36 * |
|
37 * This view handles lists of blocked devices and the abolity to unblock them. |
|
38 * |
|
39 *@lib BTUIPlugin.dll |
|
40 *@since S60 v3.2 |
|
41 */ |
|
42 class CBTUIBlockedDevicesView : public CBTUIListedDevicesView, |
|
43 public MGSTabbedView |
|
44 |
|
45 { |
|
46 public: // New functions |
|
47 |
|
48 /** |
|
49 * Symbian 2nd phase constructor. |
|
50 */ |
|
51 void ConstructL( ); |
|
52 |
|
53 /** |
|
54 * Symbian 2nd phase constructor when serve as GS plugin. |
|
55 * @param aBaseView, GS base view pointer. |
|
56 * @param aTabViewArray, the array which contains all the tabed views' pointer. |
|
57 * @return None. |
|
58 */ |
|
59 void ConstructL( CBTUIMainView* aBaseView, CArrayPtrFlat<MGSTabbedView>* aTabViewArray ); |
|
60 |
|
61 /* |
|
62 * ECOM implementation instantiation factory function of |
|
63 * interface "CBtuiPluginInterface", to be used by BTUI Application. |
|
64 */ |
|
65 static CBTUIBlockedDevicesView* NewL(MBtuiPluginViewActivationObserver* aObserver = NULL); |
|
66 |
|
67 /** |
|
68 * Symbian 2 phase constructor used by base view when serve as GS plugin. |
|
69 * @param aBaseView, GS base view pointer. |
|
70 * @param aTabViewArray, the array which contains all the tabed views' pointer. |
|
71 * @return None. |
|
72 */ |
|
73 static CBTUIBlockedDevicesView* NewLC(CBTUIMainView* aBaseView, |
|
74 CArrayPtrFlat<MGSTabbedView>* aTabViewArray); |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 virtual ~CBTUIBlockedDevicesView(); |
|
80 |
|
81 |
|
82 /** |
|
83 * From MGSTabbedView: |
|
84 * Creates new icon for tab. Ownership is transferred to client. |
|
85 * @since 3.1 |
|
86 */ |
|
87 CGulIcon* CreateTabIconL(); |
|
88 |
|
89 public: // Functions from base classes |
|
90 |
|
91 /** |
|
92 * From CAknView Returns view id. |
|
93 * @param None. |
|
94 * @return View id. |
|
95 */ |
|
96 TUid Id() const; |
|
97 |
|
98 /** |
|
99 * From CAknView Handles user commands. |
|
100 * @param aCommand A command id. |
|
101 * @return None. |
|
102 */ |
|
103 void HandleCommandL(TInt aCommand); |
|
104 |
|
105 /** Dim/unDim middleSoftkey. |
|
106 * This function is called by CBTUiDeviceContainer |
|
107 * durings screen refreshes based on if there are devices or not. |
|
108 * |
|
109 * @param aDimmed. If this is true the middleSoftKey is invisible. |
|
110 */ |
|
111 void DimMskL(TBool aDimmed); |
|
112 |
|
113 /** |
|
114 * From CAknView Dynamically initialises options menu. |
|
115 * @param aResourceId Id identifying the menu pane to initialise. |
|
116 * @param aMenuPane The in-memory representation of the menu pane. |
|
117 * @return None. |
|
118 */ |
|
119 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
120 |
|
121 public: |
|
122 /** |
|
123 * Informs the observer that adevice has been changes or a new device added. |
|
124 * @param aErr Symbian error code |
|
125 * @param aDevice the device which is changed. If iAddr == 0, it's for notifiying "GetAllDevices()", |
|
126 * @param aEnable True: pair/authorize/block/connect; False: unpair/unauthorize/unblock/disconnect |
|
127 * @param aDevNameArray hold conflicting devices' short names if "AlreadyExist" error happened during "connect" |
|
128 * @return None. |
|
129 */ |
|
130 void NotifyChangeDeviceComplete(const TInt aErr, const TBTDevice& aDevice, |
|
131 const RBTDevNameArray* aDevNameArray = NULL); |
|
132 |
|
133 /** Updates the shown device list. This module will send this list forward |
|
134 * to container that takes care of the actual display of those devices |
|
135 * |
|
136 *@param aDevices all the devices to be shown |
|
137 *@param aSelectedItemIndex currently selected item after refresh. |
|
138 */ |
|
139 void RefreshDeviceList(const RDeviceArray* aDevices,TInt aSelectedItemIndex); |
|
140 |
|
141 protected: |
|
142 /** |
|
143 * C++ default constructor. |
|
144 */ |
|
145 CBTUIBlockedDevicesView (MBtuiPluginViewActivationObserver* aObserver= NULL); |
|
146 |
|
147 private: // Functions from base classes |
|
148 |
|
149 /** |
|
150 * From CAknView Activates view. |
|
151 * @param aPrevViewId Id of previous view. |
|
152 * @param aCustomMessageId Custom message id. |
|
153 * @param aCustomMessage Custom message. |
|
154 * @return None. |
|
155 */ |
|
156 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
157 TUid aCustomMessageId, |
|
158 const TDesC8& aCustomMessage ); |
|
159 |
|
160 /** |
|
161 * From CAknView Deactivates view. |
|
162 * @param None. |
|
163 * @return None. |
|
164 */ |
|
165 void DoDeactivate(); |
|
166 |
|
167 private: // Data |
|
168 |
|
169 CGSTabHelper* iTabHelper; |
|
170 CBTUIMainView* iBaseView; |
|
171 TBool iConstructAsGsPlugin; // Flag that indicate this obj is served as GS plugin not BTUI app's plugin. |
|
172 MBtuiPluginViewActivationObserver* iActivationObserver; // view activation observer |
|
173 }; |
|
174 |
|
175 #endif |
|
176 |