Symbian3/SDK/Source/GUID-95CE2206-7AE0-48C0-97A7-4E2082F9F662.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     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 -->  <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"><concept id="GUID-95CE2206-7AE0-48C0-97A7-4E2082F9F662" xml:lang="en"><title>Enabling
       
    10 quick access to functions with a toolbar</title><prolog><metadata><keywords></keywords></metadata></prolog><conbody>
       
    11 <p>To use the Toolbar API, follow the steps below.</p>
       
    12 <ol>
       
    13 <li id="GUID-EE77C9E2-8E00-4267-81D7-348CEA8196D5">Link the <codeph>AVKON</codeph> libraries
       
    14 (<codeph>avkon.lib</codeph>, <codeph>eikcoctl.lib</codeph>) to the project
       
    15 file of the application.</li>
       
    16 <li id="GUID-ACA972C5-9E34-4220-9161-AFC18AD3194F">Define the toolbar in the
       
    17 application resources. Set it as application or view specific.</li>
       
    18 <li id="GUID-5B1DAC49-E8B3-4602-A1DF-B9071FAD8587">Provide a class that implements
       
    19 the toolbar observer (<codeph><xref href="GUID-4C4ADE30-EE2A-31FE-B029-D0C62632064F.dita"><apiname>MAknToolbarObserver</apiname></xref></codeph>)
       
    20 interface. Set the class as the observer of the toolbar (<codeph><xref href="GUID-9E7F4397-3DE4-36A3-A55B-56D9E39BEFF2.dita"><apiname>CAknToolbar</apiname></xref></codeph>)
       
    21 created in the previous step.</li>
       
    22 <li id="GUID-37161421-986B-4DBA-8E81-57CF8AA3CBBC">If the toolbar items were
       
    23 not defined in the resources, add them dynamically in the application code.</li>
       
    24 <li id="GUID-FDCAC051-D66D-4061-98A7-7A0DDAE8F916">In the case of a floating
       
    25 toolbar, set the toolbar visible. (The framework sets the fixed toolbar automatically
       
    26 visible when activating the application/view.)</li>
       
    27 <li id="GUID-32345118-A446-458E-A91D-2AEEE33E13C3">Handle toolbar events using
       
    28 the observer interface methods.</li>
       
    29 </ol>
       
    30 <fig id="GUID-DF6096FC-49A1-4120-81BB-141A1B3ADC8B">
       
    31 <title>Fixed toolbar with implementation classes</title>
       
    32 <image href="GUID-ED823C5E-A59B-476A-BF88-0FCBA5D35FED_d0e48280_href.png" scale="50" placement="inline"></image>
       
    33 </fig>
       
    34 <section><title>Implementing a toolbar</title><p>To use a toolbar in your
       
    35 application, implement the following use cases:</p><ul>
       
    36 <li><p><xref href="GUID-402C3EE7-8852-49B6-BE62-8588753FAC8F.dita">Constructing
       
    37 the toolbar</xref></p></li>
       
    38 <li><p><xref href="GUID-58318BAB-2EC4-4C9E-A7CA-580E701EE54F.dita">Adding and removing
       
    39 toolbar items</xref> (the toolbar buttons are defined in the <xref href="GUID-F3EE1000-71A6-4D48-A30B-3D2357BF20FB.dita">Generic
       
    40 button API</xref>)</p></li>
       
    41 <li><p><xref href="GUID-BC3207BF-9E9F-4BA0-8F01-B72228110A61.dita">Accessing the
       
    42 toolbar from applications or application views</xref></p></li>
       
    43 <li><p><xref href="GUID-3FE04A31-C35F-47E2-B615-6C1202FB8485.dita">Accessing toolbar
       
    44 items</xref></p></li>
       
    45 <li><p><xref href="GUID-7AE34C8A-50C6-49BA-9E43-AE76873B5E12.dita">Handling toolbar
       
    46 item events</xref></p></li>
       
    47 </ul><p><draft-comment translate="no" time="2008-05-12T14:05">We need to provide more clarity
       
    48 on the required order of implementing the use cases and clarify whether there
       
    49 are alternative approaches for achieving the same results.</draft-comment></p><p>The
       
    50 following use cases are optional, allowing you to set additional properties
       
    51 for your toolbar:</p><ul>
       
    52 <li><p><xref href="GUID-81424A53-F598-4E25-BA0A-E2FFA8BCDF2B.dita">Controlling
       
    53 toolbar visibility</xref></p></li>
       
    54 <li><p><xref href="GUID-8845AFD6-F238-43FF-BD7B-902CD8CD3973.dita">Showing and
       
    55 hiding toolbar items</xref></p></li>
       
    56 <li><p><xref href="GUID-A32FFE7A-A531-48D4-AD23-1CC13CB7F4B7.dita">Dynamic initialization
       
    57 of the toolbar</xref></p></li>
       
    58 <li><p><xref href="GUID-A4D8326E-E72F-443D-9CA5-7835D6AE171F.dita">Setting toolbar
       
    59 properties</xref></p></li>
       
    60 </ul></section>
       
    61 <section><title>Implementing a toolbar extension (optional)</title><p>To use
       
    62 a toolbar extension in your application, implement the following use cases:</p><ul>
       
    63 <li><p><xref href="GUID-2D390781-4467-403D-8FFC-8ED5B2319993.dita">Creating the
       
    64 toolbar extension</xref></p></li>
       
    65 <li><p><xref href="GUID-6113CC3B-F994-4AA8-81E9-50433A3266E2.dita">Adding and removing
       
    66 toolbar extension items</xref></p></li>
       
    67 <li><p><xref href="GUID-A168E5EB-4CF7-4B74-B67C-EDFD5378C5BF.dita">Accessing toolbar
       
    68 extension items</xref></p></li>
       
    69 </ul><p>The following use cases are optional, allowing you to set additional
       
    70 properties for your toolbar extension:</p><ul>
       
    71 <li><p><xref href="GUID-270FC83E-1D47-4CF9-A560-FB5DDA53111E.dita">Showing or hiding
       
    72 the toolbar extension</xref></p></li>
       
    73 <li><p><xref href="GUID-8F2D8656-B7F4-4BDA-81CB-8440A2FDDD82.dita">Dimming or hiding
       
    74 toolbar extension items</xref></p></li>
       
    75 </ul></section>
       
    76 <section><title>Main implementation files</title><p>The main implementation
       
    77 files for the Toolbar API are:</p><ul>
       
    78 <li><p>akntoolbar.h for
       
    79 creating the toolbar and setting its properties</p></li>
       
    80 <li><p>akntoolbarobserver.h for
       
    81 handling toolbar events</p></li>
       
    82 <li><p>akntoolbarextension.h for
       
    83 creating the toolbar extension and setting its properties</p></li>
       
    84 </ul></section>
       
    85 </conbody><related-links>
       
    86 <link href="GUID-B05B61B8-1217-441F-BAFA-C209C8F123C5.dita"><linktext>Toolbar API
       
    87 description</linktext></link>
       
    88 <link href="GUID-EB212C35-5416-4CA7-8091-61B45D78E220.dita"><linktext>Look and
       
    89 feel guidelines for the toolbar</linktext></link>
       
    90 </related-links></concept>