<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE concept
PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-95CE2206-7AE0-48C0-97A7-4E2082F9F662" xml:lang="en"><title>Enabling
quick access to functions with a toolbar</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>To use the Toolbar API, follow the steps below.</p>
<ol>
<li id="GUID-EE77C9E2-8E00-4267-81D7-348CEA8196D5">Link the <codeph>AVKON</codeph> libraries
(<codeph>avkon.lib</codeph>, <codeph>eikcoctl.lib</codeph>) to the project
file of the application.</li>
<li id="GUID-ACA972C5-9E34-4220-9161-AFC18AD3194F">Define the toolbar in the
application resources. Set it as application or view specific.</li>
<li id="GUID-5B1DAC49-E8B3-4602-A1DF-B9071FAD8587">Provide a class that implements
the toolbar observer (<codeph><xref href="GUID-4C4ADE30-EE2A-31FE-B029-D0C62632064F.dita"><apiname>MAknToolbarObserver</apiname></xref></codeph>)
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>)
created in the previous step.</li>
<li id="GUID-37161421-986B-4DBA-8E81-57CF8AA3CBBC">If the toolbar items were
not defined in the resources, add them dynamically in the application code.</li>
<li id="GUID-FDCAC051-D66D-4061-98A7-7A0DDAE8F916">In the case of a floating
toolbar, set the toolbar visible. (The framework sets the fixed toolbar automatically
visible when activating the application/view.)</li>
<li id="GUID-32345118-A446-458E-A91D-2AEEE33E13C3">Handle toolbar events using
the observer interface methods.</li>
</ol>
<fig id="GUID-DF6096FC-49A1-4120-81BB-141A1B3ADC8B">
<title>Fixed toolbar with implementation classes</title>
<image href="GUID-ED823C5E-A59B-476A-BF88-0FCBA5D35FED_d0e79634_href.png" scale="50" placement="inline"/>
</fig>
<section id="GUID-96305ADF-504C-416D-9CE8-8727830FC287"><title>Implementing
a toolbar</title><p>To use a toolbar in your application, implement the following
use cases:</p><ul>
<li><p><xref href="GUID-402C3EE7-8852-49B6-BE62-8588753FAC8F.dita">Constructing
the toolbar</xref></p></li>
<li><p><xref href="GUID-58318BAB-2EC4-4C9E-A7CA-580E701EE54F.dita">Adding and removing
toolbar items</xref> (the toolbar buttons are defined in the <xref href="GUID-F3EE1000-71A6-4D48-A30B-3D2357BF20FB.dita">Generic
button API</xref>)</p></li>
<li><p><xref href="GUID-BC3207BF-9E9F-4BA0-8F01-B72228110A61.dita">Accessing the
toolbar from applications or application views</xref></p></li>
<li><p><xref href="GUID-3FE04A31-C35F-47E2-B615-6C1202FB8485.dita">Accessing toolbar
items</xref></p></li>
<li><p><xref href="GUID-7AE34C8A-50C6-49BA-9E43-AE76873B5E12.dita">Handling toolbar
item events</xref></p></li>
</ul><p><draft-comment time="2008-05-12T14:05" translate="no">We need to provide more clarity
on the required order of implementing the use cases and clarify whether there
are alternative approaches for achieving the same results.</draft-comment></p><p>The
following use cases are optional, allowing you to set additional properties
for your toolbar:</p><ul>
<li><p><xref href="GUID-81424A53-F598-4E25-BA0A-E2FFA8BCDF2B.dita">Controlling
toolbar visibility</xref></p></li>
<li><p><xref href="GUID-8845AFD6-F238-43FF-BD7B-902CD8CD3973.dita">Showing and
hiding toolbar items</xref></p></li>
<li><p><xref href="GUID-A32FFE7A-A531-48D4-AD23-1CC13CB7F4B7.dita">Dynamic initialization
of the toolbar</xref></p></li>
<li><p><xref href="GUID-A4D8326E-E72F-443D-9CA5-7835D6AE171F.dita">Setting toolbar
properties</xref></p></li>
</ul></section>
<section id="GUID-E4F98084-4639-47DF-8E0F-2ADECFF42930"><title>Implementing
a toolbar extension (optional)</title><p>To use a toolbar extension in your
application, implement the following use cases:</p><ul>
<li><p><xref href="GUID-2D390781-4467-403D-8FFC-8ED5B2319993.dita">Creating the
toolbar extension</xref></p></li>
<li><p><xref href="GUID-6113CC3B-F994-4AA8-81E9-50433A3266E2.dita">Adding and removing
toolbar extension items</xref></p></li>
<li><p><xref href="GUID-A168E5EB-4CF7-4B74-B67C-EDFD5378C5BF.dita">Accessing toolbar
extension items</xref></p></li>
</ul><p>The following use cases are optional, allowing you to set additional
properties for your toolbar extension:</p><ul>
<li><p><xref href="GUID-270FC83E-1D47-4CF9-A560-FB5DDA53111E.dita">Showing or hiding
the toolbar extension</xref></p></li>
<li><p><xref href="GUID-8F2D8656-B7F4-4BDA-81CB-8440A2FDDD82.dita">Dimming or hiding
toolbar extension items</xref></p></li>
</ul></section>
<section id="GUID-1E0250E3-DEB8-4F42-BD6F-D7FB30A411FE"><title>Main implementation
files</title><p>The main implementation files for the Toolbar API are:</p><ul>
<li><p><codeph>akntoolbar.h</codeph> for creating the toolbar and setting
its properties</p></li>
<li><p><codeph>akntoolbarobserver.h</codeph> for handling toolbar events</p></li>
<li><p><codeph>akntoolbarextension.h</codeph> for creating the toolbar extension
and setting its properties</p></li>
</ul></section>
</conbody><related-links>
<link href="GUID-B05B61B8-1217-441F-BAFA-C209C8F123C5.dita"><linktext>Toolbar API
description</linktext></link>
<link href="GUID-EB212C35-5416-4CA7-8091-61B45D78E220.dita"><linktext>Look and
feel guidelines for the toolbar</linktext></link>
</related-links></concept>