satengine/SatServer/Commands/LanguageNotificationCmd/src/CLanguageNotificationHandler.cpp
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002-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:  Handles CLanguageNotification command
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "MSatApi.h"
       
    21 #include    "MSatUtils.h"
       
    22 #include    "MSatUiSession.h"
       
    23 #include    "MSatSystemState.h"
       
    24 #include    "SatSOpcodes.h"
       
    25 #include    "MSatSUiClientHandler.h"
       
    26 #include    "CLanguageNotificationHandler.h"
       
    27 #include    "SatLog.h"
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CLanguageNotificationHandler::CLanguageNotificationHandler
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CLanguageNotificationHandler::CLanguageNotificationHandler() :
       
    38     CSatCommandHandler(),
       
    39     iLanguageNotify(),
       
    40     iLanguageNotifyPckg( iLanguageNotify ),
       
    41     iLanguageNotifyRsp(),
       
    42     iLanguageNotifyRspPckg( iLanguageNotifyRsp )
       
    43     {
       
    44     LOG( SIMPLE, "LangNotify: CLanguageNotificationHandler:: \
       
    45         CLanguageNotificationHandler calling-exiting" )
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CLanguageNotificationHandler::NewL
       
    50 // Two-phased constructor.
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 CLanguageNotificationHandler* CLanguageNotificationHandler::NewL(
       
    54 MSatUtils* aUtils )
       
    55     {
       
    56     LOG( SIMPLE, "LangNotify: CLanguageNotificationHandler::NewL calling" )
       
    57     CLanguageNotificationHandler* self = new( ELeave ) CLanguageNotificationHandler;
       
    58 
       
    59     CleanupStack::PushL( self );
       
    60     self->BaseConstructL( aUtils );
       
    61     // ConstructL not needed.
       
    62     CleanupStack::Pop( self );
       
    63     LOG( SIMPLE, "LangNotify: CLanguageNotificationHandler::NewL exiting" )
       
    64     return self;
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CLanguageNotificationHandler::~CLanguageNotificationHandler
       
    69 // Destructor.
       
    70 // (other items were commented in a header).
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 CLanguageNotificationHandler::~CLanguageNotificationHandler()
       
    74     {
       
    75     LOG( SIMPLE,
       
    76         "LangNotify: CLanguageNotificationHandler:: \
       
    77         ~CLanguageNotificationHandler() calling" )
       
    78 
       
    79     Cancel();
       
    80 
       
    81     LOG( SIMPLE,
       
    82         "LangNotify: CLanguageNotificationHandler:: \
       
    83         ~CLanguageNotificationHandler() exiting" )
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // CLanguageNotificationHandler::DoCancel
       
    88 // Cancels the sat request.
       
    89 // (other items were commented in a header).
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 void CLanguageNotificationHandler::DoCancel()
       
    93     {
       
    94     LOG( SIMPLE,
       
    95         "LangNotify: CLanguageNotificationHandler::DoCancel calling" )
       
    96 
       
    97     iUtils->USatAPI().NotifyLanguageNotificationCancel();
       
    98 
       
    99     LOG( SIMPLE,
       
   100         "LangNotify: CLanguageNotificationHandler::DoCancel exiting" )
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CLanguageNotificationHandler::IssueUSATRequest
       
   105 // (other items were commented in a header).
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 void CLanguageNotificationHandler::IssueUSATRequest( TRequestStatus& aStatus )
       
   109     {
       
   110     LOG( SIMPLE,
       
   111         "LangNotify: CLanguageNotificationHandler::IssueUSATRequest calling" )
       
   112 
       
   113     // Clear the IPC package.
       
   114     new (&iLanguageNotify) RSat::TLanguageNotificationV2();
       
   115 
       
   116     iUtils->USatAPI().NotifyLanguageNotification(
       
   117         aStatus,
       
   118         iLanguageNotifyPckg );
       
   119 
       
   120     LOG( SIMPLE,
       
   121         "LangNotify: CLanguageNotificationHandler::IssueUSATRequest exiting" )
       
   122     }
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // CLanguageNotificationHandler::CommandAllowed
       
   126 // (other items were commented in a header).
       
   127 // -----------------------------------------------------------------------------
       
   128 //
       
   129 TBool CLanguageNotificationHandler::CommandAllowed()
       
   130     {
       
   131     LOG( SIMPLE, "LangNotify: \
       
   132         CLanguageNotificationHandler::CommandAllowed calling-exiting" )
       
   133     // By default, this is true
       
   134     // There is never any reason to disallow this
       
   135     // command, even if an error occurs.
       
   136     return ETrue;
       
   137     }
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140 // CLanguageNotificationHandler::NeedUiSession
       
   141 // (other items were commented in a header).
       
   142 // -----------------------------------------------------------------------------
       
   143 //
       
   144 TBool CLanguageNotificationHandler::NeedUiSession()
       
   145     {
       
   146     LOG( SIMPLE, "LangNotify: CLanguageNotificationHandler::NeedUiSession \
       
   147         calling-exiting" )
       
   148     // The UI is not needed by this command.
       
   149     return EFalse;
       
   150     }
       
   151 
       
   152 // -----------------------------------------------------------------------------
       
   153 // CLanguageNotificationHandler::HandleCommand
       
   154 // (other items were commented in a header).
       
   155 // -----------------------------------------------------------------------------
       
   156 //
       
   157 void CLanguageNotificationHandler::HandleCommand()
       
   158     {
       
   159     LOG( SIMPLE,
       
   160         "LangNotify: CLanguageNotificationHandler::HandleCommand calling" )
       
   161 
       
   162     // Just OK the request and send a response.
       
   163     iLanguageNotifyRsp.iInfoType = RSat::KNoAdditionalInfo;
       
   164     iLanguageNotifyRsp.iAdditionalInfo.Zero();
       
   165     iLanguageNotifyRsp.iGeneralResult = RSat::KSuccess;
       
   166     iLanguageNotifyRsp.SetPCmdNumber( iLanguageNotify.PCmdNumber() );
       
   167 
       
   168     TerminalRsp( RSat::ELanguageNotification, iLanguageNotifyRspPckg );
       
   169 
       
   170     LOG( SIMPLE,
       
   171         "LangNotify: CLanguageNotificationHandler::HandleCommand exiting" )
       
   172     }
       
   173 
       
   174 //  End of File