browserutilities/favouritesengine/ClientServer/src/FavouritesUtil.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 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 the License "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 *      Implementation of class FavouritesUtil
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include <s32strm.h>
       
    24 #include "FavouritesUtil.h"
       
    25 
       
    26 #include <e32property.h>
       
    27 #include <connect/sbdefs.h>
       
    28 
       
    29 // ================= MEMBER FUNCTIONS =======================
       
    30 
       
    31 // ---------------------------------------------------------
       
    32 // FavouritesUtil::ExternalizeL
       
    33 // ---------------------------------------------------------
       
    34 //
       
    35 void FavouritesUtil::ExternalizeL
       
    36 ( const CArrayFix<TInt>& aArray, RWriteStream& aStream )
       
    37     {
       
    38     aStream.WriteInt32L( aArray.Count() );
       
    39     for ( TInt i = 0; i < aArray.Count(); i++ )
       
    40         {
       
    41         aStream.WriteInt32L( aArray[ i ] );
       
    42         }
       
    43     }
       
    44 
       
    45 // ---------------------------------------------------------
       
    46 // FavouritesUtil::InternalizeL
       
    47 // ---------------------------------------------------------
       
    48 //
       
    49 void FavouritesUtil::InternalizeL
       
    50 ( CArrayFix<TInt>& aArray, RReadStream& aStream )
       
    51     {
       
    52     TInt count = aStream.ReadInt32L();
       
    53     for ( TInt i = 0; i < count; i++ )
       
    54         {
       
    55         aArray.AppendL( aStream.ReadInt32L() );
       
    56         }
       
    57     }
       
    58 
       
    59 // ---------------------------------------------------------
       
    60 // FavouritesUtil::IsBackupInProgressL
       
    61 // ---------------------------------------------------------
       
    62 //
       
    63 TBool FavouritesUtil::IsBackupInProgressL()
       
    64     {
       
    65     TInt backupRestoreStatus;
       
    66     TInt err = RProperty::Get(KUidSystemCategory, 
       
    67         conn::KUidBackupRestoreKey,
       
    68         backupRestoreStatus);
       
    69 
       
    70 	if(err != KErrNone)
       
    71 		{
       
    72 		if(err == KErrNotFound)
       
    73 			{
       
    74 			return EFalse;
       
    75 			}
       
    76 	    else
       
    77 			{
       
    78     		User::Leave(err);
       
    79 			}
       
    80 		}
       
    81 
       
    82     if( backupRestoreStatus == conn::EBURUnset || 
       
    83         backupRestoreStatus & conn::EBURNormal ||
       
    84         (backupRestoreStatus & conn::KBackupIncTypeMask) == conn::ENoBackup)
       
    85         {
       
    86         return EFalse;
       
    87         }
       
    88     else
       
    89         {
       
    90         return ETrue;
       
    91         }
       
    92     }
       
    93 
       
    94 //  End of File