|
1 /* |
|
2 * Copyright (c) 2006 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "musmanager.h" |
|
20 #include "musmanagerimpl.h" |
|
21 |
|
22 #include "musunittesting.h" |
|
23 #include "muslogger.h" |
|
24 #include "musavailabilityobserver.h" |
|
25 #include <featmgr.h> |
|
26 |
|
27 // --------------------------------------------------------------------------- |
|
28 // Default Constructor for CMusManager |
|
29 // CMusManager::CMusManager() |
|
30 // --------------------------------------------------------------------------- |
|
31 // |
|
32 CMusManager::CMusManager() |
|
33 { |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------------------------- |
|
37 // Two Phase Constructor |
|
38 // CMusManager::ConstructL() |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 void CMusManager::ConstructL() |
|
42 { |
|
43 FeatureManager::InitializeLibL(); |
|
44 TBool support = FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ); |
|
45 FeatureManager::UnInitializeLib(); |
|
46 if ( !support ) |
|
47 { |
|
48 User::Leave( KErrNotSupported ); |
|
49 } |
|
50 iImpl = CMusManagerImpl::NewL(); |
|
51 } |
|
52 |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // Two Phase Constructor |
|
56 // CMusManager::ConstructL() |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 void CMusManager::ConstructL( MMusAvailabilityObserver* aObserver ) |
|
60 { |
|
61 FeatureManager::InitializeLibL(); |
|
62 TBool support = FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ); |
|
63 FeatureManager::UnInitializeLib(); |
|
64 if ( !support ) |
|
65 { |
|
66 User::Leave( KErrNotSupported ); |
|
67 } |
|
68 iImpl = CMusManagerImpl::NewL( aObserver ); |
|
69 } |
|
70 |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // Two Phase Constructor |
|
74 // CMusManager::NewL() |
|
75 // --------------------------------------------------------------------------- |
|
76 // |
|
77 EXPORT_C CMusManager* CMusManager::NewL() |
|
78 { |
|
79 MUS_LOG( "mus: [MUSCLI] -> CMusManager::NewL()" ); |
|
80 CMusManager* self = CMusManager::NewLC(); |
|
81 CleanupStack::Pop( self ); |
|
82 MUS_LOG( "mus: [MUSCLI] <- CMusManager::NewL()" ); |
|
83 return self; |
|
84 } |
|
85 |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // Two Phase Constructor |
|
89 // CMusManager::NewLC() |
|
90 // --------------------------------------------------------------------------- |
|
91 // |
|
92 EXPORT_C CMusManager* CMusManager::NewLC() |
|
93 { |
|
94 MUS_LOG( "mus: [MUSCLI] -> CMusManager::NewLC()" ); |
|
95 |
|
96 CMusManager* self = new( ELeave ) CMusManager; |
|
97 CleanupStack::PushL( self ); |
|
98 self->ConstructL(); |
|
99 |
|
100 MUS_LOG( "mus: [MUSCLI] <- CMusManager::NewLC()" ); |
|
101 return self; |
|
102 } |
|
103 |
|
104 |
|
105 // --------------------------------------------------------------------------- |
|
106 // Two Phase Constructor |
|
107 // CMusManager::NewL() |
|
108 // --------------------------------------------------------------------------- |
|
109 // |
|
110 EXPORT_C CMusManager* CMusManager::NewL( MMusAvailabilityObserver* aObserver ) |
|
111 { |
|
112 MUS_LOG( "mus: [MUSCLI] -> CMusManager::NewL()" ); |
|
113 CMusManager* self = CMusManager::NewLC( aObserver ); |
|
114 CleanupStack::Pop( self ); |
|
115 MUS_LOG( "mus: [MUSCLI] <- CMusManager::NewL()" ); |
|
116 return self; |
|
117 } |
|
118 |
|
119 |
|
120 // --------------------------------------------------------------------------- |
|
121 // Two Phase Constructor |
|
122 // CMusManager::NewLC() |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 EXPORT_C CMusManager* CMusManager::NewLC( MMusAvailabilityObserver* aObserver ) |
|
126 { |
|
127 MUS_LOG( "mus: [MUSCLI] -> CMusManager::NewLC()" ); |
|
128 |
|
129 CMusManager* self = new( ELeave ) CMusManager; |
|
130 CleanupStack::PushL( self ); |
|
131 self->ConstructL( aObserver ); |
|
132 |
|
133 MUS_LOG( "mus: [MUSCLI] <- CMusManager::NewLC()" ); |
|
134 return self; |
|
135 } |
|
136 |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // Destructor |
|
140 // CMusManager::~CMusManager() |
|
141 // --------------------------------------------------------------------------- |
|
142 // |
|
143 CMusManager::~CMusManager() |
|
144 { |
|
145 MUS_LOG( "mus: [MUSCLI] -> CMusManager::~CMusManager()" ); |
|
146 delete iImpl; |
|
147 MUS_LOG( "mus: [MUSCLI] <- CMusManager::~CMusManager()" ); |
|
148 } |
|
149 |
|
150 // --------------------------------------------------------------------------- |
|
151 // CMusManager::ExamineAvailabilityL() |
|
152 // --------------------------------------------------------------------------- |
|
153 // |
|
154 EXPORT_C void CMusManager::ExamineAvailabilityL() |
|
155 { |
|
156 MUS_LOG( "mus: [MUSCLI] -> CMusManager::ExamineAvailabilityL()" ); |
|
157 iImpl->ExamineAvailabilityL(); |
|
158 MUS_LOG( "mus: [MUSCLI] <- CMusManager::ExamineAvailabilityL()" ); |
|
159 } |
|
160 |
|
161 // --------------------------------------------------------------------------- |
|
162 // CMusManager::AvailabilityL() |
|
163 // --------------------------------------------------------------------------- |
|
164 // |
|
165 EXPORT_C MultimediaSharing::TMusAvailabilityStatus CMusManager::AvailabilityL() |
|
166 { |
|
167 MUS_LOG( "mus: [MUSCLI] -> CMusManager::AvailabilityL()" ); |
|
168 MultimediaSharing::TMusAvailabilityStatus status = iImpl->AvailabilityL(); |
|
169 MUS_LOG( "mus: [MUSCLI] <- CMusManager::AvailabilityL()" ); |
|
170 return status; |
|
171 } |
|
172 |
|
173 // --------------------------------------------------------------------------- |
|
174 // CMusManager::HandleCommandL() |
|
175 // --------------------------------------------------------------------------- |
|
176 // |
|
177 EXPORT_C void CMusManager::HandleCommandL( |
|
178 MultimediaSharing::TCommandType aCommandType ) |
|
179 { |
|
180 MUS_LOG( "mus: [MUSCLI] -> CMusManager::HandleCommandL()" ); |
|
181 iImpl->HandleCommandL( aCommandType ); |
|
182 MUS_LOG( "mus: [MUSCLI] <- CMusManager::HandleCommandL()" ); |
|
183 } |
|
184 // --------------------------------------------------------------------------- |
|
185 // CMusManager::HandleSipRequestL( TRequestType aChannelId ) |
|
186 // --------------------------------------------------------------------------- |
|
187 // |
|
188 EXPORT_C void CMusManager::HandleSipRequestL( TRequestType aChannelId ) |
|
189 { |
|
190 MUS_LOG( "mus: [MUSCLI] -> CMusManager::HandleSipRequestL()" ); |
|
191 iImpl->HandleSipRequestL( ( TInt ) aChannelId ); |
|
192 MUS_LOG( "mus: [MUSCLI] <- CMusManager::HandleSipRequestL()" ); |
|
193 } |
|
194 |
|
195 // --------------------------------------------------------------------------- |
|
196 // CMusManager::StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ) |
|
197 // --------------------------------------------------------------------------- |
|
198 // |
|
199 EXPORT_C void CMusManager::StartApplicationL( |
|
200 MultimediaSharing::TMusUseCase aUseCase ) |
|
201 { |
|
202 MUS_LOG( "mus: [MUSCLI] -> CMusManager::StartApplicationL()" ); |
|
203 iImpl->StartApplicationL( aUseCase ); |
|
204 MUS_LOG( "mus: [MUSCLI] <- CMusManager::StartApplicationL()" ); |
|
205 } |
|
206 |
|
207 // --------------------------------------------------------------------------- |
|
208 // CMusManager::StopApplicationL() |
|
209 // --------------------------------------------------------------------------- |
|
210 // |
|
211 EXPORT_C void CMusManager::StopApplicationL() |
|
212 { |
|
213 MUS_LOG( "mus: [MUSCLI] -> CMusManager::StopApplicationL()" ); |
|
214 iImpl->StopApplicationL(); |
|
215 MUS_LOG( "mus: [MUSCLI] <- CMusManager::StopApplicationL()" ); |
|
216 } |