connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/nowlansdiscreetpopup.cpp
changeset 1 40cb640ef159
child 41 bbb64eb3bdee
equal deleted inserted replaced
0:5a93021fdf25 1:40cb640ef159
       
     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:  Implementation of CNoWlansDiscreetPopup.
       
    15  *
       
    16  */
       
    17 
       
    18 // INCLUDE FILES
       
    19 
       
    20 #include <akndiscreetpopup.h>
       
    21 #include <aknsconstants.hrh>
       
    22 #include <StringLoader.h>
       
    23 #include <avkon.hrh>
       
    24 #include <connectionuiutilities.mbg>
       
    25 #include <ConnUiUtilsNotif.rsg>
       
    26 
       
    27 #include "nowlansdiscreetpopup.h"
       
    28 
       
    29 
       
    30 // No discreet popup => Uid 0
       
    31 const TUid KDiscreetPopupUidNone =
       
    32     {
       
    33     0x0
       
    34     };
       
    35 
       
    36 // Path of the app's iconfile
       
    37 _LIT( KIconFileName, "\\resource\\apps\\connectionuiutilities.mif" );
       
    38 // Empty string
       
    39 _LIT( KEmpty, "");
       
    40 
       
    41 // ================= MEMBER FUNCTIONS =======================
       
    42 
       
    43 // ---------------------------------------------------------
       
    44 // CNoWlansDiscreetPopup::CNoWlansDiscreetPopup
       
    45 // ---------------------------------------------------------
       
    46 //
       
    47 CNoWlansDiscreetPopup::CNoWlansDiscreetPopup(
       
    48     CConnectionDialogsNotifBase* aNotif ) :
       
    49     CActive( EPriorityUserInput ), // Standard priority
       
    50     iNotif( aNotif )
       
    51     {
       
    52     }
       
    53 
       
    54 // ---------------------------------------------------------
       
    55 // CNoWlansDiscreetPopup::NewLC
       
    56 // ---------------------------------------------------------
       
    57 //
       
    58 CNoWlansDiscreetPopup* CNoWlansDiscreetPopup::NewLC(
       
    59     CConnectionDialogsNotifBase* aNotif )
       
    60     {
       
    61     CNoWlansDiscreetPopup* self =
       
    62             new (ELeave) CNoWlansDiscreetPopup( aNotif );
       
    63     CleanupStack::PushL( self );
       
    64     self->ConstructL();
       
    65     return self;
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------
       
    69 // CNoWlansDiscreetPopup::NewL
       
    70 // ---------------------------------------------------------
       
    71 //
       
    72 CNoWlansDiscreetPopup* CNoWlansDiscreetPopup::NewL(
       
    73     CConnectionDialogsNotifBase* aNotif )
       
    74     {
       
    75     CNoWlansDiscreetPopup* self =
       
    76             CNoWlansDiscreetPopup::NewLC( aNotif );
       
    77     CleanupStack::Pop(self);
       
    78     return self;
       
    79     }
       
    80 
       
    81 // ---------------------------------------------------------
       
    82 // CNoWlansDiscreetPopup::ConstructL
       
    83 // ---------------------------------------------------------
       
    84 //
       
    85 void CNoWlansDiscreetPopup::ConstructL()
       
    86     {
       
    87     CActiveScheduler::Add( this ); // Add to scheduler
       
    88     }
       
    89 
       
    90 // ---------------------------------------------------------
       
    91 // CNoWlansDiscreetPopup::~CNoWlansDiscreetPopup
       
    92 // ---------------------------------------------------------
       
    93 //
       
    94 CNoWlansDiscreetPopup::~CNoWlansDiscreetPopup()
       
    95     {
       
    96     Cancel(); // Cancel any request, if outstanding
       
    97     }
       
    98 
       
    99 // ---------------------------------------------------------
       
   100 // CNoWlansDiscreetPopup::DoCancel
       
   101 // ---------------------------------------------------------
       
   102 //
       
   103 void CNoWlansDiscreetPopup::DoCancel()
       
   104     {
       
   105     }
       
   106 
       
   107 // ---------------------------------------------------------
       
   108 // CNoWlansDiscreetPopup::StartL
       
   109 // ---------------------------------------------------------
       
   110 //
       
   111 void CNoWlansDiscreetPopup::StartL()
       
   112     {
       
   113     Cancel(); // Cancel any request, just to be sure
       
   114 
       
   115     SetActive(); // Tell scheduler a request is active
       
   116     iClientStatus = &iStatus;
       
   117     User::RequestComplete( iClientStatus, KErrNone );
       
   118 
       
   119     // Complete the note so client can continue its tasks
       
   120     // immediately
       
   121     iNotif->SetCancelledFlag( ETrue );
       
   122     iNotif->CompleteL( KErrNone );
       
   123     }
       
   124 
       
   125 // ---------------------------------------------------------
       
   126 // CNoWlansDiscreetPopup::RunL
       
   127 // ---------------------------------------------------------
       
   128 //
       
   129 void CNoWlansDiscreetPopup::RunL()
       
   130     {
       
   131     if ( iStatus == KErrNone )
       
   132         {
       
   133             
       
   134         // Load strings from resources
       
   135         HBufC* stringText1 = StringLoader::LoadLC( R_OCC_INFO_NO_WLAN_AVAILABLE );
       
   136         HBufC* stringText2 = KEmpty().AllocLC();
       
   137         	
       
   138         CAknDiscreetPopup::ShowGlobalPopupL(
       
   139         	    *stringText1,    // 1st text row
       
   140                 *stringText2,    // second text row
       
   141                 KAknsIIDDefault, // icon skin id
       
   142                 KIconFileName,   // bitmap file path
       
   143                 EMbmConnectionuiutilitiesQgn_prop_wlan_bearer,      // bitmap id
       
   144                 EMbmConnectionuiutilitiesQgn_prop_wlan_bearer_mask, // mask id
       
   145                 KAknDiscreetPopupDurationLong, // flags
       
   146                 0,    // command id
       
   147                 NULL, // command observer
       
   148                 KDiscreetPopupUidNone,  // application to be launched
       
   149                 KDiscreetPopupUidNone); // view to be activated
       
   150 
       
   151         CleanupStack::PopAndDestroy(2, stringText1);
       
   152         }
       
   153 
       
   154     // Cleanup
       
   155     iNotif->Cancel();
       
   156     }
       
   157 
       
   158 // ---------------------------------------------------------
       
   159 // CNoWlansDiscreetPopup::RunError
       
   160 // ---------------------------------------------------------
       
   161 //
       
   162 TInt CNoWlansDiscreetPopup::RunError( TInt aError )
       
   163     {
       
   164     return aError;
       
   165     }
       
   166