pkiutilities/CertmanUi/SRC/certmanui.cpp
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003-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:   Implementation of class CCertManUI. Methods for reading
       
    15 *                the resources
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <eikenv.h>
       
    22 #include <bautils.h>
       
    23 #include <data_caging_path_literals.hrh>
       
    24 #include "Certmanui.h"
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 _LIT( KResourceFile, "z:CertManUi.rsc" );
       
    29 
       
    30 // ================= MEMBER FUNCTIONS =======================
       
    31 
       
    32 // ----------------------------------------------------------
       
    33 // CCertManUi::InitializeLibL()
       
    34 // Initializes CCertManUi resource file
       
    35 // ----------------------------------------------------------
       
    36 //
       
    37 void CCertManUi::InitializeLibL()
       
    38   {
       
    39   if ( Dll::Tls() != NULL )
       
    40     {
       
    41     return;
       
    42     }
       
    43   CCertManUi* self = new ( ELeave ) CCertManUi();
       
    44   CleanupStack::PushL( self );
       
    45   self->ConstructL();
       
    46   Dll::SetTls( self );
       
    47   CleanupStack::Pop(); // self
       
    48   }
       
    49 
       
    50 // ----------------------------------------------------------
       
    51 // CCertManUi::UnInitializeLib()
       
    52 // Uninitializes CCertManUi resource file
       
    53 // ----------------------------------------------------------
       
    54 //
       
    55 void CCertManUi::UnInitializeLib()
       
    56   {
       
    57   CCertManUi* instance = STATIC_CAST( CCertManUi*, Dll::Tls() );
       
    58   delete instance;
       
    59   Dll::SetTls( NULL );
       
    60   }
       
    61 
       
    62 // ----------------------------------------------------------
       
    63 // CCertManUi::CCertManUi()
       
    64 // C++ default constructor
       
    65 // ----------------------------------------------------------
       
    66 //
       
    67 CCertManUi::CCertManUi() : iResourceLoader( *iCoeEnv )
       
    68   {
       
    69   }
       
    70 
       
    71 // ----------------------------------------------------------
       
    72 // CCertManUi::~CCertManUi()
       
    73 // Destructor
       
    74 // ----------------------------------------------------------
       
    75 //
       
    76 CCertManUi::~CCertManUi()
       
    77   {
       
    78   iResourceLoader.Close();
       
    79   }
       
    80 
       
    81 // ----------------------------------------------------------
       
    82 // CCertManUi::ConstructL()
       
    83 // EPOC default constructor
       
    84 // ----------------------------------------------------------
       
    85 //
       
    86 void CCertManUi::ConstructL()
       
    87   {
       
    88   AddResourceFileL();
       
    89   }
       
    90 
       
    91 // ----------------------------------------------------------
       
    92 // CCertManUi::AddResourceFileL()
       
    93 // Used in ConstructL to get resource file
       
    94 // ----------------------------------------------------------
       
    95 //
       
    96 void CCertManUi::AddResourceFileL()
       
    97   {
       
    98   TFileName fileName;
       
    99 
       
   100   TParse parse;
       
   101   parse.Set( KResourceFile, &KDC_RESOURCE_FILES_DIR, NULL );
       
   102 
       
   103   fileName = parse.FullName();
       
   104   iResourceLoader.OpenL( fileName );
       
   105   }
       
   106 
       
   107 // End of File
       
   108 
       
   109