convergedconnectionhandler/cchclientapi/cchuinotif/inc/cchuinotifierimpl.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2008-2010 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:  Actual notifier class implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CCHUINOTIFIERIMPL_H
       
    20 #define C_CCHUINOTIFIERIMPL_H
       
    21 
       
    22 #include <cchuiobserver.h> // for dialog types
       
    23 #include <AknQueryDialog.h>
       
    24 #include <sipprofileregistryobserver.h>
       
    25 
       
    26 #include "cchuinotifier.h" // Base class
       
    27 #include "cchuicommon.hrh"
       
    28 #include "cchuicallstateobserver.h"
       
    29 
       
    30 class CSIPManagedProfile;
       
    31 class CSIPManagedProfileRegistry;
       
    32 class CCchUiPluginBrandingHandler;
       
    33 class CCchUiCallStateListener;
       
    34 
       
    35 /**
       
    36  *  Implementation class for notifier.
       
    37  *  Implements specific notifier, extends base class functionality.
       
    38  *
       
    39  *  @code
       
    40  *  @endcode
       
    41  *
       
    42  *  @lib cchuinotif.lib
       
    43  *  @since S60 5.0
       
    44  */
       
    45 NONSHARABLE_CLASS( CCCHUiNotifierImpl ): public CCCHUiNotifierBase,
       
    46                                          public MCchUiCallStateObserver,
       
    47                                          public MSIPProfileRegistryObserver
       
    48     {
       
    49 public:
       
    50     
       
    51     static CCCHUiNotifierImpl* NewL();
       
    52 
       
    53     /**
       
    54      * Destructor.
       
    55      */
       
    56     virtual ~CCCHUiNotifierImpl();
       
    57 
       
    58 protected:
       
    59     
       
    60     /**
       
    61      * From MEikSrvNotifierBase2.
       
    62      * The notifier has been deactivated 
       
    63      * so resources can be freed and outstanding messages completed.
       
    64      */
       
    65     void Cancel();
       
    66     
       
    67 private:
       
    68 
       
    69     CCCHUiNotifierImpl();
       
    70     
       
    71     void ConstructL();
       
    72     
       
    73     /**
       
    74      * Shows username/password query.
       
    75      *
       
    76      * @since S60 5.0
       
    77      * @param aReplySlot Reply slot.
       
    78      * @param aMessage Should be completed when the notifier is deactivated.
       
    79      * @param aServiceId Service id to which this note related to.
       
    80      * @param aUserName service username.
       
    81      */
       
    82     void ShowUsernamePasswordQueryL( 
       
    83         TInt aReplySlot, 
       
    84         const RMessagePtr2& aMessage, 
       
    85         TUint aServiceId,
       
    86         const TDesC& aUserName );
       
    87     
       
    88     /**
       
    89      * Shows no connections available query
       
    90      *
       
    91      * @since S60 5.0
       
    92      * @param aReplySlot Reply slot.
       
    93      * @param aMessage Should be completed when the notifier is deactivated.
       
    94      * @param aServiceId Service id to which this note related to.
       
    95      * @param aNoConnectionsDefined If ETrue, no connections defined query 
       
    96      * is used
       
    97      */
       
    98     void ShowNoConnectionsQueryL(
       
    99         TInt aReplySlot, 
       
   100         const RMessagePtr2& aMessage,
       
   101         TUint aServiceId,
       
   102         TBool aNoConnectionsDefined );
       
   103     
       
   104     /**
       
   105      * Shows change connection query.
       
   106      *
       
   107      * @since S60 5.0
       
   108      * @param aReplySlot Reply slot.
       
   109      * @param aMessage Should be completed when the notifier is deactivated.
       
   110      * @param aServiceId Service id to which this note related to.
       
   111      * @param aIapid iap id of currently used connection
       
   112      */
       
   113     void ShowChangeConnectionQueryL(
       
   114         TInt aReplySlot, 
       
   115         const RMessagePtr2& aMessage,
       
   116         TUint aServiceId,
       
   117         TInt aIapid );
       
   118     
       
   119     /**
       
   120      * Shows defective settings info note.
       
   121      *
       
   122      * @since S60 5.0
       
   123      * @param aReplySlot Reply slot.
       
   124      * @param aMessage Should be completed when the notifier is deactivated.
       
   125      * @param aServiceId Service id to which this note related to.
       
   126      */    
       
   127     void ShowDefectiveSettingsL( 
       
   128         TInt aReplySlot, 
       
   129         const RMessagePtr2& aMessage,
       
   130         TUint aServiceId );
       
   131     
       
   132     /**
       
   133      * Shows error in connection info note.
       
   134      *
       
   135      * @since S60 5.0
       
   136      * @param aReplySlot Reply slot.
       
   137      * @param aMessage Should be completed when the notifier is deactivated.
       
   138      * @param aServiceId Service id to which this note related to.
       
   139      */    
       
   140     void ShowErrorInConnectionNoteL( 
       
   141         TInt aReplySlot, 
       
   142         const RMessagePtr2& aMessage,
       
   143         TUint aServiceId );
       
   144     
       
   145     /**
       
   146      * Shows invalid username/password note.
       
   147      *
       
   148      * @since S60 5.0
       
   149      * @param aReplySlot Reply slot.
       
   150      * @param aMessage Should be completed when the notifier is deactivated.
       
   151      * @param aServiceId Service id to which this note related to.
       
   152      */    
       
   153     void ShowInvalidUsernamePasswordNoteL(
       
   154         TInt aReplySlot, 
       
   155         const RMessagePtr2& aMessage,
       
   156         TUint aServiceId );
       
   157     
       
   158     /**
       
   159      * Shows confirmation note to change connection.
       
   160      *
       
   161      * @since S60 5.0
       
   162      * @param aReplySlot Reply slot.
       
   163      * @param aMessage Should be completed when the notifier is deactivated.
       
   164      * @param aServiceId Service id to which this note related to.
       
   165      * @param aIapid iap id of currently used connection.
       
   166      */    
       
   167     void ShowConfirmChangeConnectionL( 
       
   168         TInt aReplySlot, 
       
   169         const RMessagePtr2& aMessage, 
       
   170         TUint aServiceId, 
       
   171         TInt aIapid  );
       
   172         
       
   173     /**
       
   174      * Return a handle to CCchUiPluginBrandingHandler.
       
   175      *
       
   176      * @since S60 5.0
       
   177      * @return A handler to CCchUiPluginBrandingHandler.
       
   178      */
       
   179     CCchUiPluginBrandingHandler& BrandingHandlerL();
       
   180 
       
   181     /**
       
   182      * Fills list items for no connections available query. aListItems will
       
   183      * contain shown items as text, aCommandArray will contain the corresponding
       
   184      * commands. When query is dismissed, item selection can be mapped to command
       
   185      * in aCommandArray.
       
   186      *
       
   187      * @since S60 5.0
       
   188      * @param aListItems array for list items
       
   189      * @param aCommandArray array for commands
       
   190      * @param aServiceId service id
       
   191      */
       
   192     void FillNoConnectionsAvailableListboxL( 
       
   193         CDesCArray& aListItems, 
       
   194 	    RArray<TCchUiOperationCommand>& aCommandArray,
       
   195 	    TUint aServiceId );   
       
   196 	    
       
   197     /**
       
   198      * Fills list items for no connections defined query. aListItems will
       
   199      * contain shown items as text, aCommandArray will contain the corresponding
       
   200      * commands. When query is dismissed, item selection can be mapped to command
       
   201      * in aCommandArray.
       
   202      *
       
   203      * @since S60 5.0
       
   204      * @param aListItems array for list items
       
   205      * @param aCommandArray array for commands
       
   206      */
       
   207     void FillNoConnectionsDefinedListboxL( 
       
   208         CDesCArray& aListItems, 
       
   209 	    RArray<TCchUiOperationCommand>& aCommandArray );   	    
       
   210 
       
   211     /**
       
   212      * Fills list items for no connections are found query. aListItems will
       
   213      * contain shown items as text, aCommandArray will contain the corresponding
       
   214      * commands. When query is dismissed, item selection can be mapped to command
       
   215      * in aCommandArray.
       
   216      *
       
   217      * @since S60 5.0
       
   218      * @param aListItems array for list items
       
   219      * @param aCommandArray array for commands
       
   220      */
       
   221     void FillNoConnectionsFoundListboxL( 
       
   222         CDesCArray& aListItems, 
       
   223 	    RArray<TCchUiOperationCommand>& aCommandArray );
       
   224     
       
   225     /**
       
   226      * Fills list items for change current connection query. aListItems will
       
   227      * contain shown items as text, aCommandArray will contain the corresponding
       
   228      * commands. When query is dismissed, item selection can be mapped to command
       
   229      * in aCommandArray.
       
   230      *
       
   231      * @since S60 5.0
       
   232      * @param aListItems array for list items
       
   233      * @param aCommandArray array for commands
       
   234      */
       
   235     void FillChangeCurrentConnectionListboxL( 
       
   236         CDesCArray& aListItems, 
       
   237         RArray<TCchUiOperationCommand>& aCommandArray );
       
   238     
       
   239     /**
       
   240      * Fills list items for change connection query. aListItems will
       
   241      * contain shown items as text, aCommandArray will contain the corresponding
       
   242      * commands. When query is dismissed, item selection can be mapped to command
       
   243      * in aCommandArray.
       
   244      *
       
   245      * @since S60 5.0
       
   246      * @param aListItems array for list items
       
   247      * @param aCommandArray array for commands
       
   248      */
       
   249     void FillChangeConnectionListboxL( 
       
   250         CDesCArray& aListItems, 
       
   251         RArray<TCchUiOperationCommand>& aCommandArray ); 
       
   252 
       
   253     /**
       
   254      * Shows custom GPRS access point selection. User can select GPRS access
       
   255      * point from list which is formed from access points in Internet SNAP.
       
   256      *
       
   257      * @since S60 5.0
       
   258      * @param aServiceId, service id
       
   259      * @return Error code.
       
   260      */
       
   261     TInt ShowGprsSelectionL( TUint aServiceId );
       
   262     
       
   263     /**
       
   264      * Returns ETrue if VoIP over WCDMA is allowed.
       
   265      *
       
   266      * @since S60 5.0
       
   267      * @return ETrue if allowed.
       
   268      */
       
   269     TBool IsVoIPOverWCDMAAllowedL();
       
   270 
       
   271     /**
       
   272      * Returns ETrue if current service SNAP is missing gprs accespoints
       
   273      * which are set to the internet SNAP.
       
   274      *
       
   275      * @since S60 9.2
       
   276      * @return ETrue if the internet snap has gprs connection
       
   277      *         which are not in the services snap.
       
   278      */
       
   279     TBool IsServiceSnapMissingInternetGprsApsL() const;
       
   280     
       
   281     /**
       
   282      * Returns internet GPRS IAP's informations which are not
       
   283      * in the current service snap.
       
   284      * 
       
   285      * @since S60 9.2
       
   286      * @param aIaps Iap names in return.
       
   287      * @param aIapIds IapIds in return.
       
   288      * @return internet SNAP ID.
       
   289      */
       
   290     TUint32 InternetGprsApsMissingFromServiceSnapL(
       
   291         CDesCArray& aIaps, RArray<TUint32>& aIapIds ) const;
       
   292 
       
   293     /**
       
   294      * For deleting RPointerArray in case of leave.
       
   295      *
       
   296      * @since S60 5.0
       
   297      * @param aPointerArray for pointer array to be deleted
       
   298      */
       
   299      static void ResetAndDestroy( TAny* aPointerArray );
       
   300     
       
   301 // from base class CCCHUiNotifierBase
       
   302 
       
   303     /**
       
   304      * From CCCHUiNotifierBase.
       
   305      * Called when a notifier is first loaded.     
       
   306      *
       
   307      * @since S60 5.0
       
   308      * @return A structure containing priority and channel info.
       
   309      */
       
   310     TNotifierInfo RegisterL();
       
   311     
       
   312     /**
       
   313      * From CCCHUiNotifierBase.
       
   314      * Updates a currently active notifier.
       
   315      *
       
   316      * @since S60 5.0
       
   317      * @param aBuffer The updated data.
       
   318      * @return A pointer to return value.
       
   319      */
       
   320     TPtrC8 UpdateL( const TDesC8& aBuffer );
       
   321     
       
   322     /**
       
   323      * From CCCHUiNotifierBase.
       
   324      * Used in asynchronous notifier launch to 
       
   325      * store received parameters into members variables and 
       
   326      * make needed initializations.
       
   327      *
       
   328      * @since S60 5.0
       
   329      * @param aBuffer A buffer containing received parameters
       
   330      * @param aReplySlot Reply slot.
       
   331      * @param aMessage Should be completed when the notifier is deactivated.
       
   332      */
       
   333     void StartL(
       
   334         const TDesC8& aBuffer,
       
   335         TInt aReplySlot, 
       
   336         const RMessagePtr2& aMessage );
       
   337 
       
   338     /** 
       
   339      * From CActive
       
   340      */
       
   341     void RunL();
       
   342     
       
   343     
       
   344     // from base class MSIPProfileRegistryObserver
       
   345       
       
   346     /** 
       
   347      * From MSIPProfileRegistryObserver 
       
   348      * SIP profile information event.
       
   349      *
       
   350      * @since S60 v3.0
       
   351      * @param aProfileId is id for profile
       
   352      * @param aEvent type of information event
       
   353      */
       
   354     void ProfileRegistryEventOccurred(
       
   355         TUint32 aSIPProfileId, 
       
   356         TEvent aEvent );
       
   357 
       
   358           
       
   359     /**
       
   360      * From MSIPProfileRegistryObserver
       
   361      * An asynchronous error has occurred related to SIP profile.
       
   362      *
       
   363      * @since S60 v3.0
       
   364      * @param aSIPProfileId the id of failed profile 
       
   365      * @param aError a error code
       
   366      */
       
   367      void ProfileRegistryErrorOccurred(
       
   368          TUint32 aSIPProfileId,
       
   369          TInt aError );
       
   370     
       
   371 public:
       
   372 
       
   373 // from base class MCchUiCallStateObserver
       
   374 
       
   375     /**
       
   376      * From MCchUiCallStateObserver.
       
   377      * @see MCchUiCallStateObserver.
       
   378      */
       
   379     void CallStateChanged( TInt aCallState );
       
   380 
       
   381 private: // data
       
   382 
       
   383     /**
       
   384      * Branding handler. Lifetime of this pointer must be the same as 
       
   385      * for icons fetched using it.
       
   386      * Own.
       
   387      */
       
   388     CCchUiPluginBrandingHandler* iBrandingHandler;
       
   389     
       
   390     /**
       
   391      * Result parameters.
       
   392      */
       
   393     TCCHUiNotifierParams iResultParams;
       
   394 
       
   395     /**
       
   396      * Handle to created CAknListQueryDialog.
       
   397      * Own.
       
   398      */
       
   399     CAknListQueryDialog* iListQueryDialog;
       
   400 
       
   401     /**
       
   402      * Listener for call state changes.
       
   403      * Own.
       
   404      */
       
   405     CCchUiCallStateListener* iCallStateListener;
       
   406     
       
   407     /**
       
   408      * Service ID.
       
   409      */
       
   410     TUint iServiceId;
       
   411     
       
   412     /**
       
   413      * Current connection IAP ID.
       
   414      */
       
   415     TUint iCurrentConnectionIapId;
       
   416 
       
   417     /*
       
   418      * Handle to SIP managed profile registry.
       
   419      * Own.
       
   420      */
       
   421     CSIPManagedProfileRegistry* iSipProfileRegistry;
       
   422     
       
   423     CCHUI_UNIT_TEST( T_CchUiNotifierImpl )
       
   424     };
       
   425 
       
   426 #endif // C_CCHUINOTIFIERIMPL_H