mtpdataproviders/mtppictbridgedp/src/cmtppictbridgegetobjectpropssupported.cpp
changeset 0 d0791faffa3f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mtpdataproviders/mtppictbridgedp/src/cmtppictbridgegetobjectpropssupported.cpp	Tue Feb 02 01:11:40 2010 +0200
@@ -0,0 +1,91 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#include <mtp/cmtptypearray.h>
+#include "cmtppictbridgegetobjectpropssupported.h"
+#include "mtppictbridgedpconst.h"
+
+/**
+Verification data for the GetObjectPropSupported request
+*/
+const TMTPRequestElementInfo KMTPGetObjectPropSupportedPolicy[] = 
+    {
+            {TMTPTypeRequest::ERequestParameter1, EMTPElementTypeFormatCode, EMTPElementAttrNone, 1, EMTPFormatCodeUndefined, 0},
+    };
+
+MMTPRequestProcessor* CMTPPictBridgeGetObjectPropsSupported::NewL( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, CMTPPictBridgeDataProvider& aDataProvider )
+    {
+    CMTPPictBridgeGetObjectPropsSupported* self = new (ELeave) CMTPPictBridgeGetObjectPropsSupported( aFramework, aConnection, aDataProvider );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+/**
+Destructor
+*/  
+CMTPPictBridgeGetObjectPropsSupported::~CMTPPictBridgeGetObjectPropsSupported()
+    {
+    delete iObjectPropsSupported;
+    }
+
+/**
+Standard c++ constructor
+*/
+CMTPPictBridgeGetObjectPropsSupported::CMTPPictBridgeGetObjectPropsSupported( MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, CMTPPictBridgeDataProvider& aDataProvider )
+:CMTPRequestProcessor( aFramework, aConnection, sizeof(KMTPGetObjectPropSupportedPolicy)/sizeof(TMTPRequestElementInfo), KMTPGetObjectPropSupportedPolicy ),
+iPictBridgeDP( aDataProvider )
+    {
+    
+    }
+
+/**
+check format code
+*/
+TMTPResponseCode CMTPPictBridgeGetObjectPropsSupported::CheckRequestL()
+    {
+    TMTPResponseCode responseCode = CMTPRequestProcessor::CheckRequestL();
+    if ( EMTPRespCodeOK == responseCode )
+        {
+        TUint32 formatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 );
+        if( formatCode != EMTPFormatCodeScript )
+            {
+            responseCode = EMTPRespCodeInvalidObjectFormatCode;
+            }
+        }
+    
+    return responseCode;
+    }
+
+/**
+CMTPPictBridgeGetObjectPropsSupported request handler
+*/
+void CMTPPictBridgeGetObjectPropsSupported::ServiceL()
+    {
+    TInt count = sizeof(KMTPPictBridgeDpSupportedProperties) / sizeof(TUint16);
+    for( TInt i = 0; i < count; i++ )
+        {
+        iObjectPropsSupported->AppendUintL(KMTPPictBridgeDpSupportedProperties[i]);
+        }
+    SendDataL(*iObjectPropsSupported);
+    }
+
+/**
+Second-phase construction
+*/
+void CMTPPictBridgeGetObjectPropsSupported::ConstructL()
+    {
+    iObjectPropsSupported = CMTPTypeArray::NewL(EMTPTypeAUINT16);
+    }