47
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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: DCMO DM Adapter implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// INCLUDE
|
|
19 |
#include <implementationproxy.h>
|
|
20 |
#include <smldmadapter.h>
|
|
21 |
#include <data_caging_path_literals.hrh>
|
|
22 |
#include <centralrepository.h>
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <ecom.h>
|
|
25 |
#include <utf.h>
|
|
26 |
#include <SettingEnforcementInfo.h> // DCMO Enforcement
|
|
27 |
#include "nsmldebug.h"
|
|
28 |
#include "dcmodmadapter.h"
|
|
29 |
#include "dcmointerface.h"
|
|
30 |
|
|
31 |
// CONSTANTS
|
|
32 |
|
|
33 |
#define MAXBUFLEN 255
|
|
34 |
|
|
35 |
_LIT8( KTextType,"text/plain" ); // Leaf inputs
|
|
36 |
_LIT8( KDCMODMAdapterVersion, "1.0" ); // Adapter version
|
|
37 |
_LIT8( KDCMORootNode, "DCMO" ); // root URI
|
|
38 |
|
|
39 |
|
|
40 |
// ============================= MEMBER FUNCTIONS =============================
|
|
41 |
|
|
42 |
// ----------------------------------------------------------------------------
|
|
43 |
// CDcmoDMAdapter::NewL
|
|
44 |
// Symbian 1st phase contructor
|
|
45 |
// (static, may leave)
|
|
46 |
// Status : Draft
|
|
47 |
// ----------------------------------------------------------------------------
|
|
48 |
//
|
|
49 |
CDcmoDMAdapter* CDcmoDMAdapter::NewL( MSmlDmCallback* aCallback )
|
|
50 |
{
|
|
51 |
CDcmoDMAdapter* self = NewLC( aCallback );
|
|
52 |
CleanupStack::Pop( self );
|
|
53 |
return self;
|
|
54 |
}
|
|
55 |
|
|
56 |
// ----------------------------------------------------------------------------
|
|
57 |
// CDcmoDMAdapter::NewLC
|
|
58 |
// Symbian 1st phase contructor. Push object to cleanup-stack
|
|
59 |
// (static, may leave)
|
|
60 |
// Status : Draft
|
|
61 |
// ----------------------------------------------------------------------------
|
|
62 |
//
|
|
63 |
CDcmoDMAdapter* CDcmoDMAdapter::NewLC( MSmlDmCallback* aCallback )
|
|
64 |
{
|
|
65 |
_DBG_FILE( "CDcmoDMAdapter NewLC : begin" );
|
|
66 |
CDcmoDMAdapter* self = new ( ELeave ) CDcmoDMAdapter( aCallback );
|
|
67 |
CleanupStack::PushL( self );
|
|
68 |
self->ConstructL();
|
|
69 |
_DBG_FILE( "CDcmoDMAdapter NewLC : end" );
|
|
70 |
return self;
|
|
71 |
}
|
|
72 |
|
|
73 |
// ----------------------------------------------------------------------------
|
|
74 |
// CDcmoDMAdapter::CDcmoDMAdapter()
|
|
75 |
// C++ Constructor
|
|
76 |
// Status : Draft
|
|
77 |
// ----------------------------------------------------------------------------
|
|
78 |
CDcmoDMAdapter::CDcmoDMAdapter( TAny* aEcomArguments )
|
|
79 |
: CSmlDmAdapter::CSmlDmAdapter( aEcomArguments )
|
|
80 |
{
|
|
81 |
_DBG_FILE( "CDcmoDMAdapter Constructor" );
|
|
82 |
}
|
|
83 |
|
|
84 |
// ----------------------------------------------------------------------------
|
|
85 |
// CDcmoDMAdapter::ConstructL
|
|
86 |
// 2nd phase contructor
|
|
87 |
// (may leave)
|
|
88 |
// Status : Draft
|
|
89 |
// ----------------------------------------------------------------------------
|
|
90 |
//
|
|
91 |
void CDcmoDMAdapter::ConstructL()
|
|
92 |
{
|
|
93 |
_DBG_FILE( "CDcmoDMAdapter::ConstructL" );
|
|
94 |
idcmoClient = RDCMOClient::NewL();
|
|
95 |
iExtOpNode = EFalse;
|
|
96 |
}
|
|
97 |
|
|
98 |
// ----------------------------------------------------------------------------
|
|
99 |
// CDcmoDMAdapter::~CDcmoDMAdapter()
|
|
100 |
// C++ Destructor
|
|
101 |
// Status : Draft
|
|
102 |
// ----------------------------------------------------------------------------
|
|
103 |
//
|
|
104 |
CDcmoDMAdapter::~CDcmoDMAdapter()
|
|
105 |
{
|
|
106 |
_DBG_FILE( "CDcmoDMAdapter Destructor" );
|
|
107 |
if( idcmoClient )
|
|
108 |
{
|
|
109 |
idcmoClient->Close();
|
|
110 |
delete idcmoClient;
|
|
111 |
}
|
|
112 |
idcmoClient = NULL;
|
|
113 |
}
|
|
114 |
|
|
115 |
// ----------------------------------------------------------------------------
|
|
116 |
// CDcmoDMAdapter::DDFVersionL
|
|
117 |
// Return DM plug-in version
|
|
118 |
// (may leave)
|
|
119 |
// Status : Draft
|
|
120 |
// ----------------------------------------------------------------------------
|
|
121 |
//
|
|
122 |
void CDcmoDMAdapter::DDFVersionL( CBufBase& aDDFVersion )
|
|
123 |
{
|
|
124 |
// Insert version information
|
|
125 |
_DBG_FILE( "CDcmoDMAdapter::DDFVersionL" );
|
|
126 |
aDDFVersion.InsertL( 0, KDCMODMAdapterVersion );
|
|
127 |
}
|
|
128 |
|
|
129 |
// ----------------------------------------------------------------------------
|
|
130 |
// CDcmoDMAdapter::DDFStructureL
|
|
131 |
// Return DM plug-in structure
|
|
132 |
// (may leave)
|
|
133 |
// Status : Draft
|
|
134 |
// ----------------------------------------------------------------------------
|
|
135 |
//
|
|
136 |
void CDcmoDMAdapter::DDFStructureL( MSmlDmDDFObject& aDDF )
|
|
137 |
{
|
|
138 |
// Declare accesses
|
|
139 |
_DBG_FILE( "CDcmoDMAdapter::DDFStructureL begin" );
|
|
140 |
TSmlDmAccessTypes accessTypes;
|
|
141 |
accessTypes.SetGet();
|
|
142 |
|
|
143 |
// Create root node
|
|
144 |
MSmlDmDDFObject& root = aDDF.AddChildObjectL( KDCMORootNode );
|
|
145 |
FillNodeInfoL( root,
|
|
146 |
accessTypes,
|
|
147 |
MSmlDmDDFObject::EPermanent,
|
|
148 |
MSmlDmDDFObject::ENode,
|
|
149 |
MSmlDmDDFObject::EOne,
|
|
150 |
KNullDesC8(),
|
|
151 |
KTextType );
|
|
152 |
|
|
153 |
root.SetDFTitleL( KNSmlDCMOAdapterTitle );
|
|
154 |
|
|
155 |
DDFDCMOAdaptersL(root);
|
|
156 |
_DBG_FILE( "CDcmoDMAdapter::DDFStructureL end" );
|
|
157 |
|
|
158 |
}
|
|
159 |
|
|
160 |
// ----------------------------------------------------------------------------
|
|
161 |
// CDcmoDMAdapter::StreamingSupport
|
|
162 |
// Return streaming support status, set supported item size
|
|
163 |
// Status : Draft
|
|
164 |
// ----------------------------------------------------------------------------
|
|
165 |
//
|
|
166 |
TBool CDcmoDMAdapter::StreamingSupport( TInt& /* aItemSize */ )
|
|
167 |
{
|
|
168 |
// Not supported
|
|
169 |
_DBG_FILE( "CDcmoDMAdapter::StreamingSupport" );
|
|
170 |
return EFalse;
|
|
171 |
}
|
|
172 |
|
|
173 |
// ----------------------------------------------------------------------------
|
|
174 |
// CDcmoDMAdapter::StreamCommittedL
|
|
175 |
// Commit stream buffer
|
|
176 |
// (may leave)
|
|
177 |
// Status : Draft
|
|
178 |
// ----------------------------------------------------------------------------
|
|
179 |
//
|
|
180 |
void CDcmoDMAdapter::StreamCommittedL()
|
|
181 |
{
|
|
182 |
_DBG_FILE("CDcmoDMAdapter::StreamCommitted" );
|
|
183 |
// Intentionally left empty
|
|
184 |
}
|
|
185 |
|
|
186 |
// ----------------------------------------------------------------------------
|
|
187 |
// CDcmoDMAdapter::CompleteOutstandingCmdsL
|
|
188 |
// Complete outstanding commands
|
|
189 |
// (may leave)
|
|
190 |
// Status : Draft
|
|
191 |
// ----------------------------------------------------------------------------
|
|
192 |
//
|
|
193 |
void CDcmoDMAdapter::CompleteOutstandingCmdsL()
|
|
194 |
{
|
|
195 |
_DBG_FILE( "CDcmoDMAdapter::CompleteOutstandingCmdsL" );
|
|
196 |
}
|
|
197 |
|
|
198 |
// ----------------------------------------------------------------------------
|
|
199 |
// CDcmoDMAdapter::FillNodeInfoL
|
|
200 |
// Fill node info
|
|
201 |
// (may leave)
|
|
202 |
// Status : Draft
|
|
203 |
// ----------------------------------------------------------------------------
|
|
204 |
//
|
|
205 |
void CDcmoDMAdapter::FillNodeInfoL( MSmlDmDDFObject& aDDFObject,
|
|
206 |
TSmlDmAccessTypes& aAccessTypes,
|
|
207 |
MSmlDmDDFObject::TScope aScope,
|
|
208 |
MSmlDmDDFObject::TDFFormat aFormat,
|
|
209 |
MSmlDmDDFObject::TOccurence aOccurence,
|
|
210 |
const TDesC8& aDescription,
|
|
211 |
const TDesC8& aMIMEType )
|
|
212 |
{
|
|
213 |
_DBG_FILE( "CDcmoDMAdapter::FillNodeInfoL - begin" );
|
|
214 |
aDDFObject.SetAccessTypesL( aAccessTypes );
|
|
215 |
aDDFObject.SetScopeL( aScope );
|
|
216 |
aDDFObject.SetOccurenceL( aOccurence );
|
|
217 |
aDDFObject.SetDFFormatL( aFormat );
|
|
218 |
aDDFObject.SetDescriptionL( aDescription );
|
|
219 |
if ( aFormat != MSmlDmDDFObject::ENode )
|
|
220 |
{
|
|
221 |
aDDFObject.AddDFTypeMimeTypeL( aMIMEType );
|
|
222 |
}
|
|
223 |
_DBG_FILE( "CDcmoDMAdapter::FillNodeInfoL - end" );
|
|
224 |
}
|
|
225 |
|
|
226 |
// ----------------------------------------------------------------------------
|
|
227 |
// CDcmoDMAdapter::CopyCommandL
|
|
228 |
// Copy object
|
|
229 |
// (may leave)
|
|
230 |
// Status : Draft
|
|
231 |
// ----------------------------------------------------------------------------
|
|
232 |
//
|
|
233 |
void CDcmoDMAdapter::CopyCommandL( const TDesC8& /*aTargetURI*/,
|
|
234 |
const TDesC8& /*aTargetLUID*/,
|
|
235 |
const TDesC8& /*aSourceURI*/,
|
|
236 |
const TDesC8& /*aSourceLUID*/,
|
|
237 |
const TDesC8& /*aType*/,
|
|
238 |
TInt aStatusRef )
|
|
239 |
{
|
|
240 |
// Not supported
|
|
241 |
_DBG_FILE( "CDcmoDMAdapter::CopyCommandL" );
|
|
242 |
Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
|
|
243 |
}
|
|
244 |
|
|
245 |
// ----------------------------------------------------------------------------
|
|
246 |
// DeleteObjectL
|
|
247 |
// Delete object
|
|
248 |
// (may leave)
|
|
249 |
// Status : Draft
|
|
250 |
// ----------------------------------------------------------------------------
|
|
251 |
//
|
|
252 |
void CDcmoDMAdapter::DeleteObjectL( const TDesC8& /* aURI */,
|
|
253 |
const TDesC8& /* aLUID */,
|
|
254 |
TInt aStatusRef )
|
|
255 |
|
|
256 |
{
|
|
257 |
// Not supported
|
|
258 |
_DBG_FILE( "CDcmoDMAdapter::DeleteObjectL" );
|
|
259 |
Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
|
|
260 |
}
|
|
261 |
|
|
262 |
// ----------------------------------------------------------------------------
|
|
263 |
// CDcmoDMAdapter::FetchLeafObjectL
|
|
264 |
// Fetch leaf
|
|
265 |
// (may leave)
|
|
266 |
// Status : Draft
|
|
267 |
// ----------------------------------------------------------------------------
|
|
268 |
//
|
|
269 |
void CDcmoDMAdapter::FetchLeafObjectL( const TDesC8& aURI,
|
|
270 |
const TDesC8& /* aLUID */,
|
|
271 |
const TDesC8& aType,
|
|
272 |
TInt aResultsRef,
|
|
273 |
TInt aStatusRef )
|
|
274 |
{
|
|
275 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - begin" );
|
|
276 |
MSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk;
|
|
277 |
TDCMOStatus err (EDcmoFail);
|
|
278 |
|
|
279 |
TBool dcmoEnforce=EFalse;
|
|
280 |
TRAPD(eError, dcmoEnforce =CheckEnforcementL())
|
|
281 |
if(!(eError==KErrNone && dcmoEnforce))
|
|
282 |
{
|
|
283 |
// Respond
|
|
284 |
retValue = CSmlDmAdapter::ENotAllowed;
|
|
285 |
Callback().SetStatusL( aStatusRef, retValue );
|
|
286 |
return;
|
|
287 |
}
|
|
288 |
|
|
289 |
TBuf<MAXBUFLEN> iName;
|
|
290 |
|
|
291 |
TPtrC8 category = GetCategoryFromUriL( aURI );
|
|
292 |
iName.Copy ( category );
|
|
293 |
|
|
294 |
CBufBase *lObject = CBufFlat::NewL( 128 );
|
|
295 |
CleanupStack::PushL( lObject );
|
|
296 |
lObject->Reset();
|
|
297 |
TBool value;
|
|
298 |
TInt group;
|
|
299 |
|
|
300 |
if(aURI.Find(KNSmlDdfProperty)!= KErrNotFound)
|
|
301 |
{
|
|
302 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - In Property" );
|
|
303 |
TBuf<KDCMOMaxStringSize> property;
|
|
304 |
err = idcmoClient->GetDCMOStrAttributeValue(iName, EProperty,property);
|
|
305 |
lObject->Reset();
|
|
306 |
TBuf8<KDCMOMaxStringSize> tmp;
|
|
307 |
tmp.Copy(property);
|
|
308 |
lObject->InsertL(lObject->Size(),tmp);
|
|
309 |
}
|
|
310 |
|
|
311 |
else if(aURI.Find(KNSmlDdfGroup)!= KErrNotFound)
|
|
312 |
{
|
|
313 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - In Group" );
|
|
314 |
err = idcmoClient->GetDCMOIntAttributeValue(iName, EGroup, group);
|
|
315 |
switch(group)
|
|
316 |
{
|
|
317 |
case EHardware : lObject->InsertL(lObject->Size(),KNSmlHardware);
|
|
318 |
break;
|
|
319 |
case EIO : lObject->InsertL(lObject->Size(),KNSmlIO);
|
|
320 |
break;
|
|
321 |
case EConnectivity : lObject->InsertL(lObject->Size(),KNSmlConnectivity);
|
|
322 |
break;
|
|
323 |
case ESoftware : lObject->InsertL(lObject->Size(),KNSmlSoftware);
|
|
324 |
break;
|
|
325 |
case EService : lObject->InsertL(lObject->Size(),KNSmlService);
|
|
326 |
break;
|
|
327 |
default : retValue = CSmlDmAdapter::ENotFound;
|
|
328 |
|
|
329 |
}
|
|
330 |
}
|
|
331 |
else if(aURI.Find(KNSmlDdfDescription)!= KErrNotFound)
|
|
332 |
{
|
|
333 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - In Description" );
|
|
334 |
TBuf<KDCMOMaxStringSize> description;
|
|
335 |
err = idcmoClient->GetDCMOStrAttributeValue(iName, EDescription, description);
|
|
336 |
lObject->Reset();
|
|
337 |
TBuf8<KDCMOMaxStringSize> tmp;
|
|
338 |
tmp.Copy(description);
|
|
339 |
lObject->InsertL(lObject->Size(),tmp);
|
|
340 |
}
|
|
341 |
|
|
342 |
else if(aURI.Find(KNSmlDdfAttached)!= KErrNotFound)
|
|
343 |
{
|
|
344 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - In Attached" );
|
|
345 |
err = idcmoClient->GetDCMOIntAttributeValue(iName, EAttached, value);
|
|
346 |
if(value)
|
|
347 |
lObject->InsertL(lObject->Size(),KNSmlTrue);
|
|
348 |
else
|
|
349 |
lObject->InsertL(lObject->Size(),KNSmlFalse);
|
|
350 |
}
|
|
351 |
|
|
352 |
else if(aURI.Find(KNSmlDdfEnabled)!= KErrNotFound)
|
|
353 |
{
|
|
354 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - In Enabled" );
|
|
355 |
err = idcmoClient->GetDCMOIntAttributeValue(iName, EEnabled, value);
|
|
356 |
if(value)
|
|
357 |
lObject->InsertL(lObject->Size(),KNSmlTrue);
|
|
358 |
else
|
|
359 |
lObject->InsertL(lObject->Size(),KNSmlFalse);
|
|
360 |
}
|
|
361 |
|
|
362 |
else if(aURI.Find(KNSmlDdfDenyUserEnable)!= KErrNotFound)
|
|
363 |
{
|
|
364 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - In DenyUserEnable" );
|
|
365 |
err = idcmoClient->GetDCMOIntAttributeValue(iName, EDenyUserEnable, value);
|
|
366 |
if(value)
|
|
367 |
lObject->InsertL(lObject->Size(),KNSmlTrue);
|
|
368 |
else
|
|
369 |
lObject->InsertL(lObject->Size(),KNSmlFalse);
|
|
370 |
}
|
|
371 |
|
|
372 |
else if(aURI.Find(KNSmlDdfNotifyUser)!= KErrNotFound)
|
|
373 |
{
|
|
374 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - In NotifyUser" );
|
|
375 |
err = idcmoClient->GetDCMOIntAttributeValue(iName, ENotifyUser, value);
|
|
376 |
if(value)
|
|
377 |
lObject->InsertL(lObject->Size(),KNSmlTrue);
|
|
378 |
else
|
|
379 |
lObject->InsertL(lObject->Size(),KNSmlFalse);
|
|
380 |
}
|
|
381 |
|
|
382 |
else if(aURI.Find(KNSmlDdfExt)!= KErrNotFound)
|
|
383 |
{
|
|
384 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - In Ext" );
|
|
385 |
lObject->Reset();
|
|
386 |
lObject->InsertL(lObject->Size(), KNullDesC8);
|
|
387 |
err = EDcmoSuccess;
|
|
388 |
}
|
|
389 |
|
|
390 |
else
|
|
391 |
retValue = CSmlDmAdapter::ENotFound;
|
|
392 |
|
|
393 |
if(retValue == CSmlDmAdapter::EOk)
|
|
394 |
{
|
|
395 |
switch(err)
|
|
396 |
{
|
|
397 |
case EDcmoSuccess : Callback().SetResultsL( aResultsRef, *lObject, aType );
|
|
398 |
break;
|
|
399 |
case EDcmoNotSupported : retValue = CSmlDmAdapter::EError;
|
|
400 |
break;
|
|
401 |
case EDcmoAccessDenied : retValue = CSmlDmAdapter::ENotAllowed;
|
|
402 |
break;
|
|
403 |
default :
|
|
404 |
retValue = CSmlDmAdapter::EError;
|
|
405 |
}
|
|
406 |
|
|
407 |
}
|
|
408 |
|
|
409 |
CleanupStack::PopAndDestroy(); //lObject
|
|
410 |
|
|
411 |
// Respond
|
|
412 |
Callback().SetStatusL( aStatusRef, retValue );
|
|
413 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectL - end" );
|
|
414 |
}
|
|
415 |
|
|
416 |
// ----------------------------------------------------------------------------
|
|
417 |
// CDcmoDMAdapter::FetchLeafObjectSizeL
|
|
418 |
// Calculate leaf object size
|
|
419 |
// (may leave)
|
|
420 |
// Status : Draft
|
|
421 |
// ----------------------------------------------------------------------------
|
|
422 |
//
|
|
423 |
void CDcmoDMAdapter::FetchLeafObjectSizeL( const TDesC8& /* aURI */,
|
|
424 |
const TDesC8& /* aLUID */,
|
|
425 |
const TDesC8& /* aType */,
|
|
426 |
TInt /* aResultsRef */,
|
|
427 |
TInt aStatusRef )
|
|
428 |
{
|
|
429 |
_DBG_FILE( "CDcmoDMAdapter::FetchLeafObjectSizeL" );
|
|
430 |
MSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk;
|
|
431 |
// Respond
|
|
432 |
Callback().SetStatusL( aStatusRef, retValue );
|
|
433 |
}
|
|
434 |
|
|
435 |
// ----------------------------------------------------------------------------
|
|
436 |
// CDcmoDMAdapter::ChildURIListL
|
|
437 |
// Create child URI list
|
|
438 |
// (may leave)
|
|
439 |
// Status : Draft
|
|
440 |
// ----------------------------------------------------------------------------
|
|
441 |
//
|
|
442 |
void CDcmoDMAdapter::ChildURIListL( const TDesC8& aURI,
|
|
443 |
const TDesC8& /* aLUID */,
|
|
444 |
const CArrayFix<TSmlDmMappingInfo>& /* aPreviousURISegmentList */,
|
|
445 |
TInt aResultsRef,
|
|
446 |
TInt aStatusRef )
|
|
447 |
{
|
|
448 |
_DBG_FILE( "CDcmoDMAdapter::ChildURIListL - begin" );
|
|
449 |
MSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk;
|
|
450 |
CBufBase *currentURISegmentList = CBufFlat::NewL( 128 );
|
|
451 |
CleanupStack::PushL( currentURISegmentList );
|
|
452 |
|
|
453 |
if(( aURI.Match( KDcmoMatch2 ) != KErrNotFound ) &&
|
|
454 |
(aURI.Match( KDcmoMatch3 ) == KErrNotFound ))
|
|
455 |
{
|
|
456 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), KSegmDcmo );
|
|
457 |
Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EOk );
|
|
458 |
Callback().SetResultsL( aResultsRef, *currentURISegmentList, KNullDesC8 );
|
|
459 |
CleanupStack::PopAndDestroy( ); // currentURISegmentList
|
|
460 |
_DBG_FILE( "CDcmoDMAdapter::ChildURIListL(): end" );
|
|
461 |
return;
|
|
462 |
}
|
|
463 |
else if(( aURI.Match( KDcmoMatch ) != KErrNotFound ) &&
|
|
464 |
(aURI.Match( KDcmoMatch2 ) == KErrNotFound ))
|
|
465 |
{
|
|
466 |
//
|
|
467 |
}
|
|
468 |
// DCMOConfig subtree
|
|
469 |
else if( ( aURI.Match( KDcmoConfigMatch ) != KErrNotFound ))
|
|
470 |
{
|
|
471 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), KSegmDcmoConfig );
|
|
472 |
}
|
|
473 |
// Operations
|
|
474 |
else if(( aURI.Match( KDcmoOperationsMatch ) != KErrNotFound ))
|
|
475 |
{
|
|
476 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), KSegmDcmoOperations );
|
|
477 |
}
|
|
478 |
// Ext
|
|
479 |
else if(( aURI.Match(KNSmlBluetooth) != KErrNotFound) && ( aURI.Match(KDcmoOperationsExtMatch)!= KErrNotFound ))
|
|
480 |
{
|
|
481 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDdfOpExtSemiEnable );
|
|
482 |
}
|
|
483 |
else
|
|
484 |
{
|
|
485 |
retValue = CSmlDmAdapter::ENotFound;
|
|
486 |
}
|
|
487 |
|
|
488 |
// Respond
|
|
489 |
Callback().SetStatusL( aStatusRef, retValue );
|
|
490 |
CleanupStack::PopAndDestroy(); // currentURISegmentList
|
|
491 |
_DBG_FILE( "CDcmoDMAdapter::ChildURIListL - end" );
|
|
492 |
}
|
|
493 |
|
|
494 |
// ----------------------------------------------------------------------------
|
|
495 |
// CDcmoDMAdapter::AddNodeObjectL
|
|
496 |
// Add node
|
|
497 |
// (may leave)
|
|
498 |
// Status : Draft
|
|
499 |
// ----------------------------------------------------------------------------
|
|
500 |
//
|
|
501 |
void CDcmoDMAdapter::AddNodeObjectL( const TDesC8& /* aURI */,
|
|
502 |
const TDesC8& /* aParentLUID */,
|
|
503 |
TInt aStatusRef )
|
|
504 |
{
|
|
505 |
// Not supported
|
|
506 |
_DBG_FILE( "CDcmoDMAdapter::AddNodeObjectL - begin" );
|
|
507 |
Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
|
|
508 |
_DBG_FILE( "CDcmoDMAdapter::AddNodeObjectL - end" );
|
|
509 |
}
|
|
510 |
|
|
511 |
// ----------------------------------------------------------------------------
|
|
512 |
// CDcmoDMAdapter::ExecuteCommandL
|
|
513 |
// Execute command
|
|
514 |
// (may leave)
|
|
515 |
// Status : Draft
|
|
516 |
// ----------------------------------------------------------------------------
|
|
517 |
//
|
|
518 |
void CDcmoDMAdapter::ExecuteCommandL( const TDesC8& aURI ,
|
|
519 |
const TDesC8& /* aLUID */,
|
|
520 |
const TDesC8& /* aArgument */,
|
|
521 |
const TDesC8& /* aType */,
|
|
522 |
TInt aStatusRef )
|
|
523 |
{
|
|
524 |
_DBG_FILE( "CDcmoDMAdapter::ExecuteCommandL - begin" );
|
|
525 |
MSmlDmAdapter::TError status = CSmlDmAdapter::EOk;
|
|
526 |
TInt err (EDcmoFail);
|
|
527 |
|
|
528 |
TBool dcmoEnforce=EFalse;
|
|
529 |
TRAPD(eError, dcmoEnforce =CheckEnforcementL())
|
|
530 |
if(!(eError==KErrNone && dcmoEnforce))
|
|
531 |
{
|
|
532 |
// Respond
|
|
533 |
status = CSmlDmAdapter::ENotAllowed;
|
|
534 |
Callback().SetStatusL( aStatusRef, status );
|
|
535 |
return;
|
|
536 |
}
|
|
537 |
|
|
538 |
TBuf<MAXBUFLEN> iName;
|
|
539 |
TPtrC8 category = GetCategoryFromUriL( aURI );
|
|
540 |
iName.Copy ( category );
|
|
541 |
|
|
542 |
if((category.Compare( KNSmlBluetooth ) == KErrNone ) && (aURI.Find( KNSmlDdfOpExtSemiEnable ) != KErrNotFound ))
|
|
543 |
err = idcmoClient->SetDCMOIntAttributeValue(iName, EEnable, 2);
|
|
544 |
else if(aURI.Find( KNSmlDdfEnable ) != KErrNotFound )
|
|
545 |
err = idcmoClient->SetDCMOIntAttributeValue(iName, EEnable, 1);
|
|
546 |
else if(aURI.Find( KNSmlDdfDisable ) != KErrNotFound )
|
|
547 |
err = idcmoClient->SetDCMOIntAttributeValue(iName, EEnable, 0);
|
|
548 |
else
|
|
549 |
err = EDcmoNotFound;
|
|
550 |
// map error
|
|
551 |
status = MapErrorToStatus( err );
|
|
552 |
|
|
553 |
Callback().SetStatusL( aStatusRef, status );
|
|
554 |
_DBG_FILE( "CDcmoDMAdapter::ExecuteCommandL - end" );
|
|
555 |
}
|
|
556 |
|
|
557 |
// ----------------------------------------------------------------------------
|
|
558 |
// CDcmoDMAdapter::ExecuteCommandL
|
|
559 |
// Execute command, streaming enabled
|
|
560 |
// (may leave)
|
|
561 |
// Status : Draft
|
|
562 |
// ----------------------------------------------------------------------------
|
|
563 |
//
|
|
564 |
void CDcmoDMAdapter::ExecuteCommandL( const TDesC8& /* aURI */,
|
|
565 |
const TDesC8& /* aLUID */,
|
|
566 |
RWriteStream*& /* aStream */,
|
|
567 |
const TDesC8& /* aType */,
|
|
568 |
TInt aStatusRef )
|
|
569 |
{
|
|
570 |
// Not supported
|
|
571 |
Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
|
|
572 |
}
|
|
573 |
|
|
574 |
// ----------------------------------------------------------------------------
|
|
575 |
// CDcmoDMAdapter::UpdateLeafObjectL
|
|
576 |
// Update leaf object
|
|
577 |
// (may leave)
|
|
578 |
// Status : Draft
|
|
579 |
// ----------------------------------------------------------------------------
|
|
580 |
//
|
|
581 |
void CDcmoDMAdapter::UpdateLeafObjectL( const TDesC8& /* aURI */,
|
|
582 |
const TDesC8& /* aLUID */,
|
|
583 |
const TDesC8& /* aObject */,
|
|
584 |
const TDesC8& /* aType */,
|
|
585 |
TInt aStatusRef )
|
|
586 |
{
|
|
587 |
_DBG_FILE( "CDcmoDMAdapter::UpdateLeafObjectL - begin" );
|
|
588 |
// Not supported
|
|
589 |
Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
|
|
590 |
_DBG_FILE( "CDcmoDMAdapter::UpdateLeafObjectL - end" );
|
|
591 |
}
|
|
592 |
|
|
593 |
// ----------------------------------------------------------------------------
|
|
594 |
// CDcmoDMAdapter::UpdateLeafObjectL
|
|
595 |
// Update leaf object, streaming enabled
|
|
596 |
// (may leave)
|
|
597 |
// Status : Draft
|
|
598 |
// ----------------------------------------------------------------------------
|
|
599 |
//
|
|
600 |
void CDcmoDMAdapter::UpdateLeafObjectL( const TDesC8& /* aURI */,
|
|
601 |
const TDesC8& /* aLUID */,
|
|
602 |
RWriteStream*& /* aStream */,
|
|
603 |
const TDesC8& /* aType */,
|
|
604 |
TInt aStatusRef )
|
|
605 |
{
|
|
606 |
// Not supported
|
|
607 |
Callback().SetStatusL( aStatusRef, CSmlDmAdapter::EError );
|
|
608 |
}
|
|
609 |
|
|
610 |
// ----------------------------------------------------------------------------
|
|
611 |
// CDcmoDMAdapter::StartAtomicL
|
|
612 |
// Start atomic
|
|
613 |
// (may leave)
|
|
614 |
// Status : Draft
|
|
615 |
// ----------------------------------------------------------------------------
|
|
616 |
//
|
|
617 |
void CDcmoDMAdapter::StartAtomicL()
|
|
618 |
{
|
|
619 |
}
|
|
620 |
|
|
621 |
// ----------------------------------------------------------------------------
|
|
622 |
// CDcmoDMAdapter::CommitAtomicL
|
|
623 |
// Commit atomic commands
|
|
624 |
// (may leave)
|
|
625 |
// Status : Draft
|
|
626 |
// ----------------------------------------------------------------------------
|
|
627 |
//
|
|
628 |
void CDcmoDMAdapter::CommitAtomicL()
|
|
629 |
{
|
|
630 |
}
|
|
631 |
|
|
632 |
// ----------------------------------------------------------------------------
|
|
633 |
// CDcmoDMAdapter::RollbackAtomicL
|
|
634 |
// Lose all modifications after 'StartAtomicL' command
|
|
635 |
// (may leave)
|
|
636 |
// Status : Draft
|
|
637 |
// ----------------------------------------------------------------------------
|
|
638 |
//
|
|
639 |
void CDcmoDMAdapter::RollbackAtomicL()
|
|
640 |
{
|
|
641 |
}
|
|
642 |
|
|
643 |
// ---------------------------------------------------------------------------
|
|
644 |
// CNSmlDmFotaAdapter::MapStatusToError()
|
|
645 |
// Returns a status code corresponding to the system error code given
|
|
646 |
// as parameter.
|
|
647 |
// ---------------------------------------------------------------------------
|
|
648 |
//
|
|
649 |
CSmlDmAdapter::TError CDcmoDMAdapter::MapErrorToStatus( TInt aError ) const
|
|
650 |
{
|
|
651 |
CSmlDmAdapter::TError err = CSmlDmAdapter::EError;
|
|
652 |
|
|
653 |
switch( aError )
|
|
654 |
{
|
|
655 |
case EDcmoSuccess:
|
|
656 |
err = CSmlDmAdapter::EExecSuccess;
|
|
657 |
break;
|
|
658 |
case EDcmoFail:
|
|
659 |
err = CSmlDmAdapter::EExecClientError;
|
|
660 |
break;
|
|
661 |
case EDcmoNotFound:
|
|
662 |
err = CSmlDmAdapter::EExecDownloadFailed;
|
|
663 |
break;
|
|
664 |
case EDcmoNotSupported:
|
|
665 |
err = CSmlDmAdapter::EExecClientError;
|
|
666 |
break;
|
|
667 |
case EDcmoAccessDenied:
|
|
668 |
err = CSmlDmAdapter::EExecClientError;
|
|
669 |
break;
|
|
670 |
default :
|
|
671 |
err = CSmlDmAdapter::EExecClientError;
|
|
672 |
}
|
|
673 |
|
|
674 |
return err;
|
|
675 |
}
|
|
676 |
|
|
677 |
// ========================= OTHER EXPORTED FUNCTIONS =========================
|
|
678 |
|
|
679 |
void CleanupEComArray(TAny* aArray)
|
|
680 |
{
|
|
681 |
(static_cast<RImplInfoPtrArray*> (aArray))->ResetAndDestroy();
|
|
682 |
(static_cast<RImplInfoPtrArray*> (aArray))->Close();
|
|
683 |
}
|
|
684 |
|
|
685 |
// ----------------------------------------------------------------------------
|
|
686 |
// CDcmoDMAdapter::DDFDCMOAdaptersL
|
|
687 |
// This function loads all the DCMO plug-in adapters
|
|
688 |
// ----------------------------------------------------------------------------
|
|
689 |
//
|
|
690 |
void CDcmoDMAdapter::DDFDCMOAdaptersL(MSmlDmDDFObject& rootdcmo)
|
|
691 |
{
|
|
692 |
_DBG_FILE("CDcmoDMAdapter::DDFDCMOAdaptersL(): begin");
|
|
693 |
TBuf8<MAXBUFLEN> buf;
|
|
694 |
TSmlDmAccessTypes accessTypes;
|
|
695 |
accessTypes.SetGet();
|
|
696 |
|
|
697 |
CRepository* centrep = NULL;
|
|
698 |
TInt err(KErrNone);
|
|
699 |
TRAP(err, centrep = CRepository::NewL( KCRUidDCMOServer ));
|
|
700 |
if(err == KErrNone)
|
|
701 |
{
|
|
702 |
TUint32 centrepKey = 0;
|
|
703 |
TInt count(0);
|
|
704 |
TInt reterr = centrep->Get( centrepKey, count );
|
|
705 |
if(reterr == KErrNone)
|
|
706 |
{
|
|
707 |
TBuf<MAXBUFLEN> buffer;
|
|
708 |
for(TInt i=0; i<count; i++)
|
|
709 |
{
|
|
710 |
centrepKey = KDCMOKeyMaxNumber*i + KDCMOPropertyNumber ;
|
|
711 |
reterr = centrep->Get( centrepKey, buffer );
|
|
712 |
if( reterr== KErrNone )
|
|
713 |
{
|
|
714 |
buf.Copy ( buffer );
|
|
715 |
MSmlDmDDFObject& entityNode = rootdcmo.AddChildObjectL( buf );
|
|
716 |
FillNodeInfoL( entityNode,
|
|
717 |
accessTypes,
|
|
718 |
MSmlDmDDFObject::EDynamic,
|
|
719 |
MSmlDmDDFObject::ENode,
|
|
720 |
MSmlDmDDFObject::EZeroOrOne,
|
|
721 |
KDCMOCapabilityDescription,
|
|
722 |
KMimeType );
|
|
723 |
|
|
724 |
FillDCMODDFL(entityNode);
|
|
725 |
buf.Zero();
|
|
726 |
}
|
|
727 |
}
|
|
728 |
}
|
|
729 |
delete centrep;
|
|
730 |
centrep = NULL;
|
|
731 |
}
|
|
732 |
|
|
733 |
// Read info about all implementations into infoArray
|
|
734 |
RImplInfoPtrArray infoArray;
|
|
735 |
// Note that a special cleanup function is required to reset and destroy
|
|
736 |
// all items in the array, and then close it.
|
|
737 |
TCleanupItem cleanup(CleanupEComArray, &infoArray);
|
|
738 |
CleanupStack::PushL(cleanup);
|
|
739 |
REComSession::ListImplementationsL(KDCMOInterfaceUid, infoArray);
|
|
740 |
|
|
741 |
// Loop through each info for each implementation
|
|
742 |
// and create and use each in turn
|
|
743 |
CDCMOInterface* ex;
|
|
744 |
|
|
745 |
for (TInt i=0; i< infoArray.Count(); i++)
|
|
746 |
{
|
|
747 |
|
|
748 |
TUid impluid = infoArray[i]->ImplementationUid();
|
|
749 |
// Create object of type and call its function
|
|
750 |
|
|
751 |
buf = infoArray[i]->OpaqueData();
|
|
752 |
|
|
753 |
CDCMOInterface::TDCMOInterfaceInitParams initParms;
|
|
754 |
initParms.uid = impluid;
|
|
755 |
TBuf<MAXBUFLEN> categoryName;
|
|
756 |
categoryName.Copy(buf);
|
|
757 |
initParms.descriptor = categoryName.AllocL();
|
|
758 |
ex = CDCMOInterface::NewL(initParms);
|
|
759 |
CleanupStack::PushL(ex);
|
|
760 |
if( buf.Compare(KNSmlBluetooth)== KErrNone )
|
|
761 |
{
|
|
762 |
iExtOpNode = ETrue;
|
|
763 |
}
|
|
764 |
MSmlDmDDFObject& entityNode = rootdcmo.AddChildObjectL( buf );
|
|
765 |
FillNodeInfoL( entityNode,
|
|
766 |
accessTypes,
|
|
767 |
MSmlDmDDFObject::EDynamic,
|
|
768 |
MSmlDmDDFObject::ENode,
|
|
769 |
MSmlDmDDFObject::EZeroOrOne,
|
|
770 |
KDCMOCapabilityDescription,
|
|
771 |
KMimeType );
|
|
772 |
|
|
773 |
FillDCMODDFL(entityNode);
|
|
774 |
ex = NULL;
|
|
775 |
buf.Zero();
|
|
776 |
CleanupStack::PopAndDestroy(); //ex
|
|
777 |
}
|
|
778 |
|
|
779 |
// Clean up
|
|
780 |
CleanupStack::PopAndDestroy(); //infoArray, results in a call to CleanupEComArray
|
|
781 |
_DBG_FILE("CDcmoDMAdapter::DDFDCMOAdaptersL(): end");
|
|
782 |
}
|
|
783 |
|
|
784 |
// ----------------------------------------------------------------------------
|
|
785 |
// CDcmoDMAdapter::FillDCMODDFL
|
|
786 |
// This function constructs the DDFnode with the details
|
|
787 |
// ----------------------------------------------------------------------------
|
|
788 |
//
|
|
789 |
void CDcmoDMAdapter::FillDCMODDFL(MSmlDmDDFObject& aDDF)
|
|
790 |
{
|
|
791 |
_DBG_FILE("CDcmoDMAdapter::FillDCMPDDFL(): begin");
|
|
792 |
|
|
793 |
TSmlDmAccessTypes accessTypesG;
|
|
794 |
accessTypesG.SetGet();
|
|
795 |
|
|
796 |
MSmlDmDDFObject& nPropertyDDF = aDDF.AddChildObjectL( KNSmlDdfProperty ); // Property
|
|
797 |
FillNodeInfoL( nPropertyDDF, accessTypesG,
|
|
798 |
MSmlDmDDFObject::EPermanent, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
799 |
KNSmlDdfPropertyDescription, KMimeType );
|
|
800 |
|
|
801 |
//Group
|
|
802 |
MSmlDmDDFObject& nGroupDDF = aDDF.AddChildObjectL( KNSmlDdfGroup ); // Group
|
|
803 |
FillNodeInfoL( nGroupDDF, accessTypesG,
|
|
804 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
805 |
KNSmlDdfGroupDescription, KMimeType );
|
|
806 |
|
|
807 |
// Description node
|
|
808 |
MSmlDmDDFObject& nDescriptionDDF = aDDF.AddChildObjectL( KNSmlDdfDescription ); // Description
|
|
809 |
FillNodeInfoL( nDescriptionDDF, accessTypesG,
|
|
810 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
811 |
KNSmlDdfDescDescription, KMimeType );
|
|
812 |
|
|
813 |
MSmlDmDDFObject& nAttachedDDF = aDDF.AddChildObjectL( KNSmlDdfAttached ); // Attached
|
|
814 |
FillNodeInfoL( nAttachedDDF, accessTypesG,
|
|
815 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
816 |
KNSmlDdfAttachedDescription, KMimeType );
|
|
817 |
|
|
818 |
MSmlDmDDFObject& nEnabledDDF = aDDF.AddChildObjectL( KNSmlDdfEnabled ); // Enabled
|
|
819 |
FillNodeInfoL( nEnabledDDF, accessTypesG,
|
|
820 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
821 |
KNSmlDdfEnabledDescription, KMimeType );
|
|
822 |
|
|
823 |
MSmlDmDDFObject& nDCMOConfigDDF = aDDF.AddChildObjectL( KNSmlDdfDCMOConfig ); // DCMOConfig
|
|
824 |
FillNodeInfoL( nDCMOConfigDDF, accessTypesG,
|
|
825 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::ENode, MSmlDmDDFObject::EOne,
|
|
826 |
KNSmlDdfDCMOConfigDescription, KMimeType );
|
|
827 |
|
|
828 |
MSmlDmDDFObject& nDenyUserEnableDDF = nDCMOConfigDDF.AddChildObjectL( KNSmlDdfDenyUserEnable ); // DenyUserEnable
|
|
829 |
FillNodeInfoL( nDenyUserEnableDDF, accessTypesG,
|
|
830 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EZeroOrOne,
|
|
831 |
KNSmlDdfDenyUserEnableDescription, KMimeType );
|
|
832 |
|
|
833 |
|
|
834 |
MSmlDmDDFObject& nNotifyUserDDF = nDCMOConfigDDF.AddChildObjectL( KNSmlDdfNotifyUser ); // NotifyUser
|
|
835 |
FillNodeInfoL( nNotifyUserDDF, accessTypesG,
|
|
836 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
837 |
KNSmlDdfNotifyUserDescription, KMimeType );
|
|
838 |
//Operations
|
|
839 |
|
|
840 |
MSmlDmDDFObject& nOperationsDDF = aDDF.AddChildObjectL( KNSmlDdfOperations ); // Operations
|
|
841 |
FillNodeInfoL( nOperationsDDF, accessTypesG,
|
|
842 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::ENode, MSmlDmDDFObject::EOne,
|
|
843 |
KNSmlDdfOperationsDescription, KMimeType );
|
|
844 |
|
|
845 |
|
|
846 |
TSmlDmAccessTypes accessTypesE;
|
|
847 |
accessTypesE.SetExec();
|
|
848 |
|
|
849 |
MSmlDmDDFObject& nEnableDDF = nOperationsDDF.AddChildObjectL( KNSmlDdfEnable ); // Enable
|
|
850 |
FillNodeInfoL( nEnableDDF, accessTypesE,
|
|
851 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
852 |
KNSmlDdfEnableDescription, KMimeType );
|
|
853 |
|
|
854 |
|
|
855 |
MSmlDmDDFObject& nDisableDDF = nOperationsDDF.AddChildObjectL( KNSmlDdfDisable ); // Disable
|
|
856 |
FillNodeInfoL( nDisableDDF, accessTypesE,
|
|
857 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
858 |
KNSmlDdfDisableDescription, KMimeType );
|
|
859 |
|
|
860 |
|
|
861 |
MSmlDmDDFObject& nOpExtDDF = nOperationsDDF.AddChildObjectL( KNSmlDdfOpExt ); // Operations/Ext
|
|
862 |
FillNodeInfoL( nOpExtDDF, accessTypesG,
|
|
863 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::ENode, MSmlDmDDFObject::EOne,
|
|
864 |
KNSmlDdfOpExtDescription, KMimeType );
|
|
865 |
|
|
866 |
if( iExtOpNode )
|
|
867 |
{
|
|
868 |
MSmlDmDDFObject& nOpExtSemiEnableDDF = nOpExtDDF.AddChildObjectL( KNSmlDdfOpExtSemiEnable ); // Operations/Ext/SemiEnable
|
|
869 |
FillNodeInfoL( nOpExtSemiEnableDDF, accessTypesE,
|
|
870 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
871 |
KNSmlDdfOpExtSemiEnableDescription, KMimeType );
|
|
872 |
iExtOpNode = EFalse;
|
|
873 |
}
|
|
874 |
|
|
875 |
MSmlDmDDFObject& nExtDDF = aDDF.AddChildObjectL( KNSmlDdfExt ); // Ext
|
|
876 |
FillNodeInfoL( nExtDDF, accessTypesG,
|
|
877 |
MSmlDmDDFObject::EDynamic, MSmlDmDDFObject::EChr, MSmlDmDDFObject::EOne,
|
|
878 |
KNSmlDdfExtDescription, KMimeType );
|
|
879 |
|
|
880 |
|
|
881 |
_DBG_FILE("CDcmoDMAdapter::FillDCMPDDFL(): end");
|
|
882 |
}
|
|
883 |
|
|
884 |
// ----------------------------------------------------------------------------
|
|
885 |
// CDcmoDMAdapter::GetCategoryFromUriL
|
|
886 |
// This function returns the implementation UID if the plug-in
|
|
887 |
// ----------------------------------------------------------------------------
|
|
888 |
//
|
|
889 |
TPtrC8 CDcmoDMAdapter::GetCategoryFromUriL(const TDesC8& aURI )
|
|
890 |
{
|
|
891 |
_DBG_FILE("CDcmoDMAdapter::GetDCMOAdapterUidL(): begin");
|
|
892 |
|
|
893 |
TInt length = aURI.Length ();
|
|
894 |
TInt count = 0;
|
|
895 |
TInt flag = 0;
|
|
896 |
for (count=0; count<length; count++)
|
|
897 |
{
|
|
898 |
if ( aURI[count]=='/')
|
|
899 |
{
|
|
900 |
if ( flag )
|
|
901 |
break;
|
|
902 |
flag = count;
|
|
903 |
}
|
|
904 |
}
|
|
905 |
|
|
906 |
_DBG_FILE("CDcmoDMAdapter::GetDCMOAdapterUidL(): end");
|
|
907 |
return ( aURI.Mid ( flag+1 , count-(flag+1) ));
|
|
908 |
|
|
909 |
|
|
910 |
}
|
|
911 |
|
|
912 |
//----------------------------------------------------------------------
|
|
913 |
// TBool CDcmoDMAdapter::CheckEnforcementL()
|
|
914 |
// If DCMO policy is enforced true is returned else false
|
|
915 |
//----------------------------------------------------------------------
|
|
916 |
TBool CDcmoDMAdapter::CheckEnforcementL()
|
|
917 |
{
|
|
918 |
CSettingEnforcementInfo* info = CSettingEnforcementInfo::NewL();
|
|
919 |
CleanupStack::PushL(info);
|
|
920 |
TBool enforceActive ( EFalse );
|
|
921 |
User::LeaveIfError(info->EnforcementActive(EDCMOEnforcement, enforceActive));
|
|
922 |
CleanupStack::PopAndDestroy(info);
|
|
923 |
return enforceActive;
|
|
924 |
}
|
|
925 |
|
|
926 |
// End of File
|