phoneclientserver/phoneserver/Inc/Ussd/CPhSrvUssdManager.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
     1 /*
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 #define CPHSRVUSSDMANAGER_H
    19 #define CPHSRVUSSDMANAGER_H
    20 
    20 
    21 
    21 
    22 // INCLUDES
    22 // INCLUDES
    23 #include <etelmm.h>            // ETel
    23 #include <etelmm.h>            // ETel
    24 #include "phcltclientserver.h" 
    24 #include "PhCltClientServer.h"
    25 #include "mphsrvussdnetworkobserver.h" 
    25 #include "MPhSrvUssdNetworkObserver.h"
    26 #include "mphsrvussdreplytimerobserver.h" 
    26 #include "MPhSrvUssdReplyTimerObserver.h"
    27 #include <badesca.h>
    27 #include <badesca.h>
    28 #include <hbdevicemessageboxsymbian.h>
    28 
    29 
    29 
    30 // FORWARD DECLARATIONS
    30 // FORWARD DECLARATIONS
    31 class RFs;
    31 class RFs;
    32 class CPhSrvResourceManager;
    32 class CPhSrvResourceManager;
    33 class CPhSrvUssdSendHandler;
    33 class CPhSrvUssdSendHandler;
    34 class CPhSrvUssdReceiveHandler;
    34 class CPhSrvUssdReceiveHandler;
    35 class CPhSrvUssdReplyTimer;
    35 class CPhSrvUssdReplyTimer;
    36 class MPhSrvPhoneInterface;
    36 class MPhSrvPhoneInterface;
    37 class MPhSrvUssdMessageSentObserver;
    37 class MPhSrvUssdMessageSentObserver;
       
    38 class CAknGlobalMsgQuery;
    38 class CPhSrvUssdSessionCancelWaiter;
    39 class CPhSrvUssdSessionCancelWaiter;
    39 class CPhSrvUssdNotifyNWRelease;
    40 class CPhSrvUssdNotifyNWRelease;
       
    41 // RM-RIM 417-66528
       
    42 class CUssdExtensionInterface;
    40 
    43 
    41 // CLASS DECLARATION
    44 // CLASS DECLARATION
    42 
    45 
    43 /**
    46 /**
    44 *  Handles all the Ussd sessions.
    47 *  Handles all the Ussd sessions.
    46 *  @since 1.0
    49 *  @since 1.0
    47 */
    50 */
    48 class CPhSrvUssdManager : 
    51 class CPhSrvUssdManager : 
    49     public CActive, 
    52     public CActive, 
    50     public MPhSrvUssdNetworkObserver, 
    53     public MPhSrvUssdNetworkObserver, 
    51     public MPhSrvUssdReplyTimerObserver,
    54     public MPhSrvUssdReplyTimerObserver
    52     public MHbDeviceMessageBoxObserver
       
    53     {
    55     {
    54     public:  // Constructors and destructor
    56     public:  // Constructors and destructor
    55 
    57 
    56         /**
    58         /**
    57         * C++ constructor.
    59         * C++ constructor.
   159         /**
   161         /**
   160         * @see MPhSrvUssdReplyTimerObserver
   162         * @see MPhSrvUssdReplyTimerObserver
   161         */
   163         */
   162         void UssdReplyTimerObserverHandleExpiredL( TInt aError );
   164         void UssdReplyTimerObserverHandleExpiredL( TInt aError );
   163         
   165         
   164         /**
       
   165         * @see MHbDeviceMessageBoxObserver
       
   166         */        
       
   167         void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox,
       
   168             CHbDeviceMessageBoxSymbian::TButtonId aButton);
       
   169         
       
   170         /*
   166         /*
   171         * @see CActive
   167         * @see CActive
   172         */
   168         */
   173         void RunL();
   169         void RunL();
   174         
   170         
   179         
   175         
   180         /*
   176         /*
   181         * @see CActive
   177         * @see CActive
   182         */
   178         */
   183         TInt RunError( TInt aError );
   179         TInt RunError( TInt aError );
       
   180  
       
   181 
   184 
   182 
   185     private: // New functions
   183     private: // New functions
   186         
   184         
   187         CPhSrvUssdSendHandler& SendHandlerL();
   185         CPhSrvUssdSendHandler& SendHandlerL();
   188 
   186 
   216          */
   214          */
   217         void UssdHandleReceivedEventL(
   215         void UssdHandleReceivedEventL(
   218             const TDes8& aMsgData, 
   216             const TDes8& aMsgData, 
   219             const RMobileUssdMessaging::TMobileUssdAttributesV1& 
   217             const RMobileUssdMessaging::TMobileUssdAttributesV1& 
   220                   aMsgAttributes);
   218                   aMsgAttributes);
       
   219 
       
   220         // RM-RIM 417-66528
       
   221         /** Third stage handler for received messages meant for extension 
       
   222         */
       
   223         void PorcessReceivedMessageInExtesnionL(const TDes8& aMsgData, 
       
   224                 const RMobileUssdMessaging::TMobileUssdAttributesV1& 
       
   225                       aMsgAttributes);
       
   226         /** Third stage handler for received messages 
       
   227         */
       
   228         void ProcessReceivedMessageL(const TDes8& aMsgData, 
       
   229                 const RMobileUssdMessaging::TMobileUssdAttributesV1& 
       
   230                       aMsgAttributes);
   221         // Restart the reply timer
   231         // Restart the reply timer
   222         void RestartReplyTimerL();
   232         void RestartReplyTimerL();
   223         
   233         
   224         /** Is the reply timer up and running? */
   234         /** Is the reply timer up and running? */
   225         TBool NetworkWaitingForAnAnswer();
   235         TBool NetworkWaitingForAnAnswer();
   226         
   236         
   227         // Set timer and activate it if there are notifications available
   237         // Set timer and activate it if there are notifications available
   228         void SetActiveIfPendingNotificationsExist();
   238         void SetActiveIfPendingNotificationsExist();
   229         
   239         
       
   240         // RM-RIM 417-66528
       
   241         // Create and Initialize the global message query
       
   242         void CreateGlobalMessageQueryL( 
       
   243                 const RMobileUssdMessaging::TMobileUssdAttributesV1& 
       
   244                       aMsgAttributes);
   230         // Launch the global message query (used from RunL)
   245         // Launch the global message query (used from RunL)
   231         void LaunchGlobalMessageQueryL();
   246         void LaunchGlobalMessageQueryL();
   232         
   247         
   233         // Send an MO ACK message if any such are pending
   248         // Send an MO ACK message if any such are pending
   234         void ProcessMoAcksL();
   249         void ProcessMoAcksL();
   305         /**
   320         /**
   306         * Updates Notify Message
   321         * Updates Notify Message
   307         * 
   322         * 
   308         * @since 3.1
   323         * @since 3.1
   309         */
   324         */
   310         void UpdateNotifyMessageL();
   325         void UpdateNotifyMessage();
   311         
   326         
   312         /**
   327         /**
   313         * Turn lights on
   328         * Turn lights on
   314         * 
   329         * 
   315         * @since 3.1
   330         * @since 3.1
   316         */
   331         */
   317         void TurnLightsOn();
   332         void TurnLightsOn();
   318         
       
   319         /**
       
   320         * Load default string by QT style localization
       
   321         * @param aText default string id defined by _LIT
       
   322         */        
       
   323         const TPtrC LoadDefaultString( const TDesC& aText );
       
   324 
   333 
   325     private:     // Data
   334     private:     // Data
   326         
   335 
   327         // The file session reference.
   336         // The file session reference.
   328         RFs& iFsSession;
   337         RFs& iFsSession;
   329         
   338         
   330         // The resource manager reference.
   339         // The resource manager reference.
   331         CPhSrvResourceManager& iResourceManager;
   340         CPhSrvResourceManager& iResourceManager;
   350         
   359         
   351         // The buffer for received message.
   360         // The buffer for received message.
   352         TBuf< KPhCltUssdMax8BitCharacters > iReceivedMessage;
   361         TBuf< KPhCltUssdMax8BitCharacters > iReceivedMessage;
   353         
   362         
   354         // The message query for showing USSD operation queries.
   363         // The message query for showing USSD operation queries.
   355         CHbDeviceMessageBoxSymbian* iDeviceDialog;
   364         CAknGlobalMsgQuery* iGlobalMsgQuery;
   356        
   365         
   357         // Is editor emptied.
   366         // Is editor emptied.
   358         TBool iEmptyEditor;
   367         TBool iEmptyEditor;
   359         
   368         
   360         // Will the editor be started.
   369         // Will the editor be started.
   361         TBool iStartEditor;
   370         TBool iStartEditor;
   382         TBool iLaunchGMQ;
   391         TBool iLaunchGMQ;
   383 
   392 
   384         // Local Telephony variant read-only data.
   393         // Local Telephony variant read-only data.
   385         TInt iVariantReadOnlyValues;
   394         TInt iVariantReadOnlyValues;
   386 
   395 
       
   396         // The message query header text.
       
   397         HBufC* iMeQuHeaderText;
       
   398 
   387         // The buffer for received decoded message.
   399         // The buffer for received decoded message.
   388         TBuf< KPhCltUssdMax8BitCharacters > iDecodedMessage;
   400         TBuf< KPhCltUssdMax8BitCharacters > iDecodedMessage;
   389 
   401 
   390         // If ETrue, then the last received USSD message was EUssdMtNotify.
   402         // If ETrue, then the last received USSD message was EUssdMtNotify.
   391         TBool iNotifyMessage;
   403         TBool iNotifyMessage;
   409         TBool iSatCanceled;
   421         TBool iSatCanceled;
   410         
   422         
   411         // Show Done note
   423         // Show Done note
   412         TBool iShowDone;
   424         TBool iShowDone;
   413 
   425 
   414         // Checks if received message type is Reply
   426 		// Checks if received message type is Reply
   415         TBool iMsgTypeReply;
   427         TBool iMsgTypeReply;
   416         
   428         
   417         // Has the transaction been closed or not
   429         // Has the transaction been closed or not
   418         TBool iNetworkReleased;
   430         TBool iNetworkReleased;
   419         
   431         
   424         TInt iAcksToBeSent;
   436         TInt iAcksToBeSent;
   425         
   437         
   426         // An asynchronous callback for sending MO ACK messages
   438         // An asynchronous callback for sending MO ACK messages
   427         CAsyncCallBack* iMoAckCallback;
   439         CAsyncCallBack* iMoAckCallback;
   428         
   440         
   429         HBufC* iTextBuffer;
   441         // RM-RIM 417-66528
   430 
   442         // Pointer to the UssdExtension
       
   443         CUssdExtensionInterface* iUssdExtnInterface;
   431     };
   444     };
   432     
   445     
   433 #endif // CPHSRVUSSDMANAGER_H
   446 #endif // CPHSRVUSSDMANAGER_H
   434 
   447 
   435 
   448