|
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: Wait note dialog for formatting |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <StringLoader.h> |
|
21 #include <avkon.rsg> |
|
22 #include <avkon.mbg> |
|
23 #include <aknconsts.h> |
|
24 #include <mpxcollectionmessage.h> |
|
25 #include <mpxwaitnotedialog.rsg> |
|
26 #include <mpxcollectionframeworkdefs.h> |
|
27 #include <mpxlog.h> |
|
28 #include <mpxcollectionutility.h> |
|
29 #include <mpxmessagegeneraldefs.h> |
|
30 #include "mpxformatdialog.h" |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // Constructor |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 CMPXFormattingWaitDialog::CMPXFormattingWaitDialog( MMPXWaitNoteObserver* aObs ) |
|
37 : CMPXWaitNoteDialog ( aObs, |
|
38 EMPXFormatScanningNote, |
|
39 EFalse ) |
|
40 { |
|
41 } |
|
42 |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // 2nd Phased constructor |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 void CMPXFormattingWaitDialog::ConstructL() |
|
49 { |
|
50 BaseConstructL(); |
|
51 } |
|
52 |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // Two-Phased Constructor |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 CMPXFormattingWaitDialog* CMPXFormattingWaitDialog::NewL( MMPXWaitNoteObserver* aObs ) |
|
59 { |
|
60 CMPXFormattingWaitDialog* self = new(ELeave) CMPXFormattingWaitDialog( aObs ); |
|
61 CleanupStack::PushL( self ); |
|
62 self->ConstructL(); |
|
63 CleanupStack::Pop( self ); |
|
64 return self; |
|
65 } |
|
66 |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // Destructor |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 CMPXFormattingWaitDialog::~CMPXFormattingWaitDialog() |
|
73 { |
|
74 } |
|
75 |
|
76 |
|
77 // --------------------------------------------------------------------------- |
|
78 // Setup Wait Notes |
|
79 // --------------------------------------------------------------------------- |
|
80 // |
|
81 void CMPXFormattingWaitDialog::PreNoteDisplayHandleL() |
|
82 { |
|
83 // CBA |
|
84 SetCBAL( R_AVKON_SOFTKEYS_EMPTY ); |
|
85 |
|
86 // Text |
|
87 HBufC* text = StringLoader::LoadLC( R_MPX_FORMATTING_TXT ); |
|
88 SetTextL( *text ); |
|
89 CleanupStack::PopAndDestroy( text ); |
|
90 |
|
91 // Icon |
|
92 TNoteIconInfo icon( (TInt)EMbmAvkonQgn_note_progress, |
|
93 (TInt)EMbmAvkonQgn_note_progress_mask, |
|
94 TFileName(KAvkonBitmapFile) ); |
|
95 SetIconL( icon ); |
|
96 } |
|
97 |
|
98 |
|
99 // --------------------------------------------------------------------------- |
|
100 // Handle Collection Messages |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 void CMPXFormattingWaitDialog::HandleCollectionMessage( CMPXMessage* aMessage, |
|
104 TInt aError ) |
|
105 { |
|
106 TRAP_IGNORE( DoHandleCollectionMessageL( *aMessage, aError ) ); |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------------------------- |
|
110 // Handle Collection Messages |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 void CMPXFormattingWaitDialog::DoHandleCollectionMessageL( const CMPXMessage& aMessage, |
|
114 TInt /*aError*/ ) |
|
115 { |
|
116 MPX_FUNC( "CMPXFormattingWaitDialog::DoHandleCollectionMessageL" ); |
|
117 TMPXMessageId id( aMessage.ValueTObjectL<TMPXMessageId>( KMPXMessageGeneralId ) ); |
|
118 if ( KMPXMessageGeneral == id ) |
|
119 { |
|
120 TInt event( aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralEvent ) ); |
|
121 TInt op( aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralType ) ); |
|
122 TInt data( aMessage.ValueTObjectL<TInt>( KMPXMessageGeneralData ) ); |
|
123 |
|
124 if( event == TMPXCollectionMessage::EBroadcastEvent && |
|
125 op == EMcMsgFormatEnd ) |
|
126 { |
|
127 MPX_DEBUG1("CMPXFormattingWaitDialog::DoHandleCollectionMessageL -- killing dialog"); |
|
128 if( iWaitDialog ) |
|
129 { |
|
130 iWaitDialog->ProcessFinishedL(); |
|
131 } |
|
132 } |
|
133 } |
|
134 } |
|
135 |
|
136 // End of File |