|
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 TRAP_IGNORE( iWaitDialog->ProcessFinishedL() ); |
|
55 } |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CFLDWaitNote::DialogDismissedL |
|
60 // Gets called when the dialog is dismissed/closed. |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 void CFLDWaitNote::DialogDismissedL( const TInt /*aButtonId*/ ) |
|
64 { |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CFLDWaitNote::CloseWaitNoteL |
|
69 // Close the wait note dialog. |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 void CFLDWaitNote::CloseWaitNoteL() |
|
73 { |
|
74 // Close and delete the wait note dialog, |
|
75 // if it has not been dismissed yet |
|
76 if( iWaitDialog ) |
|
77 { |
|
78 iWaitDialog->ProcessFinishedL(); |
|
79 } |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CFLDWaitNote::OpenWaitNoteL |
|
84 // Open the wait note dialog. |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 void CFLDWaitNote::OpenWaitNoteL() |
|
88 { |
|
89 CloseWaitNoteL(); |
|
90 |
|
91 // Create and view the wait note dialog |
|
92 iWaitDialog = new (ELeave) CAknWaitDialog( |
|
93 reinterpret_cast<CEikDialog**>( &iWaitDialog ) ); |
|
94 iWaitDialog->SetCallback( this ); |
|
95 iWaitDialog->ExecuteLD( iWaitNoteResourceId ); // CSI: 50 # Pointer to iWaitDialog variable is given to iWaitDialog itself, so won't dare to set it NULL below |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CFLDWaitNote::IsRunning |
|
100 // Gets called by the model to see if the wait note (refresh) is already running. |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 TBool CFLDWaitNote::IsRunning() |
|
104 { |
|
105 if( iWaitDialog == NULL ) |
|
106 { |
|
107 return EFalse; |
|
108 } |
|
109 else |
|
110 { |
|
111 return ETrue; |
|
112 } |
|
113 } |
|
114 |
|
115 // End of File |