syncmlfw/syncmlnotifier/src/SyncMLQueryDialog.cpp
changeset 49 689a71addb96
parent 48 7e865e817571
child 50 a36219ae6585
equal deleted inserted replaced
48:7e865e817571 49:689a71addb96
     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 the query dialog.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "SyncMLQueryDialog.h"
       
    22 #include "SyncMLNotifDebug.h"
       
    23 
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CSyncMLQueryDialog::CSyncMLQueryDialog
       
    29 // C++ default constructor can NOT contain any code, that
       
    30 // might leave.
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 CSyncMLQueryDialog::CSyncMLQueryDialog(TBool& aKeyPress  ):iKeyPress(aKeyPress)
       
    34     
       
    35     {
       
    36     }
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CSyncMLQueryDialog::NewL
       
    40 // Two-phased constructor.
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CSyncMLQueryDialog* CSyncMLQueryDialog::NewL(TBool& aKeyPress )
       
    44     {
       
    45     CSyncMLQueryDialog* self =
       
    46         new( ELeave ) CSyncMLQueryDialog (aKeyPress  );
       
    47     
       
    48     return self;
       
    49     }
       
    50 
       
    51     
       
    52 // -----------------------------------------------------------------------------
       
    53 // CSyncMLQueryDialog::~CSyncMLQueryDialog
       
    54 // Destructor.
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 CSyncMLQueryDialog::~CSyncMLQueryDialog()
       
    58     {
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CSyncMLQueryDialog::OkToExitL
       
    63 // Determines if the dialog can be closed.
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 TBool CSyncMLQueryDialog::OkToExitL( TInt aButtonId )
       
    67     {
       
    68     return CAknQueryDialog::OkToExitL( aButtonId );
       
    69     }
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 // CSyncMLQueryDialog::NeedToDismissQueryL
       
    73 // Called by OfferkeyEventL(), gives a change to dismiss the query even with
       
    74 // keys different than Enter of Ok.
       
    75 // -----------------------------------------------------------------------------
       
    76 // 
       
    77 TBool CSyncMLQueryDialog::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
       
    78     {
       
    79     if (aKeyEvent.iCode == EKeyNo)
       
    80         {
       
    81         iKeyPress=ETrue;
       
    82 		DismissQueryL();
       
    83         return ETrue;
       
    84         }
       
    85     return EFalse;
       
    86     }
       
    87 
       
    88 //  End of File