|
1 /* |
|
2 * |
|
3 * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of the License "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Original Contributors: |
|
11 * Comarch S.A. - original contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef HSPREMOTEAUDIOVOLUMECONTROL_H |
|
20 #define HSPREMOTEAUDIOVOLUMECONTROL_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "hspfeaturecommons.h" |
|
25 |
|
26 class CHsHSPCommand; |
|
27 class CHsHSPSettings; |
|
28 |
|
29 /** |
|
30 * @brief Represents "Remote audio volume control" feature |
|
31 */ |
|
32 class CHsHSPRemoteAudioVolumeControl : public CBase, |
|
33 public MHsHSPProcedureCommons |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * |
|
40 * @param aObserver feature observer |
|
41 * |
|
42 * @return instance of class |
|
43 */ |
|
44 static CHsHSPRemoteAudioVolumeControl* NewL( |
|
45 MHsHSPFeatureProviderObserver* aObserver ); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 * |
|
50 * @param aObserver feature observer |
|
51 * |
|
52 * @return instance of class |
|
53 */ |
|
54 static CHsHSPRemoteAudioVolumeControl* NewLC( |
|
55 MHsHSPFeatureProviderObserver* aObserver ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CHsHSPRemoteAudioVolumeControl(); |
|
61 |
|
62 public: |
|
63 |
|
64 /** |
|
65 * Resets volume settings |
|
66 */ |
|
67 void Reset(); |
|
68 |
|
69 public: |
|
70 //Methods inherited from MHsHFPProcedureCommons |
|
71 TInt ProcessCommand( const CHsHSPCommand* aInputCmd, |
|
72 CHsHSPCommand &aOutputCmd ); |
|
73 |
|
74 private: |
|
75 |
|
76 /** |
|
77 * Constructor for performing 1st stage construction |
|
78 * |
|
79 * @param aObserver feature observer |
|
80 */ |
|
81 CHsHSPRemoteAudioVolumeControl( MHsHSPFeatureProviderObserver* aObserver ); |
|
82 |
|
83 /** |
|
84 * Constructor for performing 2nd stage construction |
|
85 */ |
|
86 void ConstructL(); |
|
87 |
|
88 private: |
|
89 |
|
90 /** |
|
91 * Informs observer about procedure's completion |
|
92 * |
|
93 * @param aErr error value |
|
94 */ |
|
95 void InformObserver( TInt aErr ); |
|
96 |
|
97 /** |
|
98 * Sets volume level. Value is retrieved from AT command. |
|
99 * |
|
100 * @param aCmd AT command |
|
101 */ |
|
102 void SetVolumeLevelL( const CHsHSPCommand* aCmd ); |
|
103 |
|
104 /** |
|
105 * Sets mic gain level. Value is retrieved from AT command. |
|
106 * |
|
107 * @param aCmd AT command |
|
108 */ |
|
109 void SetMicGainLevelL( const CHsHSPCommand* aCmd ); |
|
110 |
|
111 /** |
|
112 * Checks if passed AT command's params are valid. Leaves if invalid. |
|
113 * |
|
114 * @param aCmd AT command |
|
115 */ |
|
116 void CheckParamsL( const CHsHSPCommand* aCmd ); |
|
117 private: |
|
118 |
|
119 /** Procedure's type */ |
|
120 const THSPProcedure iHSPProc = EHSPVolumeControl; |
|
121 |
|
122 /** Pointer to observer, not owned */ |
|
123 MHsHSPFeatureProviderObserver* iObserver; |
|
124 |
|
125 /** Pointer to profile's settings */ |
|
126 CHsHSPSettings* iSettings; |
|
127 |
|
128 /** |
|
129 * Denotes if the next expected command is <cr><lf> OK <cr><lf> |
|
130 * after +VGM handled |
|
131 */ |
|
132 TBool iWaitingForVgmOK; |
|
133 |
|
134 /** |
|
135 * Denotes if the next expected command is <cr><lf> OK <cr><lf> |
|
136 * after +VGS handled |
|
137 */ |
|
138 TBool iWaitingForVgsOK; |
|
139 |
|
140 }; |
|
141 |
|
142 #endif // HSPREMOTEAUDIOVOLUMECONTROL_H |