voipplugins/sipconnectionprovider/ipvoicemailengine/src/ipvmbxinterface.cpp
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Interface class to control voice mail engine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "ipvmbxinterface.h"
       
    21 #include "ipvmbxengine.h"
       
    22 #include "ipvmbxlogger.h"
       
    23 
       
    24 
       
    25 // ======== MEMBER FUNCTIONS ========
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // 
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 CIpVmbxInterface::CIpVmbxInterface( MIpVmbxObserver& aEngineObserver ) : 
       
    32     iEngineObserver( aEngineObserver )
       
    33     {
       
    34     }
       
    35 
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // 
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 void CIpVmbxInterface::ConstructL()
       
    42     {
       
    43     iIpVmbxEngine = CIpVmbxEngine::NewL( *this );
       
    44     }
       
    45 
       
    46 
       
    47 // ---------------------------------------------------------------------------
       
    48 // 
       
    49 // ---------------------------------------------------------------------------
       
    50 //
       
    51 EXPORT_C CIpVmbxInterface* CIpVmbxInterface::NewL( 
       
    52     MIpVmbxObserver& aEngineObserver )
       
    53     {
       
    54     IPVMEPRINT( "CIpVmbxInterface::NewL - IN" );
       
    55     
       
    56     CIpVmbxInterface* self = new( ELeave ) CIpVmbxInterface( aEngineObserver );
       
    57     CleanupStack::PushL( self );
       
    58     self->ConstructL();
       
    59     CleanupStack::Pop( self );
       
    60     
       
    61     IPVMEPRINT( "CIpVmbxInterface::NewL - OUT" );
       
    62     return self;
       
    63     }
       
    64     
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // 
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 CIpVmbxInterface::~CIpVmbxInterface()
       
    71     {
       
    72     IPVMEPRINT( "CIpVmbxInterface::~CIpVmbxInterface - IN" );
       
    73     
       
    74     delete iIpVmbxEngine;
       
    75     
       
    76     IPVMEPRINT( "CIpVmbxInterface::~CIpVmbxInterface - OUT" );
       
    77     }
       
    78 
       
    79 
       
    80 // ---------------------------------------------------------------------------
       
    81 // Subscribes profile to ip voice mail server
       
    82 // ---------------------------------------------------------------------------
       
    83 //
       
    84 EXPORT_C void CIpVmbxInterface::SubscribeL( 
       
    85     TUint32 aServiceProviderId, 
       
    86     CSIPProfile& aSipProfile )
       
    87     {
       
    88     IPVMEPRINT( "CIpVmbxInterface::SubscribeL - IN" );
       
    89     
       
    90     iIpVmbxEngine->SubscribeProfileL( aServiceProviderId, aSipProfile );
       
    91     
       
    92     IPVMEPRINT( "CIpVmbxInterface::SubscribeL - OUT" );
       
    93     }
       
    94 
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // Un-subscribes profile from ip voice mail server
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 EXPORT_C void CIpVmbxInterface::UnsubscribeL( TUint32 aServiceProviderId )
       
   101     {
       
   102     IPVMEPRINT( "CIpVmbxInterface::UnsubscribeL - IN" );
       
   103     
       
   104     iIpVmbxEngine->UnsubscribeProfileL( aServiceProviderId );
       
   105     
       
   106     IPVMEPRINT( "CIpVmbxInterface::UnsubscribeL - OUT" );
       
   107     }
       
   108 
       
   109 
       
   110 // ---------------------------------------------------------------------------
       
   111 // Check if profile is registered to ip voice mail server
       
   112 // ---------------------------------------------------------------------------
       
   113 //
       
   114 EXPORT_C TInt CIpVmbxInterface::IsSubscribed( 
       
   115     TUint32 aServiceProviderId, 
       
   116     TBool& aProfileSubscribed ) const
       
   117     {
       
   118     
       
   119     return iIpVmbxEngine->ProfileSubscribed( aServiceProviderId, aProfileSubscribed );
       
   120     }
       
   121 
       
   122 
       
   123 // ---------------------------------------------------------------------------
       
   124 // Send messages through observer
       
   125 // ---------------------------------------------------------------------------
       
   126 //
       
   127 void CIpVmbxInterface::SendMessage( 
       
   128     TUint32 aServiceProviderId, 
       
   129     MIpVmbxObserver::TVmbxMessage aMessage )
       
   130     {
       
   131     IPVMEPRINT( "CIpVmbxInterface::SendMessage - IN" );
       
   132     
       
   133     iEngineObserver.HandleMessage( aServiceProviderId, aMessage );
       
   134     
       
   135     IPVMEPRINT( "CIpVmbxInterface::SendMessage - OUT" );
       
   136     }