|
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 |
|
20 |
|
21 #include <sipprofile.h> |
|
22 #include "CMCETestUIEngineProfile.h" |
|
23 |
|
24 // Applicaple commands |
|
25 #include "TMCETestUIEngineCmdBase.h" |
|
26 #include "TMCETestUIEngineCmdRegister.h" |
|
27 #include "TMCETestUIEngineCmdUnregister.h" |
|
28 #include "TMCETestUIEngineCmdCreateSession.h" |
|
29 #include "TMCETestUIEngineCmdCreatePoCSession.h" |
|
30 #include "TMCETestUIEngineCmdCreateVoIPSession.h" |
|
31 #include "TMCETestUIEngineCmdCreate2WayVideoSession.h" |
|
32 #include "TMCETestUIEngineCmdCreateEvent.h" |
|
33 #include "TMCETestUIEngineCmdCreateMceSettings.h" |
|
34 #include "TMCETestUIEngineCmdCreateMceValueSettings.h" |
|
35 #include "TMCETestUIEngineCmdDisplayProfileUser.h" |
|
36 |
|
37 |
|
38 // ============================ MEMBER FUNCTIONS =============================== |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CMCETestUIEngineProfile::NewL |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 CMCETestUIEngineProfile* CMCETestUIEngineProfile::NewL( |
|
45 CSIPProfile* aProfile, CMCETestUIEngine& aEngine ) |
|
46 { |
|
47 |
|
48 CMCETestUIEngineProfile* self = |
|
49 new (ELeave) CMCETestUIEngineProfile( aProfile, aEngine ); |
|
50 CleanupStack::PushL( self ); |
|
51 self->ConstructL( ); |
|
52 CleanupStack::Pop( self ); |
|
53 return self; |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CMCETestUIEngineProfile::CMCETestUIEngineProfile |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 CMCETestUIEngineProfile::CMCETestUIEngineProfile( CSIPProfile* aProfile, |
|
61 CMCETestUIEngine& aEngine ) |
|
62 :iProfile( aProfile ), |
|
63 iEngine( aEngine ) |
|
64 { |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CMCETestUIEngineProfile::ConstructL |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 void CMCETestUIEngineProfile::ConstructL() |
|
72 { |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CMCETestUIEngineProfile::~CMCETestUIEngineProfile |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 CMCETestUIEngineProfile::~CMCETestUIEngineProfile() |
|
80 { |
|
81 iCommands.ResetAndDestroy(); |
|
82 delete iProfile; |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CMCETestUIEngineProfile::GetCommands |
|
87 // ----------------------------------------------------------------------------- |
|
88 // |
|
89 const RPointerArray<TMCETestUIEngineCmdBase>& |
|
90 CMCETestUIEngineProfile::GetCommandsL() |
|
91 { |
|
92 iCommands.ResetAndDestroy(); |
|
93 |
|
94 if ( !IsRegistered() ) |
|
95 { |
|
96 iCommands.Append( new (ELeave) TMCETestUIEngineCmdRegister( |
|
97 iEngine, *this ) ); |
|
98 } |
|
99 else |
|
100 { |
|
101 iCommands.Append( new (ELeave) TMCETestUIEngineCmdCreateSession( |
|
102 iEngine, *this ) ); |
|
103 |
|
104 iCommands.Append( new (ELeave) TMCETestUIEngineCmdCreatePoCSession( |
|
105 iEngine, *this ) ); |
|
106 |
|
107 iCommands.Append( new (ELeave) TMCETestUIEngineCmdCreateVoIPSession( |
|
108 iEngine, *this ) ); |
|
109 |
|
110 iCommands.Append( new (ELeave) TMCETestUIEngineCmdCreate2WayVideoSession( |
|
111 iEngine, *this ) ); |
|
112 |
|
113 iCommands.Append( new (ELeave) TMCETestUIEngineCmdCreateEvent( |
|
114 iEngine, *this ) ); |
|
115 iCommands.Append( |
|
116 new (ELeave) TMCETestUIEngineCmdCreateRefer( |
|
117 iEngine, *this) ); |
|
118 |
|
119 /* iCommands.Append( new (ELeave) TMCETestUIEngineCmdUnregister( |
|
120 iEngine, *this ) ); |
|
121 |
|
122 */ iCommands.Append( new (ELeave) TMCETestUIEngineCmdCreateMceSettings( |
|
123 iEngine, *this ) ); |
|
124 |
|
125 iCommands.Append( new (ELeave) TMCETestUIEngineCmdCreateMceValueSettings( |
|
126 iEngine, *this ) ); |
|
127 |
|
128 } |
|
129 iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisplayProfileUser(iEngine, *this) ); |
|
130 |
|
131 return iCommands; |
|
132 } |
|
133 |
|
134 // ----------------------------------------------------------------------------- |
|
135 // CMCETestUIEngineProfile::Profile |
|
136 // ----------------------------------------------------------------------------- |
|
137 // |
|
138 CSIPProfile& CMCETestUIEngineProfile::Profile() |
|
139 { |
|
140 return *iProfile; |
|
141 } |
|
142 |
|
143 // ----------------------------------------------------------------------------- |
|
144 // CMCETestUIEngineProfile::IsDefault |
|
145 // ----------------------------------------------------------------------------- |
|
146 // |
|
147 EXPORT_C TBool CMCETestUIEngineProfile::IsDefault() const |
|
148 { |
|
149 TBool isDefault = EFalse; |
|
150 iProfile->GetParameter( KSIPDefaultProfile, isDefault ); |
|
151 return isDefault; |
|
152 } |
|
153 |
|
154 // ----------------------------------------------------------------------------- |
|
155 // CMCETestUIEngineProfile::IsRegistered |
|
156 // ----------------------------------------------------------------------------- |
|
157 // |
|
158 EXPORT_C TBool CMCETestUIEngineProfile::IsRegistered() const |
|
159 { |
|
160 TBool profileRegistered = EFalse; |
|
161 iProfile->GetParameter( KSIPProfileRegistered, profileRegistered ); |
|
162 return profileRegistered; |
|
163 } |
|
164 |
|
165 // ----------------------------------------------------------------------------- |
|
166 // CMCETestUIEngineProfile::ProfileId |
|
167 // ----------------------------------------------------------------------------- |
|
168 // |
|
169 EXPORT_C TInt CMCETestUIEngineProfile::ProfileId() const |
|
170 { |
|
171 TUint32 profileId = 0; |
|
172 iProfile->GetParameter( KSIPProfileId, profileId ); |
|
173 return profileId; |
|
174 } |
|
175 |
|
176 // ----------------------------------------------------------------------------- |
|
177 // CMCETestUIEngineProfile::ProviderName |
|
178 // ----------------------------------------------------------------------------- |
|
179 // |
|
180 EXPORT_C const TDesC8& CMCETestUIEngineProfile::ProviderName() const |
|
181 { |
|
182 const TDesC8* providerName = NULL; |
|
183 iProfile->GetParameter( KSIPProviderName, providerName ); |
|
184 return *providerName; |
|
185 } |
|
186 // ----------------------------------------------------------------------------- |
|
187 // CMCETestUIEngineProfile::Aor |
|
188 // ----------------------------------------------------------------------------- |
|
189 // |
|
190 EXPORT_C const TDesC8& CMCETestUIEngineProfile::Aor() const |
|
191 { |
|
192 const TDesC8* aor = NULL; |
|
193 iProfile->GetParameter( KSIPUserAor, aor ); |
|
194 return *aor; |
|
195 } |