syncmlfw/syncmlnotifier/inc/SyncMLTimedNumberQueryDialog.h
branchRCL_3
changeset 26 19bba8228ff0
parent 0 b497e44ab2fc
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Number Query dialog with timeout.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSYNCMLTIMEDNUMBERQUERYDIALOG_H
       
    21 #define CSYNCMLTIMEDNUMBERQUERYDIALOG_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknQueryDialog.h>
       
    25 
       
    26 #include "SyncMLQueryTimer.h"
       
    27 #include "SyncMLTimedMessageQuery.h"
       
    28 
       
    29 // CONSTANTS
       
    30 const TInt KSyncMLNotifierTimeout = 300; // 5 min timeout
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Message query with timeout.
       
    36 *
       
    37 *  @lib SyncMLNotifier
       
    38 *  @since Series 60 3.2
       
    39 */
       
    40 NONSHARABLE_CLASS ( CSyncMLTimedNumberQueryDialog ) : public CAknFloatingPointQueryDialog,
       
    41                                                  public MSyncMLQueryTimerObserver
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44         
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         */
       
    48         static CSyncMLTimedNumberQueryDialog* NewL(
       
    49             TReal& aValue, const TDesC& aIptext,TBool& aKeypress, 
       
    50                   TInt   aTimeout = KSyncMLNNoTimeout );
       
    51         
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55         virtual ~CSyncMLTimedNumberQueryDialog();
       
    56        
       
    57 
       
    58     public: // Functions from base classes
       
    59 
       
    60         /**
       
    61         * From MSyncMLQueryTimerObserver Is called when the timer
       
    62         * runs out.
       
    63         * @since Series 60 3.0
       
    64         * @param None
       
    65         * @return None
       
    66         */
       
    67         void TimerExpired();
       
    68         
       
    69     protected:  // Functions from base classes
       
    70         
       
    71         /**
       
    72         * From CEikDialog Starts the dialog timer.
       
    73         * Called after the dialog is laid out.
       
    74         * @since Series 60 3.0
       
    75         * @param None
       
    76         * @return None
       
    77         */
       
    78         void PostLayoutDynInitL();
       
    79 
       
    80         /**
       
    81         * From CEikDialog Determines if the dialog can be closed.
       
    82         * @since Series 60 3.0
       
    83         * @param aButtonId Identifier of the button pressed.
       
    84         * @return None
       
    85         */
       
    86         TBool OkToExitL( TInt aButtonId );
       
    87         
       
    88         /** 
       
    89         * Called by OfferkeyEventL(), gives a change to dismiss the query even with 
       
    90         * keys different than Enter of Ok. 
       
    91         */ 
       
    92         TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
       
    93         
       
    94         /**
       
    95         * Called by NeedToDismissQueryL(), gives a change to either accept or reject
       
    96         * the query. Default implementation is to accept the query if the Left soft
       
    97         * key is displayed and reject it otherwise. Left softkey is only displayed if
       
    98         * the query has valid data into it.
       
    99         */
       
   100         void DismissQueryL();
       
   101         
       
   102     private:
       
   103 
       
   104         /**
       
   105         * C++ default constructor.
       
   106         */
       
   107         CSyncMLTimedNumberQueryDialog( TReal& aValue, TBool& aKeypress, TInt aTimeout = KSyncMLNNoTimeout );
       
   108 
       
   109     private:    // Data
       
   110         // Number of seconds before the query is timed out. 0 = no timeout.
       
   111         TInt               iTimeout;
       
   112 
       
   113         // Pointer to the timer instance
       
   114         CSyncMLQueryTimer*  iTimer;
       
   115      public:   
       
   116         //Detecting the key press
       
   117          TBool iKeypress;
       
   118     };
       
   119 
       
   120 #endif      // CSYNCMLTIMEDQUERYDIALOG_H   
       
   121             
       
   122 // End of File