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