|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "cquietus.h" |
|
17 |
|
18 /** static method to create CQuietus object |
|
19 |
|
20 @return The singleton CQuietus object |
|
21 @internalTechnology |
|
22 @released |
|
23 */ |
|
24 CQuietus* CQuietus::NewL() |
|
25 { |
|
26 CQuietus* self = new(ELeave) CQuietus(); |
|
27 return self; |
|
28 } |
|
29 |
|
30 /** destructor, cancel any outstanding request |
|
31 |
|
32 @internalTechnology |
|
33 @released |
|
34 */ |
|
35 CQuietus::~CQuietus() |
|
36 { |
|
37 Cancel(); |
|
38 } |
|
39 |
|
40 /** constructor, create CActive object with standard priority and add itself to AS |
|
41 |
|
42 @return The singleton CQuietus object |
|
43 @internalTechnology |
|
44 @released |
|
45 */ |
|
46 CQuietus::CQuietus() : CActive(CActive::EPriorityStandard) |
|
47 { |
|
48 CActiveScheduler::Add(this); |
|
49 } |
|
50 |
|
51 /** setactive itself and issue a message to force complete the request to enter into RunL |
|
52 |
|
53 @internalTechnology |
|
54 @released |
|
55 */ |
|
56 void CQuietus::CoupDeGrace() |
|
57 { |
|
58 // kill out active scheduler. thsi can only be done under a RunL, so we'll |
|
59 // force ourselves into the active scheduler Q and kill ourseleves when we run |
|
60 SetActive(); |
|
61 TRequestStatus* trs = &iStatus; |
|
62 User::RequestComplete(trs, KErrNone); |
|
63 } |
|
64 |
|
65 /** All it does is to kill the process! |
|
66 |
|
67 @internalTechnology |
|
68 @released |
|
69 */ |
|
70 void CQuietus::RunL() |
|
71 { |
|
72 // kill the controlling AS |
|
73 CActiveScheduler::Stop(); |
|
74 } |
|
75 |
|
76 /** Do the cancel job if cancel is issued to cancel an outstanding request |
|
77 |
|
78 @internalTechnology |
|
79 @released |
|
80 */ |
|
81 void CQuietus::DoCancel() |
|
82 { |
|
83 // no operation!! |
|
84 // This operationin NOT CANCELABLE by defination and design |
|
85 // No this is NOT a bug :) |
|
86 } |