satengine/SatServer/Commands/SendSmCmd/inc/CSendSmHandler.h
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:  SendSm command handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSENDSMHANDLER_H
       
    20 #define CSENDSMHANDLER_H
       
    21 
       
    22 #include <etelsat.h>
       
    23 
       
    24 #include "CSatCommandHandler.h"
       
    25 #include "SatSTypes.h"
       
    26 #include "MSatSmsObserver.h"
       
    27 
       
    28 class MSatUtils;
       
    29 class CSatSSendMessageNoLoggingHandler;
       
    30 
       
    31 /**
       
    32 *  Command handler for SendSm command.
       
    33 *
       
    34 *  @lib SendSmCmd.lib
       
    35 *  @since S60 v3.0
       
    36 */
       
    37 class CSendSmHandler : public CSatCommandHandler,
       
    38                        public MSatSmsObserver
       
    39     {
       
    40     
       
    41 public:
       
    42 
       
    43     static CSendSmHandler* NewL( MSatUtils* aUtils );
       
    44 
       
    45     virtual ~CSendSmHandler();
       
    46 
       
    47 // from base class MSatCommand
       
    48 
       
    49     /**
       
    50      * From MSatCommand. 
       
    51      * Query response.
       
    52      *
       
    53      */
       
    54     void ClientResponse();
       
    55     
       
    56 // from base class MSatSmsObserver
       
    57 
       
    58     /**
       
    59      * From MSatEventObserver.
       
    60      * Event notification
       
    61      *
       
    62      * @param aEvent An event that is occured.
       
    63      */
       
    64     void Event( TInt aEvent );
       
    65 
       
    66     /**
       
    67      * From MSatSmsObserver.
       
    68      * Notification that sms was sent.
       
    69      *
       
    70      * @param aErrorCode Error code indicating a possible error.
       
    71      */
       
    72     void SmsSent( TInt aErrorCode );
       
    73 
       
    74 
       
    75 protected:
       
    76 
       
    77     /**
       
    78      * Sets the sca number to the iSendSmData.
       
    79      *
       
    80      * @param aScaNumber SCA number.
       
    81      * @return Boolean indicating SCA number successfully set.
       
    82      */
       
    83     TBool SetScaNumber( const RSat::TSatTelNumber& aScaNumber );
       
    84     
       
    85 // from base class CActive
       
    86 
       
    87     /**
       
    88      * From CActive
       
    89      * Cancels the usat request.
       
    90      *
       
    91      */
       
    92     void DoCancel();
       
    93 
       
    94 // from base class CSatCommandHandler
       
    95 
       
    96     /**
       
    97      * From CSatCommandHandler
       
    98      * Requests the command notification.
       
    99      *
       
   100      * @param aStatus Request status to active object notification
       
   101      */
       
   102     void IssueUSATRequest( TRequestStatus& aStatus );
       
   103 
       
   104     /**
       
   105      * From CSatCommandHandler
       
   106      * Precheck before executing the command.
       
   107      *
       
   108      * @return Boolean indicating is this command allowed to execute.
       
   109      */
       
   110     TBool CommandAllowed();
       
   111 
       
   112     /**
       
   113      * From CSatCommandHandler
       
   114      * Need for ui session.
       
   115      *
       
   116      * @return Boolean indicating does this command need UI session.
       
   117      */
       
   118     TBool NeedUiSession();
       
   119 
       
   120     /**
       
   121      * From CSatCommandHandler
       
   122      * Called when USAT API notifies that command.
       
   123      *
       
   124      */
       
   125     void HandleCommand();
       
   126 
       
   127     /**
       
   128      * From CSatCommandHandler
       
   129      * Called when UI launch fails
       
   130      *
       
   131      */
       
   132     void UiLaunchFailed();
       
   133 
       
   134 private:
       
   135 
       
   136     CSendSmHandler();
       
   137 
       
   138     void ConstructL();
       
   139 
       
   140     /**
       
   141      * Checks is the command transparent or not
       
   142      *
       
   143      */
       
   144     TBool TransparentSmsSending() const;
       
   145 
       
   146     /**
       
   147      * Checks is the SCA available
       
   148      *
       
   149      */
       
   150     TBool IsSCAAvailable();
       
   151 
       
   152 private: // data
       
   153 
       
   154     /**
       
   155      * SendSm command data.
       
   156      */
       
   157     RSat::TSendSmV1 iSendSmData;
       
   158 
       
   159     /**
       
   160      * SendSm command package.
       
   161      */
       
   162     RSat::TSendSmV1Pckg iSendSmPckg;
       
   163 
       
   164     /**
       
   165      * SendSm response data
       
   166      */
       
   167     RSat::TSendSmRspV1 iSendSmRsp;
       
   168 
       
   169     /**
       
   170      * SendSm response package.
       
   171      */
       
   172     RSat::TSendSmRspV1Pckg iSendSmRspPckg;
       
   173 
       
   174     /**
       
   175      * Query command data.
       
   176      */
       
   177     TSatQueryV1 iQueryData;
       
   178 
       
   179     /**
       
   180      * Query package.
       
   181      */
       
   182     TSatQueryV1Pckg iQueryPckg;
       
   183 
       
   184     /**
       
   185      * Query response.
       
   186      */
       
   187     TSatQueryRspV1 iQueryRsp;
       
   188 
       
   189     /**
       
   190      * Query rsp package.
       
   191      */
       
   192     TSatQueryRspV1Pckg iQueryRspPckg;
       
   193 
       
   194     /**
       
   195      * SendSm notification send data
       
   196      */
       
   197     TSatNotificationV1 iNotificationData;
       
   198 
       
   199     /**
       
   200      * SendSm notification package
       
   201      */
       
   202     TSatNotificationV1Pckg iNotificationDataPckg;
       
   203 
       
   204     /**
       
   205      * SendSm notification Response data
       
   206      */
       
   207     TSatNotificationRspV1 iNotificationRsp;
       
   208 
       
   209     /**
       
   210      * SendSm notification Response package
       
   211      */
       
   212     TSatNotificationRspV1Pckg iNotificationRspPckg;
       
   213 
       
   214     /**
       
   215      * Is MoSmControl active.
       
   216      */
       
   217     TBool iMoSmControlActive;
       
   218 
       
   219     /**
       
   220      * Message sender.
       
   221      */
       
   222     CSatSSendMessageNoLoggingHandler* iMsgSender;
       
   223 
       
   224     /**
       
   225      * Indicates does this command need UI session ot not
       
   226      */
       
   227     TBool iNeedUiSession;
       
   228 
       
   229     /**
       
   230      * Indicates if KPartialComprehension is needed instead of KSuccess
       
   231      */
       
   232     TBool iPartialComprehension;
       
   233 
       
   234     /**
       
   235      * Indicates is SCA number available at all
       
   236      */
       
   237     TBool iSCANumberAvailable;
       
   238 
       
   239     /**
       
   240      * Indicates is notification already sent
       
   241      */
       
   242     TBool iNotificationSent;
       
   243         
       
   244     /**
       
   245      * Flag to signal that command has icon data
       
   246      * To be removed when icons are allowed in this command
       
   247      */
       
   248     TBool iIconCommand;
       
   249 
       
   250     };
       
   251 
       
   252 #endif      // CSENDSMHANDLER_H
       
   253