|
1 /* |
|
2 * Copyright (c) 2006 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: LandmarksUi Content File - Encapuslates the Wait dialog in an Active Object interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 #ifndef CLMWAITDLGLAUNCHER_H |
|
25 #define CLMWAITDLGLAUNCHER_H |
|
26 |
|
27 // System Includes |
|
28 #include <AknWaitDialog.h> |
|
29 #include <AknProgressDialog.h> |
|
30 #include <e32base.h> |
|
31 |
|
32 // Class Declaration |
|
33 /** |
|
34 * MLmkDlgMenuObserver class |
|
35 */ |
|
36 class MLmkWaitDialogLauncherObserver |
|
37 { |
|
38 public: // New functions |
|
39 virtual void HandleDialogDismissed( TInt aButtonId ) = 0; |
|
40 }; |
|
41 /** |
|
42 * Class used to encapsulate the AknWaitDialog in an Active object interface. |
|
43 * Provides the functionality to launch the Wait dialog in an asynchronous mode |
|
44 * so that the current running context is not blocked. |
|
45 */ |
|
46 NONSHARABLE_CLASS ( CLmkWaitDialogLauncher ) : public CActive, |
|
47 public MProgressDialogCallback |
|
48 { |
|
49 public: |
|
50 /** |
|
51 * Two phased constructor for creating the Wait dialog launcher. |
|
52 * |
|
53 * @return CLmkWaitDialogLauncher* Pointer to the created object. |
|
54 */ |
|
55 static CLmkWaitDialogLauncher* NewL(); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CLmkWaitDialogLauncher(); |
|
61 |
|
62 /** |
|
63 * Issues an asynchronous request to start the Wait dialog. The termination |
|
64 * of the dialog either when User terminated or when terminated using the |
|
65 * StopWaitingDialog call will be notified using the MProgressDialogCallback |
|
66 * observer object. |
|
67 */ |
|
68 void StartWaitDialogL(); |
|
69 |
|
70 /** |
|
71 * Issues an asynchronous request to the stop the running Wait dialog. The |
|
72 * actual dismissal of the dialog will be communicated using the |
|
73 * MProgressDialogCallback observer object. |
|
74 * |
|
75 * @return TInt The Button ID with which the dialog was dismissed |
|
76 */ |
|
77 TInt StopWaitDialogL(); |
|
78 |
|
79 /** |
|
80 * Sets an observer, so that, client can be notified about the |
|
81 * button id, after the dialog dismissal. |
|
82 */ |
|
83 void SetObserver( MLmkWaitDialogLauncherObserver* aObserver); |
|
84 |
|
85 private: |
|
86 /** |
|
87 * Inherited from MProgressDialogCallback. The scope of the function is |
|
88 * made private since, this should be called only from the |
|
89 * MProgressDialogCallback interface and from the Wait dialog alone. |
|
90 */ |
|
91 void DialogDismissedL( TInt aButtonId ); |
|
92 |
|
93 private: |
|
94 /** |
|
95 * Overloaded C++ constructor |
|
96 */ |
|
97 CLmkWaitDialogLauncher(); |
|
98 |
|
99 /** |
|
100 * Second phase constructor |
|
101 */ |
|
102 void ConstructL(); |
|
103 |
|
104 protected: |
|
105 /** |
|
106 * Inherited from CActive |
|
107 */ |
|
108 void RunL(); |
|
109 |
|
110 /** |
|
111 * Inherited from CActive |
|
112 */ |
|
113 void DoCancel(); |
|
114 |
|
115 private: |
|
116 |
|
117 /** |
|
118 * Button ID with which the dialog was cancelled |
|
119 */ |
|
120 TInt iButtonId; |
|
121 |
|
122 /** |
|
123 * Wait Note |
|
124 * Owns |
|
125 */ |
|
126 CAknWaitDialog* iWaitNote; |
|
127 |
|
128 /** |
|
129 * Active Scheduler re-loop to make Stop synchronous |
|
130 */ |
|
131 CActiveSchedulerWait* iSchedWait; |
|
132 /** |
|
133 * ref |
|
134 * Observer for callback, when the dialog is dissmissed. |
|
135 */ |
|
136 MLmkWaitDialogLauncherObserver* iObserver; |
|
137 }; |
|
138 |
|
139 #endif // CLMWAITDLGLAUNCHER_H |
|
140 |
|
141 // End of File |