|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MUSENGSESSION_H |
|
20 #define MUSENGSESSION_H |
|
21 |
|
22 // USER INCLUDES |
|
23 #include "musunittesting.h" |
|
24 |
|
25 //SYSTEM INCLUDES |
|
26 #include <e32base.h> |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CMusEngTelephoneUtils; |
|
31 class CMusSipProfileHandler; |
|
32 class CRepository; |
|
33 class MMusEngAudioRoutingObserver; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Base class for Multimedia Sharing Engine sessions, inherited by |
|
39 * CMusEngMceSession. |
|
40 * |
|
41 * CMusEngSession encapsulates all common activities example using |
|
42 * resources. |
|
43 * |
|
44 * @lib musengine.lib |
|
45 */ |
|
46 class CMusEngSession : public CBase |
|
47 { |
|
48 MUS_UNITTEST( UT_CMusEngSession ) |
|
49 |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Desctructor, finalize session |
|
54 * |
|
55 */ |
|
56 ~CMusEngSession(); |
|
57 |
|
58 |
|
59 public: // API FUNCTIONS |
|
60 |
|
61 /** |
|
62 * Returns currently assigned drawing area |
|
63 * |
|
64 * @return TRect This session drawing area recttangle |
|
65 */ |
|
66 IMPORT_C TRect Rect() const; |
|
67 |
|
68 /** |
|
69 * Sets new drawing area |
|
70 * |
|
71 * @param TRect This session new drawing area rectangle |
|
72 */ |
|
73 IMPORT_C void SetRectL( const TRect& aRect ); |
|
74 |
|
75 /** |
|
76 * Checks if audio routing can be changed using EnableLoudspeakerL |
|
77 * |
|
78 * @return ETrue if audio routing can be changed using EnableLoudspeakerL |
|
79 */ |
|
80 IMPORT_C TBool AudioRoutingCanBeChanged(); |
|
81 |
|
82 /** |
|
83 * Activates/deactivates loadspeaker |
|
84 * |
|
85 * @param TBool Enable or disable loudspeaker |
|
86 * @param TBool Show activation dialog |
|
87 */ |
|
88 IMPORT_C void EnableLoudspeakerL( TBool aEnable, TBool aShowDialog ); |
|
89 |
|
90 /** |
|
91 * Checks is loudspeaker enabled or disabled. |
|
92 * |
|
93 * @return TBool true if enabled |
|
94 */ |
|
95 IMPORT_C TBool IsLoudSpeakerEnabled() const; |
|
96 |
|
97 /** |
|
98 * Returns current volume level |
|
99 */ |
|
100 IMPORT_C TInt VolumeL() const; |
|
101 |
|
102 /** |
|
103 * Mutes CS call microphone. |
|
104 */ |
|
105 IMPORT_C void MuteMicL( TBool aMute ); |
|
106 |
|
107 /** |
|
108 * Returns current CS call mic mute state. |
|
109 */ |
|
110 IMPORT_C TBool IsMicMutedL(); |
|
111 |
|
112 /** |
|
113 * Sets audio routing observer. Can be set to NULL in order to indicate |
|
114 * ending of observing changes in audio routing. |
|
115 */ |
|
116 IMPORT_C void SetAudioRoutingObserver( |
|
117 MMusEngAudioRoutingObserver* aObserver ); |
|
118 |
|
119 |
|
120 public: // VIRTUAL API FUNCTIONS |
|
121 |
|
122 /** |
|
123 * Increases volume level by one. |
|
124 */ |
|
125 IMPORT_C virtual void VolumeUpL(); |
|
126 |
|
127 /** |
|
128 * Decreases volume level by one. |
|
129 */ |
|
130 IMPORT_C virtual void VolumeDownL(); |
|
131 |
|
132 /** |
|
133 * Set volume value |
|
134 * @param aVal the value of volume |
|
135 */ |
|
136 IMPORT_C virtual void SetVolumeL( TInt aVal ); |
|
137 |
|
138 /** |
|
139 * Enables or disables display. Call to this function is considered |
|
140 * as a permission or denial to draw to the display. |
|
141 */ |
|
142 virtual void EnableDisplayL( TBool aEnable ) = 0; |
|
143 |
|
144 /** |
|
145 * Mutes current audio stream meaning that any audio is not played or |
|
146 * sent to network. |
|
147 */ |
|
148 virtual void MuteL() = 0; |
|
149 |
|
150 /** |
|
151 * Unmute current audio stream meaning that all the audio is played |
|
152 * and if needed also sent to network. |
|
153 */ |
|
154 virtual void UnmuteL() = 0; |
|
155 |
|
156 |
|
157 protected: // INTERNAL |
|
158 |
|
159 virtual void RectChangedL() = 0; |
|
160 |
|
161 |
|
162 protected: |
|
163 |
|
164 /** |
|
165 * Constructor, private cannot be instantiate |
|
166 * |
|
167 * @param aRect reserved drawing area for this session |
|
168 */ |
|
169 CMusEngSession( const TRect& aRect ); |
|
170 |
|
171 |
|
172 protected: |
|
173 |
|
174 /** |
|
175 * second-phase constructor, called by those session specific |
|
176 * constructors |
|
177 */ |
|
178 void ConstructL(); |
|
179 |
|
180 |
|
181 private: // MEMBERS |
|
182 |
|
183 /** |
|
184 * Drawing area rect. |
|
185 */ |
|
186 TRect iRect; |
|
187 |
|
188 /** |
|
189 * Telephone utilities. |
|
190 */ |
|
191 CMusEngTelephoneUtils* iTelephoneUtils; |
|
192 |
|
193 }; |
|
194 |
|
195 #endif //MUSENGSESSION_H |