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: DCMO Notifier Aob |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "dcmonotifieraob.h" |
|
20 #include "dcmoserver.h" |
|
21 #include "dcmodebug.h" |
|
22 |
|
23 |
|
24 // -------------------------------------------------------------------------- |
|
25 // CDCMONotifierAob* CDCMONotifierAob::NewL( CAknGlobalMsgQuery& aGlobalMsgQuery ) |
|
26 // -------------------------------------------------------------------------- |
|
27 // |
|
28 CDCMONotifierAob* CDCMONotifierAob::NewL( ) |
|
29 { |
|
30 RDEBUG("CDCMONotifierAob::NewL begin"); |
|
31 CDCMONotifierAob* self = new (ELeave) CDCMONotifierAob( ); |
|
32 CleanupStack::PushL(self); |
|
33 self->ConstructL(); |
|
34 CleanupStack::Pop(); // self |
|
35 RDEBUG("CDCMONotifierAob::NewL end"); |
|
36 return self; |
|
37 } |
|
38 |
|
39 // -------------------------------------------------------------------------- |
|
40 // CDCMONotifierAob::CDCMONotifierAob( CAknGlobalMsgQuery& aGlobalMsgQuery ) |
|
41 // -------------------------------------------------------------------------- |
|
42 // |
|
43 CDCMONotifierAob::CDCMONotifierAob( ) |
|
44 :CActive( EPriorityStandard ) //EPriorityNormal ) |
|
45 { |
|
46 RDEBUG("CDCMONotifierAob::constructor"); |
|
47 } |
|
48 |
|
49 |
|
50 // -------------------------------------------------------------------------- |
|
51 // void CDCMONotifierAob::ConstructL() |
|
52 // -------------------------------------------------------------------------- |
|
53 // |
|
54 void CDCMONotifierAob::ConstructL() |
|
55 { |
|
56 RDEBUG("CDCMONotifierAob::ConstructL begin"); |
|
57 iGlobalMsgQuery = NULL; |
|
58 CActiveScheduler::Add(this); |
|
59 RDEBUG("CDCMONotifierAob::ConstructL end"); |
|
60 } |
|
61 |
|
62 // -------------------------------------------------------------------------- |
|
63 // CDCMONotifierAob::~CDCMONotifierAob() |
|
64 // -------------------------------------------------------------------------- |
|
65 // |
|
66 CDCMONotifierAob::~CDCMONotifierAob() |
|
67 { |
|
68 RDEBUG("CDCMONotifierAob::~CDCMONotifierAob begin"); |
|
69 if( iGlobalMsgQuery ) |
|
70 { |
|
71 delete iGlobalMsgQuery ; |
|
72 iGlobalMsgQuery = NULL; |
|
73 } |
|
74 RDEBUG("CDCMONotifierAob::~CDCMONotifierAob end"); |
|
75 } |
|
76 |
|
77 // -------------------------------------------------------------------------- |
|
78 // void CDCMONotifierAob::RunL() |
|
79 // -------------------------------------------------------------------------- |
|
80 // |
|
81 void CDCMONotifierAob::RunL() |
|
82 { |
|
83 RDEBUG("CDCMONotifierAob::RunL() : Begin"); |
|
84 |
|
85 if(iStatus == EAknSoftkeyOk) |
|
86 { |
|
87 RDEBUG("CDCMONotifierAob::RunL() : EAknSoftkeyOk"); |
|
88 delete iGlobalMsgQuery ; |
|
89 iGlobalMsgQuery = NULL; |
|
90 if( CDCMOServer::iSessionCount == 0) |
|
91 CActiveScheduler::Stop(); |
|
92 } |
|
93 |
|
94 RDEBUG("CDCMONotifierAob::RunL() : End"); |
|
95 } |
|
96 |
|
97 // -------------------------------------------------------------------------- |
|
98 // void CDCMONotifierAob::DoCancel() |
|
99 // -------------------------------------------------------------------------- |
|
100 // |
|
101 void CDCMONotifierAob::DoCancel() |
|
102 { |
|
103 RDEBUG("CDCMONotifierAob::DoCancel() : Begin"); |
|
104 iGlobalMsgQuery->CancelMsgQuery(); |
|
105 delete iGlobalMsgQuery ; |
|
106 iGlobalMsgQuery = NULL; |
|
107 RDEBUG("CDCMONotifierAob::DoCancel() : End"); |
|
108 } |
|
109 |
|
110 // -------------------------------------------------------------------------- |
|
111 // void CDCMONotifierAob::ShowNotifierL( TDesC& aString ) |
|
112 // -------------------------------------------------------------------------- |
|
113 // |
|
114 void CDCMONotifierAob::ShowNotifierL( TDesC& aString ) |
|
115 { |
|
116 RDEBUG("CDCMONotifierAob::ShowNotifierL() : Begin"); |
|
117 if( !iGlobalMsgQuery ) |
|
118 iGlobalMsgQuery = CAknGlobalMsgQuery::NewL(); |
|
119 if (!IsActive()) |
|
120 { |
|
121 iStatus = KRequestPending; |
|
122 |
|
123 iGlobalMsgQuery->ShowMsgQueryL( |
|
124 iStatus, |
|
125 aString, |
|
126 R_AVKON_SOFTKEYS_OK_EMPTY, //R_AVKON_SOFTKEYS_OK_EMPTY, //R_AVKON_SOFTKEYS_OK_CANCEL, |
|
127 KNullDesC, |
|
128 KNullDesC); |
|
129 SetActive(); |
|
130 } |
|
131 RDEBUG("CDCMONotifierAob::ShowNotifierL() : End"); |
|
132 } |
|
133 |
|
134 // ----------------------------------------------------------------------------- |
|
135 // CDCMONotifierAob::RunError |
|
136 // Called when RunL leaves |
|
137 // This method can't leave |
|
138 // ----------------------------------------------------------------------------- |
|
139 |
|
140 TInt CDCMONotifierAob::RunError(TInt /* aError */) |
|
141 { |
|
142 RDEBUG("CDCMONotifierAob::RunError >>"); |
|
143 |
|
144 RDEBUG("CDCMONotifierAob::RunError <<"); |
|
145 return KErrNone; |
|
146 } |
|
147 |
|
148 // End of File |
|