adaptationlayer/tsy/nokiatsy_dll/inc/cmmussdmesshandler.h
changeset 0 63b37f68c1ce
child 8 6295dc2169f3
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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 the License "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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 //  INCLUDES
       
    21 
       
    22 #ifndef _INC_CMMUSSDMESSHANDLER_
       
    23 #define _INC_CMMUSSDMESSHANDLER_
       
    24 
       
    25 #include <e32def.h>
       
    26 
       
    27 #include "mmmmesshandlerbase.h"
       
    28 #include "cmmphonetreceiver.h"
       
    29 #include "cmmphonetsender.h"
       
    30 
       
    31 //  CONSTANTS
       
    32 
       
    33     //none
       
    34 
       
    35 
       
    36 //  MACROS
       
    37 
       
    38     //none
       
    39 
       
    40 
       
    41 //  DATA TYPES
       
    42 
       
    43     //none
       
    44 
       
    45 
       
    46 //  EXTERNAL DATA STRUCTURES
       
    47 
       
    48     //none
       
    49 
       
    50 
       
    51 //  FUNCTION PROTOTYPES
       
    52 
       
    53     //none
       
    54 
       
    55 
       
    56 //  FORWARD DECLARATIONS
       
    57 
       
    58 class CMmMessageRouter;
       
    59 class CMmPhoNetReceiver;
       
    60 class CMmPhoNetSender;
       
    61 class CMmUssdTsy;
       
    62 
       
    63 //  CLASS DEFINITIONS
       
    64 
       
    65 // DESCRIPTION
       
    66 //
       
    67 // CMmUssdMessHandler is used to create and send mode-independent Ussd
       
    68 // ISI-messages to PhoNet via PhoNetSender. It also receives Ussd ISI-messages
       
    69 // from PhoNet via PhoNetReceiver. If the message is mode-independent,
       
    70 // it will be handled here. Otherwise, the message will be sent to message
       
    71 // handler of active mode.
       
    72 
       
    73 class CMmUssdMessHandler :
       
    74     public CBase, public MMmMessHandlerBase, public MMmMessageReceiver
       
    75 {
       
    76     //METHODS
       
    77     public:
       
    78 
       
    79         /**
       
    80         * C++ destructor
       
    81         * @param none
       
    82         * @return none
       
    83         */
       
    84         ~CMmUssdMessHandler();
       
    85 
       
    86         /**
       
    87         * Two-phased constructor.
       
    88         * @param aPhoNetSender Pointer to the phonet sender
       
    89         * @param aPhoNetReceiver Pointer to the phonet receiver
       
    90         * @param aMessageRouter Pointer to the message router
       
    91         */
       
    92         static CMmUssdMessHandler* NewL(
       
    93             CMmPhoNetSender* aCMmPhoNetSender,
       
    94             CMmPhoNetReceiver* aCMmPhoNetReceiver,
       
    95             CMmMessageRouter* aMessageRouter );
       
    96 
       
    97         /**
       
    98         * From CMessHandlerBase. This method is the single entry point for
       
    99         * requests coming from the Symbian OS layer to this message handler
       
   100         * @since ?Series60_version
       
   101         * @param aIpc IPC number of the request
       
   102         * @return TInt KErrNone or error code
       
   103         */
       
   104         TInt  ExtFuncL( TInt aIpc,
       
   105             const CMmDataPackage* aDataPackage );
       
   106 
       
   107     public: // New functions
       
   108 
       
   109         /**
       
   110         * Handles a received message by calling the specific
       
   111         * message handling method.
       
   112         * @param aIsiMessage, reference to the received message.
       
   113         * @return TInt: True if message been handled in this message handler
       
   114         */
       
   115         void ReceiveMessageL( const TIsiReceiveC &aIsiMessage );
       
   116 
       
   117         /**
       
   118         * Construct a SS_GSM_USSD_SEND_REQ ISI message
       
   119         * @param TUint8 aTransactionId, transaction id number
       
   120         * @param TDes8* aData, message data
       
   121         * @param TDes8* aAttributes, message attributes
       
   122         * @return TInt KErrNone or error code
       
   123         */
       
   124         TInt SsGsmUssdSendReq(
       
   125             const CMmDataPackage* aDataPackage );
       
   126 
       
   127         /**
       
   128         * Construct a SS_GSM_USSD_SEND_REQ ISI message
       
   129         * @return TInt KErrNone or error code
       
   130         */
       
   131         TInt SsGsmUssdSendReq( void );
       
   132 
       
   133         /**
       
   134         * Completes successful Ss Gsm Ussd Send Request
       
   135         * @param aIsiMessage
       
   136         */
       
   137         void SsGsmUssdSendResp( const TIsiReceiveC &aIsiMessage );
       
   138 
       
   139         /*
       
   140         * Completes unsuccessful Ss Gsm Ussd Send Request
       
   141         * @param  const TIsiReceiveC &aIsiMessage , the received ISI message
       
   142         */
       
   143         void SsServiceFailedResp( const TIsiReceiveC &aIsiMessage );
       
   144 
       
   145         /**
       
   146         * breaks a SS_GSM_USSD_RECEIVE_IND ISI message
       
   147         * @param aIsiMessage
       
   148         */
       
   149         void SsGsmUssdReceiveInd( const TIsiReceiveC &aIsiMessage );
       
   150 
       
   151         /**
       
   152         * Handles errors comes from PhoNetReceiver RunError
       
   153         * @param const TIsiReceiveC &aIsiMessage: The received ISI message
       
   154         */
       
   155         void HandleError(const TIsiReceiveC &aIsiMessage, TInt aError);
       
   156 
       
   157     protected:
       
   158 
       
   159         /**
       
   160         * C++ constructor
       
   161         * @param none
       
   162         * @return none
       
   163         */
       
   164         CMmUssdMessHandler();
       
   165 
       
   166     private:
       
   167 
       
   168         /**
       
   169         * Initialises object attributes.
       
   170         */
       
   171         void ConstructL();
       
   172 
       
   173     //ATTRIBUTES
       
   174     public:
       
   175         //none
       
   176 
       
   177     protected:
       
   178 
       
   179         // Pointer to the PhonetSender
       
   180         CMmPhoNetSender* iPhoNetSender;
       
   181 
       
   182         // pointer to the message router
       
   183         CMmMessageRouter* iMessageRouter;
       
   184 
       
   185 
       
   186     private:
       
   187 
       
   188         TBool iIsSendReleaseCalled;
       
   189         TBool iIsUssdSendReqOnGoing;
       
   190         TBool iIsSendReleaseReqPending;
       
   191 
       
   192         // Etrue if NoFdn request is in active
       
   193         TBool iNoFdnUSSDReq;
       
   194 
       
   195 };
       
   196 
       
   197 #endif // CMMUSSDMESSHANDLER
       
   198 
       
   199 //End Of File