pictographs/AknPictograph/src/AknPictographInterface.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:  Pictograph interface instance
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <featmgr.h>
       
    22 
       
    23 #include "AknPictographInterface.h"
       
    24 #include "AknPictographDrawerInterface.h"
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 typedef MAknPictographDrawer* (*TPictographDrawerFactoryFunctionL)(
       
    29     MAknPictographAnimatorCallBack& );
       
    30 
       
    31 _LIT( KImplementationDllPath, "z:\\sys\\bin" );
       
    32 _LIT( KImplementationDll, "AknPictographImpl.dll" );
       
    33 
       
    34 // ============================ MEMBER FUNCTIONS ===============================
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CAknPictographInterface::CAknPictographInterface
       
    38 // C++ default constructor can NOT contain any code, that
       
    39 // might leave.
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CAknPictographInterface::CAknPictographInterface()
       
    43 	{
       
    44 	}
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CAknPictographInterface::ConstructL
       
    48 // Symbian 2nd phase constructor can leave.
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 void CAknPictographInterface::ConstructL( 
       
    52     MAknPictographAnimatorCallBack& aCallBack )
       
    53     {
       
    54     // load polymorphic implementation DLL
       
    55     User::LeaveIfError( iLib.Load( KImplementationDll, KImplementationDllPath ) );
       
    56 
       
    57     iInterface = ( *(TPictographDrawerFactoryFunctionL)iLib.Lookup( 1 ) )(
       
    58         aCallBack );
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CAknPictographInterface::NewL
       
    63 // Two-phased constructor.
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 EXPORT_C CAknPictographInterface* CAknPictographInterface::NewL(
       
    67     CCoeControl& /*aParent*/,
       
    68     MAknPictographAnimatorCallBack& aCallBack )
       
    69 	{
       
    70     FeatureManager::InitializeLibL();
       
    71 
       
    72     TBool pictographsSupported = 
       
    73         FeatureManager::FeatureSupported( KFeatureIdJapanesePicto );
       
    74 
       
    75     FeatureManager::UnInitializeLib();    
       
    76 
       
    77     CAknPictographInterface* self = NULL;
       
    78 
       
    79     if ( pictographsSupported )
       
    80         {
       
    81         self = new( ELeave ) CAknPictographInterface();
       
    82         CleanupStack::PushL( self );
       
    83         self->ConstructL( aCallBack );
       
    84         CleanupStack::Pop();
       
    85         }
       
    86 
       
    87     return self;
       
    88 	}
       
    89 
       
    90 // Destructor
       
    91 CAknPictographInterface::~CAknPictographInterface()
       
    92     {
       
    93     delete iInterface;
       
    94     iLib.Close();
       
    95     }
       
    96 
       
    97 //  End of File