phonebookengines/VirtualPhonebook/VPbkCntModel/src/CNamedRemoteViewHandle.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002-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 named remote view .
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "CNamedRemoteViewHandle.h"
       
    20 
       
    21 // VPbkCntModel
       
    22 #include "NamedRemoteViewViewDefinitionStoreUtility.h"
       
    23 
       
    24 // VPbkEng
       
    25 
       
    26 // System includes
       
    27 
       
    28 
       
    29 namespace VPbkCntModel {
       
    30 
       
    31 /// Unnamed namespace for local definitions
       
    32 namespace {
       
    33 
       
    34 #ifdef _DEBUG
       
    35 enum TPanicCode 
       
    36     {
       
    37     EPanicPreCond_CreateRemoteViewL = 1
       
    38     };
       
    39 
       
    40 void Panic ( TPanicCode aReason )
       
    41     {
       
    42     _LIT(KPanicText, "CNamedRemoteViewHandle");
       
    43     User::Panic(KPanicText, aReason);
       
    44     }
       
    45 #endif // _DEBUG
       
    46 
       
    47 } /// namespace
       
    48 
       
    49 // --------------------------------------------------------------------------
       
    50 // CNamedRemoteView::CNamedRemoteViewHandle
       
    51 // --------------------------------------------------------------------------
       
    52 //
       
    53 inline CNamedRemoteViewHandle::CNamedRemoteViewHandle()
       
    54     {
       
    55     }
       
    56 
       
    57 // --------------------------------------------------------------------------
       
    58 // CNamedRemoteView::ConstructL
       
    59 // --------------------------------------------------------------------------
       
    60 //
       
    61 inline void CNamedRemoteViewHandle::ConstructL()
       
    62     {
       
    63     }
       
    64 
       
    65 // --------------------------------------------------------------------------
       
    66 // CNamedRemoteViewHandle::NewLC
       
    67 // --------------------------------------------------------------------------
       
    68 //
       
    69 CNamedRemoteViewHandle* CNamedRemoteViewHandle::NewLC()
       
    70     {
       
    71     CNamedRemoteViewHandle* self = new ( ELeave ) CNamedRemoteViewHandle;
       
    72     CleanupStack::PushL( self );
       
    73     self->ConstructL();
       
    74     return self;
       
    75     }
       
    76 
       
    77 // --------------------------------------------------------------------------
       
    78 // CNamedRemoteViewHandle::~CNamedRemoteViewHandle
       
    79 // --------------------------------------------------------------------------
       
    80 //
       
    81 CNamedRemoteViewHandle::~CNamedRemoteViewHandle()
       
    82     {
       
    83     if (iRemoteViewHandle)
       
    84         {
       
    85         iRemoteViewHandle->Close(*this);
       
    86         }
       
    87     }
       
    88 
       
    89 // --------------------------------------------------------------------------
       
    90 // CNamedRemoteViewHandle::SetRemoteViewHandle
       
    91 // --------------------------------------------------------------------------
       
    92 //
       
    93 void CNamedRemoteViewHandle::CreateRemoteViewL(
       
    94         const TDesC& aViewName,
       
    95         CContactDatabase& /*aDatabase*/,
       
    96         RContactViewSortOrder aSortOrder,
       
    97         TContactViewPreferences aViewPreferences)
       
    98     {
       
    99     __ASSERT_DEBUG(!iRemoteViewHandle, Panic(EPanicPreCond_CreateRemoteViewL));
       
   100 
       
   101     NamedRemoteViewViewDefinitionStoreUtility::SetNamedRemoteViewViewDefinitionL(
       
   102         aViewName, aSortOrder, aViewPreferences);
       
   103     }
       
   104 
       
   105 // --------------------------------------------------------------------------
       
   106 // CNamedRemoteViewHandle::ViewName
       
   107 // --------------------------------------------------------------------------
       
   108 //
       
   109 void CNamedRemoteViewHandle::HandleContactViewEvent(
       
   110         const CContactViewBase& /*aView*/, 
       
   111         const TContactViewEvent& /*aEvent*/ )
       
   112     {
       
   113     // Do nothing
       
   114     }
       
   115 
       
   116 } // namespace VPbkCntModel
       
   117 
       
   118 // End of File