phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CompressConfig.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 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: 
       
    15 *     Phonebook database compression configuration.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef COMPRESSCONFIG_H
       
    21 #define COMPRESSCONFIG_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <cntdb.h>
       
    25 #include <vpbkdebug.h>
       
    26 
       
    27 namespace VPbkCntModel {
       
    28 	
       
    29 // MACROS
       
    30 #ifdef PBK2_COMPRESS_ALWAYS
       
    31     #pragma message("Warning: PBK_COMPRESS_ALWAYS is set.")
       
    32 #endif
       
    33 
       
    34 /**
       
    35  * Phonebook compression configuration.
       
    36  */
       
    37 namespace CompressConfig
       
    38     {
       
    39 
       
    40     /**
       
    41      * Returns ETrue if aContactDb requires compression.
       
    42      */
       
    43     inline TBool CompressRequired(CContactDatabase& aContactDb)
       
    44         {
       
    45         #ifdef PBK2_COMPRESS_ALWAYS
       
    46             const TBool result = ETrue;
       
    47         #else
       
    48             const TBool result = aContactDb.CompressRequired();
       
    49         #endif
       
    50 
       
    51         if (result)
       
    52             {
       
    53             VPBK_DEBUG_PRINT(VPBK_DEBUG_STRING("CompressConfig::CompressRequired() returns ETrue"));
       
    54             }
       
    55         return result;
       
    56         }
       
    57 
       
    58     } // namespace CompressConfig
       
    59 } // namespace VPbkCntModel
       
    60 
       
    61 #endif  // COMPRESSCONFIG_H
       
    62 
       
    63 // End of File