|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE reference |
|
11 PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"> |
|
12 <reference id="GUID-B14B3D67-B0D5-54B6-AAE4-D4486D019498" xml:lang="en"><title>SystemStateManager: |
|
13 The System State Manager example</title><shortdesc>This example demonstrates the System State Manager (SSM) API. It |
|
14 consists of System State Manager example executable (ssmanager.exe), two system |
|
15 state policy plugins (ssm.state.policy.0004.dll and ssm.state.policy.0005.dll), |
|
16 a system-wide property policy plugin (ssm.swp.policy.dummy.diskstatus.dll), |
|
17 an example Normal State policy (ssm.state.policy.0001.dll) and a dummy back-up |
|
18 application (dummybackup.exe). </shortdesc><prolog><metadata><keywords/></metadata></prolog><refbody> |
|
19 <section id="GUID-2F32F775-F525-5893-A581-3A5396A66333"><title>Purpose</title> <p>This |
|
20 example demonstrates following SSM features </p> <ul> |
|
21 <li id="GUID-55D30A2E-9EEF-515C-9DA5-2261AD64FD2E"><p>How to write a System |
|
22 Wide Property (SWP) policy. </p> </li> |
|
23 <li id="GUID-477F87E7-D3B2-53FB-A96D-8304632AF48D"><p>How to write a System |
|
24 State policy. </p> </li> |
|
25 <li id="GUID-3AAA1DCD-F21A-53A2-8AB8-39F42396972D"><p>How to request a change |
|
26 to an SWP, with and without notification </p> </li> |
|
27 <li id="GUID-5022B224-8620-5AB8-B8C7-F95296DC7A14"><p>How to request a change |
|
28 to a system state, with and without notification </p> </li> |
|
29 </ul> </section> |
|
30 <section id="GUID-878E4690-1F02-5C15-8B4E-F53E8EA8719D-GENID-1-7-1-8-1-1-7-1-5-1-6-1-3-2"><title>Download</title><p>Click |
|
31 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-77c0248d-dda5-4b56-9d5a-eda76091bca2.zip" scope="external">ssmanager.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-77c0248d-dda5-4b56-9d5a-eda76091bca2.html" scope="peer">browse</xref> to view the example code. </p> </section> |
|
32 <section><title>Class Summary</title><p><xref href="GUID-60E6220E-5B9B-3D4E-A95F-B7AD6DB8AF68.dita"><apiname>TSsmSwp</apiname></xref></p><p> <xref href="GUID-CEBD45FB-5E0E-3EBA-B134-545B7F82EBEC.dita"><apiname>TSsmStateTransition</apiname></xref></p><p> <xref href="GUID-76D2A5E8-BC64-3528-BED6-499E52CF8B2B.dita"><apiname>CSsmSystemWideProperty</apiname></xref></p><p> <xref href="GUID-89C25B0F-DB76-30D5-A4D6-0C12922194E4.dita"><apiname>RSsmStateAwareSession</apiname></xref></p><p> <xref href="GUID-8CE82869-EA9E-327C-B817-ACF497CCDC9D.dita"><apiname>RSsmStateManager</apiname></xref></p><p> <xref href="GUID-31FB0BC8-83FC-3581-A7A3-C1781CAE7187.dita"><apiname>MSsmSwpPolicy</apiname></xref></p><p> <xref href="GUID-ABE0DF1C-78FB-3141-8AE6-5CC8C73A8034.dita"><apiname>CSsmCommandList</apiname></xref></p><p> <xref href="GUID-62413EF5-F6F1-37C9-9213-5178EAE6C2F5.dita"><apiname>MSwpChangeNotificationSubscriber</apiname></xref></p><p> <xref href="GUID-4181374F-8545-3AF0-8932-A73138296FD1.dita"><apiname>CSsmCommandListResourceReader</apiname></xref></p><p> <xref href="GUID-B29C0C6D-4BFC-3AAF-B9CB-8C200CF4B4C7.dita"><apiname>MSsmConditionalCallback</apiname></xref></p></section> |
|
33 <section id="GUID-C68A69F1-0692-50E3-A049-D38D90E4B52B"><title>Design and |
|
34 implementation</title> <p>The example consists of several components: a System |
|
35 State Manager example executable (<filepath>ssmanager.exe</filepath>), two |
|
36 system state policy plugins (<filepath>ssm.state.policy.0004.dll</filepath> and <filepath>ssm.state.policy.0005.dll</filepath>), |
|
37 a system-wide property policy plugin (<filepath>ssm.swp.policy.dummy.diskstatus.dll</filepath>), |
|
38 an example Normal State policy (<filepath>ssm.state.policy.0001.dll</filepath>) |
|
39 and a dummy back-up application (<filepath>dummybackup.exe</filepath>). </p> <p>This |
|
40 section describes the components in the example: </p> <ul> |
|
41 <li id="GUID-61B148DD-A13E-51C2-9EEB-54E354DE2DB3"><p> <filepath>ssmanager.exe</filepath>: |
|
42 The main process which presents the menu to the user, receives the input from |
|
43 the user . It has the following functions: </p> <ul> |
|
44 <li id="GUID-EA2E0A4A-8EC3-5BF8-8994-A2F90E4D032D"><p> <codeph>RequestSwpChange()</codeph>. |
|
45 This demonstrates changing the value of a system wide property without notifying |
|
46 any clients. When the disk status changes, the dummy backup application is |
|
47 launched to simulate a disk backup. <codeph>RequestSwpChangeWithNotificationL()</codeph> is |
|
48 similar to RequestSwpChange(), but it notifies its clients when a value of |
|
49 a system wide property changes. </p> </li> |
|
50 <li id="GUID-D87525A4-570E-5CA9-AAC7-721564BDB50A"><p> <codeph>RequestSsChange()</codeph>. |
|
51 This demonstrates changing the system state without notifying any clients. |
|
52 When the system state changes from 'Normal' to 'Restore' state, the dummy |
|
53 backup application is launched. <codeph>RequestSsChangeWithNotification()</codeph> is |
|
54 similar to RequestSwpChange(), but it notifies its clients when a value of |
|
55 a system wide property changes. </p> </li> |
|
56 </ul> </li> |
|
57 <li id="GUID-A61E42C7-F62E-5012-86D6-9D71833BB488"><p> <filepath>ssm.state.policy.0004.dll</filepath>:The |
|
58 dummy backup system state policy with custom commands listed in a resource |
|
59 file (<filepath>ssm_cmdlist_state_dummy_backup.rss</filepath>). The command |
|
60 list is prepared in the dummy backup policy using the <xref href="GUID-4181374F-8545-3AF0-8932-A73138296FD1.dita"><apiname>CSsmCommandListResourceReader</apiname></xref> class. </p> </li> |
|
61 <li id="GUID-A74E6A5F-7E2B-5DEF-A8D9-75BDE2BCF765"><p> <filepath>ssm.state.policy.0005.dll</filepath>: |
|
62 The dummy restore system state policy with custom commands defined using the |
|
63 command factory classes <xref href="GUID-A9E6135E-3C15-3176-A41A-108CE99AE28F.dita"><apiname>MSsmCommand</apiname></xref> and <xref href="GUID-365DF661-A86F-3218-9C77-483526385EDC.dita"><apiname>SsmCommandFactory</apiname></xref>. </p> </li> |
|
64 <li id="GUID-90199262-D9C1-52C3-8475-02957E8A4E74"><p> <filepath>ssm.swp.policy.dummy.diskstatus.dll</filepath>: |
|
65 The dummy disk status system-wide property with custom commands listed in |
|
66 a resource file (<filepath>ssm_cmdlist_swp_dummy_diskstatus.rss</filepath>). |
|
67 The command list is prepared by using the <xref href="GUID-4181374F-8545-3AF0-8932-A73138296FD1.dita"><apiname>CSsmCommandListResourceReader</apiname></xref> class. </p> </li> |
|
68 <li id="GUID-6374DEC2-4AAB-500C-8AFA-EE8BF003F741"><p> <filepath>ssm.state.policy.0001.dll</filepath>: |
|
69 the dummy back up and restore states need to be supported by the Normal state |
|
70 inorder to allow transition from one state to another. Hence, the existing |
|
71 Normal state policy file is updated with the changes required to support these |
|
72 transitions. </p> </li> |
|
73 <li id="GUID-4F412BA5-3A79-5688-BD95-A3C384981FC1"><p> <filepath>dummybackup.exe</filepath>: |
|
74 The dummy application which is launched when the system state changes to 'backup'. |
|
75 It just prints a series of statements to the console. </p> </li> |
|
76 </ul> </section> |
|
77 <section id="GUID-DEFCF4B9-452A-5EAF-ABD3-BC4F6FBD528B-GENID-1-7-1-8-1-1-7-1-5-1-6-1-3-5"><title>Building and |
|
78 configuring</title> <p>To build the example: </p> <ul> |
|
79 <li id="GUID-BCB63B67-BA41-5BE6-B80A-3DE0A0211A96"><p>The example builds the |
|
80 following binaries </p> <p> <filepath>ssmanager.exe</filepath> </p> <p> <filepath>ssm.state.policy.0004.dll</filepath> </p> <p> <filepath>ssm.state.policy.0005.dll</filepath> </p> <p> <filepath>ssm.swp.policy.dummy.diskstatus.dll</filepath> </p> <p> <filepath>ssm.state.policy.0001.dll</filepath> </p> <p> <filepath>dummybackup.exe</filepath> </p> </li> |
|
81 <li id="GUID-1D7646C4-40E8-5615-BD7C-DAFF33483CD5"><p>You can build the example |
|
82 from your IDE or the command line. </p> <p>If you use an IDE, import the <filepath>bld.inf</filepath> file |
|
83 of the example into your IDE, and use the build command of the IDE. </p> <p>If |
|
84 you use the command line, open a command prompt, and set the current directory |
|
85 to the source code directory of the example. You can then build the example |
|
86 with the SBSv1 build tools with the following commands: </p> <p><userinput>bldmake |
|
87 bldfiles</userinput> </p> <p><userinput>abld build</userinput> </p> <p><xref href="GUID-793A5EF9-CC16-5EEB-9011-6431EA76EB15.dita">How to use bldmake</xref> and <xref href="GUID-B6B54E07-3B34-5D5C-8815-93383FA8FB4B.dita">How to use abld</xref> describe |
|
88 how to use the SBSv1 build tools. </p> </li> |
|
89 <li id="GUID-53F53A62-94CE-5412-AD52-CC00D4A44053"><p>For the emulator, the |
|
90 example builds <filepath>ssmanager.exe</filepath> in the <filepath>epoc32\release\winscw\<udeb |
|
91 or urel>\</filepath> folder. </p> </li> |
|
92 </ul> </section> |
|
93 </refbody><related-links> |
|
94 <link href="GUID-26DBE128-6244-557E-989D-A4A608F43A0F.dita"><linktext>System State |
|
95 Manager Overview</linktext></link> |
|
96 <link href="GUID-06724AAF-3C6D-5964-B69D-D9D981543505.dita"><linktext>System State |
|
97 Manager Tutorials</linktext></link> |
|
98 </related-links></reference> |