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: Helper class for wait notes |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVIMPSTUTILSWAITNOTE_H |
|
21 #define CVIMPSTUTILSWAITNOTE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <AknWaitDialog.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 |
|
31 // Observer class to notice dismissing note by cancel. |
|
32 class MVIMPSTUtilsWaitNoteObserver |
|
33 { |
|
34 public: // Interface methods |
|
35 |
|
36 /** |
|
37 * Wait note is canceled. |
|
38 */ |
|
39 virtual void NoteCanceled( TInt aButtonId ) = 0; |
|
40 }; |
|
41 |
|
42 /** |
|
43 * Helper class for wait notes |
|
44 * |
|
45 * @lib chat.exe |
|
46 * @since |
|
47 */ |
|
48 class CVIMPSTUtilsWaitNote : public CBase, public MProgressDialogCallback |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Shows waitnote and pushes the item to cleanupstack |
|
54 * |
|
55 * @param aText Text to be shown in note. |
|
56 * @param aShowImmediately If ETrue waitnote is shown immediately |
|
57 * (not after 1 sec delay) |
|
58 * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not |
|
59 */ |
|
60 IMPORT_C static CVIMPSTUtilsWaitNote* ShowWaitNoteLC( const TDesC& aText, |
|
61 TBool aShowImmediately = EFalse, |
|
62 TBool aCanBeCanceledByUser = EFalse, |
|
63 MVIMPSTUtilsWaitNoteObserver* aObserver = NULL ); |
|
64 |
|
65 /** |
|
66 * Shows waitnote,does not leave anything to cleanupstack. |
|
67 * |
|
68 * @param aText Text to be shown in note. |
|
69 * @param aShowImmediately If ETrue waitnote is shown immediately |
|
70 * (not after 1 sec delay) |
|
71 * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not |
|
72 */ |
|
73 IMPORT_C static CVIMPSTUtilsWaitNote* ShowWaitNoteL( const TDesC& aText, |
|
74 TBool aShowImmediately = EFalse, |
|
75 TBool aCanBeCanceledByUser = EFalse, |
|
76 MVIMPSTUtilsWaitNoteObserver* aObserver = NULL ); |
|
77 |
|
78 |
|
79 /** |
|
80 * Shows waitnote and pushes the item to cleanupstack |
|
81 * |
|
82 * @param aTextResource Resource id of text to be shown in note. |
|
83 * @param aShowImmediately If ETrue waitnote is shown immediately |
|
84 * (not after 1 sec delay) |
|
85 * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not |
|
86 */ |
|
87 IMPORT_C static CVIMPSTUtilsWaitNote* ShowWaitNoteLC( TInt aTextResource, |
|
88 TBool aShowImmediately = EFalse, |
|
89 TBool aCanBeCanceledByUser = EFalse, |
|
90 MVIMPSTUtilsWaitNoteObserver* aObserver = NULL ); |
|
91 |
|
92 /** |
|
93 * Shows waitnote, does not leave anything to cleanupstack. |
|
94 * |
|
95 * @param aTextResource Resource id of text to be shown in note. |
|
96 * @param aShowImmediately If ETrue waitnote is shown immediately |
|
97 * (not after 1 sec delay) |
|
98 * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not |
|
99 */ |
|
100 IMPORT_C static CVIMPSTUtilsWaitNote* ShowWaitNoteL( TInt aTextResource, |
|
101 TBool aShowImmediately = EFalse, |
|
102 TBool aCanBeCanceledByUser = EFalse, |
|
103 MVIMPSTUtilsWaitNoteObserver* aObserver = NULL ); |
|
104 /** |
|
105 * Destructor. |
|
106 */ |
|
107 virtual ~CVIMPSTUtilsWaitNote(); |
|
108 |
|
109 protected: // From MProgressDialogCallback |
|
110 |
|
111 /** |
|
112 * From MProgressDialogCallback Get's called when a dialog is dismissed |
|
113 * @param aButtonId Button that was used to dismiss the dialog |
|
114 */ |
|
115 IMPORT_C void DialogDismissedL( TInt aButtonId ); |
|
116 |
|
117 |
|
118 public: // New functions |
|
119 |
|
120 /** |
|
121 * Dismisses this waitnote |
|
122 */ |
|
123 IMPORT_C void DismissDialog(); |
|
124 |
|
125 |
|
126 private: |
|
127 |
|
128 /** |
|
129 * C++ default constructor. |
|
130 */ |
|
131 CVIMPSTUtilsWaitNote(); |
|
132 |
|
133 /** |
|
134 * By default Symbian 2nd phase constructor is private. |
|
135 */ |
|
136 void ConstructL( const TDesC& aText, |
|
137 TBool aShowImmediately, |
|
138 TBool aCanBeCanceledByUser, |
|
139 MVIMPSTUtilsWaitNoteObserver* aObserver ); |
|
140 |
|
141 public: // New methods |
|
142 |
|
143 /** |
|
144 * Set wait note observer. NULL will unset this one. |
|
145 */ |
|
146 IMPORT_C void SetObserver( MVIMPSTUtilsWaitNoteObserver* aObserver ); |
|
147 |
|
148 private: // Data |
|
149 |
|
150 // Doesn't own (destroys itself) |
|
151 CAknWaitDialog* iWaitDialog; |
|
152 |
|
153 /// Wait note observer. This will be notified when wait note is dismissed. |
|
154 MVIMPSTUtilsWaitNoteObserver* iObserver; |
|
155 }; |
|
156 |
|
157 #endif // CCAWAITNOTE_H |
|
158 |
|
159 // End of File |
|