|
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: Implementation of the CFLDWaitNote. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // CLASS HEADER |
|
21 #include "CFLDWaitNote.h" |
|
22 |
|
23 // ============================ MEMBER FUNCTIONS =============================== |
|
24 |
|
25 // ----------------------------------------------------------------------------- |
|
26 // CFLDWaitNote::CFLDWaitNote |
|
27 // C++ default constructor can NOT contain any code, that |
|
28 // might leave. |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 CFLDWaitNote::CFLDWaitNote( const TInt aWaitNoteResourceId ) |
|
32 : iWaitNoteResourceId (aWaitNoteResourceId) |
|
33 { |
|
34 } |
|
35 |
|
36 // ----------------------------------------------------------------------------- |
|
37 // CFLDWaitNote::NewL |
|
38 // Two-phased constructor. |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 CFLDWaitNote* CFLDWaitNote::NewL( const TInt aWaitNoteResourceId ) |
|
42 { |
|
43 CFLDWaitNote* self = new (ELeave) CFLDWaitNote( aWaitNoteResourceId ); |
|
44 return self; |
|
45 } |
|
46 |
|
47 // Destructor |
|
48 CFLDWaitNote::~CFLDWaitNote() |
|
49 { |
|
50 if( iWaitDialog ) |
|
51 { |
|
52 // Do not delete CAknWaitDialog object: |
|
53 // CAknWaitDialog::ProcessFinishedL should be used instead. |
|
54 iWaitDialog->SetCallback( NULL ); |
|
55 TRAP_IGNORE( iWaitDialog->ProcessFinishedL() ); |
|
56 } |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CFLDWaitNote::DialogDismissedL |
|
61 // Gets called when the dialog is dismissed/closed. |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 void CFLDWaitNote::DialogDismissedL( const TInt /*aButtonId*/ ) |
|
65 { |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // CFLDWaitNote::CloseWaitNoteL |
|
70 // Close the wait note dialog. |
|
71 // ----------------------------------------------------------------------------- |
|
72 // |
|
73 void CFLDWaitNote::CloseWaitNoteL() |
|
74 { |
|
75 // Close and delete the wait note dialog, |
|
76 // if it has not been dismissed yet |
|
77 if( iWaitDialog ) |
|
78 { |
|
79 iWaitDialog->ProcessFinishedL(); |
|
80 } |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CFLDWaitNote::OpenWaitNoteL |
|
85 // Open the wait note dialog. |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 void CFLDWaitNote::OpenWaitNoteL() |
|
89 { |
|
90 CloseWaitNoteL(); |
|
91 |
|
92 // Create and view the wait note dialog |
|
93 iWaitDialog = new (ELeave) CAknWaitDialog( |
|
94 reinterpret_cast<CEikDialog**>( &iWaitDialog ) ); |
|
95 iWaitDialog->SetCallback( this ); |
|
96 iWaitDialog->ExecuteLD( iWaitNoteResourceId ); // CSI: 50 # Pointer to iWaitDialog variable is given to iWaitDialog itself, so won't dare to set it NULL below |
|
97 } |
|
98 |
|
99 // ----------------------------------------------------------------------------- |
|
100 // CFLDWaitNote::IsRunning |
|
101 // Gets called by the model to see if the wait note (refresh) is already running. |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 TBool CFLDWaitNote::IsRunning() |
|
105 { |
|
106 if( iWaitDialog == NULL ) |
|
107 { |
|
108 return EFalse; |
|
109 } |
|
110 else |
|
111 { |
|
112 return ETrue; |
|
113 } |
|
114 } |
|
115 |
|
116 // End of File |