profilesservices/ProfileEngine/WrapperSrc/ProEngMmfInfoUtility.cpp
changeset 0 8c5d936e5675
equal deleted inserted replaced
-1:000000000000 0:8c5d936e5675
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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: Implementation of ProEngMmfInfoUtility.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // CLASS HEADER
       
    21 #include    "ProEngMmfInfoUtility.h"
       
    22 
       
    23 // INTERNAL INCLUDES
       
    24 
       
    25 // EXTERNAL INCLUDES
       
    26 #include <e32std.h>
       
    27 #include <badesca.h>
       
    28 #include <mmf/common/mmfcontrollerpluginresolver.h>
       
    29 
       
    30 namespace
       
    31 	{
       
    32 	// CONSTANTS
       
    33 	_LIT8( KProEngRngMimeType,    "application/vnd.nokia.ringing-tone" );
       
    34 	//_LIT8( KProEngPlainTextType,  "text/plain" );
       
    35     }
       
    36 
       
    37 // ============================ MEMBER FUNCTIONS ===============================
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CProEngMmfInfoUtility::GetSupportedMimeTypesL
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 void ProEngMmfInfoUtility::GetSupportedMimeTypesL( CDesC8Array& aMimeArray )
       
    44     {
       
    45 
       
    46     aMimeArray.InsertIsqL( KProEngRngMimeType );
       
    47 
       
    48 	CMMFFormatSelectionParameters* formatPrms =
       
    49         CMMFFormatSelectionParameters::NewLC();
       
    50 	CMMFControllerPluginSelectionParameters* controllerPrms =
       
    51         CMMFControllerPluginSelectionParameters::NewLC();
       
    52 
       
    53     // Empty format parameters means: "get all the supported formats"
       
    54     controllerPrms->SetRequiredPlayFormatSupportL( *formatPrms );
       
    55     RMMFControllerImplInfoArray cntrlArray;
       
    56     controllerPrms->ListImplementationsL( cntrlArray );
       
    57 
       
    58     TInt index( 0 );
       
    59     for( TInt i( cntrlArray.Count() - 1 ); i >= 0 ; --i )
       
    60         {
       
    61         const RMMFFormatImplInfoArray&
       
    62             infoArray( cntrlArray[i]->PlayFormats() );
       
    63 
       
    64         for( TInt j( infoArray.Count() - 1 ); j >= 0; --j )
       
    65             {
       
    66             const CDesC8Array& mimes = (infoArray[j])->SupportedMimeTypes();
       
    67             for( TInt k( mimes.MdcaCount() - 1 ); k >= 0; --k )
       
    68                 {
       
    69                 if( aMimeArray.FindIsq( mimes[k], index ) != KErrNone )
       
    70                     {
       
    71                     aMimeArray.InsertIsqL( mimes[k] );
       
    72                     }
       
    73                 }
       
    74             }
       
    75         }
       
    76 	
       
    77 	cntrlArray.ResetAndDestroy();
       
    78 	cntrlArray.Close();
       
    79     CleanupStack::PopAndDestroy( 2, formatPrms );
       
    80 
       
    81     //if( aMimeArray.FindIsq( KProEngPlainTextType, index ) == KErrNone )
       
    82     //    {
       
    83     //    aMimeArray.Delete( index );
       
    84     //    }
       
    85 
       
    86     aMimeArray.Compress();
       
    87     }
       
    88 
       
    89 //  End of File
       
    90