connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/connectionstatuspopup.h
changeset 20 9c97ad6591ae
child 23 7ec726f93df1
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
       
     1 /*
       
     2 * Copyright (c) 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:  Declaration of CConnectionStatusPopup
       
    15 *
       
    16 */
       
    17 #ifndef __CCONNECTIONSTATUSPOPUP_H_
       
    18 #define __CCONNECTIONSTATUSPOPUP_H_
       
    19 
       
    20 // INCLUDES
       
    21 #include <e32base.h>
       
    22 #include "HbDeviceNotificationDialogSymbian.h"
       
    23 
       
    24 /**
       
    25  * CConnectionStatusPopup
       
    26  * Handler for connection status popups
       
    27  */
       
    28 NONSHARABLE_CLASS( CConnectionStatusPopup ) : public CBase, 
       
    29     public MHbDeviceNotificationDialogObserver
       
    30     {
       
    31 public: // Constructors and destructor
       
    32 
       
    33     /**
       
    34     * Two-phased constructor. Leaves on failure.
       
    35     * @return The constructed CConnectionStatusPopup object.
       
    36     */
       
    37     static CConnectionStatusPopup* NewL();
       
    38     
       
    39     /**
       
    40      * Destructor
       
    41      */
       
    42     virtual ~CConnectionStatusPopup();
       
    43 
       
    44 public:
       
    45     
       
    46     /**
       
    47      * Shows "Connecting" discreet popup.
       
    48      */
       
    49     void ConnectingViaDiscreetPopup( );
       
    50 
       
    51     /**
       
    52      * Shows "Connecting via '%U'" discreet popup.
       
    53      */
       
    54     void ConnectingViaDiscreetPopup( TUint32 aIAPId, 
       
    55             TBool aConnectionAlreadyActive );
       
    56     /**
       
    57      * Cancels the "Connecting via '%U'" discreet popup.
       
    58      */
       
    59     void CancelConnectingViaDiscreetPopup();
       
    60 
       
    61     /**
       
    62      * Shows connection error discreet popup.
       
    63      */
       
    64     void ConnectionErrorDiscreetPopup( TInt aErrorCode );
       
    65     
       
    66 public: // MHbDeviceNotificationDialogObserver
       
    67 
       
    68     void NotificationDialogActivated(
       
    69             const CHbDeviceNotificationDialogSymbian* aDialog );
       
    70     
       
    71     void NotificationDialogClosed(
       
    72             const CHbDeviceNotificationDialogSymbian* aDialog,
       
    73             TInt aCompletionCode );
       
    74     
       
    75 private:
       
    76     
       
    77     /**
       
    78      * Defines long enough timeout for the popup to be considered shown
       
    79      * "forever".
       
    80      */
       
    81     const static TInt KForeverTimeout = 3*60*1000*1000;
       
    82 
       
    83     /**
       
    84      * The state of the popup
       
    85      */
       
    86     enum TPopupState
       
    87         {
       
    88         /**
       
    89          *  Not shown
       
    90          */
       
    91         EPopupClosed,
       
    92         /**
       
    93          *  "Connecting" one-liner
       
    94          */
       
    95         EPopupConnecting,
       
    96         /**
       
    97          *  "Connecting" with iap name on second row
       
    98          */
       
    99         EPopupConnectingIap,
       
   100         /**
       
   101          *  "Connection failed/error"
       
   102          */
       
   103         EPopupError
       
   104         };
       
   105     
       
   106     /**
       
   107      * Constructor
       
   108      */
       
   109     CConnectionStatusPopup();
       
   110 
       
   111     /**
       
   112      * Second-phase constructor
       
   113      */
       
   114     void ConstructL();
       
   115     
       
   116     /**
       
   117      * Sets the new state for the popup.
       
   118      */
       
   119     void SetState( TPopupState aNewState );
       
   120 
       
   121     /**
       
   122      * Formats iap info for Connecting via -popup.
       
   123      */
       
   124     void FormatIapInfoL( TUint32 aIapId );
       
   125 
       
   126     /**
       
   127      * Prepares popup for error code.
       
   128      * @return ETrue when popup should be shown.
       
   129      */
       
   130     TBool ResolveErrorCodeL( TInt aErrorCode );
       
   131 
       
   132 private:
       
   133 
       
   134     // Popup dialog
       
   135     CHbDeviceNotificationDialogSymbian* iPopup;
       
   136     
       
   137     // The state of the popup
       
   138     TPopupState iPopupState;
       
   139     };
       
   140 
       
   141 #endif /* __CCONNECTIONSTATUSPOPUP_H_ */