Symbian3/SDK/Source/GUID-34614E31-45F1-5BD8-963D-9526AAD31734.dita
changeset 13 48780e181b38
parent 0 89d6a7a84779
equal deleted inserted replaced
12:80ef3a206772 13:48780e181b38
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE concept
    10 <!DOCTYPE concept
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    12 <concept id="GUID-34614E31-45F1-5BD8-963D-9526AAD31734" xml:lang="en"><title>resourcemanager:
    12 <concept id="GUID-34614E31-45F1-5BD8-963D-9526AAD31734" xml:lang="en"><title>resourcemanager: Power Resource Manager Framework example</title><shortdesc>This example demonstrates the Power Resource Manager user
    13 Power Resource Manager Framework example</title><shortdesc>This example demonstrates the Power Resource Manager user side
    13 side APIs. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
    14 APIs. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
    14 <section id="GUID-479DBACE-22C6-47B7-AA0B-06D09F7972C0"><title>Purpose</title> <p>The example shows how to use the <xref href="GUID-6E1DE1E4-1B09-541C-8708-9126E69B42CE.dita">Power Resource Manager
    15 <section><title>Purpose</title> <p>The example shows how to use the <xref href="GUID-6E1DE1E4-1B09-541C-8708-9126E69B42CE.dita">Power Resource Manager user
    15 user side APIs</xref> provided by the <xref href="GUID-FD3DEFC1-DA39-3A1A-8E00-A46B34B78899.dita"><apiname>RBusDevResManUs</apiname></xref> class. </p> The use cases demonstrated are:<ul>
    16 side APIs</xref> provided by the <xref href="GUID-FD3DEFC1-DA39-3A1A-8E00-A46B34B78899.dita"><apiname>RBusDevResManUs</apiname></xref> class. </p> The
       
    17 use cases demonstrated are:<ul>
       
    18 <li><p>How to get information about power resources.</p></li>
    16 <li><p>How to get information about power resources.</p></li>
    19 <li><p>How to get information about other clients registered with the Power
    17 <li><p>How to get information about other clients registered with
    20 Resource Manager. </p></li>
    18 the Power Resource Manager. </p></li>
    21 <li><p> How to change the state of a resource.</p></li>
    19 <li><p> How to change the state of a resource.</p></li>
    22 <li><p>How to get notification when a resource changes state.</p></li>
    20 <li><p>How to get notification when a resource changes state.</p></li>
    23 </ul></section>
    21 </ul></section>
    24 <section><title>Class summary</title><ol>
    22 <section id="GUID-5A18CC8E-11D7-401C-8957-7A82DA4D7C44"><title>Class summary</title><ol>
    25 <li id="GUID-BF6BF1A4-061C-4643-95D8-C89388675B91"><p><xref href="GUID-FD3DEFC1-DA39-3A1A-8E00-A46B34B78899.dita"><apiname>RBusDevResManUs</apiname></xref></p></li>
    23 <li id="GUID-BF6BF1A4-061C-4643-95D8-C89388675B91"><p><xref href="GUID-FD3DEFC1-DA39-3A1A-8E00-A46B34B78899.dita"><apiname>RBusDevResManUs</apiname></xref></p></li>
    26 <li id="GUID-4DD7C3AC-048E-446D-8D52-EE6CFCEB8227"><p><xref href="GUID-A1DDD3E3-C009-3C02-895B-0B2D0EE67A9D.dita"><apiname>TResourceInfo</apiname></xref></p></li>
    24 <li id="GUID-4DD7C3AC-048E-446D-8D52-EE6CFCEB8227"><p><xref href="GUID-A1DDD3E3-C009-3C02-895B-0B2D0EE67A9D.dita"><apiname>TResourceInfo</apiname></xref></p></li>
    27 <li id="GUID-D1CD4D8A-B58E-46DC-AB17-E19EEC0C7714"><p><xref href="GUID-3BC432D9-6C37-35C0-BE85-DA21E6E520C7.dita"><apiname>TClientInfo</apiname></xref></p></li>
    25 <li id="GUID-D1CD4D8A-B58E-46DC-AB17-E19EEC0C7714"><p><xref href="GUID-3BC432D9-6C37-35C0-BE85-DA21E6E520C7.dita"><apiname>TClientInfo</apiname></xref></p></li>
    28 </ol></section>
    26 </ol></section>
    29 <section><title>Download</title> <p>Click on the following link to download
    27 <section id="GUID-78393943-2E05-43C3-97E9-053D7A6F63E7"><title>Download</title> <p>Click on the following link to
    30 the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-bca7fbc0-b2fc-48da-adf3-3f0961ac9f88.zip" scope="external">resourcemanager.zip</xref>.</p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-bca7fbc0-b2fc-48da-adf3-3f0961ac9f88.html" scope="peer">browse</xref> to view the example code.</p> </section>
    28 download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-bca7fbc0-b2fc-48da-adf3-3f0961ac9f88.zip" scope="external">resourcemanager.zip</xref>.</p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-bca7fbc0-b2fc-48da-adf3-3f0961ac9f88.html" scope="peer">browse</xref> to view the example code.</p> </section>
    31 <section><title>Design and implementation</title> <p>This example builds a
    29 <section id="GUID-4AE582AE-5232-4EC1-87F3-9EC131825897"><title>Design and implementation</title> <p>This example
    32 console application called <filepath>resourcemanager.exe</filepath>. It requests
    30 builds a console application called <filepath>resourcemanager.exe</filepath>. It requests user input, and prints information to the console. </p> <p>The following menu options are presented to the user: </p> <ul>
    33 user input, and prints information to the console. </p> <p>The following menu
    31 <li id="GUID-D5D0980D-140F-5142-B002-4986476AB082"><p>Get Power Resource
    34 options are presented to the user: </p> <ul>
    32 information. </p> </li>
    35 <li id="GUID-D5D0980D-140F-5142-B002-4986476AB082"><p>Get Power Resource information. </p> </li>
    33 <li id="GUID-90DE75D2-2F4C-5FEC-BFC0-89BC65A68EA1"><p>Change the state
    36 <li id="GUID-90DE75D2-2F4C-5FEC-BFC0-89BC65A68EA1"><p>Change the state of
    34 of a resource. </p> </li>
    37 a resource. </p> </li>
    35 <li id="GUID-AA262888-404A-58B8-85BA-EC10E523F8DD"><p>Notify a change
    38 <li id="GUID-AA262888-404A-58B8-85BA-EC10E523F8DD"><p>Notify a change of resource
    36 of resource state. </p> </li>
    39 state. </p> </li>
    37 </ul> <p><b>Get Power Resource information</b> </p> <p>This option
    40 </ul> <p><b>Get Power Resource information</b> </p> <p>This option gets and
    38 gets and displays information about the clients of the Power Resource
    41 displays information about the clients of the Power Resource Manager framework
    39 Manager framework and about the available resources. </p> <p>The following
    42 and about the available resources. </p> <p>The following sub-menu options
    40 sub-menu options are presented: </p> <ul>
    43 are presented: </p> <ul>
    41 <li id="GUID-0C71EA91-4622-568F-B909-F48E453E3261"><p>1. Get the number
    44 <li id="GUID-0C71EA91-4622-568F-B909-F48E453E3261"><p>1. Get the number of
    42 of available resources. </p> </li>
    45 available resources. </p> </li>
    43 <li id="GUID-83B6CD7A-6830-58EE-9AC1-DD59E1320FAA"><p>2. Get information
    46 <li id="GUID-83B6CD7A-6830-58EE-9AC1-DD59E1320FAA"><p>2. Get information about
    44 about a particular resource. </p> </li>
    47 a particular resource. </p> </li>
    45 <li id="GUID-85B710BA-7EA7-5A6A-8389-34115D094044"><p>3. Get information
    48 <li id="GUID-85B710BA-7EA7-5A6A-8389-34115D094044"><p>3. Get information about
    46 about all the available resources. </p> </li>
    49 all the available resources. </p> </li>
    47 <li id="GUID-D92401B4-0F81-5FF4-A413-1AB3DE0E4EAF"><p>4. Get the state
    50 <li id="GUID-D92401B4-0F81-5FF4-A413-1AB3DE0E4EAF"><p>4. Get the state of
    48 of a particular resource. </p> </li>
    51 a particular resource. </p> </li>
    49 <li id="GUID-B7E8C908-5AF7-5C3A-9CD9-4E812BE446A1"><p>5. Get the number
    52 <li id="GUID-B7E8C908-5AF7-5C3A-9CD9-4E812BE446A1"><p>5. Get the number of
    50 of clients using a particular resource. </p> </li>
    53 clients using a particular resource. </p> </li>
    51 <li id="GUID-90A8D835-F4D4-5B4E-831A-F4BB6B8D36C7"><p>6. Get the number
    54 <li id="GUID-90A8D835-F4D4-5B4E-831A-F4BB6B8D36C7"><p>6. Get the number of
    52 of resources used by a particular client. </p> </li>
    55 resources used by a particular client. </p> </li>
    53 <li id="GUID-CF511B2E-A7A4-5435-8878-8F9332EBEF8C"><p>7. Get information
    56 <li id="GUID-CF511B2E-A7A4-5435-8878-8F9332EBEF8C"><p>7. Get information about
    54 about all the resources in use by a particular client. </p> </li>
    57 all the resources in use by a particular client. </p> </li>
    55 <li id="GUID-4E7F9E93-1FFF-56DD-9970-87EAF45CDB7A"><p>8. Get information
    58 <li id="GUID-4E7F9E93-1FFF-56DD-9970-87EAF45CDB7A"><p>8. Get information on
    56 on all clients using a particular resource. </p> </li>
    59 all clients using a particular resource. </p> </li>
    57 <li id="GUID-85D80BC5-99E1-5AA9-AE0C-573CAD798B6D"><p>9. Get the names
    60 <li id="GUID-85D80BC5-99E1-5AA9-AE0C-573CAD798B6D"><p>9. Get the names of
    58 of all clients. </p> </li>
    61 all clients. </p> </li>
    59 </ul> <p><b>Change the state of a resource</b> </p> <p>This option
    62 </ul> <p><b>Change the state of a resource</b> </p> <p>This option allows
    60 allows the user to change the state of a resource. </p> <p><b>Notify
    63 the user to change the state of a resource. </p> <p><b>Notify any change of
    61 any change of resource state</b> </p> <p>This option changes the state
    64 resource state</b> </p> <p>This option changes the state of a resource and
    62 of a resource and notifies the user about the change. </p> </section>
    65 notifies the user about the change. </p> </section>
    63 <section id="GUID-6F1BD626-F15A-478B-AB59-72AF09A3C0EE"><title>Building and configuring</title> <p>To build the example: </p> <ul>
    66 <section><title>Building and configuring</title> <p>To build the example: </p> <ul>
    64 <li id="GUID-1724170B-EEB9-5899-AB43-540035CE23F4"><p>You can build
    67 <li id="GUID-1724170B-EEB9-5899-AB43-540035CE23F4"><p>You can build the example
    65 the example from your IDE or the command line. </p> <p>If you use
    68 from your IDE or the command line. </p> <p>If you use an IDE, import the <filepath>bld.inf</filepath> file
    66 an IDE, import the <filepath>bld.inf</filepath> file of the example
    69 of the example into your IDE, and use the build command of the IDE. </p> <p>If
    67 into your IDE, and use the build command of the IDE. </p> <p>If you
    70 you use the command line, open a command prompt, and set the current directory
    68 use the command line, open a command prompt, and set the current directory
    71 to the source code directory of the example. You can then build the example
    69 to the source code directory of the example. You can then build the
    72 with the SBSv1 build tools with the following commands: </p> <p><userinput>bldmake
    70 example with the SBSv1 build tools with the following commands: </p> <p><userinput>bldmake bldfiles</userinput> </p> <p><userinput>abld
    73 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
    71 build</userinput> </p> </li>
    74 how to use the SBSv1 build tools. </p> </li>
    72 <li id="GUID-23AF0285-6E6B-55F4-BF08-49C6E41C1B7D"><p>For the emulator,
    75 <li id="GUID-23AF0285-6E6B-55F4-BF08-49C6E41C1B7D"><p>For the emulator, the
    73 the example builds an executable called <filepath>resourcemanager.exe</filepath> in the <filepath>epoc32\release\winscw\&lt;udeb or             
    76 example builds an executable called <filepath>resourcemanager.exe</filepath> in
    74    urel&gt;\</filepath> folder. </p> </li>
    77 the <filepath>epoc32\release\winscw\&lt;udeb or                 urel&gt;\</filepath> folder. </p> </li>
       
    78 </ul> </section>
    75 </ul> </section>
    79 <section><title>Running the example</title> <p>To run the example, launch
    76 <section id="GUID-5BF499DA-9E68-4A77-AFE3-C5597FD12401"><title>Running the example</title> <p>To run the example,
    80 the executable <filepath>resourcemanager.exe</filepath>, then choose from
    77 launch the executable <filepath>resourcemanager.exe</filepath>, then
    81 the menu options. Press <userinput>Esc</userinput> to quit. </p> <p>Note:
    78 choose from the menu options. Press <userinput>Esc</userinput> to
    82 this example requires an LDD, a PDD and a PSL (platform specific layer). If
    79 quit. </p> <p>Note: this example requires an LDD, a PDD and a PSL
    83 these are not provided on the platform you are using, the example will not
    80 (platform specific layer). If these are not provided on the platform
    84 run. </p> </section>
    81 you are using, the example will not run. </p> </section>
    85 </conbody><related-links>
    82 </conbody><related-links>
    86 <link href="GUID-6E1DE1E4-1B09-541C-8708-9126E69B42CE.dita"><linktext>Power Resource
    83 <link href="GUID-6E1DE1E4-1B09-541C-8708-9126E69B42CE.dita"><linktext>Power
    87 Manager Architecture Overview</linktext></link>
    84 Resource Manager Architecture Overview</linktext></link>
    88 </related-links></concept>
    85 </related-links></concept>