author | Dominic Pinkman <Dominic.Pinkman@Nokia.com> |
Tue, 30 Mar 2010 16:16:55 +0100 | |
changeset 6 | 43e37759235e |
permissions | -rw-r--r-- |
6
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
3 |
<head> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
5 |
<title>TB9.2 Example Applications: examples/AppFramework/ssmanager/policies/sysstates/gsastatepolicynormal.cpp Source File</title> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
6 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
7 |
<link href="doxygen.css" rel="stylesheet" type="text/css"/> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
8 |
</head> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
9 |
<body> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
10 |
<!-- Generated by Doxygen 1.6.2 --> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
11 |
<h1>examples/AppFramework/ssmanager/policies/sysstates/gsastatepolicynormal.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// gsastatepolicynormal.cpp</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
12 |
<a name="l00002"></a>00002 <span class="comment">//</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
13 |
<a name="l00003"></a>00003 <span class="comment">// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
14 |
<a name="l00004"></a>00004 <span class="comment">// All rights reserved.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
15 |
<a name="l00005"></a>00005 <span class="comment">// This component and the accompanying materials are made available</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
16 |
<a name="l00006"></a>00006 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
17 |
<a name="l00007"></a>00007 <span class="comment">// which accompanies this distribution, and is available</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
18 |
<a name="l00008"></a>00008 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
19 |
<a name="l00009"></a>00009 <span class="comment">//</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
20 |
<a name="l00010"></a>00010 <span class="comment">// Initial Contributors:</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
21 |
<a name="l00011"></a>00011 <span class="comment">// Nokia Corporation - initial contribution.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
22 |
<a name="l00012"></a>00012 <span class="comment">//</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
23 |
<a name="l00013"></a>00013 <span class="comment">// Contributors:</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
24 |
<a name="l00014"></a>00014 <span class="comment">//</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
25 |
<a name="l00015"></a>00015 <span class="comment">// Extends the GSA (Generic Startup Architecture) normal policy to </span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
26 |
<a name="l00016"></a>00016 <span class="comment">// to support the dummy backup and restore states added as part of this example. </span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
27 |
<a name="l00017"></a>00017 <span class="comment">// The default Normal state policy supports only the states start up, shut down, and fail.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
28 |
<a name="l00018"></a>00018 <span class="comment">// The example uses this extended normal state, which replaces the existing normal policy.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
29 |
<a name="l00019"></a>00019 <span class="comment">// </span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
30 |
<a name="l00020"></a>00020 <span class="comment">// This example Normal State policy creates and registers a SwP (ssm.swp.policy.dummy.diskstatus.dll)</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
31 |
<a name="l00021"></a>00021 <span class="comment">// with key KExampleSwPKey and KExampleSwPValue.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
32 |
<a name="l00022"></a>00022 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
33 |
<a name="l00023"></a>00023 <span class="preprocessor">#include <barsread2.h></span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
34 |
<a name="l00024"></a>00024 <span class="preprocessor">#include <e32debug.h></span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
35 |
<a name="l00025"></a>00025 <span class="preprocessor">#include <ssm/ssmcmd.hrh></span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
36 |
<a name="l00026"></a>00026 <span class="preprocessor">#include <ssm/ssmsubstates.hrh></span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
37 |
<a name="l00027"></a>00027 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
38 |
<a name="l00028"></a>00028 <span class="preprocessor">#include <ssm/ssmstatetransition.h></span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
39 |
<a name="l00029"></a>00029 <span class="preprocessor">#include <ssm/ssmcommandlistresourcereader.h></span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
40 |
<a name="l00030"></a>00030 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
41 |
<a name="l00031"></a>00031 <span class="preprocessor">#include "gsastatepolicynormal.h"</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
42 |
<a name="l00032"></a>00032 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
43 |
<a name="l00036"></a>00036 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KPanicGsaNormalState, <span class="stringliteral">"NormalStatePolicy"</span>); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
44 |
<a name="l00037"></a>00037 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
45 |
<a name="l00043"></a>00043 EXPORT_C MSsmStatePolicy* CEgGsaStatePolicyNormal::NewL() |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
46 |
<a name="l00044"></a>00044 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
47 |
<a name="l00045"></a>00045 CEgGsaStatePolicyNormal* <span class="keyword">self</span> = <span class="keyword">new</span> (ELeave) CEgGsaStatePolicyNormal; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
48 |
<a name="l00046"></a>00046 CleanupStack::PushL(<span class="keyword">self</span>); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
49 |
<a name="l00047"></a>00047 <span class="keyword">self</span>->ConstructL(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
50 |
<a name="l00048"></a>00048 CleanupStack::Pop(<span class="keyword">self</span>); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
51 |
<a name="l00049"></a>00049 <span class="keywordflow">return</span> <span class="keyword">self</span>; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
52 |
<a name="l00050"></a>00050 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
53 |
<a name="l00051"></a>00051 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
54 |
<a name="l00055"></a>00055 CEgGsaStatePolicyNormal::CEgGsaStatePolicyNormal() |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
55 |
<a name="l00056"></a>00056 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
56 |
<a name="l00057"></a>00057 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
57 |
<a name="l00058"></a>00058 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
58 |
<a name="l00062"></a>00062 CEgGsaStatePolicyNormal::~CEgGsaStatePolicyNormal() |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
59 |
<a name="l00063"></a>00063 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
60 |
<a name="l00064"></a>00064 <span class="keyword">delete</span> iCommandListResourceReader; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
61 |
<a name="l00065"></a>00065 iCurrentlySupportedTransitions.Close(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
62 |
<a name="l00066"></a>00066 iFs.Close(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
63 |
<a name="l00067"></a>00067 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
64 |
<a name="l00068"></a>00068 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
65 |
<a name="l00074"></a>00074 <span class="keywordtype">void</span> CEgGsaStatePolicyNormal::ConstructL() |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
66 |
<a name="l00075"></a>00075 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
67 |
<a name="l00076"></a>00076 User::LeaveIfError(iFs.Connect()); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
68 |
<a name="l00077"></a>00077 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
69 |
<a name="l00078"></a>00078 <span class="comment">// Add supported transitions from Normal 'ESsmNormal'</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
70 |
<a name="l00079"></a>00079 iCurrentlySupportedTransitions.AppendL(TSsmState(ESsmShutdown, KSsmAnySubState)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
71 |
<a name="l00080"></a>00080 iCurrentlySupportedTransitions.AppendL(TSsmState(ESsmFail, KSsmAnySubState)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
72 |
<a name="l00081"></a>00081 iCurrentlySupportedTransitions.AppendL(TSsmState(ESsmShutdown, ESsmShutdownSubStateCritical)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
73 |
<a name="l00082"></a>00082 iCurrentlySupportedTransitions.AppendL(TSsmState(ESsmBackup, ESsmBackupSubState)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
74 |
<a name="l00083"></a>00083 iCurrentlySupportedTransitions.AppendL(TSsmState(ESsmRestore, ESsmRestoreSubState)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
75 |
<a name="l00084"></a>00084 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
76 |
<a name="l00085"></a>00085 <span class="comment">/*</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
77 |
<a name="l00086"></a>00086 <span class="comment"> Normal state policy resource file path ("z:\private<SID of SSM>\normal\").</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
78 |
<a name="l00087"></a>00087 <span class="comment"> This resource file is already being generated by the production code, hence its not re-generated.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
79 |
<a name="l00088"></a>00088 <span class="comment"> */</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
80 |
<a name="l00089"></a>00089 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KCommandListPath, <span class="stringliteral">"z:\\private\\2000D75B\\normal\\"</span>); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
81 |
<a name="l00090"></a>00090 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
82 |
<a name="l00091"></a>00091 <span class="comment">// Create a resource reader</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
83 |
<a name="l00092"></a>00092 iCommandListResourceReader = CSsmCommandListResourceReader::NewL(iFs, KCommandListPath(), *<span class="keyword">this</span>); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
84 |
<a name="l00093"></a>00093 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
85 |
<a name="l00094"></a>00094 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
86 |
<a name="l00103"></a>00103 <span class="keywordtype">void</span> CEgGsaStatePolicyNormal::Initialize(TRequestStatus& aStatus) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
87 |
<a name="l00104"></a>00104 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
88 |
<a name="l00105"></a>00105 __ASSERT_DEBUG(iCommandListResourceReader, User::Panic(KPanicGsaNormalState, EInvalidResourceReader)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
89 |
<a name="l00106"></a>00106 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
90 |
<a name="l00107"></a>00107 <span class="comment">// initialise command list resource reader.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
91 |
<a name="l00108"></a>00108 iCommandListResourceReader->Initialise(aStatus); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
92 |
<a name="l00109"></a>00109 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
93 |
<a name="l00110"></a>00110 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
94 |
<a name="l00116"></a>00116 <span class="keywordtype">void</span> CEgGsaStatePolicyNormal::InitializeCancel() |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
95 |
<a name="l00117"></a>00117 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
96 |
<a name="l00118"></a>00118 __ASSERT_DEBUG(iCommandListResourceReader, User::Panic(KPanicGsaNormalState, EInvalidResourceReader)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
97 |
<a name="l00119"></a>00119 iCommandListResourceReader->InitialiseCancel(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
98 |
<a name="l00120"></a>00120 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
99 |
<a name="l00121"></a>00121 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
100 |
<a name="l00127"></a>00127 <span class="keywordtype">void</span> CEgGsaStatePolicyNormal::Release() |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
101 |
<a name="l00128"></a>00128 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
102 |
<a name="l00129"></a>00129 <span class="keyword">delete</span> <span class="keyword">this</span>; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
103 |
<a name="l00130"></a>00130 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
104 |
<a name="l00131"></a>00131 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
105 |
<a name="l00149"></a>00149 MSsmStatePolicy::TResponse CEgGsaStatePolicyNormal::TransitionAllowed(<span class="keyword">const</span> TSsmStateTransition& aRequest, TSsmStateTransition <span class="keyword">const</span>* aCurrent, |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
106 |
<a name="l00150"></a>00150 TSsmStateTransition <span class="keyword">const</span>* aQueued, <span class="keyword">const</span> RMessagePtr2& aMessage) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
107 |
<a name="l00151"></a>00151 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
108 |
<a name="l00152"></a>00152 TResponse response = ENotAllowed; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
109 |
<a name="l00153"></a>00153 <span class="keywordflow">if</span> (!aMessage.HasCapability(ECapabilityPowerMgmt)) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
110 |
<a name="l00154"></a>00154 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
111 |
<a name="l00155"></a>00155 <span class="keywordflow">return</span> response; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
112 |
<a name="l00156"></a>00156 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
113 |
<a name="l00157"></a>00157 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
114 |
<a name="l00158"></a>00158 <span class="comment">// Check if the requested transition is supported from the current state</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
115 |
<a name="l00159"></a>00159 <span class="keywordflow">if</span> (TransitionSupported(aRequest.State())) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
116 |
<a name="l00160"></a>00160 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
117 |
<a name="l00161"></a>00161 <span class="keywordflow">if</span>((NULL == aCurrent) && (NULL == aQueued)) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
118 |
<a name="l00162"></a>00162 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
119 |
<a name="l00163"></a>00163 <span class="comment">// SsmServer is idle</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
120 |
<a name="l00164"></a>00164 response = EDefinitelyAllowed; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
121 |
<a name="l00165"></a>00165 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
122 |
<a name="l00166"></a>00166 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(aRequest.State().MainState() == ESsmFail) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
123 |
<a name="l00167"></a>00167 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
124 |
<a name="l00168"></a>00168 <span class="comment">// Going into failed state will override anything currently ongoing or queued</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
125 |
<a name="l00169"></a>00169 response = EReplaceCurrentClearQueue; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
126 |
<a name="l00170"></a>00170 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
127 |
<a name="l00171"></a>00171 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
128 |
<a name="l00172"></a>00172 TSsmStateName name = aRequest.State().Name(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
129 |
<a name="l00173"></a>00173 <span class="keywordflow">return</span> response; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
130 |
<a name="l00174"></a>00174 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
131 |
<a name="l00175"></a>00175 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
132 |
<a name="l00187"></a>00187 <span class="keywordtype">void</span> CEgGsaStatePolicyNormal::PrepareCommandList(TSsmState aState, TInt <span class="comment">/*aReason*/</span>, TRequestStatus& aStatus) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
133 |
<a name="l00188"></a>00188 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
134 |
<a name="l00189"></a>00189 __ASSERT_DEBUG( iCommandListResourceReader , User::Panic(KPanicGsaNormalState, EInvalidResourceReader)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
135 |
<a name="l00190"></a>00190 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
136 |
<a name="l00191"></a>00191 <span class="comment">// Start from the beginning if no specific substate is selected</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
137 |
<a name="l00192"></a>00192 <span class="keyword">const</span> TUint16 substate = aState.SubState(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
138 |
<a name="l00193"></a>00193 <span class="keyword">const</span> TSsmState state(aState.MainState(), (substate==KSsmAnySubState) ? ESsmNormalSubState : substate); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
139 |
<a name="l00194"></a>00194 <span class="keyword">const</span> TInt commandListId = state.SubState(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
140 |
<a name="l00195"></a>00195 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
141 |
<a name="l00196"></a>00196 <span class="comment">// Build the command list from the resource</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
142 |
<a name="l00197"></a>00197 iCommandListResourceReader->PrepareCommandList(commandListId, state, aStatus); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
143 |
<a name="l00198"></a>00198 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
144 |
<a name="l00199"></a>00199 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
145 |
<a name="l00205"></a>00205 <span class="keywordtype">void</span> CEgGsaStatePolicyNormal::PrepareCommandListCancel() |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
146 |
<a name="l00206"></a>00206 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
147 |
<a name="l00207"></a>00207 iCommandListResourceReader->PrepareCommandListCancel(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
148 |
<a name="l00208"></a>00208 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
149 |
<a name="l00209"></a>00209 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
150 |
<a name="l00216"></a>00216 CSsmCommandList* CEgGsaStatePolicyNormal::CommandList() |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
151 |
<a name="l00217"></a>00217 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
152 |
<a name="l00218"></a>00218 __ASSERT_DEBUG( iCommandListResourceReader , User::Panic(KPanicGsaNormalState, EInvalidResourceReader)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
153 |
<a name="l00219"></a>00219 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
154 |
<a name="l00220"></a>00220 <span class="keywordflow">return</span> iCommandListResourceReader->GetCommandList(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
155 |
<a name="l00221"></a>00221 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
156 |
<a name="l00222"></a>00222 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
157 |
<a name="l00235"></a>00235 TBool CEgGsaStatePolicyNormal::GetNextState(TSsmState aCurrentTransition, TInt <span class="comment">/*aReason*/</span>, TInt aError, TInt <span class="comment">/*aSeverity*/</span>, TSsmState& aNextState) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
158 |
<a name="l00236"></a>00236 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
159 |
<a name="l00237"></a>00237 __ASSERT_ALWAYS(aCurrentTransition.MainState() == ESsmNormal, User::Panic(KPanicGsaNormalState, EInvalidNormalState)); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
160 |
<a name="l00238"></a>00238 <span class="keywordflow">if</span> (KErrNone != aError) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
161 |
<a name="l00239"></a>00239 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
162 |
<a name="l00240"></a>00240 aNextState = TSsmState(ESsmFail, KSsmAnySubState); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
163 |
<a name="l00241"></a>00241 TSsmStateName name = aNextState.Name(); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
164 |
<a name="l00242"></a>00242 <span class="keywordflow">return</span> ETrue; |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
165 |
<a name="l00243"></a>00243 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
166 |
<a name="l00244"></a>00244 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
167 |
<a name="l00245"></a>00245 <span class="keywordflow">return</span> EFalse; <span class="comment">// no more substates to execute</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
168 |
<a name="l00246"></a>00246 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
169 |
<a name="l00247"></a>00247 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
170 |
<a name="l00258"></a>00258 TBool CEgGsaStatePolicyNormal::ConditionalCommandAllowedL(CResourceFile& <span class="comment">/*aResourceFile*/</span>, TInt <span class="comment">/*aResourceId*/</span>) |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
171 |
<a name="l00259"></a>00259 { |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
172 |
<a name="l00260"></a>00260 <span class="comment">// no commands use 'conditional_information' in Normal state command list.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
173 |
<a name="l00261"></a>00261 User::Panic(KPanicGsaNormalState, EConditionalInfoNotImplemented); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
174 |
<a name="l00262"></a>00262 <span class="keywordflow">return</span> EFalse; <span class="comment">// avoid a compiler warning.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
175 |
<a name="l00263"></a>00263 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
176 |
<a name="l00264"></a>00264 |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
177 |
<a name="l00265"></a>00265 <span class="comment">/*</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
178 |
<a name="l00266"></a>00266 <span class="comment">Helper function to check whether requested transition is supported or not.</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
179 |
<a name="l00267"></a>00267 <span class="comment">@param aRequestedState Requested transition</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
180 |
<a name="l00268"></a>00268 <span class="comment">@return ETrue if transition is supported</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
181 |
<a name="l00269"></a>00269 <span class="comment"> EFalse if transition is not supported</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
182 |
<a name="l00270"></a>00270 <span class="comment">*/</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
183 |
<a name="l00271"></a>00271 TBool CEgGsaStatePolicyNormal::TransitionSupported(<span class="keyword">const</span> TSsmState& aRequestedState)<span class="keyword"> const</span> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
184 |
<a name="l00272"></a>00272 <span class="keyword"> </span>{ |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
185 |
<a name="l00273"></a>00273 <span class="keywordflow">return</span> (iCurrentlySupportedTransitions.Find(aRequestedState) > KErrNotFound); |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
186 |
<a name="l00274"></a>00274 } |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
187 |
</pre></div></div> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
188 |
<hr size="1"/><address style="text-align: right;"><small>Generated by |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
189 |
<a href="http://www.doxygen.org/index.html"> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
190 |
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
191 |
</body> |
43e37759235e
Week 12 contribution of example code"
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
192 |
</html> |