1 /* |
|
2 * Copyright (c) 2008 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: Profile Settings Handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_EVTPROFILEHANDLER_H |
|
20 #define C_EVTPROFILEHANDLER_H |
|
21 |
|
22 // System Includes |
|
23 #include <e32base.h> |
|
24 #include <cenrepnotifyhandler.h> |
|
25 |
|
26 //Forward Declaration |
|
27 |
|
28 // Class Definition |
|
29 /** |
|
30 * Interface class to observe for profile settings change. |
|
31 * |
|
32 * @lib |
|
33 * @since S60 v9.1 |
|
34 */ |
|
35 class MEvtProfileObserver |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * This will notify when there is a change in profile settings |
|
40 */ |
|
41 virtual void HandleProfileSettingsChange( )=0; |
|
42 |
|
43 }; |
|
44 |
|
45 /** |
|
46 * Adapter class to get Profile Settings. |
|
47 * This class notifies any changes to Profile Settings if |
|
48 * observer(MEvtProfileObserver) is set. |
|
49 * |
|
50 * @lib |
|
51 * @since S60 v9.1 |
|
52 */ |
|
53 NONSHARABLE_CLASS( CEvtProfileHandler ): public CBase, |
|
54 public MCenRepNotifyHandlerCallback |
|
55 { |
|
56 public: |
|
57 /** |
|
58 * Constructs a new instance of Profile Handler. |
|
59 * |
|
60 * @return The new instance of Profile Handler object. |
|
61 * @leave System wide error code if the object creation fails. |
|
62 */ |
|
63 static CEvtProfileHandler* NewL( MEvtProfileObserver& aObserver ); |
|
64 |
|
65 /** |
|
66 * Constructs a new instance of Profile Handler. |
|
67 * Leaves the created instance on the cleanup stack. |
|
68 * |
|
69 * @return The new instance of Profile Handler object. |
|
70 * @leave System wide error code if the object creation fails. |
|
71 */ |
|
72 static CEvtProfileHandler* NewLC( MEvtProfileObserver& aObserver ); |
|
73 |
|
74 /** |
|
75 * Destructor. |
|
76 */ |
|
77 virtual ~CEvtProfileHandler(); |
|
78 |
|
79 public: // Public Functions |
|
80 |
|
81 /** |
|
82 * Volume settings in the currently active profile. |
|
83 * @return Volume value of the active profile. |
|
84 */ |
|
85 TInt Volume( ); |
|
86 |
|
87 /** |
|
88 * Check if the Ringtype is silent. |
|
89 * @return ETrue if the ringing type is silent. |
|
90 */ |
|
91 TBool IsSilentRingingType( ); |
|
92 |
|
93 /** |
|
94 * Check if the Vibra settings is On/ff. |
|
95 * @return ETrue if the Vibra is On in Active Profile. |
|
96 */ |
|
97 TBool IsVibra( ); |
|
98 |
|
99 private: // Methods derived from MCenRepNotifyHandlerCallback |
|
100 void HandleNotifyInt(TUint32 aId, TInt aNewValue); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Default C++ Constructor. |
|
106 */ |
|
107 CEvtProfileHandler( MEvtProfileObserver& aObserver ); |
|
108 |
|
109 /** |
|
110 * Second phase of the two phase constructor. |
|
111 */ |
|
112 void ConstructL(); |
|
113 |
|
114 private: // data |
|
115 |
|
116 /** |
|
117 * Profile Settings change Observer. |
|
118 */ |
|
119 MEvtProfileObserver& iObserver; |
|
120 |
|
121 /** |
|
122 * Cenrep Session to Profile Settings. |
|
123 * Own |
|
124 */ |
|
125 CRepository* iProfileSession; |
|
126 |
|
127 /** |
|
128 * Cenrep Session to Vibra Settings. |
|
129 * Own |
|
130 */ |
|
131 CRepository* iVibraSession; |
|
132 |
|
133 /** |
|
134 * Handler to Cenrep Notifier |
|
135 * Own |
|
136 */ |
|
137 CCenRepNotifyHandler* iVolumeNotifyHandler; |
|
138 |
|
139 /** |
|
140 * Handler to Cenrep Notifier |
|
141 * Own |
|
142 */ |
|
143 CCenRepNotifyHandler* iTypeNotifyHandler; |
|
144 |
|
145 /** |
|
146 * Handler to Cenrep Notifier |
|
147 * Own |
|
148 */ |
|
149 CCenRepNotifyHandler* iVibraNotifyHandler; |
|
150 |
|
151 /** |
|
152 * Profile Volume Settings. |
|
153 */ |
|
154 TInt iRingingVolume; |
|
155 |
|
156 /** |
|
157 * Profile Ringing Type Settings. |
|
158 */ |
|
159 TInt iRingingType; |
|
160 |
|
161 /** |
|
162 * Profile Vibra Settings. |
|
163 */ |
|
164 TInt iVibra; |
|
165 }; |
|
166 |
|
167 #endif C_EVTPROFILEHANDLER_H |
|