|
1 // Copyright (c) 2008-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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "ssmstatetransitionrequest.h" |
|
17 #include "ssmserverpanic.h" |
|
18 |
|
19 CSsmStateTransitionRequest::CSsmStateTransitionRequest(const TSsmStateTransition& aStateTransition) |
|
20 : iStateTransition(aStateTransition) |
|
21 { |
|
22 } |
|
23 |
|
24 CSsmStateTransitionRequest::CSsmStateTransitionRequest(const TSsmStateTransition& aStateTransition, const RMessage2& aMessage) |
|
25 : iStateTransition(aStateTransition), iMessage(aMessage) |
|
26 { |
|
27 } |
|
28 CSsmStateTransitionRequest::~CSsmStateTransitionRequest() |
|
29 { |
|
30 __ASSERT_DEBUG(KNullHandle == iMessage.Handle(), PanicNow(KPanicSysStateMgr, ESsmTransitionRequestError1)); |
|
31 } |
|
32 |
|
33 const TSsmStateTransition& CSsmStateTransitionRequest::StateTransition() const |
|
34 { |
|
35 return iStateTransition; |
|
36 } |
|
37 |
|
38 void CSsmStateTransitionRequest::SetStateTransition(const TSsmStateTransition& aStateTransition) |
|
39 { |
|
40 iStateTransition = aStateTransition; |
|
41 } |
|
42 |
|
43 void CSsmStateTransitionRequest::Complete(TInt aCompletionCode) |
|
44 { |
|
45 // Guard against multiple calls to complete |
|
46 if( KNullHandle != iMessage.Handle() ) |
|
47 { |
|
48 iMessage.Complete(aCompletionCode); |
|
49 } |
|
50 } |
|
51 TSsmState CSsmStateTransitionRequest::State() const |
|
52 { |
|
53 return iStateTransition.State(); |
|
54 } |
|
55 |
|
56 TInt CSsmStateTransitionRequest::Reason() const |
|
57 { |
|
58 return iStateTransition.Reason(); |
|
59 } |
|
60 |
|
61 TBool CSsmStateTransitionRequest::OriginatesFrom(CSession2* aSession) const |
|
62 { |
|
63 return (iMessage.Session() == aSession); |
|
64 } |