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