Symbian3/PDK/Source/GUID-DB2E0959-C24E-4E6E-BC6D-064B91BDE662.dita
changeset 5 f345bda72bc4
child 14 578be2adaf3e
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
       
     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-DB2E0959-C24E-4E6E-BC6D-064B91BDE662" xml:lang="en"><title>Checking
       
    13 for touch support at runtime</title><shortdesc>The Symbian platform now includes <parmname>AknLayoutUtils::PenEnabled()</parmname> to
       
    14 check for touch support at runtime to allow for reduced run-time memory consumption
       
    15 if the device does not support touch.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    16 <p>Typical cases where <parmname>AknLayoutUtils::PenEnabled()</parmname> might
       
    17 be useful include:</p>
       
    18 <ul>
       
    19 <li><p>In the component’s constructor to skip the creation of touch-only component
       
    20 controls.</p></li>
       
    21 <li><p>In the component’s <parmname>HandleResourceChange</parmname>, create
       
    22 touch-only component controls if the layout is switched from a non-touchable
       
    23 to a touchable one. Touch-only component controls should not be deleted.</p></li>
       
    24 <li><p>In the component’s drawing code.</p></li>
       
    25 </ul>
       
    26 <note><p><codeph>AknLayoutUtils::PenEnabled()</codeph> is supported from S60
       
    27 3rd Edition, FP1, onwards.</p></note>
       
    28 <codeblock xml:space="preserve">void CMyAppContainer::ConstructL( const TRect&amp; aRect )
       
    29     {
       
    30     CreateWindowL();
       
    31     SetRect( aRect );
       
    32  
       
    33     // If the device supports touch, construct long tap detector
       
    34     if ( AknLayoutUtils::PenEnabled() )
       
    35         {
       
    36         iLongTapDetector = CAknLongTapDetector::NewL( this );
       
    37         }
       
    38     ActivateL();
       
    39     }</codeblock>
       
    40 <note><p>You cannot use <codeph>AknLayoutUtils::PenEnabled()</codeph> in <codeph>.rss</codeph> resource
       
    41 files.</p></note>
       
    42 </conbody></concept>