cellular/PsetNotesUi/Src/PsuiNoteController.cpp
changeset 0 ff3b6d0fd310
child 12 ae8abd0db65c
child 43 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 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: Implementation of CPsuiNoteController class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "PsuiNoteController.h"
       
    21 #include "PsuiInternalConstants.h"
       
    22 
       
    23 // ================= MEMBER FUNCTIONS =======================
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // CPsuiNoteController::CPsuiNoteController
       
    27 // C++ default constructor can NOT contain any code, that
       
    28 // might leave.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CPsuiNoteController::CPsuiNoteController() : CCoeStatic( KUidNoteControllerSingleton )
       
    32     {
       
    33     }
       
    34 
       
    35 // Destructor
       
    36 CPsuiNoteController::~CPsuiNoteController()
       
    37     {
       
    38     delete iNote;
       
    39     iNote = NULL; 
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------
       
    43 // CPsuiNoteController::InstanceL
       
    44 // (other items were commented in a header).
       
    45 // ---------------------------------------------------------
       
    46 //
       
    47 CPsuiNoteController* CPsuiNoteController::InstanceL()
       
    48     {
       
    49     CPsuiNoteController* instance = static_cast<CPsuiNoteController*>(
       
    50         CCoeEnv::Static( KUidNoteControllerSingleton ) );
       
    51     if ( !instance )
       
    52         {
       
    53         instance = new ( ELeave ) CPsuiNoteController;
       
    54         CleanupStack::PushL( instance );
       
    55         instance->ConstructL();
       
    56         CleanupStack::Pop( instance );
       
    57         }
       
    58     return instance;
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CPsuiNoteController::ConstructL
       
    63 // Symbian 2nd phase constructor can leave.
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 void CPsuiNoteController::ConstructL()
       
    67     {
       
    68     iNote = CPsuiNoteMaster::NewL();
       
    69     }
       
    70 
       
    71 // ---------------------------------------------------------
       
    72 // CPsuiNoteController::ShowNoteL
       
    73 // ---------------------------------------------------------
       
    74 //
       
    75 void CPsuiNoteController::ShowNoteL( TPsuiNoteTypes aType, TInt aResourceID )
       
    76     {
       
    77 	  iNote->ShowNoteL( aType, aResourceID );
       
    78     }       
       
    79 
       
    80 // ---------------------------------------------------------
       
    81 // CPsuiNoteController::ShowBscListL
       
    82 // ---------------------------------------------------------
       
    83 //
       
    84 void CPsuiNoteController::ShowBscListL( TInt aResourceHeading, TUint8 aBsc[KPSUIMaxBscNumber] )
       
    85     {
       
    86 	  iNote->ShowBscListL( aResourceHeading, aBsc );
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------
       
    90 // CPsuiNoteController::SetErrorNoteResourceID
       
    91 // ---------------------------------------------------------
       
    92 //
       
    93 TInt CPsuiNoteController::SetErrorNoteResourceID ( const TInt aErrorCode )
       
    94     {
       
    95 	  return iNote->SetErrorNoteResourceID( aErrorCode );
       
    96     }
       
    97 
       
    98 // ---------------------------------------------------------
       
    99 // CPsuiNoteController::RemoveNotesL
       
   100 // ---------------------------------------------------------
       
   101 //
       
   102 void CPsuiNoteController::RemoveNotesL()
       
   103     {
       
   104 	  delete iNote;
       
   105 	  iNote = NULL;
       
   106 	  iNote = CPsuiNoteMaster::NewL();
       
   107     }
       
   108 
       
   109 // ---------------------------------------------------------
       
   110 // CPsuiNoteController::KillStaticNoteL
       
   111 // ---------------------------------------------------------
       
   112 //
       
   113 void CPsuiNoteController::KillStaticNoteL()
       
   114     {
       
   115 	  iNote->KillStaticNoteL();
       
   116     }
       
   117 
       
   118 // ---------------------------------------------------------
       
   119 // CPsuiNoteController::SetEngineContacts
       
   120 // ---------------------------------------------------------
       
   121 //
       
   122 void CPsuiNoteController::SetEngineContacts( MPsetCallWaiting* aWaitingEngine,
       
   123     MPsetCallBarring* aBarringEngine, MPsetCallDiverting* aDivertEngine,
       
   124     MPsetCli* aCliEngine )
       
   125     {
       
   126     iNote->SetEngineContacts( aWaitingEngine, aBarringEngine,
       
   127         aDivertEngine, aCliEngine );	
       
   128     }
       
   129 
       
   130 // ---------------------------------------------------------
       
   131 // CPsuiNoteController::ShowBscCFListL
       
   132 // ---------------------------------------------------------
       
   133 //
       
   134 TCFType CPsuiNoteController::ShowBscCFListL( TInt aResourceHeading, 
       
   135     CMobilePhoneCFList& aList, TCFType aCFType, TInt& aIndex )
       
   136     {
       
   137     return iNote->ShowBscCFListL( aResourceHeading, aList,
       
   138         aCFType, aIndex );	
       
   139     }
       
   140 
       
   141 // ---------------------------------------------------------
       
   142 // CPsuiNoteController::ShowCfInfoL
       
   143 // ---------------------------------------------------------
       
   144 //
       
   145 void CPsuiNoteController::ShowCfInfoL( TCFType& aCFType,
       
   146     const RMobilePhone::TMobilePhoneCFInfoEntryV1& aSetting )
       
   147     {
       
   148     iNote->ShowCfInfoL( aCFType, aSetting );	
       
   149     }
       
   150 
       
   151 // End of File