convergedconnectionhandler/cchclientapi/cchuinotif/inc/cchuinotifierimpl.h
changeset 0 a4daefaec16c
child 16 df4dfb214df5
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2008-2009 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 
       
    25 #include "cchuinotifier.h" // Base class
       
    26 #include "cchuicommon.hrh"
       
    27 #include "cchuicallstateobserver.h"
       
    28 
       
    29 class CCchUiPluginBrandingHandler;
       
    30 class CCchUiCallStateListener;
       
    31 
       
    32 /**
       
    33  *  Implementation class for notifier.
       
    34  *  Implements specific notifier, extends base class functionality.
       
    35  *
       
    36  *  @code
       
    37  *  @endcode
       
    38  *
       
    39  *  @lib cchuinotif.lib
       
    40  *  @since S60 5.0
       
    41  */
       
    42 NONSHARABLE_CLASS( CCCHUiNotifierImpl ): public CCCHUiNotifierBase,
       
    43                                          public MCchUiCallStateObserver
       
    44     {
       
    45 public:
       
    46     
       
    47     static CCCHUiNotifierImpl* NewL();
       
    48 
       
    49     /**
       
    50      * Destructor.
       
    51      */
       
    52     virtual ~CCCHUiNotifierImpl();
       
    53 
       
    54 protected:
       
    55     
       
    56     /**
       
    57      * From MEikSrvNotifierBase2.
       
    58      * The notifier has been deactivated 
       
    59      * so resources can be freed and outstanding messages completed.
       
    60      */
       
    61     void Cancel();
       
    62     
       
    63 private:
       
    64 
       
    65     CCCHUiNotifierImpl();
       
    66     
       
    67     void ConstructL();
       
    68     
       
    69     /**
       
    70      * Shows username/password query.
       
    71      *
       
    72      * @since S60 5.0
       
    73      * @param aReplySlot Reply slot.
       
    74      * @param aMessage Should be completed when the notifier is deactivated.
       
    75      * @param aServiceId Service id to which this note related to.
       
    76      * @param aUserName service username.
       
    77      */
       
    78     void ShowUsernamePasswordQueryL( 
       
    79         TInt aReplySlot, 
       
    80         const RMessagePtr2& aMessage, 
       
    81         TUint aServiceId,
       
    82         const TDesC& aUserName );
       
    83     
       
    84     /**
       
    85      * Shows no connections available query
       
    86      *
       
    87      * @since S60 5.0
       
    88      * @param aReplySlot Reply slot.
       
    89      * @param aMessage Should be completed when the notifier is deactivated.
       
    90      * @param aServiceId Service id to which this note related to.
       
    91      * @param aNoConnectionsDefined If ETrue, no connections defined query 
       
    92      * is used
       
    93      */
       
    94     void ShowNoConnectionsQueryL(
       
    95         TInt aReplySlot, 
       
    96         const RMessagePtr2& aMessage,
       
    97         TUint aServiceId,
       
    98         TBool aNoConnectionsDefined );
       
    99     
       
   100     /**
       
   101      * Shows change connection query.
       
   102      *
       
   103      * @since S60 5.0
       
   104      * @param aReplySlot Reply slot.
       
   105      * @param aMessage Should be completed when the notifier is deactivated.
       
   106      * @param aServiceId Service id to which this note related to.
       
   107      * @param aIapid iap id of currently used connection
       
   108      */
       
   109     void ShowChangeConnectionQueryL(
       
   110         TInt aReplySlot, 
       
   111         const RMessagePtr2& aMessage,
       
   112         TUint aServiceId,
       
   113         TInt aIapid );
       
   114     
       
   115     /**
       
   116      * Shows defective settings info note.
       
   117      *
       
   118      * @since S60 5.0
       
   119      * @param aReplySlot Reply slot.
       
   120      * @param aMessage Should be completed when the notifier is deactivated.
       
   121      * @param aServiceId Service id to which this note related to.
       
   122      */    
       
   123     void ShowDefectiveSettingsL( 
       
   124         TInt aReplySlot, 
       
   125         const RMessagePtr2& aMessage,
       
   126         TUint aServiceId );
       
   127     
       
   128     /**
       
   129      * Shows error in connection info note.
       
   130      *
       
   131      * @since S60 5.0
       
   132      * @param aReplySlot Reply slot.
       
   133      * @param aMessage Should be completed when the notifier is deactivated.
       
   134      * @param aServiceId Service id to which this note related to.
       
   135      */    
       
   136     void ShowErrorInConnectionNoteL( 
       
   137         TInt aReplySlot, 
       
   138         const RMessagePtr2& aMessage,
       
   139         TUint aServiceId );
       
   140     
       
   141     /**
       
   142      * Shows invalid username/password note.
       
   143      *
       
   144      * @since S60 5.0
       
   145      * @param aReplySlot Reply slot.
       
   146      * @param aMessage Should be completed when the notifier is deactivated.
       
   147      * @param aServiceId Service id to which this note related to.
       
   148      */    
       
   149     void ShowInvalidUsernamePasswordNoteL(
       
   150         TInt aReplySlot, 
       
   151         const RMessagePtr2& aMessage,
       
   152         TUint aServiceId );
       
   153     
       
   154     /**
       
   155      * Shows confirmation note to change connection.
       
   156      *
       
   157      * @since S60 5.0
       
   158      * @param aReplySlot Reply slot.
       
   159      * @param aMessage Should be completed when the notifier is deactivated.
       
   160      * @param aServiceId Service id to which this note related to.
       
   161      * @param aIapid iap id of currently used connection.
       
   162      */    
       
   163     void ShowConfirmChangeConnectionL( 
       
   164         TInt aReplySlot, 
       
   165         const RMessagePtr2& aMessage, 
       
   166         TUint aServiceId, 
       
   167         TInt aIapid  );
       
   168         
       
   169     /**
       
   170      * Return a handle to CCchUiPluginBrandingHandler.
       
   171      *
       
   172      * @since S60 5.0
       
   173      * @return A handler to CCchUiPluginBrandingHandler.
       
   174      */
       
   175     CCchUiPluginBrandingHandler& BrandingHandlerL();
       
   176 
       
   177     /**
       
   178      * Fills list items for no connections available query. aListItems will
       
   179      * contain shown items as text, aCommandArray will contain the corresponding
       
   180      * commands. When query is dismissed, item selection can be mapped to command
       
   181      * in aCommandArray.
       
   182      *
       
   183      * @since S60 5.0
       
   184      * @param aListItems array for list items
       
   185      * @param aCommandArray array for commands
       
   186      * @param aServiceId service id
       
   187      */
       
   188     void FillNoConnectionsAvailableListboxL( 
       
   189         CDesCArray& aListItems, 
       
   190 	    RArray<TCchUiOperationCommand>& aCommandArray,
       
   191 	    TUint aServiceId );   
       
   192 	    
       
   193     /**
       
   194      * Fills list items for no connections defined query. aListItems will
       
   195      * contain shown items as text, aCommandArray will contain the corresponding
       
   196      * commands. When query is dismissed, item selection can be mapped to command
       
   197      * in aCommandArray.
       
   198      *
       
   199      * @since S60 5.0
       
   200      * @param aListItems array for list items
       
   201      * @param aCommandArray array for commands
       
   202      */
       
   203     void FillNoConnectionsDefinedListboxL( 
       
   204         CDesCArray& aListItems, 
       
   205 	    RArray<TCchUiOperationCommand>& aCommandArray );   	    
       
   206 
       
   207     /**
       
   208      * Fills list items for no connections are found query. aListItems will
       
   209      * contain shown items as text, aCommandArray will contain the corresponding
       
   210      * commands. When query is dismissed, item selection can be mapped to command
       
   211      * in aCommandArray.
       
   212      *
       
   213      * @since S60 5.0
       
   214      * @param aListItems array for list items
       
   215      * @param aCommandArray array for commands
       
   216      */
       
   217     void FillNoConnectionsFoundListboxL( 
       
   218         CDesCArray& aListItems, 
       
   219 	    RArray<TCchUiOperationCommand>& aCommandArray );
       
   220     
       
   221     /**
       
   222      * Fills list items for change current connection query. aListItems will
       
   223      * contain shown items as text, aCommandArray will contain the corresponding
       
   224      * commands. When query is dismissed, item selection can be mapped to command
       
   225      * in aCommandArray.
       
   226      *
       
   227      * @since S60 5.0
       
   228      * @param aListItems array for list items
       
   229      * @param aCommandArray array for commands
       
   230      */
       
   231     void FillChangeCurrentConnectionListboxL( 
       
   232         CDesCArray& aListItems, 
       
   233         RArray<TCchUiOperationCommand>& aCommandArray );
       
   234     
       
   235     /**
       
   236      * Fills list items for change connection query. aListItems will
       
   237      * contain shown items as text, aCommandArray will contain the corresponding
       
   238      * commands. When query is dismissed, item selection can be mapped to command
       
   239      * in aCommandArray.
       
   240      *
       
   241      * @since S60 5.0
       
   242      * @param aListItems array for list items
       
   243      * @param aCommandArray array for commands
       
   244      */
       
   245     void FillChangeConnectionListboxL( 
       
   246         CDesCArray& aListItems, 
       
   247         RArray<TCchUiOperationCommand>& aCommandArray ); 
       
   248 
       
   249     /**
       
   250      * Shows custom GPRS access point selection. User can select GPRS access
       
   251      * point from list which is formed from access points in Internet SNAP.
       
   252      *
       
   253      * @since S60 5.0
       
   254      * @param aServiceId, service id
       
   255      */
       
   256     void ShowGprsSelectionL( TUint aServiceId );
       
   257     
       
   258     TBool IsVoIPOverWCDMAAllowedL();
       
   259 
       
   260 // from base class CCCHUiNotifierBase
       
   261 
       
   262     /**
       
   263      * From CCCHUiNotifierBase.
       
   264      * Called when a notifier is first loaded.     
       
   265      *
       
   266      * @since S60 5.0
       
   267      * @return A structure containing priority and channel info.
       
   268      */
       
   269     TNotifierInfo RegisterL();
       
   270     
       
   271     /**
       
   272      * From CCCHUiNotifierBase.
       
   273      * Updates a currently active notifier.
       
   274      *
       
   275      * @since S60 5.0
       
   276      * @param aBuffer The updated data.
       
   277      * @return A pointer to return value.
       
   278      */
       
   279     TPtrC8 UpdateL( const TDesC8& aBuffer );
       
   280     
       
   281     /**
       
   282      * From CCCHUiNotifierBase.
       
   283      * Used in asynchronous notifier launch to 
       
   284      * store received parameters into members variables and 
       
   285      * make needed initializations.
       
   286      *
       
   287      * @since S60 5.0
       
   288      * @param aBuffer A buffer containing received parameters
       
   289      * @param aReplySlot Reply slot.
       
   290      * @param aMessage Should be completed when the notifier is deactivated.
       
   291      */
       
   292     void StartL(
       
   293         const TDesC8& aBuffer,
       
   294         TInt aReplySlot, 
       
   295         const RMessagePtr2& aMessage );
       
   296 
       
   297     /** 
       
   298      * From CActive
       
   299      */
       
   300     void RunL();
       
   301     
       
   302 public:
       
   303 
       
   304 // from base class MCchUiCallStateObserver
       
   305 
       
   306     /**
       
   307      * From MCchUiCallStateObserver.
       
   308      * @see MCchUiCallStateObserver.
       
   309      */
       
   310     void CallStateChanged( TInt aCallState );
       
   311 
       
   312 private: // data
       
   313 
       
   314     /**
       
   315      * Branding handler. Lifetime of this pointer must be the same as 
       
   316      * for icons fetched using it.
       
   317      * Own.
       
   318      */
       
   319     CCchUiPluginBrandingHandler* iBrandingHandler;
       
   320     
       
   321     /**
       
   322      * Result parameters.
       
   323      */
       
   324     TCCHUiNotifierParams iResultParams;
       
   325 
       
   326     /**
       
   327      * Handle to created CAknListQueryDialog.
       
   328      * Own.
       
   329      */
       
   330     CAknListQueryDialog* iListQueryDialog;
       
   331 
       
   332     /**
       
   333      * Listener for call state changes.
       
   334      * Own.
       
   335      */
       
   336     CCchUiCallStateListener* iCallStateListener;
       
   337     
       
   338     TUint iServiceId;
       
   339     
       
   340     CCHUI_UNIT_TEST( T_CchUiNotifierImpl )
       
   341     };
       
   342 
       
   343 #endif // C_CCHUINOTIFIERIMPL_H