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: Query dialog with timeout. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CSYNCMLTIMEDQUERYDIALOG_H |
|
21 #define CSYNCMLTIMEDQUERYDIALOG_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.0 |
|
39 */ |
|
40 NONSHARABLE_CLASS ( CSyncMLTimedQueryDialog ) : public CAknQueryDialog, |
|
41 public MSyncMLQueryTimerObserver |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CSyncMLTimedQueryDialog* NewL( |
|
49 const TDesC& aMessage, |
|
50 TInt aTimeout = KSyncMLNNoTimeout ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CSyncMLTimedQueryDialog(); |
|
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 private: |
|
88 |
|
89 /** |
|
90 * C++ default constructor. |
|
91 */ |
|
92 CSyncMLTimedQueryDialog( TInt aTimeout = KSyncMLNNoTimeout ); |
|
93 |
|
94 private: // Data |
|
95 // Number of seconds before the query is timed out. 0 = no timeout. |
|
96 TInt iTimeout; |
|
97 |
|
98 // Pointer to the timer instance |
|
99 CSyncMLQueryTimer* iTimer; |
|
100 }; |
|
101 |
|
102 #endif // CSYNCMLTIMEDQUERYDIALOG_H |
|
103 |
|
104 // End of File |
|