|
1 /* |
|
2 * Copyright (c) 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: Handler for camera, keypad and video player resources |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "musuipropertyobserver.h" |
|
21 #include "musresourceproperties.h" |
|
22 #include "mussettingskeys.h" |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 class CMusUiPropertyWatch; |
|
27 class MMusUiEventObserver; |
|
28 class CAknWaitDialog; |
|
29 |
|
30 /** |
|
31 * Encapsulates handling and observing of camera, keypad and video player |
|
32 * hardware and software resources. |
|
33 */ |
|
34 class CMusUiResourceHandler : public CBase, |
|
35 public MMusUiPropertyObserver |
|
36 { |
|
37 |
|
38 public: |
|
39 |
|
40 virtual ~CMusUiResourceHandler(); |
|
41 |
|
42 static CMusUiResourceHandler* NewL( MMusUiEventObserver& aObserver ); |
|
43 |
|
44 public: // API |
|
45 |
|
46 TBool RequestKeypadL( TBool aMandatory = EFalse ); |
|
47 |
|
48 TBool RequestCameraL( TBool aMandatory = EFalse ); |
|
49 |
|
50 TBool RequestVideoPlayerL( TBool aMandatory = EFalse ); |
|
51 |
|
52 |
|
53 public: // From MMusUiPropertyObserver |
|
54 |
|
55 /** |
|
56 * @param TUint aKey - The Property key |
|
57 * @param TInt aValue - The value of the Property key |
|
58 */ |
|
59 virtual void PropertyChanged( const TUint aKey, const TInt aValue ); |
|
60 |
|
61 virtual void HandlePropertyError( const TInt aReason ); |
|
62 |
|
63 |
|
64 private: |
|
65 |
|
66 CMusUiResourceHandler( MMusUiEventObserver& aObserver ); |
|
67 |
|
68 void ConstructL(); |
|
69 |
|
70 |
|
71 private: // Helpers |
|
72 |
|
73 TBool ShowChangeProductModeDialogL( const TDesC& aPrompt ); |
|
74 |
|
75 TBool IsCurrentlyAvailable( NMusResourceApi::TAvailability aResourceAvailability, |
|
76 MusSettingsKeys::TUsability aResourceUsability ); |
|
77 |
|
78 |
|
79 private: // data |
|
80 |
|
81 /** |
|
82 * |
|
83 */ |
|
84 MMusUiEventObserver& iObserver; |
|
85 |
|
86 /** |
|
87 * |
|
88 */ |
|
89 CMusUiPropertyWatch* iCameraResourceWatch; |
|
90 |
|
91 /** |
|
92 * |
|
93 */ |
|
94 CMusUiPropertyWatch* iKeypadResourceWatch; |
|
95 |
|
96 /** |
|
97 * It holds the value for CameraAvailability. |
|
98 * If it is static available ( Bit set to 0 in Cenrep) |
|
99 * then it will be available always , if the bit set |
|
100 * to 1 ( dynamic ) then it should be monitored by property |
|
101 * listner and set the value accordingly. |
|
102 */ |
|
103 NMusResourceApi::TAvailability iCameraAvailability; |
|
104 |
|
105 /** |
|
106 * It holds the value for KeypadAvailability. |
|
107 * If it is static available ( Bit set to 0 in Cenrep) |
|
108 * then it will be available always , if the bit set |
|
109 * to 1 ( dynamic ) then it should be monitored by property |
|
110 * listner and set the value accordingly. |
|
111 */ |
|
112 NMusResourceApi::TAvailability iKeypadAvailability; |
|
113 |
|
114 /** |
|
115 * It holds the value for CameraUsability. |
|
116 * Intially read from cenrep and assigned |
|
117 * Refer mussettingskeys.h to know the bit value. |
|
118 */ |
|
119 MusSettingsKeys::TUsability iCameraUsability; |
|
120 |
|
121 /** |
|
122 * It holds the value for KeypadUsability. |
|
123 * Intially read from cenrep and assigned |
|
124 * Refer mussettingskeys.h to know the bit value. |
|
125 */ |
|
126 MusSettingsKeys::TUsability iKeypadUsability; |
|
127 |
|
128 /** |
|
129 * It holds the value for VideoplayerUsability. |
|
130 * Intially read from cenrep and assigned |
|
131 * Refer mussettingskeys.h to know the bit value. |
|
132 */ |
|
133 MusSettingsKeys::TUsability iVideoplayerUsability; |
|
134 |
|
135 /** |
|
136 * |
|
137 */ |
|
138 TBool iCameraAvailibilityInProgress; |
|
139 |
|
140 /** |
|
141 * |
|
142 */ |
|
143 TBool iKeypadAvailibilityInProgress; |
|
144 |
|
145 /** |
|
146 * |
|
147 */ |
|
148 CAknWaitDialog* iChangeProductModeDialog; |
|
149 |
|
150 /** |
|
151 * |
|
152 */ |
|
153 HBufC* iDialogPrompt; |
|
154 |
|
155 }; |
|
156 |
|
157 |
|
158 |
|
159 |