commonuis/CommonDialogs/src/AknFileFilterFactory.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "AknFileFilterFactory.h"
       
    21 
       
    22 #include <barsread.h>   // TResourceReader
       
    23 
       
    24 #include "CAknFileNameFilter.h"
       
    25 #include "CAknAttributeFilter.h"
       
    26 #include "CommonDialogs.hrh"
       
    27 #include "CAknCommonDialogsBase.h"  // Panic codes
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // AknFileFilterFactory::CreateFilterLC
       
    33 //
       
    34 //
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 EXPORT_C MAknFileFilter* AknFileFilterFactory::CreateFilterLC( TResourceReader& aReader )
       
    38 	{
       
    39 	// Read the type of the filter
       
    40 	TInt filterType( aReader.ReadInt16() );
       
    41 
       
    42 	// Create desired filter
       
    43 	switch( filterType )
       
    44 		{
       
    45 		case EFilenameFilter:
       
    46 			{
       
    47 			return CAknFileNameFilter::NewLC( aReader );
       
    48 			}
       
    49 		case EAttributeFilter:
       
    50 			{
       
    51 			return CAknAttributeFilter::NewLC( aReader );
       
    52 			}
       
    53 		default:
       
    54 			{
       
    55 			// Filter type is invalid
       
    56 			User::Panic( KCFDPanicText, ECFDPanicInvalidFilterType );
       
    57 			}
       
    58 		}
       
    59 
       
    60 	// Avoid warning
       
    61 	return NULL;
       
    62 	}
       
    63 
       
    64 // End of File