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