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