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