clfwrapper/ClientSrc/CLFUtils.cpp
changeset 0 c53acadfccc6
child 14 646a02f170b9
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // Includes
       
    20 #include <e32base.h>
       
    21 #include <CLFContentListing.hrh>
       
    22 #include <mdeconstants.h>
       
    23 #include "CLFConsts.h"
       
    24 #include "CLFUtils.h"
       
    25 #include "MGDebugPrint.h"
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // Maps CLF mediatype to MdE object class
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 const TDesC& CLFUtils::MapClfType( const TInt aType )
       
    32     {
       
    33     MG_DEBUG2( MCT, "[CLF]\t CCLFQueryAdapter::MapClfType %d", aType );
       
    34     const TDesC* ret = &KNullDesC;
       
    35 
       
    36     switch ( aType )
       
    37         {
       
    38         /// Music media type
       
    39         case ECLFMediaTypeMusic:
       
    40             {
       
    41             ret = &MdeConstants::Audio::KAudioObject;
       
    42             break;
       
    43             }
       
    44         /// Sound media type
       
    45         case ECLFMediaTypeSound:
       
    46             {
       
    47             ret = &MdeConstants::Audio::KAudioObject;
       
    48             break;
       
    49             }
       
    50         /// Image media type
       
    51         case ECLFMediaTypeImage:
       
    52             {
       
    53             ret = &MdeConstants::Image::KImageObject;
       
    54             break;
       
    55             }
       
    56         /// Video media type
       
    57         case ECLFMediaTypeVideo:
       
    58             {
       
    59             ret = &MdeConstants::Video::KVideoObject;
       
    60             break;
       
    61             }
       
    62         /// Map ECLFMediaTypeUnknown, ECLFMediaTypeStreamingURL, ECLFMediaTypePlaylist and
       
    63         /// ECLFMediaTypePresentations to KBaseObject.
       
    64         case ECLFMediaTypeUnknown:
       
    65         case ECLFMediaTypeStreamingURL:
       
    66         case ECLFMediaTypePlaylist:
       
    67         case ECLFMediaTypePresentations:
       
    68         default:
       
    69             {
       
    70             MG_DEBUG1( MCT3, "[CLF]\t MapClfType reached default, returning KBaseObject" );   
       
    71             ret = &MdeConstants::Object::KBaseObject;
       
    72             break;
       
    73             }
       
    74         }
       
    75     return *ret;
       
    76     }
       
    77 
       
    78 //  End of File