vmbx/vmbxengine/src/cvoicemailbox.cpp
branchRCL_3
changeset 19 7d48bed6ce0c
equal deleted inserted replaced
18:594d59766373 19:7d48bed6ce0c
       
     1 /*
       
     2 * Copyright (c) 2009 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 CVoiceMailbox class
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <exception>
       
    20 
       
    21 #include <cvoicemailbox.h>
       
    22 #include <cvoicemailboxentry.h>
       
    23 #include "voicemailboximpl.h"
       
    24 #include "vmbxlogger.h"
       
    25 
       
    26 // ============================ MEMBER FUNCTIONS =============================
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 EXPORT_C TInt TVoiceMailboxParams::Version()
       
    32     {
       
    33     return iVersion;
       
    34     }
       
    35     
       
    36 // ---------------------------------------------------------------------------
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 EXPORT_C TVoiceMailboxParams::TVoiceMailboxParams():
       
    40                                         iType( EVmbxNone ),
       
    41                                         iServiceId( KVmbxServiceIdNone ),
       
    42                                         iLineType( EVmbxAlsLineDefault )
       
    43     {
       
    44     VMBLOGSTRING( "VMBX: TVoiceMailboxParams: default cnstructor =>" );
       
    45     VMBLOGSTRING( "VMBX: TVoiceMailboxParams: default cnstructor<=" );
       
    46     }
       
    47     
       
    48 // ---------------------------------------------------------------------------
       
    49 // ---------------------------------------------------------------------------
       
    50 //
       
    51 EXPORT_C TVoiceMailboxParams::TVoiceMailboxParams( 
       
    52                         const CVoiceMailboxEntry& aEntry )
       
    53     {
       
    54     VMBLOGSTRING( "VMBX: TVoiceMailboxParams: Entry cnstructor =>" );
       
    55     iType = aEntry.VoiceMailboxType();
       
    56     iServiceId = aEntry.ServiceId();
       
    57     iLineType = aEntry.VmbxAlsLineType();
       
    58     VMBLOGSTRING( "VMBX: TVoiceMailboxParams: Entry cnstructor <=" );
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // CVoiceMailbox::CVoiceMailboxImpl
       
    63 // C++ default constructor can NOT contain any code, that
       
    64 // might leave.
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 CVoiceMailbox::CVoiceMailbox()
       
    68     {
       
    69     VMBLOGSTRING( "VMBX: CVoiceMailbox::CVoiceMailbox <=>" );
       
    70     }
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // CVoiceMailbox::ConstructL
       
    74 // Symbian 2nd phase constructor can leave.
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 void CVoiceMailbox::ConstructL()
       
    78     {
       
    79     VMBLOGSTRING( "VMBX: CVoiceMailbox::ConstructL =>" );
       
    80     iBody =CVoiceMailboxImpl::NewL();
       
    81     VMBLOGSTRING( "VMBX: CVoiceMailbox::ConstructL <=" );
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // CVoiceMailbox::NewL
       
    86 // Two-phased constructor.
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 EXPORT_C CVoiceMailbox* CVoiceMailbox::NewL()
       
    90     {
       
    91     VMBLOGSTRING( "VMBX: CVoiceMailbox::NewL =>" );
       
    92     CVoiceMailbox* self = CVoiceMailbox::NewLC();
       
    93     CleanupStack::Pop( self );
       
    94     VMBLOGSTRING( "VMBX: CVoiceMailbox::NewL <=" );
       
    95     return self;
       
    96     }
       
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 // CVoiceMailbox::NewLC
       
   100 // Two-phased constructor.
       
   101 // ---------------------------------------------------------------------------
       
   102 //
       
   103 EXPORT_C CVoiceMailbox* CVoiceMailbox::NewLC()
       
   104     {
       
   105     VMBLOGSTRING( "VMBX: CVoiceMailbox::NewLC =>" );
       
   106     CVoiceMailbox* self = new( ELeave ) CVoiceMailbox;
       
   107     CleanupStack::PushL( self );
       
   108     self->ConstructL();
       
   109     VMBLOGSTRING( "VMBX: CVoiceMailbox::NewLC <=" );
       
   110     return self;
       
   111     }
       
   112 
       
   113 // ---------------------------------------------------------------------------
       
   114 // CVoiceMailbox::~CVoiceMailbox
       
   115 // Destructor
       
   116 // ---------------------------------------------------------------------------
       
   117 //
       
   118 CVoiceMailbox::~CVoiceMailbox()
       
   119     {
       
   120     VMBLOGSTRING( "VMBX: CVoiceMailbox::~CVoiceMailbox =>" );
       
   121     delete iBody;
       
   122     VMBLOGSTRING( "VMBX: CVoiceMailbox::~CVoiceMailbox <=" );
       
   123     }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // CVoiceMailbox::GetStoredEntry
       
   127 //
       
   128 // ---------------------------------------------------------------------------
       
   129 //
       
   130 EXPORT_C TInt CVoiceMailbox::GetStoredEntry( 
       
   131     const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry ) const
       
   132     {
       
   133     VMBLOGSTRING( "VMBX: CVoiceMailbox::GetStoredEntry <=>" );
       
   134     return iBody->GetStoredEntry( aParams, aEntry );
       
   135     }
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // CVoiceMailbox::SaveEntry
       
   139 // Destructor
       
   140 // ---------------------------------------------------------------------------
       
   141 //
       
   142 EXPORT_C TInt CVoiceMailbox::SaveEntry( const CVoiceMailboxEntry& aEntry )
       
   143     {
       
   144     VMBLOGSTRING( "VMBX: CVoiceMailbox::SaveEntry <=>" );
       
   145     return iBody->SaveEntry( aEntry );
       
   146     }
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // CVoiceMailbox::QueryNewEntry
       
   150 //
       
   151 // ---------------------------------------------------------------------------
       
   152 //
       
   153 EXPORT_C TInt CVoiceMailbox::QueryNewEntry(
       
   154         const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry )
       
   155     {
       
   156     VMBLOGSTRING( "VMBX: CVoiceMailbox::QueryNewEntry <=>" );
       
   157     return iBody->QueryNewEntry( aParams, aEntry );
       
   158     }
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // CVoiceMailbox::QueryChangeEntry
       
   162 //
       
   163 // ---------------------------------------------------------------------------
       
   164 //
       
   165 EXPORT_C TInt CVoiceMailbox::QueryChangeEntry( 
       
   166         const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry )
       
   167     {
       
   168     VMBLOGSTRING( "VMBX: CVoiceMailbox::QueryChangeEntry <=>" );
       
   169     return iBody->QueryChangeEntry( aParams, aEntry );
       
   170     }
       
   171 
       
   172 // ---------------------------------------------------------------------------
       
   173 // CVoiceMailbox::QueryVmbxType
       
   174 //
       
   175 // ---------------------------------------------------------------------------
       
   176 //
       
   177 EXPORT_C TInt CVoiceMailbox::QueryVmbxType(
       
   178                             TVoiceMailboxParams& aParams )
       
   179     {
       
   180     VMBLOGSTRING( "VMBX: CVoiceMailbox::QueryVmbxType <=>" );
       
   181     return iBody->QueryVmbxType( aParams );
       
   182     }
       
   183 
       
   184 // ---------------------------------------------------------------------------
       
   185 // CVoiceMailbox::NotifyVmbxNumberChangeL
       
   186 //
       
   187 // ---------------------------------------------------------------------------
       
   188 //
       
   189 EXPORT_C void CVoiceMailbox::NotifyVmbxNumberChangeL(
       
   190     MVoiceMailboxObserver& aObserver, const TBool aNotifyOnActiveLineOnly )
       
   191     {
       
   192     VMBLOGSTRING( "VMBX: CVoiceMailbox::NotifyVmbxNumberChangeL =>" );
       
   193     iBody->NotifyVmbxNumberChangeL( aObserver,
       
   194                                              aNotifyOnActiveLineOnly);
       
   195     VMBLOGSTRING( "VMBX: CVoiceMailbox::NotifyVmbxNumberChangeL <=" );
       
   196     }
       
   197 
       
   198 // ---------------------------------------------------------------------------
       
   199 // CVoiceMailbox::NotifyVmbxNumberChangeCancel
       
   200 //
       
   201 // ---------------------------------------------------------------------------
       
   202 //
       
   203 EXPORT_C void CVoiceMailbox::NotifyVmbxNumberChangeCancel()
       
   204     {
       
   205     VMBLOGSTRING( "VMBX: CVoiceMailbox::NotifyVmbxNumberChangeCancel =>" );
       
   206     iBody->NotifyVmbxNumberChangeCancel();
       
   207     VMBLOGSTRING( "VMBX: CVoiceMailbox::NotifyVmbxNumberChangeCancel <=" );
       
   208     }
       
   209 
       
   210 // ---------------------------------------------------------------------------
       
   211 //  CVoiceMailbox::CheckConfiguration
       
   212 //
       
   213 // ---------------------------------------------------------------------------
       
   214 //
       
   215 EXPORT_C TBool CVoiceMailbox::CheckConfiguration(
       
   216     const TVoiceMailboxParams& aParams, const TInt aFlags )
       
   217     {
       
   218     VMBLOGSTRING( "VMBX: CVoiceMailbox::CheckConfiguration <=>" );
       
   219     return iBody->CheckConfiguration( aParams, aFlags );
       
   220     }
       
   221 
       
   222 // ---------------------------------------------------------------------------
       
   223 // CVoiceMailbox::GetServiceIds
       
   224 //
       
   225 // ---------------------------------------------------------------------------
       
   226 //
       
   227 EXPORT_C TInt CVoiceMailbox::GetServiceIds( RIdArray& aProfileIds ) const
       
   228     {
       
   229     VMBLOGSTRING( "VMBX: CVoiceMailbox::GetServiceIds <=>" );
       
   230     return iBody->GetServiceIds( aProfileIds );
       
   231     }
       
   232 
       
   233 // Commented out because branding not yet supported.
       
   234 // ---------------------------------------------------------------------------
       
   235 // CVoiceMailbox::GetVmbxImage
       
   236 //
       
   237 // ---------------------------------------------------------------------------
       
   238 /* EXPORT_C CGulIcon* CVoiceMailbox::GetVmbxImage(
       
   239                         const TVoiceMailboxParams& aParams ) const
       
   240     {
       
   241     VMBLOGSTRING( "VMBX: CVoiceMailbox::GetVmbxImageL <=>" );
       
   242     return iBody->GetVmbxImage( aParams );
       
   243     }
       
   244  */
       
   245 // ---------------------------------------------------------------------------
       
   246 // CVoiceMailbox::GetVmbxImages
       
   247 //
       
   248 // ---------------------------------------------------------------------------
       
   249 //
       
   250 /* EXPORT_C CArrayPtr<CGulIcon>* CVoiceMailbox::GetVmbxImages(
       
   251                             RArray<TVoiceMailboxParams>& aParams ) const
       
   252     {
       
   253     VMBLOGSTRING( "VMBX: CVoiceMailbox::GetVmbxImages <=>" );
       
   254     return iBody->GetVmbxImages( aParams );
       
   255     }
       
   256  */
       
   257 // ---------------------------------------------------------------------------
       
   258 // CVoiceMailbox::SaveProvisionedEntry
       
   259 //
       
   260 // ---------------------------------------------------------------------------
       
   261 //
       
   262 EXPORT_C TInt CVoiceMailbox::SaveProvisionedEntry( 
       
   263                                 const CVoiceMailboxEntry& aEntry )
       
   264     {
       
   265     VMBLOGSTRING( "VMBX: CVoiceMailbox::SaveProvisionedEntry <=>" );
       
   266     return iBody->SaveProvisionedEntry( aEntry );
       
   267     }
       
   268 
       
   269 // End of file