cellular/psetnotesui/src/psuiresourceloader.cpp
changeset 51 12bc758d6a02
parent 48 78df25012fda
child 53 25b8d29b7c59
equal deleted inserted replaced
48:78df25012fda 51:12bc758d6a02
     1 /*
       
     2 * Copyright (c) 2002-2004,2007 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:  Loads resources from file.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <coemain.h>
       
    21 #include <ConeResLoader.h> 
       
    22 
       
    23 #include "psuiresourceloader.h" 
       
    24 
       
    25 // CONSTANTS
       
    26 _LIT( KPsuiResourceFileNameAndPath, "Z:\\resource\\Psui.rsc" );
       
    27 
       
    28 // MEMBER FUNCTIONS 
       
    29 //-----------------------------------------------------------------------------
       
    30 // Symbian OS two-phased constructor.
       
    31 //-----------------------------------------------------------------------------
       
    32 EXPORT_C CPsuiResourceLoader* CPsuiResourceLoader::NewL()
       
    33     {
       
    34     CPsuiResourceLoader* self = CPsuiResourceLoader::NewLC();
       
    35     CleanupStack::Pop( self );
       
    36     return self;
       
    37     }
       
    38 
       
    39 //-----------------------------------------------------------------------------
       
    40 // Symbian OS two-phased constructor.
       
    41 //-----------------------------------------------------------------------------
       
    42 EXPORT_C CPsuiResourceLoader* CPsuiResourceLoader::NewLC()
       
    43     {
       
    44     CPsuiResourceLoader* self = new( ELeave ) CPsuiResourceLoader;
       
    45     CleanupStack::PushL( self );
       
    46     self->ConstructL();
       
    47     return self;
       
    48     }
       
    49 
       
    50 //-----------------------------------------------------------------------------
       
    51 // Destructor.
       
    52 //-----------------------------------------------------------------------------
       
    53 CPsuiResourceLoader::~CPsuiResourceLoader()
       
    54     {
       
    55     if ( iResourceLoader )
       
    56         {
       
    57         iResourceLoader->Close();
       
    58         }
       
    59     delete iResourceLoader;
       
    60     iResourceLoader = NULL;
       
    61     }
       
    62 
       
    63 // ----------------------------------------------------------------------------
       
    64 // 
       
    65 // Creates the resource loader and connects it with environment.
       
    66 // 
       
    67 // ----------------------------------------------------------------------------
       
    68 //
       
    69 void CPsuiResourceLoader::ConstructL()
       
    70     {
       
    71     iResourceLoader = new ( ELeave ) RConeResourceLoader( *CCoeEnv::Static() ); 
       
    72     TFileName fileName ( KPsuiResourceFileNameAndPath ); 
       
    73     iResourceLoader->OpenL( fileName );
       
    74     }
       
    75 //  End of File  
       
    76