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