uigraphics/AknIcon/src/AknIconFormatHandlerFactory.cpp
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2002 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 
       
    20 // INCLUDE FILES
       
    21 #include <mifconvdefs.h>
       
    22 #include <bldvariant.hrh>
       
    23 #include "AknIconFormatHandlerFactory.h"
       
    24 #include "AknIconTraces.h"
       
    25 
       
    26 #ifdef __SVGT
       
    27 #include "AknSvgFormatHandler.h"
       
    28 #endif // __SVGT
       
    29 #include "AknNGAFormatHandler.h"
       
    30 
       
    31 #ifdef __NVG
       
    32 #include "AknNvgFormatHandler.h"
       
    33 #endif // __NVG
       
    34 
       
    35 // CONSTANTS
       
    36 
       
    37 // ============================ MEMBER FUNCTIONS ===============================
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // AknIconFormatHandlerFactory::NewIconFormatHandlerL
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 MAknIconFormatHandler* AknIconFormatHandlerFactory::NewIconFormatHandlerL(
       
    44     const TInt aType,TSize aBitmapSize,TDisplayMode aBitmapDspMode,TDisplayMode aMaskDspMode )
       
    45     {
       
    46     MAknIconFormatHandler* handler = NULL;
       
    47 
       
    48     switch ( aType )
       
    49         {
       
    50 #ifdef __NVG
       
    51         case EIconFormatNVG:
       
    52             handler = CAknNvgFormatHandler::NewL();
       
    53             break;
       
    54 #endif // __NVG
       
    55 #ifdef __SVGT
       
    56         case EIconFormatSVG:
       
    57 #ifndef __ONLYNGAICON
       
    58             handler = CAknSvgFormatHandler::NewL(EIconFormatSVG, aBitmapSize, aBitmapDspMode, aMaskDspMode);
       
    59             break;
       
    60 #endif 
       
    61 #endif // __SVGT
       
    62         case EIconFormatNGA:
       
    63             handler = CAknNGAFormatHandler::NewL(EIconFormatNGA, aBitmapSize, aBitmapDspMode, aMaskDspMode);
       
    64             break;
       
    65         default:
       
    66             break;
       
    67         }
       
    68 
       
    69     if ( !handler )
       
    70         {
       
    71         User::Leave( KErrNotSupported );
       
    72         }
       
    73 
       
    74     return handler;
       
    75     }
       
    76 
       
    77 //  End of File