phoneapp/phoneuiutils/src/cphonelibrarycontainer.cpp
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Container for factory library handles.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "cphonelibrarycontainer.h"
       
    21 
       
    22 // ================= MEMBER FUNCTIONS =======================
       
    23 
       
    24 // ---------------------------------------------------------
       
    25 // CPhoneLibraryContainer::~CPhoneLibraryContainer()
       
    26 // Destructor
       
    27 // (other items were commented in a header).
       
    28 // ---------------------------------------------------------
       
    29 //
       
    30 EXPORT_C CPhoneLibraryContainer::~CPhoneLibraryContainer()
       
    31     {
       
    32     TInt i( 0 );
       
    33     TInt count( iLibraries.Count() ); 
       
    34 
       
    35     // Close the libraries
       
    36     for( ; i < count; i++ )
       
    37         {
       
    38         iLibraries[i].Close();
       
    39         }
       
    40 
       
    41     // Free allocated memory from array
       
    42     iLibraries.Close();
       
    43     }
       
    44 
       
    45 // ---------------------------------------------------------
       
    46 // CPhoneLibraryContainer::CPhoneLibraryContainer()
       
    47 // Default constructor
       
    48 // (other items were commented in a header).
       
    49 // ---------------------------------------------------------
       
    50 //
       
    51 CPhoneLibraryContainer::CPhoneLibraryContainer()
       
    52     {
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------
       
    56 // CPhoneLibraryContainer::NewL()
       
    57 // Two-phased constructor.
       
    58 // (other items were commented in a header).
       
    59 // ---------------------------------------------------------
       
    60 //
       
    61 EXPORT_C CPhoneLibraryContainer* CPhoneLibraryContainer::NewL()
       
    62     {
       
    63     CPhoneLibraryContainer* self = new( ELeave ) CPhoneLibraryContainer;
       
    64 
       
    65     return self;
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------
       
    69 // CPhoneLibraryContainer::AddLibraryL()
       
    70 // Adds library to container.
       
    71 // (other items were commented in a header).
       
    72 // ---------------------------------------------------------
       
    73 //
       
    74 EXPORT_C void CPhoneLibraryContainer::AddLibraryL( 
       
    75     const RLibrary& aLibraryHandle )
       
    76     {
       
    77     User::LeaveIfError( iLibraries.Append( aLibraryHandle ) );
       
    78     }
       
    79 
       
    80 //  End of File