vmbx/vmbxengine/src/vmbxenginebase.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
       
     2 * Copyright (c) 2009-2010 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:  Implementation of the CVmbxEngineBase class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <cvoicemailboxentry.h>
       
    21 
       
    22 #include "vmbxlogger.h"
       
    23 #include "vmbxuiutilities.h"
       
    24 #include "vmbxenginebase.h"
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS =============================
       
    29 
       
    30 // ---------------------------------------------------------------------------
       
    31 // CVmbxEngineBase::CVmbxEngineBase
       
    32 // C++ default constructor can NOT contain any code, that
       
    33 // might leave.
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 CVmbxEngineBase::CVmbxEngineBase( MVmbxResourceProvider& aProvider ) 
       
    37                           : iProvider( aProvider ),
       
    38                             iVmbxServiceId( KVmbxServiceIdNone )
       
    39     {
       
    40     VMBLOGSTRING( "VMBX: CVmbxEngineBase::CVmbxEngineBase =>" );
       
    41     VMBLOGSTRING( "VMBX: CVmbxEngineBase::CVmbxEngineBase <=" );
       
    42     }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // CVmbxEngineBase::~CVmbxEngineBase
       
    46 // Destructor
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 CVmbxEngineBase::~CVmbxEngineBase()
       
    50     {
       
    51     VMBLOGSTRING( "VMBX: CVmbxEngineBase::~CVmbxEngineBase =>" );
       
    52     VMBLOGSTRING( "VMBX: CVmbxEngineBase::~CVmbxEngineBase <=" );
       
    53     }
       
    54 
       
    55 // ----------------------------------------------------------------------------
       
    56 //  CVmbxEngineBase::GetServiceIds()
       
    57 // ----------------------------------------------------------------------------
       
    58 //
       
    59 void CVmbxEngineBase::GetServiceIdsL( RIdArray& /*aProfileIds*/ )
       
    60     {
       
    61     VMBLOGSTRING( "VMBX: CVmbxEngineBase::GetServiceIdsL <=>" );
       
    62     User::Leave( KErrNotFound );
       
    63     }
       
    64 
       
    65 // Commented out because branding is not supported yet.
       
    66 // ----------------------------------------------------------------------------
       
    67 //  CVmbxEngineBase::GetVmbxImageL()
       
    68 // ----------------------------------------------------------------------------
       
    69 //
       
    70 /* CGulIcon* CVmbxEngineBase::GetVmbxImageL( const TVoiceMailboxParams& aParams )
       
    71     {
       
    72     VMBLOGSTRING( "VMBX: CVmbxEngineBase::GetVmbxImageL =>" );
       
    73     VMBLOGSTRING( "VMBX: CVmbxEngineBase::GetVmbxImageL <=" );
       
    74     return iProvider.VmbxUiUtilities().GetVmbxImageL( aParams );
       
    75     } */
       
    76 
       
    77 // ----------------------------------------------------------------------------
       
    78 //  CVmbxEngineBase::SetCurrentServiceId()
       
    79 // ----------------------------------------------------------------------------
       
    80 //
       
    81 void CVmbxEngineBase::SetCurrentServiceId( const TServiceId& aVmbxServiceId )
       
    82     {
       
    83     VMBLOGSTRING( "VMBX: CVmbxEngineBase::SetCurrentServiceId =>" );
       
    84     iVmbxServiceId = aVmbxServiceId;
       
    85     VMBLOGSTRING( "VMBX: CVmbxEngineBase::SetCurrentServiceId <=" );
       
    86     }
       
    87 
       
    88 // ----------------------------------------------------------------------------
       
    89 //  CVmbxCsVideoEngine::CheckConfiguration()
       
    90 // ----------------------------------------------------------------------------
       
    91 //
       
    92 TBool CVmbxEngineBase::CheckConfiguration( 
       
    93             const TVoiceMailboxParams& /*aParams*/, const TInt aFlags )
       
    94     {
       
    95     VMBLOGSTRING( "VMBX: CVmbxEngineBase::CheckConfiguration =>" );
       
    96     TBool conf( EFalse );
       
    97     if ( EVmbxChangeNbrAllowedOnUi & aFlags )
       
    98         {
       
    99         // NOT suppported as default
       
   100         }
       
   101     else if ( EVmbxVideoMailboxSupported & aFlags )
       
   102         {
       
   103         // NOT suppported as default
       
   104         }
       
   105     else
       
   106         {
       
   107         // default
       
   108         }
       
   109     VMBLOGSTRING2( "VMBX: CVmbxEngineBase::CheckConfiguration: conf%I <=",
       
   110                  conf );
       
   111     return conf;
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // CVmbxEngineBase::QueryDefineNumberL
       
   116 //
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 void CVmbxEngineBase::QueryDefineNumberL( CVoiceMailboxEntry& aEntry )
       
   120     {
       
   121     VMBLOGSTRING( "VMBX: CVmbxEngineBase::QueryDefineNumberL =>" );
       
   122     HBufC* defineNumber = HBufC::NewLC( KVmbxMaxNumberLength );
       
   123     TPtr ptrNumber( defineNumber->Des() );
       
   124 
       
   125     iProvider.VmbxUiUtilities().ShowQueryL( aEntry.VoiceMailboxType(),
       
   126                                              EVmbxDefineMode, ptrNumber );
       
   127     TInt err = aEntry.SetVmbxNumber( ptrNumber );
       
   128     CleanupStack::PopAndDestroy( defineNumber );
       
   129     VMBLOGSTRING2( "VMBX: CVmbxEngineBase::QueryDefineNumberL, err%I", err );
       
   130     User::LeaveIfError( err );
       
   131     VMBLOGSTRING( "VMBX: CVmbxEngineBase::QueryDefineNumberL <= ");
       
   132     }
       
   133 
       
   134 // ----------------------------------------------------------------------------
       
   135 // CVmbxEngineBase::QueryChangeNumberL
       
   136 //
       
   137 // ----------------------------------------------------------------------------
       
   138 //
       
   139 void CVmbxEngineBase::QueryChangeNumberL( CVoiceMailboxEntry& aEntry )
       
   140     {
       
   141     VMBLOGSTRING( "VMBX: CVmbxEngineBase::QueryChangeNumberL =>" );
       
   142     TInt err( KErrNone );
       
   143     TPtrC vmbxNumber( KNullDesC );
       
   144     err = aEntry.GetVmbxNumber( vmbxNumber );
       
   145 
       
   146     if ( KErrNone == err )
       
   147         {
       
   148         HBufC* changeNumber = HBufC::NewLC( KVmbxMaxNumberLength );
       
   149         TPtr tempNumber( changeNumber->Des() );
       
   150         tempNumber.Copy( vmbxNumber );
       
   151         iProvider.VmbxUiUtilities().ShowQueryL( aEntry.VoiceMailboxType(),
       
   152                                    EVmbxChangeMode, tempNumber );
       
   153         err = aEntry.SetVmbxNumber( tempNumber );
       
   154         CleanupStack::PopAndDestroy( changeNumber );
       
   155         }
       
   156     VMBLOGSTRING2( "VMBX: CVmbxEngineBase::QueryChangeNumberL, err%I", err );
       
   157     User::LeaveIfError( err );
       
   158     VMBLOGSTRING( "VMBX: CVmbxEngineBase::QueryChangeNumberL <=" );
       
   159     }
       
   160 
       
   161 // End of file