mtpfws/mtpfw/dataproviders/devdp/src/cmtpgetnumobjects.cpp
author hgs
Fri, 03 Sep 2010 18:38:04 +0800
changeset 49 c20dd21d1eb4
parent 31 a26669f87b46
permissions -rw-r--r--
201035_05
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
//
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
//
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
// Contributors:
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
//
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
// Description:
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
//
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
    16
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
#include <mtp/tmtptyperequest.h>
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include <mtp/mmtpdataproviderframework.h>
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include <mtp/mmtpobjectmgr.h>
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include <mtp/mmtpdataprovider.h>
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <mtp/cmtpdataproviderplugin.h>
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    22
#include <mtp/cmtpobjectmetadata.h>
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include "cmtpdataprovidercontroller.h"
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include "cmtpdataprovider.h"
18
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
    26
#include "cmtpdevicedatastore.h"
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
    27
#include "cmtpdataprovidercontroller.h"
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#include "cmtpgetnumobjects.h"
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#include "mtpdevicedpconst.h"
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include "mtpdevdppanic.h"
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
    32
#include "OstTraceDefinitions.h"
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
    33
#ifdef OST_TRACE_COMPILER_IN_USE
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
    34
#include "cmtpgetnumobjectsTraces.h"
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
    35
#endif
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
    36
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
18
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
    38
// Class constants.
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
    39
static const TInt KMTPGetObjectNumTimeOut(1);
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    40
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
/**
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
Verification data for GetNumObjects request
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
*/
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
const TMTPRequestElementInfo KMTPGetNumObjectsPolicy[] = 
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
    {
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
        {TMTPTypeRequest::ERequestParameter1, EMTPElementTypeStorageId, EMTPElementAttrNone, 1, KMTPStorageAll, 0},
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
        {TMTPTypeRequest::ERequestParameter2, EMTPElementTypeFormatCode, EMTPElementAttrNone, 1, 0, 0},
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
        {TMTPTypeRequest::ERequestParameter3, EMTPElementTypeObjectHandle, EMTPElementAttrDir, 2, KMTPHandleAll, 0}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
    };
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
/**
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
Two-phase construction method
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
@param aPlugin	The data provider plugin
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
@param aFramework	The data provider framework
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
@param aConnection	The connection from which the request comes
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
@return a pointer to the created request processor object
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
*/    
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
MMTPRequestProcessor* CMTPGetNumObjects::NewL(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection)
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
	{
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
	CMTPGetNumObjects* self = new (ELeave) CMTPGetNumObjects(aFramework, aConnection);
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
	CleanupStack::PushL(self);
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
	self->ConstructL();
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
	CleanupStack::Pop();
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
	return self;
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
	}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
/**
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
Destructor
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
*/	
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
CMTPGetNumObjects::~CMTPGetNumObjects()
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
	{	
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    72
	iDevDpSingletons.Close();
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    iSingletons.Close();
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
	}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
/**
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
Standard c++ constructor
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
*/	
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
CMTPGetNumObjects::CMTPGetNumObjects(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection) :
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
    CMTPRequestProcessor(aFramework, aConnection, sizeof(KMTPGetNumObjectsPolicy)/sizeof(TMTPRequestElementInfo), KMTPGetNumObjectsPolicy)
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
	{
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
	}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
    
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
/**
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
Second phase constructor.
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
*/
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
void CMTPGetNumObjects::ConstructL()
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
    {
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
    iSingletons.OpenL();
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    90
    iDevDpSingletons.OpenL(iFramework);
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
    }
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
TMTPResponseCode CMTPGetNumObjects::CheckRequestL()
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
	{
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
	TMTPResponseCode responseCode = CMTPRequestProcessor::CheckRequestL();
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    96
	if(responseCode != EMTPRespCodeOK)
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    97
		{
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    98
		return responseCode;	
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    99
		}
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   100
	
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   101
	TUint32 formatCode = Request().Uint32(TMTPTypeRequest::ERequestParameter2); 
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   102
	if(formatCode != 0 && !IsSupportedFormatL(formatCode))
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   103
		{
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   104
		return EMTPRespCodeInvalidObjectFormatCode;
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   105
		}
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   106
	
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   107
	/*
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   108
	if(iSingletons.DpController().EnumerateState() != CMTPDataProviderController::EEnumeratedFulllyCompleted)
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
		{
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   110
		TUint handle = Request().Uint32(TMTPTypeRequest::ERequestParameter3);
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   111
		if(handle != KMTPHandleAll)
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   112
			{
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   113
			responseCode = EMTPRespCodeDeviceBusy;
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
			}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
		}
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   116
		*/
17
aabe5387f5ce Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
   117
	
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
	return responseCode;	
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
	}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
	
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
	
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
/**
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
GetNumObjects request handler
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
*/	
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
void CMTPGetNumObjects::ServiceL()
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
	{
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   127
    OstTraceFunctionEntry0( CMTPGETNUMOBJECTS_SERVICEL_ENTRY );
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   128
    OstTraceExt2( TRACE_NORMAL, CMTPGETNUMOBJECTS_SERVICEL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   129
            "IsConnectMac = %d; ERequestParameter2 = %d", iDevDpSingletons.DeviceDataStore().IsConnectMac(), Request().Uint32(TMTPTypeRequest::ERequestParameter2));
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   130
    
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   131
    if(iSingletons.DpController().EnumerateState() != CMTPDataProviderController::EEnumeratedFulllyCompleted)
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   132
        {
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   133
        TUint storageId = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   134
        TUint handle = Request().Uint32(TMTPTypeRequest::ERequestParameter3);
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   135
        TUint enumerateState = iSingletons.DpController().StorageEnumerateState(storageId);
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   136
        if ( (enumerateState < CMTPDataProviderController::EEnumeratingPhaseOneDone)
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   137
            || (enumerateState != CMTPDataProviderController::EEnumeratedFulllyCompleted && handle != KMTPHandleAll))
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   138
            {
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   139
            if (iTimeoutCount++ >= KMTPGetObjectNumTimeOut)
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   140
                {
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   141
                OstTrace0( TRACE_NORMAL, DUP1_CMTPGETNUMOBJECTS_SERVICEL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   142
                        "Wait for enumeration time out, return busy." );
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   143
                SendResponseL(EMTPRespCodeDeviceBusy);
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   144
                iTimeoutCount = 0;
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   145
                OstTraceFunctionExit0( CMTPGETNUMOBJECTS_SERVICEL_EXIT );
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   146
                return;
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   147
                }
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   148
            else
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   149
                {
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   150
                OstTrace0( TRACE_NORMAL, DUP2_CMTPGETNUMOBJECTS_SERVICEL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   151
                        "Enumeration not completed, suspend request." );
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   152
                RegisterPendingRequest(20);
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   153
                OstTraceFunctionExit0( DUP1_CMTPGETNUMOBJECTS_SERVICEL_EXIT );
20
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   154
                return; 
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   155
                }
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   156
            }
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   157
        }
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   158
    
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   159
    iTimeoutCount = 0;
6e82ae192c3a Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   160
    
18
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   161
	if(iDevDpSingletons.DeviceDataStore().IsConnectMac()
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   162
        &&(KMTPFormatsAll == Request().Uint32(TMTPTypeRequest::ERequestParameter2)))
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   163
        {
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   164
        TUint32 count(0);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   165
    	CMTPTypeArray *handles = CMTPTypeArray::NewLC(EMTPTypeAUINT32);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   166
        HandleObjectHandlesUnderMacL(*handles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   167
        count = handles->NumElements();
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   168
        CleanupStack::PopAndDestroy(handles);         
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   169
        OstTrace1( TRACE_NORMAL, DUP3_CMTPGETNUMOBJECTS_SERVICEL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   170
                "ConnectMac and Fetch all, total count = %d", count );           
18
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   171
    	SendResponseL(EMTPRespCodeOK, 1, &count); 
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   172
        }
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   173
    else
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   174
        {       
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   175
    	TMTPObjectMgrQueryParams params(Request().Uint32(TMTPTypeRequest::ERequestParameter1), Request().Uint32(TMTPTypeRequest::ERequestParameter2), Request().Uint32(TMTPTypeRequest::ERequestParameter3));
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   176
    	TUint32 count = iFramework.ObjectMgr().CountL(params);	
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   177
        OstTrace1( TRACE_NORMAL, DUP4_CMTPGETNUMOBJECTS_SERVICEL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   178
                "NOT ConnectMac or NOT Fetch all, total count = %d", count );
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   179
        SendResponseL(EMTPRespCodeOK, 1, &count);
18
1b39655331a3 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   180
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   181
	OstTraceFunctionExit0( DUP2_CMTPGETNUMOBJECTS_SERVICEL_EXIT );
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
	}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
/**
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
Check if the format code is supported by the current installed data providers
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
*/	
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
TBool CMTPGetNumObjects::IsSupportedFormatL(TUint32 aFormatCode)
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
	{
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
	TBool supported(EFalse);
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
		
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
	CMTPDataProviderController& dps(iSingletons.DpController());
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
	const TInt count(dps.Count());
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
	for (TInt i(0); ((i < count) && (!supported)); i++)
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
		{						
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
		CMTPDataProvider& dp = dps.DataProviderByIndexL(i);
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
		if (dp.DataProviderId() != dps.ProxyDpId())
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
			{
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
			supported = (
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
			    dp.Supported(EObjectCaptureFormats, aFormatCode) || 
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
			    dp.Supported(EObjectPlaybackFormats, aFormatCode));
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
			}			
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
		}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
	return supported;	
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
	}
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   207
/**
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   208
Handle special case under Mac.
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   209
Only expose the Folder, Image File and Viedo, Script under Drive:\Images, Drive\Viedos
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   210
*/
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   211
void CMTPGetNumObjects::HandleObjectHandlesUnderMacL(CMTPTypeArray &aObjectHandles)
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   212
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   213
    OstTraceFunctionEntry0( CMTPGETNUMOBJECTS_HANDLEOBJECTHANDLESUNDERMACL_ENTRY );
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   214
    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   215
    CMTPTypeArray* totalHandles = CMTPTypeArray::NewLC(EMTPTypeAUINT32);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   216
    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   217
    //get folder object handles    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   218
    GetObjectHandlesByFormatCodeL(EMTPFormatCodeAssociation,*totalHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   219
    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   220
    //get image/jpeg object handles
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   221
    GetObjectHandlesByFormatCodeL(EMTPFormatCodeEXIFJPEG,*totalHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   222
    //get image/bmp object handles
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   223
    GetObjectHandlesByFormatCodeL(EMTPFormatCodeBMP,*totalHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   224
    //get image/jif object handles
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   225
    GetObjectHandlesByFormatCodeL(EMTPFormatCodeGIF,*totalHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   226
    //get image/jpeg object handles
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   227
    GetObjectHandlesByFormatCodeL(EMTPFormatCodePNG,*totalHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   228
    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   229
    //get video/mp4 object handles
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   230
    GetObjectHandlesByFormatCodeL(EMTPFormatCodeMP4Container,*totalHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   231
    //get video/3gp object handles
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   232
    GetObjectHandlesByFormatCodeL(EMTPFormatCode3GPContainer,*totalHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   233
    //get video/wmv object handles
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   234
    GetObjectHandlesByFormatCodeL(EMTPFormatCodeWMV,*totalHandles); 
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   235
    //get video/asf object handles
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   236
    GetObjectHandlesByFormatCodeL(EMTPFormatCodeASF,*totalHandles); 
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   237
    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   238
    //Filer the folder list, ?:\\Images\\* and ?:\\Videos\\*
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   239
    _LIT(KImagesFolderPre, "?:\\Images\\*");
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   240
    _LIT(KViedosFolderPre, "?:\\Videos\\*");    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   241
   
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   242
    const TUint KCount(totalHandles->NumElements());
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   243
    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   244
    for (TUint i(0); (i < KCount); i++)//handles loop
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   245
        {
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   246
         CMTPObjectMetaData* object(CMTPObjectMetaData::NewLC());
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   247
         iFramework.ObjectMgr().ObjectL(totalHandles->ElementUint(i),*object);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   248
         const TDesC& suid(object->DesC(CMTPObjectMetaData::ESuid));
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   249
         
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   250
#ifdef OST_TRACE_COMPILER_IN_USE    
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   251
        TBuf8<KMaxFileName> tmp;
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   252
        tmp.Copy(suid);
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   253
        OstTraceExt1( TRACE_NORMAL, DUP2_CMTPGETNUMOBJECTS_HANDLEOBJECTHANDLESUNDERMACL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   254
                "HandleObjectHandlesUnderMacL - suid: %s", tmp);       
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   255
#endif // OST_TRACE_COMPILER_IN_USE
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   256
         if((KErrNotFound != suid.MatchF(KImagesFolderPre)) ||
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   257
            (KErrNotFound != suid.MatchF(KViedosFolderPre)))
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   258
            {
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   259
        	_LIT(KComma,",");
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   260
        	_LIT(KLineation,"-");
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   261
        	_LIT(KUnderline,"_");
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   262
        	_LIT(Ksemicolon ,";");
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   263
            if((KErrNotFound != suid.Find(KComma))||
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   264
                (KErrNotFound != suid.Find(KLineation))||
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   265
                (KErrNotFound != suid.Find(KUnderline))||
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   266
                (KErrNotFound != suid.Find(Ksemicolon)))
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   267
                {
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   268
                OstTrace0( TRACE_NORMAL, CMTPGETNUMOBJECTS_HANDLEOBJECTHANDLESUNDERMACL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   269
                        "HandleObjectHandlesUnderMacL - Skip handle" );              
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   270
                }
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   271
            else
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   272
                {
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   273
                OstTrace1( TRACE_NORMAL, DUP1_CMTPGETNUMOBJECTS_HANDLEOBJECTHANDLESUNDERMACL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   274
                        "HandleObjectHandlesUnderMacL - Add handle: %x", totalHandles->ElementUint(i));
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   275
                RArray<TUint>   tmphandles;
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   276
                CleanupClosePushL(tmphandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   277
                tmphandles.AppendL(totalHandles->ElementUint(i));
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   278
                aObjectHandles.AppendL(tmphandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   279
                CleanupStack::PopAndDestroy(&tmphandles);                
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   280
                }
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   281
            }
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   282
         CleanupStack::PopAndDestroy(object);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   283
        }
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   284
    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   285
    CleanupStack::PopAndDestroy(totalHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   286
    //get script object handles    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   287
    GetObjectHandlesByFormatCodeL(EMTPFormatCodeScript,aObjectHandles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   288
    
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   289
    OstTraceFunctionExit0( CMTPGETNUMOBJECTS_HANDLEOBJECTHANDLESUNDERMACL_EXIT );
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   290
    }
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   291
/**
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   292
Get Object Handles by format code
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   293
*/
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   294
void CMTPGetNumObjects::GetObjectHandlesByFormatCodeL(TUint32 aFormatCode, CMTPTypeArray &aObjectHandles)
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   295
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   296
    OstTraceFunctionEntry0( CMTPGETNUMOBJECTS_GETOBJECTHANDLESBYFORMATCODEL_ENTRY );
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   297
    OstTrace1( TRACE_NORMAL, CMTPGETNUMOBJECTS_GETOBJECTHANDLESBYFORMATCODEL, 
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   298
            "FormatCode: %x",  aFormatCode); 
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   299
    RMTPObjectMgrQueryContext   context;
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   300
    RArray<TUint>               handles;   
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   301
    CleanupClosePushL(context);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   302
    CleanupClosePushL(handles);    
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   303
    TMTPObjectMgrQueryParams    paramsFolder(Request().Uint32(TMTPTypeRequest::ERequestParameter1), aFormatCode, Request().Uint32(TMTPTypeRequest::ERequestParameter3));  
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   304
    do
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   305
        {
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   306
        iFramework.ObjectMgr().GetObjectHandlesL(paramsFolder, context, handles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   307
        aObjectHandles.AppendL(handles);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   308
        }
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   309
    while (!context.QueryComplete());
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   310
    CleanupStack::PopAndDestroy(&context);
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   311
    CleanupStack::PopAndDestroy(&handles);
49
c20dd21d1eb4 201035_05
hgs
parents: 31
diff changeset
   312
    OstTraceFunctionExit0( CMTPGETNUMOBJECTS_GETOBJECTHANDLESBYFORMATCODEL_EXIT );
31
a26669f87b46 201027_03
hgs
parents: 20
diff changeset
   313
    }
0
d0791faffa3f Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314