mtpdataproviders/mtpimagedp/src/cmtpimagedpgetobjectpropssupported.cpp
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalTechnology
       
    19 */
       
    20 
       
    21 
       
    22 #include <f32file.h>
       
    23 #include <mtp/tmtptyperequest.h>
       
    24 #include <mtp/mmtpdataproviderframework.h>
       
    25 #include <mtp/mtpprotocolconstants.h>
       
    26 #include <mtp/cmtptypearray.h>
       
    27 #include <mtp/mtpdatatypeconstants.h>
       
    28 
       
    29 #include "cmtpimagedpgetobjectpropssupported.h"
       
    30 #include "mtpimagedpconst.h"
       
    31 #include "cmtpimagedp.h"
       
    32 
       
    33 __FLOG_STMT(_LIT8(KComponent,"GetObjectPropsSupported");)
       
    34 
       
    35 /**
       
    36 Verification data for the GetObjectPropSupported request
       
    37 */
       
    38 const TMTPRequestElementInfo KMTPGetObjectPropSupportedPolicy[] = 
       
    39     {
       
    40         {TMTPTypeRequest::ERequestParameter1, EMTPElementTypeFormatCode, EMTPElementAttrNone, 1, EMTPFormatCodeUndefined, 0},
       
    41     };
       
    42  
       
    43 /**
       
    44 Two-phase construction method
       
    45 @param aPlugin	The data provider plugin
       
    46 @param aFramework	The data provider framework
       
    47 @param aConnection	The connection from which the request comes
       
    48 @return a pointer to the created request processor object
       
    49 */     
       
    50 MMTPRequestProcessor* CMTPImageDpGetObjectPropsSupported::NewL(
       
    51                                             MMTPDataProviderFramework& aFramework,
       
    52                                             MMTPConnection& aConnection,CMTPImageDataProvider& /*aDataProvider*/)
       
    53     {
       
    54     CMTPImageDpGetObjectPropsSupported* self = new (ELeave) CMTPImageDpGetObjectPropsSupported(aFramework, aConnection);
       
    55     CleanupStack::PushL(self);
       
    56     self->ConstructL();
       
    57     CleanupStack::Pop(self);
       
    58     return self;
       
    59     }
       
    60 
       
    61 /**
       
    62 Destructor
       
    63 */	
       
    64 CMTPImageDpGetObjectPropsSupported::~CMTPImageDpGetObjectPropsSupported()
       
    65     {
       
    66     delete iObjectPropsSupported;
       
    67     __FLOG_CLOSE;
       
    68     }
       
    69 
       
    70 /**
       
    71 Standard c++ constructor
       
    72 */		
       
    73 CMTPImageDpGetObjectPropsSupported::CMTPImageDpGetObjectPropsSupported(
       
    74                                     MMTPDataProviderFramework& aFramework,
       
    75                                     MMTPConnection& aConnection)
       
    76     :CMTPRequestProcessor(aFramework, aConnection, sizeof(KMTPGetObjectPropSupportedPolicy)/sizeof(TMTPRequestElementInfo), KMTPGetObjectPropSupportedPolicy)
       
    77     {
       
    78     __FLOG_OPEN(KMTPSubsystem, KComponent);
       
    79     }
       
    80     
       
    81 /**
       
    82 GetObjectPropSupported request handler
       
    83 */
       
    84 void CMTPImageDpGetObjectPropsSupported::ServiceL()
       
    85     {
       
    86     TInt count = sizeof(KMTPImageDpSupportedProperties) / sizeof(TUint16);
       
    87     for(TInt i = 0; i < count; i++)
       
    88         {
       
    89         iObjectPropsSupported->AppendUintL(KMTPImageDpSupportedProperties[i]);
       
    90         }
       
    91     SendDataL(*iObjectPropsSupported);	
       
    92     }
       
    93 
       
    94 /**
       
    95 Second-phase construction
       
    96 */		
       
    97 void CMTPImageDpGetObjectPropsSupported::ConstructL()
       
    98     {
       
    99     iObjectPropsSupported = CMTPTypeArray::NewL(EMTPTypeAUINT16);	
       
   100     }