1 /* |
|
2 * Copyright (c) 2009 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 CConnectionErrorDiscreetPopupNotif. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "connectionerrordiscreetpopupnotif.h" |
|
20 #include "connectionerrordiscreetpopup.h" |
|
21 #include "ConnUiUtilsNotif.h" |
|
22 #include "ConnectionDialogsUidDefs.h" |
|
23 #include "ConnectionUiUtilitiesCommon.h" |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 |
|
27 // --------------------------------------------------------- |
|
28 // CConnectionErrorDiscreetPopupNotif::TNotifierInfo |
|
29 // CConnectionErrorDiscreetPopupNotif::RegisterL() |
|
30 // --------------------------------------------------------- |
|
31 // |
|
32 CConnectionErrorDiscreetPopupNotif::TNotifierInfo |
|
33 CConnectionErrorDiscreetPopupNotif::RegisterL() |
|
34 { |
|
35 iInfo.iUid = KUidConnectionErrorDiscreetPopup; |
|
36 iInfo.iPriority = ENotifierPriorityVHigh; |
|
37 iInfo.iChannel = KUidConnectionErrorDiscreetPopup; |
|
38 |
|
39 return iInfo; |
|
40 } |
|
41 |
|
42 // --------------------------------------------------------- |
|
43 // void CConnectionErrorDiscreetPopupNotif::StartL() |
|
44 // --------------------------------------------------------- |
|
45 // |
|
46 void CConnectionErrorDiscreetPopupNotif::StartL( const TDesC8& aBuffer, |
|
47 TInt aReplySlot, const RMessagePtr2& aMessage ) |
|
48 { |
|
49 if ( iActiveNote ) |
|
50 { |
|
51 // Note is already active |
|
52 aMessage.Complete( KErrNone ); |
|
53 return; |
|
54 } |
|
55 iReplySlot = aReplySlot; |
|
56 iMessage = aMessage; |
|
57 iCancelled = EFalse; |
|
58 |
|
59 iActiveNote = CConnectionErrorDiscreetPopup::NewL( this ); |
|
60 |
|
61 TPckgBuf<TUint32> data; |
|
62 data.Copy( aBuffer ); |
|
63 |
|
64 iActiveNote->StartL( data() ); |
|
65 iCancelled = EFalse; |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------- |
|
69 // void CConnectionErrorDiscreetPopupNotif::CompleteL( TInt aStatus ) |
|
70 // --------------------------------------------------------- |
|
71 // |
|
72 void CConnectionErrorDiscreetPopupNotif::CompleteL( TInt aStatus ) |
|
73 { |
|
74 iCancelled = ETrue; |
|
75 if ( !iMessage.IsNull() ) |
|
76 { |
|
77 iMessage.Complete( aStatus ); |
|
78 } |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------- |
|
82 // CConnectionErrorDiscreetPopupNotif* |
|
83 // CConnectionErrorDiscreetPopupNotif::NewL() |
|
84 // --------------------------------------------------------- |
|
85 // |
|
86 CConnectionErrorDiscreetPopupNotif* CConnectionErrorDiscreetPopupNotif::NewL( |
|
87 const TBool aResourceFileResponsible ) |
|
88 { |
|
89 CConnectionErrorDiscreetPopupNotif* self = |
|
90 new (ELeave) CConnectionErrorDiscreetPopupNotif(); |
|
91 CleanupStack::PushL( self ); |
|
92 self->ConstructL( KResourceFileName, aResourceFileResponsible ); |
|
93 CleanupStack::Pop( self ); |
|
94 |
|
95 return self; |
|
96 } |
|
97 |
|
98 // --------------------------------------------------------- |
|
99 // CConnectionErrorDiscreetPopupNotif::CConnectionErrorDiscreetPopupNotif() |
|
100 // --------------------------------------------------------- |
|
101 // |
|
102 CConnectionErrorDiscreetPopupNotif::CConnectionErrorDiscreetPopupNotif() : |
|
103 CConnectionDialogsNotifBase(), iActiveNote( NULL ) |
|
104 { |
|
105 } |
|
106 |
|
107 // --------------------------------------------------------- |
|
108 // void CConnectionErrorDiscreetPopupNotif::Cancel() |
|
109 // --------------------------------------------------------- |
|
110 // |
|
111 void CConnectionErrorDiscreetPopupNotif::Cancel() |
|
112 { |
|
113 if ( !iCancelled ) |
|
114 { |
|
115 iCancelled = ETrue; |
|
116 if ( !iMessage.IsNull() ) |
|
117 { |
|
118 iMessage.Complete( KErrCancel ); |
|
119 } |
|
120 } |
|
121 if ( iActiveNote ) |
|
122 { |
|
123 delete iActiveNote; |
|
124 iActiveNote = NULL; |
|
125 } |
|
126 } |
|
127 |
|
128 // End of File |
|