email/imum/DomainApi/src/ImumDaMailboxServicesImpl.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  ImumDaMailboxServicesImpl.cpp
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #include <ImumInMailboxServices.h>
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "ImumDaMailboxServicesImpl.h"
       
    23 #include "ImumDaSettingsDataImpl.h"
       
    24 #include "ImumInSettingsData.h"
       
    25 
       
    26 // ============================ MEMBER FUNCTIONS ===============================
       
    27 
       
    28 // ----------------------------------------------------------------------------
       
    29 // CImumDaMailboxServicesImpl::CImumDaMailboxServicesImpl()
       
    30 // ----------------------------------------------------------------------------
       
    31 //
       
    32 CImumDaMailboxServicesImpl::CImumDaMailboxServicesImpl(
       
    33     CImumInternalApi& aMailboxApi)
       
    34     :
       
    35     iMailboxApi( aMailboxApi ),
       
    36     iServices( NULL )
       
    37     {
       
    38     }
       
    39 
       
    40 // ----------------------------------------------------------------------------
       
    41 // CImumDaMailboxServicesImpl::~CImumDaMailboxServicesImpl()
       
    42 // ----------------------------------------------------------------------------
       
    43 //
       
    44 CImumDaMailboxServicesImpl::~CImumDaMailboxServicesImpl()
       
    45     {
       
    46     iServices = NULL;
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // CImumDaMailboxServicesImpl::NewL()
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 CImumDaMailboxServicesImpl* CImumDaMailboxServicesImpl::NewL(
       
    54     CImumInternalApi& aMailboxApi)
       
    55     {
       
    56     CImumDaMailboxServicesImpl* self = NewLC( aMailboxApi );
       
    57     CleanupStack::Pop( self );
       
    58 
       
    59     return self;
       
    60     }
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // CImumDaMailboxServicesImpl::NewLC()
       
    64 // ---------------------------------------------------------------------------
       
    65 //
       
    66 CImumDaMailboxServicesImpl* CImumDaMailboxServicesImpl::NewLC(
       
    67     CImumInternalApi& aMailboxApi)
       
    68     {
       
    69     CImumDaMailboxServicesImpl* self =
       
    70         new ( ELeave ) CImumDaMailboxServicesImpl( aMailboxApi );
       
    71     CleanupStack::PushL( self );
       
    72     self->ConstructL();
       
    73 
       
    74     return self;
       
    75     }
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // CImumDaMailboxServicesImpl::ConstructL()
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 void CImumDaMailboxServicesImpl::ConstructL()
       
    82     {
       
    83     iServices = const_cast<MImumInMailboxServices*>(
       
    84         &iMailboxApi.MailboxServicesL() );
       
    85     }
       
    86 
       
    87 // ======================= INTERFACE IMPLEMENTATION ===========================
       
    88 
       
    89 // ---------------------------------------------------------------------------
       
    90 // From class MImumDaMailboxServices
       
    91 // CImumDaMailboxServicesImpl::CreateSettingsDataL()
       
    92 // ---------------------------------------------------------------------------
       
    93 //
       
    94 CImumDaSettingsData* CImumDaMailboxServicesImpl::CreateSettingsDataL(
       
    95     const TUid& aProtocol ) const
       
    96     {
       
    97     return CImumDaSettingsDataImpl::NewL( iMailboxApi, aProtocol );
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // From class MImumDaMailboxServices
       
   102 // CImumDaMailboxServicesImpl::CreateMailboxL()
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 TMsvId CImumDaMailboxServicesImpl::CreateMailboxL(
       
   106     CImumDaSettingsData& aSettingsData ) const
       
   107     {
       
   108     CImumDaSettingsDataImpl *inData =
       
   109         static_cast<CImumDaSettingsDataImpl*>( &aSettingsData );
       
   110 
       
   111     return iServices->CreateMailboxL( inData->GetInData() );
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // From class MImumDaMailboxServices
       
   116 // CImumDaMailboxServicesImpl::SetDefaultMailboxL()
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 void CImumDaMailboxServicesImpl::SetDefaultMailboxL(
       
   120     const TMsvId aMailboxId ) const
       
   121     {
       
   122     iServices->SetDefaultMailboxL( aMailboxId );
       
   123     }
       
   124 
       
   125 
       
   126