phonebookengines/VirtualPhonebook/VPbkSimStore/src/RemoteViewPreferences.cpp
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:  The virtual phonebook SIM remote view settings.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "RemoteViewPreferences.h"
       
    21 
       
    22 #include <CVPbkContactViewDefinition.h>
       
    23 
       
    24 namespace VPbkSimStore {
       
    25 
       
    26 // FUNCTIONS
       
    27 
       
    28 TBool RemoteViewDefinition( 
       
    29         const CVPbkContactViewDefinition& aViewDefinition )
       
    30     {
       
    31     TVPbkContactViewSharing sharing = aViewDefinition.Sharing();
       
    32     return ( sharing == EVPbkViewSharingUndefined ||
       
    33              sharing == EVPbkSharedView );
       
    34     }
       
    35 
       
    36 const TDesC& RemoteViewName( 
       
    37         const CVPbkContactViewDefinition& aViewDefinition )
       
    38     {
       
    39     if ( aViewDefinition.Name().Length() > 0 )
       
    40         {
       
    41         return aViewDefinition.Name();
       
    42         }
       
    43     else if ( aViewDefinition.Type() == EVPbkContactsView )
       
    44         {
       
    45         return KVPbkAllContactsViewName;
       
    46         }
       
    47     else
       
    48         {
       
    49         return KNullDesC;
       
    50         }
       
    51     }
       
    52 }  // namespace VPbkSimStore
       
    53 
       
    54 //End of file