connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/OfflineWlanNoteDlg.cpp
changeset 0 5a93021fdf25
child 1 40cb640ef159
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     1 /*
       
     2 * Copyright (c) 2005 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 class COfflineWlanNoteDlg.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "OfflineWlanNoteDlg.h"
       
    21 #include "OfflineWlanNoteNotif.h"
       
    22 #include "ExpiryTimer.h"
       
    23 #include <uikon/eiksrvui.h>
       
    24 
       
    25 
       
    26 
       
    27 // CONSTANTS
       
    28 #if defined(_DEBUG)
       
    29 _LIT( KErrNullPointer, "NULL pointer" );
       
    30 #endif
       
    31 
       
    32 
       
    33 // ================= MEMBER FUNCTIONS =======================
       
    34 //
       
    35 // ---------------------------------------------------------
       
    36 // COfflineWlanNoteDlg::COfflineWlanNoteDlg
       
    37 // ---------------------------------------------------------
       
    38 //
       
    39 COfflineWlanNoteDlg::COfflineWlanNoteDlg( COfflineWlanNoteNotif* aNotif )
       
    40 : iNotif( aNotif )    
       
    41     {
       
    42     }
       
    43     
       
    44     
       
    45 // ---------------------------------------------------------
       
    46 // COfflineWlanNoteDlg::~COfflineWlanNoteDlg
       
    47 // ---------------------------------------------------------
       
    48 //
       
    49 COfflineWlanNoteDlg::~COfflineWlanNoteDlg()
       
    50     {
       
    51     STATIC_CAST( CEikServAppUi*, 
       
    52                 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse );
       
    53     delete iExpiryTimer;
       
    54     }
       
    55 
       
    56 
       
    57 
       
    58 // ---------------------------------------------------------
       
    59 // COfflineWlanNoteDlg::OkToExitL
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 TBool COfflineWlanNoteDlg::OkToExitL( TInt aButtonId )
       
    63     {
       
    64     TInt status = KErrCancel;
       
    65     if (aButtonId == EAknSoftkeyYes || aButtonId == EAknSoftkeyDone || 
       
    66         aButtonId == EAknSoftkeyOk )
       
    67         {
       
    68         status = KErrNone;
       
    69         }
       
    70 
       
    71     __ASSERT_DEBUG( iNotif, User::Panic( KErrNullPointer, KErrNone ) );
       
    72     iNotif->CompleteL( status );
       
    73 
       
    74     return ETrue;
       
    75     }
       
    76     
       
    77     
       
    78 // ---------------------------------------------------------
       
    79 // COfflineWlanNoteDlg::PreLayoutDynInitL()
       
    80 // ---------------------------------------------------------
       
    81 //
       
    82 void COfflineWlanNoteDlg::PreLayoutDynInitL()
       
    83     {
       
    84     
       
    85     CAknQueryDialog::PreLayoutDynInitL();
       
    86 
       
    87     STATIC_CAST( CEikServAppUi*, 
       
    88                 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue );
       
    89     iExpiryTimer = CExpiryTimer::NewL( *this );
       
    90     iExpiryTimer->Start();
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------
       
    94 // COfflineWlanNoteDlg::NeedToDismissQueryL
       
    95 // ---------------------------------------------------------
       
    96 //
       
    97 TBool COfflineWlanNoteDlg::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
       
    98     {
       
    99     if (aKeyEvent.iCode == EKeyPhoneSend)
       
   100         {
       
   101         TryExitL(EEikBidCancel);
       
   102         return ETrue;
       
   103         }
       
   104         
       
   105     return EFalse;
       
   106     }
       
   107 
       
   108 
       
   109 void COfflineWlanNoteDlg::HandleTimedOut()
       
   110     {
       
   111     TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) );
       
   112     }
       
   113 // End of File