Revert incorrect RCL_3 drop: RCL_3 PDK_3.0.2
authorPat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:29:54 +0100
branchRCL_3
changeset 21 10c6e6d6e4d9
parent 20 41b775cdc0c8
child 22 bec11adf88f9
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
extras/about/aboutgsplugin/Src/aboutgsplugin.cpp
extras/about/aboutgsplugin/Src/aboutgspluginimplementationtable.cpp
extras/about/aboutgsplugin/data/aboutgsplugin.rss
extras/about/aboutgsplugin/data/aboutgspluginrsc.rss
extras/about/aboutgsplugin/group/aboutgsplugin.mmp
extras/about/aboutgsplugin/group/aboutgspluginicons.mk
extras/about/aboutgsplugin/group/bld.inf
extras/about/aboutgsplugin/inc/aboutgsplugin.h
extras/about/aboutgsplugin/loc/aboutgsplugin.loc
extras/about/aif/aboutaif.rss
extras/about/data/about.rss
extras/about/data/about_caption.rss
extras/about/data/about_reg.rss
extras/about/group/About.pkg
extras/about/group/about.mmp
extras/about/group/about_icons.mk
extras/about/group/about_icons_aif_bitmaps.mk
extras/about/group/about_icons_aif_bitmaps_dc.mk
extras/about/group/about_icons_aif_scalable.mk
extras/about/group/about_icons_aif_scalable_dc.mk
extras/about/group/about_icons_dc.mk
extras/about/group/bld.inf
extras/about/inc/AboutApp.h
extras/about/inc/AboutAppUi.h
extras/about/inc/AboutContainer.h
extras/about/inc/AboutDocument.h
extras/about/inc/AboutImage.h
extras/about/inc/about.hrh
extras/about/inc/about.rh
extras/about/inc/about_test.hrh
extras/about/loc/about.loc
extras/about/rom/About.iby
extras/about/rom/AboutResources.iby
extras/about/src/AboutApp.cpp
extras/about/src/AboutAppUi.cpp
extras/about/src/AboutContainer.cpp
extras/about/src/AboutDocument.cpp
extras/about/src/AboutImage.cpp
extras/calcsoft/aif/CalcAif.rss
extras/calcsoft/aif/Calcsoft_caption.rss
extras/calcsoft/group/Calcsoft.mmp
extras/calcsoft/group/Calcsoft.rss
extras/calcsoft/group/Calcsoft_reg.rss
extras/calcsoft/group/backup_registration.xml
extras/calcsoft/group/bld.inf
extras/calcsoft/group/iconlist.txt
extras/calcsoft/group/icons_aif_bitmaps_calcsoft.mk
extras/calcsoft/group/icons_aif_scalable_calcsoft.mk
extras/calcsoft/group/icons_calcsoft.mk
extras/calcsoft/group/icons_scalable_calcsoft.mk
extras/calcsoft/help/data/xhtml.zip
extras/calcsoft/help/group/bld.inf
extras/calcsoft/help/inc/calc.hlp.hrh
extras/calcsoft/help/rom/calcsofthelps_variant.iby
extras/calcsoft/inc/CalcApp.h
extras/calcsoft/inc/CalcAppUi.h
extras/calcsoft/inc/CalcAppUi.inl
extras/calcsoft/inc/CalcCmdBtn.h
extras/calcsoft/inc/CalcCont.h
extras/calcsoft/inc/CalcCont.inl
extras/calcsoft/inc/CalcDoc.h
extras/calcsoft/inc/CalcDrawingConst.laf
extras/calcsoft/inc/CalcEdit.h
extras/calcsoft/inc/CalcEdit.inl
extras/calcsoft/inc/CalcEditLine.inl
extras/calcsoft/inc/CalcEditline.h
extras/calcsoft/inc/CalcEnv.h
extras/calcsoft/inc/CalcEnv.inl
extras/calcsoft/inc/CalcFunc.h
extras/calcsoft/inc/CalcHistory.h
extras/calcsoft/inc/CalcOutSheet.h
extras/calcsoft/inc/CalcOutSheet.inl
extras/calcsoft/inc/CalcView.h
extras/calcsoft/inc/calc.hrh
extras/calcsoft/loc/calc.loc
extras/calcsoft/rom/Calcsoft.iby
extras/calcsoft/rom/CalculatorResources.iby
extras/calcsoft/src/CalcApp.cpp
extras/calcsoft/src/CalcAppUi.cpp
extras/calcsoft/src/CalcCmdBtn.cpp
extras/calcsoft/src/CalcCont.cpp
extras/calcsoft/src/CalcDoc.cpp
extras/calcsoft/src/CalcEdit.cpp
extras/calcsoft/src/CalcEditline.cpp
extras/calcsoft/src/CalcEnv.cpp
extras/calcsoft/src/CalcFunc.cpp
extras/calcsoft/src/CalcHistory.cpp
extras/calcsoft/src/CalcOutSheet.cpp
extras/calcsoft/src/CalcView.cpp
extras/group/bld.inf
group/bld.inf
layers.sysdef.xml
sysdef_1_4_0.dtd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/Src/aboutgsplugin.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,248 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Source file for CAboutGsPlugin class
+*
+*/
+
+
+#include <aknViewAppUi.h>
+#include <ConeResLoader.h>
+#include <barsread.h>       // For TResourceReader
+#include <StringLoader.h>
+#include <apgcli.h>
+#include <AknLaunchAppService.h>
+#include <bautils.h>
+
+// Includes from GS framework:
+#include <gsfwviewuids.h>
+#include <gsprivatepluginproviderids.h>
+
+
+// Plugin includes:
+#include <aboutgspluginrsc.rsg>
+#include <aboutgsplugin.mbg>
+
+
+// Includes
+#include "aboutgsplugin.h"
+
+#define ABOUTAPPUID  0x10005a22
+
+const TUid KAboutGsPluginUid = { 0x102833A0 };
+
+// svg icons
+_LIT( KGSAboutGsPluginIconFileName, "\\resource\\apps\\aboutgsplugin.mif");
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::CAboutGsPlugin()
+//
+// ---------------------------------------------------------------------------
+//
+CAboutGsPlugin::CAboutGsPlugin()
+    : iPlgResourceLoader( *iCoeEnv ), iNullService( NULL )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::~CAboutGsPlugin()
+//
+// ---------------------------------------------------------------------------
+//
+CAboutGsPlugin::~CAboutGsPlugin()
+    {
+    iPlgResourceLoader.Close();
+    if ( iNullService )
+    	{
+    	delete iNullService;
+    	iNullService = NULL;
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::ConstructL()
+//
+// ---------------------------------------------------------------------------
+//
+void CAboutGsPlugin::ConstructL()
+    {
+    OpenLocalizedResourceFileL();
+    }
+
+
+void CAboutGsPlugin::OpenLocalizedResourceFileL()
+    {
+    TFileName resourceFileName;
+    TPtrC driveLetter = TParsePtrC( RProcess().FileName() ).Drive();
+    _LIT( KResoureFileName, "aboutgspluginrsc.rsc" );
+   
+    resourceFileName.Copy( driveLetter );  
+    resourceFileName.Append( KDC_ECOM_RESOURCE_DIR );
+    resourceFileName.Append( KResoureFileName );
+
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+
+    // Find the resource file:
+    TParse parse;
+    parse.Set( resourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+    TFileName fileName( parse.FullName() );
+
+    // Get language of resource file:
+    BaflUtils::NearestLanguageFile( fsSession, fileName );
+
+    // Open resource file:
+    iPlgResourceLoader.OpenL( fileName );
+
+    // If leave occurs before this, close is called automatically when the
+    // thread exits.
+    fsSession.Close ( );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::NewL()
+//
+// ---------------------------------------------------------------------------
+//
+CAboutGsPlugin* CAboutGsPlugin::NewL( TAny* /*aInitParams*/ )
+  {
+  	CAboutGsPlugin* self = new( ELeave ) CAboutGsPlugin();
+  	CleanupStack::PushL( self );
+  	self->ConstructL();
+  	CleanupStack::Pop( self );
+  	return self;
+  }
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+//
+// ---------------------------------------------------------------------------
+//
+TUid CAboutGsPlugin::Id() const
+    {
+    return KAboutGsPluginUid;
+    }
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+//
+// ---------------------------------------------------------------------------
+//
+void CAboutGsPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                                  TUid /*aCustomMessageId*/,
+                                  const TDesC8& /*aCustomMessage*/ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+//
+// ---------------------------------------------------------------------------
+//
+void CAboutGsPlugin::DoDeactivate()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::GetCaptionL()
+//
+// ---------------------------------------------------------------------------
+//
+void CAboutGsPlugin::GetCaptionL( TDes& aCaption ) const
+	{
+	HBufC* result = StringLoader::LoadL( R_ABOUT_GS_VIEW_CAPTION );
+	aCaption.Copy( *result );
+	delete result;
+	result = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::PluginProviderCategory()
+//
+// ---------------------------------------------------------------------------
+//
+TInt CAboutGsPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::CreateIconL
+// Return the icon, if has one.
+// ---------------------------------------------------------------------------
+//
+CGulIcon* CAboutGsPlugin::CreateIconL( const TUid aIconType )
+    {
+    CGulIcon* icon;
+
+    if( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpDevAbout,
+        KGSAboutGsPluginIconFileName,
+        EMbmAboutgspluginQgn_prop_cp_dev_about,
+        EMbmAboutgspluginQgn_prop_cp_dev_about_mask );
+        }
+     else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    return icon;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::ItemType
+// ---------------------------------------------------------------------------
+//
+TGSListboxItemTypes CAboutGsPlugin::ItemType()
+    {
+    // See TGSListboxItemTypes for details.
+    return EGSItemTypeSettingDialog;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::HandleSelection
+// ---------------------------------------------------------------------------
+//
+void CAboutGsPlugin::HandleSelection( 
+        const TGSSelectionTypes /*aSelectionType*/ )
+    {
+    // This used as a call-back from paren plugin to handle selection. Because
+    // this plugin is of type EGSItemTypeSettingDialog, DoActivateL is never 
+    // called on selection but only HandleSelection. See TGSListboxItemTypes
+    // for details.
+    TRAP_IGNORE( LaunchAboutAppL() );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CAboutGsPlugin::LaunchAboutAppL
+// ---------------------------------------------------------------------------
+//
+void CAboutGsPlugin::LaunchAboutAppL()
+    {
+    TUid  aboutAppUid;
+    aboutAppUid.iUid = ABOUTAPPUID;
+    iNullService = CAknNullService::NewL( aboutAppUid, NULL );
+    }
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/Src/aboutgspluginimplementationtable.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  ECOM proxy table for this plugin
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// User includes
+#include "aboutgsplugin.h"
+
+// Constants
+const TImplementationProxy KAboutGsPluginImplementationTable[] = 
+	{
+		IMPLEMENTATION_PROXY_ENTRY( 0x1028338B,	CAboutGsPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KAboutGsPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KAboutGsPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/data/aboutgsplugin.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  ECOM plugin resource file for aboutgsplugin.
+*
+*/
+
+
+// INCLUDES
+#include <registryinfo.rh>
+
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x102833A0; 
+	interfaces  = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236; // General settings interface uid
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x1028338B;
+					version_no          = 1;
+					display_name        = "About Plugin";
+					default_data        = "0x10283317"; // Device Management plugin id
+					opaque_data         = "60";//Order number
+					}
+				};
+			}
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/data/aboutgspluginrsc.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Resource file for aboutgsplugin
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    ABUT // 4 letter ID
+
+//  System Includes
+#include <avkon.loc> 
+#include <avkon.mbg>
+#include <avkon.rsg>
+#include <eikcore.rsg>
+#include <uikon.rh>
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.rh>
+#include <avkon.hrh>
+
+
+
+// User includes
+#include <aboutgsplugin.loc>
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+//----------------------------------------------------
+//  r_about_gs_view_caption
+// About view caption for plugin
+//----------------------------------------------------
+//
+RESOURCE TBUF r_about_gs_view_caption
+    {
+	    buf = qtn_cp_folder_about;
+    }
+
+//----------------------------------------------------
+//    r_about_gs_view_title
+//    About view title
+//----------------------------------------------------
+//
+
+RESOURCE TITLE_PANE r_about_gs_view_title
+    {
+	    txt = qtn_set_title_settings_About;        
+    }
+
+//----------------------------------------------------
+//    r_about_gs_view
+//    About view's menu
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_about_gs_view 
+    {
+  	  menubar = r_about_gs_menubar_view; 
+ 	  cba = r_about_gs_softkeys;
+    }
+
+//----------------------------------------------------
+//    r_about_gs_menubar_view
+//    About view's menu items
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_about_gs_menubar_view 
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane = r_about_gs_menu_item_exit;},
+        MENU_TITLE { menu_pane = r_about_gs_view_menu;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+// r_about_gs_menu_item_exit
+// About view menu's EXIT item
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_about_gs_menu_item_exit
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//    r_about_gs_view_menu
+//    About view menu's OPEN item
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_about_gs_view_menu
+    {
+    items=
+        {
+        MENU_ITEM 
+            {
+            command = EAknSoftkeyOpen;
+            txt = qtn_options_open;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//    r_about_gs_softkeys
+//    About gs plugin's softkeys
+//----------------------------------------------------
+//
+RESOURCE CBA r_about_gs_softkeys
+	{
+	buttons =
+		{
+		CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option;},
+		CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_exit; },
+		CBA_BUTTON { id = EAknSoftkeyOpen; txt = text_softkey_open;}
+		};
+	}
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/group/aboutgsplugin.mmp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Project specification file.
+*
+*/
+
+
+
+#include  <data_caging_paths.hrh>    
+#include <platform_paths.hrh>
+
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              aboutgsplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x102833A0 //dll uid
+VENDORID            VID_DEFAULT
+
+// Source
+SOURCEPATH  ../Src
+SOURCE      aboutgspluginimplementationtable.cpp
+SOURCE      aboutgsplugin.cpp
+
+
+//User include paths
+USERINCLUDE     ../inc
+USERINCLUDE     ../data
+
+
+//System include paths
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+APP_LAYER_SYSTEMINCLUDE
+
+// Resource
+SOURCEPATH      ../data
+
+START RESOURCE  aboutgsplugin.rss
+TARGET          aboutgsplugin.rsc
+END
+
+START RESOURCE  ../data/aboutgspluginrsc.rss
+HEADER
+LANGUAGE_IDS
+END
+
+// Libraries 
+LIBRARY   euser.lib
+LIBRARY   ecom.lib
+LIBRARY   efsrv.lib
+LIBRARY   avkon.lib
+LIBRARY   bafl.lib 
+LIBRARY   cone.lib 
+LIBRARY   eikcoctl.lib 
+LIBRARY   eikcore.lib 
+LIBRARY   egul.lib
+LIBRARY   flogger.lib           // File logging
+LIBRARY   commonengine.lib      // For RConeResourceLoader
+LIBRARY   featmgr.lib           // Feature manager 
+LIBRARY   centralrepository.lib
+LIBRARY   aknskinsrv.lib        // for enhanced skinning
+LIBRARY   aknskins.lib          // for enhanced skinning
+LIBRARY   gsecomplugin.lib
+LIBRARY   hlplch.lib            // for "Help" options menu
+LIBRARY   gsframework.lib       // For base classes
+LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
+LIBRARY   apgrfx.lib 
+LIBRARY   apparc.lib
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/group/aboutgspluginicons.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: icons makefile for aboutplugin
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\aboutgsplugin.mif
+HEADERFILENAME=$(HEADERDIR)\aboutgsplugin.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+		/c8,8 qgn_prop_cp_dev_about.svg
+
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/group/bld.inf	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  This file provides the information required for building 
+*                AboutGsPlugin
+*
+*/
+
+
+#include  <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+// export localised loc file
+../loc/aboutgsplugin.loc APP_LAYER_LOC_EXPORT_PATH(aboutgsplugin.loc)
+
+// Only for 5.0 release 
+#ifdef  RD_CONTROL_PANEL
+	PRJ_MMPFILES
+	//gnumakefile aboutgspluginicons.mk
+	aboutgsplugin.mmp
+
+PRJ_EXTENSIONS
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE aboutgsplugin.mif
+OPTION HEADERFILE aboutgsplugin.mbg
+OPTION SOURCES -c8,8 qgn_prop_cp_dev_about
+END
+#endif //RD_CONTROL_PANEL
+
+PRJ_TESTMMPFILES
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/inc/aboutgsplugin.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Container for the About sub-folder
+*
+*/
+
+
+#ifndef ABOUTGSPLUGIN_H
+#define ABOUTGSPLUGIN_H
+
+// Includes
+#include <aknview.h>
+#include <eikclb.h>
+#include <gsplugininterface.h>
+#include <gsfwviewuids.h>
+#include <ConeResLoader.h>
+#include <AknNullService.h>
+
+// Classes referenced
+class CAknViewAppUi;
+class RConeResourceLoader;
+
+
+// CLASS DECLARATION
+
+/**
+* CAboutGsPlugin view class.
+* @since S60_5.0
+*/
+class CAboutGsPlugin : public CGSPluginInterface
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CAboutGsPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CAboutGsPlugin();
+
+    public: // From CAknView
+
+        /**
+        * See base class.
+        */
+        TUid Id() const;
+
+        /**
+        * See base class.
+        */
+        void DoActivateL( const TVwsViewId& aPrevViewId,
+                          TUid aCustomMessageId,
+                          const TDesC8& aCustomMessage );
+        /**
+        * See base class.
+        */
+        void DoDeactivate();
+
+    public: // From CGSPluginInterface
+
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * @see CGSPluginInterface header file.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+        /**
+        * See base class.
+        */
+        TGSListboxItemTypes ItemType();
+
+        /**
+        * See base class.
+        */
+        void HandleSelection(const TGSSelectionTypes aSelectionType );
+        
+    protected: // New
+        /**
+        * C++ default constructor.
+        */
+        CAboutGsPlugin();
+    
+     private:
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+        
+        void LaunchAboutAppL();
+        void OpenLocalizedResourceFileL();
+         
+    private: // Data
+
+        // Resource loader.
+        RConeResourceLoader iPlgResourceLoader;
+        CAknNullService *iNullService;
+    };
+
+#endif //ABOUTGSPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aboutgsplugin/loc/aboutgsplugin.loc	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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: 
+*
+* Description:  Localization strings for GSSecurityPlugin
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+//d:Text of a list item in General folder list
+//d:Item opens Security folder
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 5.0
+#define qtn_cp_folder_about "About"
+
+//d:Text in title pane
+//d:About view
+//l:title_pane_t2/opt9
+//w:
+//r: 5.0
+#define qtn_set_title_settings_about "About Settings"
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/aif/aboutaif.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  resource file
+*
+*/
+
+
+#include <aiftool.rh>
+
+RESOURCE AIF_DATA
+    {
+    app_uid = 0x10005A22;
+    num_icons = 1;
+    embeddability = KAppNotEmbeddable;
+    newfile = KAppDoesNotSupportNewFile;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/data/about.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,1097 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Resource file for about
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    ABOU // 4 letter ID
+
+//  INCLUDES
+
+#include "about.rh"
+#include "about.hrh"
+#include <about.loc>
+#include <about.mbg>
+
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.loc>
+#include <avkon.rsg>
+#include <avkon.mbg>
+
+#include <appinfo.rh>
+
+#include <data_caging_paths_strings.hrh>
+
+    #define about_mbm APP_BITMAP_DIR"\\about.mbm"
+
+RESOURCE RSS_SIGNATURE {}
+
+RESOURCE TBUF { buf= ""; }
+
+RESOURCE EIK_APP_INFO
+    {
+    	status_pane = r_about_status_pane;
+    	
+    	// for 5.0
+    	#ifdef RD_CONTROL_PANEL
+    		cba = R_AVKON_SOFTKEYS_BACK;
+ 	 	#else
+ 	 		cba = R_AVKON_SOFTKEYS_EXIT;
+ 	 	#endif	
+ 	 		
+ 	 // no menu bar
+    }
+
+
+RESOURCE STATUS_PANE_APP_MODEL r_about_status_pane
+    {
+    panes =
+        {
+        SPANE_PANE
+            {
+            id = EEikStatusPaneUidTitle;
+            type = EAknCtTitlePane;
+            resource = r_about_title_pane;
+            }
+#ifndef __SCALABLE_ICONS
+,
+        SPANE_PANE
+            {
+            id = EEikStatusPaneUidContext;
+            type = EAknCtContextPane;
+            resource =  r_about_title_icon;
+            }
+#endif            
+        };
+    
+}
+
+RESOURCE TITLE_PANE r_about_title_pane
+    {
+    txt = qtn_about_title_text;
+    }
+
+RESOURCE CONTEXT_PANE r_about_title_icon
+    {
+    bmpfile = about_mbm;
+    bmpid = EMbmAboutQgn_menu_about_cxt;
+    bmpmask = EMbmAboutQgn_menu_about_cxt_mask;
+    }
+    
+// Texts and images appear in this order on the about screen.
+// Every new text item starts from a new line.
+
+RESOURCE ABOUT_ITEM_LIST r_about_main_text
+    {
+    items =
+        {     
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_1;
+			},
+		ABOUT_TEXT
+			{
+            updatetimeflag = EAboutUpdateTime;
+            txt = r_about_legal_text_2;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_3;
+			},
+		ABOUT_IMAGE
+			{
+			bmpfile = about_mbm;
+			bmpid = EMbmAboutQgn_graf_java_logo;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_4;
+            },
+        ABOUT_TEXT
+            {
+            txt = r_about_legal_text_5;
+            },
+#ifdef FF_VIDEO_AUDIO_BRANDING
+    	ABOUT_TEXT
+    		{
+    		txt = r_about_legal_text_193;
+    		},
+#endif
+        ABOUT_TEXT
+            {
+			txt = r_about_legal_text_6;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_7;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_8;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_9;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_10;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_11;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_12;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_13;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_14;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_15;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_16;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_17;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_18;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_19;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_20;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_21;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_22;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_23;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_24;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_25;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_26;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_27;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_28;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_29;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_30;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_31;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_32;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_33;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_34;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_35;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_36;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_37;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_38;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_39;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_40;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_41;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_42;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_43;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_44;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_45;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_46;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_47;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_48;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_49;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_50;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_51;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_52;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_53;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_54;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_55;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_56;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_57;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_58;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_59;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_60;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_61;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_62;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_63;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_64;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_65;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_66;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_67;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_68;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_69;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_70;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_71;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_72;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_73;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_74;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_75;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_76;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_77;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_78;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_79;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_80;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_81;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_82;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_83;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_84;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_85;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_86;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_87;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_88;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_89;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_90;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_91;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_92;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_93;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_94;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_95;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_96;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_97;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_98;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_99;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_100;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_101;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_102;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_103;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_104;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_105;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_106;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_107;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_108;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_109;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_110;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_111;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_112;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_113;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_114;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_115;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_116;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_117;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_118;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_119;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_120;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_121;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_122;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_123;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_124;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_125;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_126;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_127;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_128;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_129;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_130;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_131;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_132;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_133;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_134;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_135;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_136;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_137;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_138;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_139;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_140;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_141;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_142;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_143;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_144;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_145;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_146;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_147;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_148;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_149;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_150;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_151;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_152;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_153;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_154;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_155;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_156;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_157;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_158;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_159;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_160;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_161;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_162;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_163;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_164;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_165;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_166;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_167;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_168;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_169;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_170;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_171;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_172;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_173;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_174;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_175;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_176;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_177;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_178;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_179;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_180;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_181;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_182;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_183;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_184;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_185;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_186;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_187;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_188;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_189;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_190;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_191;
+			},
+		ABOUT_TEXT
+			{
+			txt = r_about_legal_text_192;
+			}
+		};
+	}
+    
+RESOURCE TBUF r_about_legal_text_1   { buf = qtn_about_legal_text_1; }
+RESOURCE TBUF r_about_legal_text_2   { buf = qtn_about_legal_text_2; }
+RESOURCE TBUF r_about_legal_text_3   { buf = qtn_about_legal_text_3; }
+RESOURCE TBUF r_about_legal_text_4   { buf = qtn_about_legal_text_4; }
+RESOURCE TBUF r_about_legal_text_5   { buf = qtn_about_legal_text_5; }
+RESOURCE TBUF r_about_legal_text_6   { buf = qtn_about_legal_text_6; }
+RESOURCE TBUF r_about_legal_text_7   { buf = qtn_about_legal_text_7; }
+RESOURCE TBUF r_about_legal_text_8	 { buf = qtn_about_legal_text_8; } 
+RESOURCE TBUF r_about_legal_text_9	 { buf = qtn_about_legal_text_9; } 
+RESOURCE TBUF r_about_legal_text_10	 { buf = qtn_about_legal_text_10; } 
+RESOURCE TBUF r_about_legal_text_11  { buf = qtn_about_legal_text_11; } 
+RESOURCE TBUF r_about_legal_text_12	 { buf = qtn_about_legal_text_12; } 
+RESOURCE TBUF r_about_legal_text_13	 { buf = qtn_about_legal_text_13; } 	
+RESOURCE TBUF r_about_legal_text_14	 { buf = qtn_about_legal_text_14; } 
+RESOURCE TBUF r_about_legal_text_15	 { buf = qtn_about_legal_text_15; } 
+RESOURCE TBUF r_about_legal_text_16	 { buf = qtn_about_legal_text_16; } 
+RESOURCE TBUF r_about_legal_text_17	 { buf = qtn_about_legal_text_17; } 
+RESOURCE TBUF r_about_legal_text_18	 { buf = qtn_about_legal_text_18; } 
+RESOURCE TBUF r_about_legal_text_19  { buf = qtn_about_legal_text_19; } 
+RESOURCE TBUF r_about_legal_text_20  { buf = qtn_about_legal_text_20; } 
+RESOURCE TBUF r_about_legal_text_21  { buf = qtn_about_legal_text_21; } 
+RESOURCE TBUF r_about_legal_text_22  { buf = qtn_about_legal_text_22; }
+RESOURCE TBUF r_about_legal_text_23  { buf = qtn_about_legal_text_23; }
+RESOURCE TBUF r_about_legal_text_24  { buf = qtn_about_legal_text_24; }
+RESOURCE TBUF r_about_legal_text_25  { buf = qtn_about_legal_text_25; }
+RESOURCE TBUF r_about_legal_text_26  { buf = qtn_about_legal_text_26; }
+RESOURCE TBUF r_about_legal_text_27  { buf = qtn_about_legal_text_27; }
+RESOURCE TBUF r_about_legal_text_28	 { buf = qtn_about_legal_text_28; } 
+RESOURCE TBUF r_about_legal_text_29	 { buf = qtn_about_legal_text_29; } 
+RESOURCE TBUF r_about_legal_text_30	 { buf = qtn_about_legal_text_30; } 
+RESOURCE TBUF r_about_legal_text_31  { buf = qtn_about_legal_text_31; } 
+RESOURCE TBUF r_about_legal_text_32  { buf = qtn_about_legal_text_32; }
+RESOURCE TBUF r_about_legal_text_33  { buf = qtn_about_legal_text_33; }
+RESOURCE TBUF r_about_legal_text_34  { buf = qtn_about_legal_text_34; }
+RESOURCE TBUF r_about_legal_text_35  { buf = qtn_about_legal_text_35; }
+RESOURCE TBUF r_about_legal_text_36  { buf = qtn_about_legal_text_36; }
+RESOURCE TBUF r_about_legal_text_37  { buf = qtn_about_legal_text_37; }
+RESOURCE TBUF r_about_legal_text_38	 { buf = qtn_about_legal_text_38; } 
+RESOURCE TBUF r_about_legal_text_39	 { buf = qtn_about_legal_text_39; } 
+RESOURCE TBUF r_about_legal_text_40	 { buf = qtn_about_legal_text_40; } 
+RESOURCE TBUF r_about_legal_text_41   { buf = qtn_about_legal_text_41; }
+RESOURCE TBUF r_about_legal_text_42   { buf = qtn_about_legal_text_42; }
+RESOURCE TBUF r_about_legal_text_43   { buf = qtn_about_legal_text_43; }
+RESOURCE TBUF r_about_legal_text_44   { buf = qtn_about_legal_text_44; }
+RESOURCE TBUF r_about_legal_text_45   { buf = qtn_about_legal_text_45; }
+RESOURCE TBUF r_about_legal_text_46   { buf = qtn_about_legal_text_46; }
+RESOURCE TBUF r_about_legal_text_47   { buf = qtn_about_legal_text_47; }
+RESOURCE TBUF r_about_legal_text_48	 { buf = qtn_about_legal_text_48; } 
+RESOURCE TBUF r_about_legal_text_49	 { buf = qtn_about_legal_text_49; } 
+RESOURCE TBUF r_about_legal_text_50	 { buf = qtn_about_legal_text_50; }
+RESOURCE TBUF r_about_legal_text_51   { buf = qtn_about_legal_text_51; }
+RESOURCE TBUF r_about_legal_text_52   { buf = qtn_about_legal_text_52; }
+RESOURCE TBUF r_about_legal_text_53   { buf = qtn_about_legal_text_53; }
+RESOURCE TBUF r_about_legal_text_54   { buf = qtn_about_legal_text_54; }
+RESOURCE TBUF r_about_legal_text_55   { buf = qtn_about_legal_text_55; }
+RESOURCE TBUF r_about_legal_text_56   { buf = qtn_about_legal_text_56; }
+RESOURCE TBUF r_about_legal_text_57   { buf = qtn_about_legal_text_57; }
+RESOURCE TBUF r_about_legal_text_58	 { buf = qtn_about_legal_text_58; } 
+RESOURCE TBUF r_about_legal_text_59	 { buf = qtn_about_legal_text_59; } 
+RESOURCE TBUF r_about_legal_text_60	 { buf = qtn_about_legal_text_60; } 
+RESOURCE TBUF r_about_legal_text_61   { buf = qtn_about_legal_text_61; }
+RESOURCE TBUF r_about_legal_text_62   { buf = qtn_about_legal_text_62; }
+RESOURCE TBUF r_about_legal_text_63   { buf = qtn_about_legal_text_63; }
+RESOURCE TBUF r_about_legal_text_64   { buf = qtn_about_legal_text_64; }
+RESOURCE TBUF r_about_legal_text_65   { buf = qtn_about_legal_text_65; }
+RESOURCE TBUF r_about_legal_text_66   { buf = qtn_about_legal_text_66; }
+RESOURCE TBUF r_about_legal_text_67   { buf = qtn_about_legal_text_67; }
+RESOURCE TBUF r_about_legal_text_68	 { buf = qtn_about_legal_text_68; } 
+RESOURCE TBUF r_about_legal_text_69	 { buf = qtn_about_legal_text_69; } 
+RESOURCE TBUF r_about_legal_text_70	 { buf = qtn_about_legal_text_70; } 
+RESOURCE TBUF r_about_legal_text_71   { buf = qtn_about_legal_text_71; }
+RESOURCE TBUF r_about_legal_text_72   { buf = qtn_about_legal_text_72; }
+RESOURCE TBUF r_about_legal_text_73   { buf = qtn_about_legal_text_73; }
+RESOURCE TBUF r_about_legal_text_74   { buf = qtn_about_legal_text_74; }
+RESOURCE TBUF r_about_legal_text_75   { buf = qtn_about_legal_text_75; }
+RESOURCE TBUF r_about_legal_text_76   { buf = qtn_about_legal_text_76; }
+RESOURCE TBUF r_about_legal_text_77   { buf = qtn_about_legal_text_77; }
+RESOURCE TBUF r_about_legal_text_78	 { buf = qtn_about_legal_text_78; } 
+RESOURCE TBUF r_about_legal_text_79	 { buf = qtn_about_legal_text_79; } 
+RESOURCE TBUF r_about_legal_text_80	 { buf = qtn_about_legal_text_80; }
+RESOURCE TBUF r_about_legal_text_81   { buf = qtn_about_legal_text_81; }
+RESOURCE TBUF r_about_legal_text_82   { buf = qtn_about_legal_text_82; }
+RESOURCE TBUF r_about_legal_text_83   { buf = qtn_about_legal_text_83; }
+RESOURCE TBUF r_about_legal_text_84   { buf = qtn_about_legal_text_84; }
+RESOURCE TBUF r_about_legal_text_85   { buf = qtn_about_legal_text_85; }
+RESOURCE TBUF r_about_legal_text_86   { buf = qtn_about_legal_text_86; }
+RESOURCE TBUF r_about_legal_text_87   { buf = qtn_about_legal_text_87; }
+RESOURCE TBUF r_about_legal_text_88	 { buf = qtn_about_legal_text_88; } 
+RESOURCE TBUF r_about_legal_text_89	 { buf = qtn_about_legal_text_89; } 
+RESOURCE TBUF r_about_legal_text_90	 { buf = qtn_about_legal_text_90; } 
+RESOURCE TBUF r_about_legal_text_91   { buf = qtn_about_legal_text_91; }
+RESOURCE TBUF r_about_legal_text_92   { buf = qtn_about_legal_text_92; }
+RESOURCE TBUF r_about_legal_text_93   { buf = qtn_about_legal_text_93; }
+RESOURCE TBUF r_about_legal_text_94   { buf = qtn_about_legal_text_94; }
+RESOURCE TBUF r_about_legal_text_95   { buf = qtn_about_legal_text_95; }
+RESOURCE TBUF r_about_legal_text_96   { buf = qtn_about_legal_text_96; }
+RESOURCE TBUF r_about_legal_text_97   { buf = qtn_about_legal_text_97; }
+RESOURCE TBUF r_about_legal_text_98	 { buf = qtn_about_legal_text_98; } 
+RESOURCE TBUF r_about_legal_text_99	 { buf = qtn_about_legal_text_99; } 
+RESOURCE TBUF r_about_legal_text_100 { buf = qtn_about_legal_text_100; }
+RESOURCE TBUF r_about_legal_text_101  { buf = qtn_about_legal_text_101; }
+RESOURCE TBUF r_about_legal_text_102  { buf = qtn_about_legal_text_102; }
+RESOURCE TBUF r_about_legal_text_103  { buf = qtn_about_legal_text_103; }
+RESOURCE TBUF r_about_legal_text_104  { buf = qtn_about_legal_text_104; }
+RESOURCE TBUF r_about_legal_text_105  { buf = qtn_about_legal_text_105; }
+RESOURCE TBUF r_about_legal_text_106  { buf = qtn_about_legal_text_106; }
+RESOURCE TBUF r_about_legal_text_107  { buf = qtn_about_legal_text_107; }
+RESOURCE TBUF r_about_legal_text_108  { buf = qtn_about_legal_text_108; }
+RESOURCE TBUF r_about_legal_text_109  { buf = qtn_about_legal_text_109; }
+RESOURCE TBUF r_about_legal_text_110  { buf = qtn_about_legal_text_110; }
+RESOURCE TBUF r_about_legal_text_111  { buf = qtn_about_legal_text_111; }
+RESOURCE TBUF r_about_legal_text_112  { buf = qtn_about_legal_text_112; }
+RESOURCE TBUF r_about_legal_text_113  { buf = qtn_about_legal_text_113; }
+RESOURCE TBUF r_about_legal_text_114  { buf = qtn_about_legal_text_114; }
+RESOURCE TBUF r_about_legal_text_115  { buf = qtn_about_legal_text_115; }
+RESOURCE TBUF r_about_legal_text_116  { buf = qtn_about_legal_text_116; }
+RESOURCE TBUF r_about_legal_text_117  { buf = qtn_about_legal_text_117; }
+RESOURCE TBUF r_about_legal_text_118  { buf = qtn_about_legal_text_118; }
+RESOURCE TBUF r_about_legal_text_119  { buf = qtn_about_legal_text_119; }
+RESOURCE TBUF r_about_legal_text_120  { buf = qtn_about_legal_text_120; }
+RESOURCE TBUF r_about_legal_text_121  { buf = qtn_about_legal_text_121; }
+RESOURCE TBUF r_about_legal_text_122  { buf = qtn_about_legal_text_122; }
+RESOURCE TBUF r_about_legal_text_123  { buf = qtn_about_legal_text_123; }
+RESOURCE TBUF r_about_legal_text_124  { buf = qtn_about_legal_text_124; }
+RESOURCE TBUF r_about_legal_text_125  { buf = qtn_about_legal_text_125; }
+RESOURCE TBUF r_about_legal_text_126  { buf = qtn_about_legal_text_126; }
+RESOURCE TBUF r_about_legal_text_127  { buf = qtn_about_legal_text_127; }
+RESOURCE TBUF r_about_legal_text_128  { buf = qtn_about_legal_text_128; }
+RESOURCE TBUF r_about_legal_text_129  { buf = qtn_about_legal_text_129; }
+RESOURCE TBUF r_about_legal_text_130  { buf = qtn_about_legal_text_130; }
+RESOURCE TBUF r_about_legal_text_131  { buf = qtn_about_legal_text_131; }
+RESOURCE TBUF r_about_legal_text_132  { buf = qtn_about_legal_text_132; }
+RESOURCE TBUF r_about_legal_text_133  { buf = qtn_about_legal_text_133; }
+RESOURCE TBUF r_about_legal_text_134  { buf = qtn_about_legal_text_134; }
+RESOURCE TBUF r_about_legal_text_135  { buf = qtn_about_legal_text_135; }
+RESOURCE TBUF r_about_legal_text_136  { buf = qtn_about_legal_text_136; }
+RESOURCE TBUF r_about_legal_text_137  { buf = qtn_about_legal_text_137; }
+RESOURCE TBUF r_about_legal_text_138  { buf = qtn_about_legal_text_138; }
+RESOURCE TBUF r_about_legal_text_139  { buf = qtn_about_legal_text_139; }
+RESOURCE TBUF r_about_legal_text_140  { buf = qtn_about_legal_text_140; }
+RESOURCE TBUF r_about_legal_text_141  { buf = qtn_about_legal_text_141; }
+RESOURCE TBUF r_about_legal_text_142  { buf = qtn_about_legal_text_142; }
+RESOURCE TBUF r_about_legal_text_143  { buf = qtn_about_legal_text_143; }
+RESOURCE TBUF r_about_legal_text_144  { buf = qtn_about_legal_text_144; }
+RESOURCE TBUF r_about_legal_text_145  { buf = qtn_about_legal_text_145; }
+RESOURCE TBUF r_about_legal_text_146  { buf = qtn_about_legal_text_146; }
+RESOURCE TBUF r_about_legal_text_147  { buf = qtn_about_legal_text_147; }
+RESOURCE TBUF r_about_legal_text_148  { buf = qtn_about_legal_text_148; }
+RESOURCE TBUF r_about_legal_text_149  { buf = qtn_about_legal_text_149; }
+RESOURCE TBUF r_about_legal_text_150  { buf = qtn_about_legal_text_150; }
+RESOURCE TBUF r_about_legal_text_151  { buf = qtn_about_legal_text_151; }
+RESOURCE TBUF r_about_legal_text_152  { buf = qtn_about_legal_text_152; }
+RESOURCE TBUF r_about_legal_text_153  { buf = qtn_about_legal_text_153; }
+RESOURCE TBUF r_about_legal_text_154  { buf = qtn_about_legal_text_154; }
+RESOURCE TBUF r_about_legal_text_155  { buf = qtn_about_legal_text_155; }
+RESOURCE TBUF r_about_legal_text_156  { buf = qtn_about_legal_text_156; }
+RESOURCE TBUF r_about_legal_text_157  { buf = qtn_about_legal_text_157; }
+RESOURCE TBUF r_about_legal_text_158  { buf = qtn_about_legal_text_158; }
+RESOURCE TBUF r_about_legal_text_159  { buf = qtn_about_legal_text_159; }
+RESOURCE TBUF r_about_legal_text_160  { buf = qtn_about_legal_text_160; }
+RESOURCE TBUF r_about_legal_text_161  { buf = qtn_about_legal_text_161; }
+RESOURCE TBUF r_about_legal_text_162  { buf = qtn_about_legal_text_162; }
+RESOURCE TBUF r_about_legal_text_163  { buf = qtn_about_legal_text_163; }
+RESOURCE TBUF r_about_legal_text_164  { buf = qtn_about_legal_text_164; }
+RESOURCE TBUF r_about_legal_text_165  { buf = qtn_about_legal_text_165; }
+RESOURCE TBUF r_about_legal_text_166  { buf = qtn_about_legal_text_166; }
+RESOURCE TBUF r_about_legal_text_167  { buf = qtn_about_legal_text_167; }
+RESOURCE TBUF r_about_legal_text_168  { buf = qtn_about_legal_text_168; }
+RESOURCE TBUF r_about_legal_text_169  { buf = qtn_about_legal_text_169; }
+RESOURCE TBUF r_about_legal_text_170  { buf = qtn_about_legal_text_170; }
+RESOURCE TBUF r_about_legal_text_171  { buf = qtn_about_legal_text_171; }
+RESOURCE TBUF r_about_legal_text_172  { buf = qtn_about_legal_text_172; }
+RESOURCE TBUF r_about_legal_text_173  { buf = qtn_about_legal_text_173; }
+RESOURCE TBUF r_about_legal_text_174  { buf = qtn_about_legal_text_174; }
+RESOURCE TBUF r_about_legal_text_175  { buf = qtn_about_legal_text_175; }
+RESOURCE TBUF r_about_legal_text_176  { buf = qtn_about_legal_text_176; }
+RESOURCE TBUF r_about_legal_text_177  { buf = qtn_about_legal_text_177; }
+RESOURCE TBUF r_about_legal_text_178  { buf = qtn_about_legal_text_178; }
+RESOURCE TBUF r_about_legal_text_179  { buf = qtn_about_legal_text_179; }
+RESOURCE TBUF r_about_legal_text_180  { buf = qtn_about_legal_text_180; }
+RESOURCE TBUF r_about_legal_text_181  { buf = qtn_about_legal_text_181; }
+RESOURCE TBUF r_about_legal_text_182  { buf = qtn_about_legal_text_182; }
+RESOURCE TBUF r_about_legal_text_183  { buf = qtn_about_legal_text_183; }
+RESOURCE TBUF r_about_legal_text_184  { buf = qtn_about_legal_text_184; }
+RESOURCE TBUF r_about_legal_text_185  { buf = qtn_about_legal_text_185; }
+RESOURCE TBUF r_about_legal_text_186  { buf = qtn_about_legal_text_186; }
+RESOURCE TBUF r_about_legal_text_187  { buf = qtn_about_legal_text_187; }
+RESOURCE TBUF r_about_legal_text_188  { buf = qtn_about_legal_text_188; }
+RESOURCE TBUF r_about_legal_text_189  { buf = qtn_about_legal_text_189; }
+RESOURCE TBUF r_about_legal_text_190  { buf = qtn_about_legal_text_190; }
+RESOURCE TBUF r_about_legal_text_191  { buf = qtn_about_legal_text_191; }
+RESOURCE TBUF r_about_legal_text_192  { buf = qtn_about_legal_text_192; }
+RESOURCE TBUF r_about_legal_text_193  { buf = qtn_about_legal_text_193; }
+
+RESOURCE LOCALISABLE_APP_INFO r_about_localisable_app_info
+    {
+    short_caption = qtn_apps_about_grid;
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_apps_about_list;
+#ifdef __SCALABLE_ICONS
+        number_of_icons = 1;
+        icon_file = APP_BITMAP_DIR"\\about_aif.mif";
+#else
+        number_of_icons = 2;
+        icon_file = APP_BITMAP_DIR"\\about_aif.mbm";
+#endif
+        };
+    }
+
+        
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/data/about_caption.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Resource file for about
+*
+*/
+
+
+#include <about.loc>
+#include <apcaptionfile.rh>
+
+RESOURCE CAPTION_DATA
+    {
+    caption = qtn_apps_about_list;
+    shortcaption = qtn_apps_about_grid;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/data/about_reg.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description: This file contains the application registration resource.
+*
+*/
+
+
+#include <appinfo.rh>
+#include <about.rsg>
+#include <data_caging_paths_strings.hrh>
+#include <about.loc>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x10005A22 // Define your application UID here
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "About";
+  
+    localisable_resource_file = APP_RESOURCE_DIR"\\About";
+    localisable_resource_id = R_ABOUT_LOCALISABLE_APP_INFO;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/About.pkg	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "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:
+;
+; Description:  package file
+;
+&EN
+;Header
+#{"About"},(0x10005A22),0,0,0
+
+;Supports Series 60 v 0.9
+;This line indicates that this installation is for the Series 60 platform v0.9
+;This line must appear _exactly_ as shown below in the sis file
+;If this line is missing or incorrect, the sis file will not be able
+;to be installed on Series 60 v0.9 platforms
+(0x101F6F88), 0, 0, 0, 
+{"Series60ProductID"}
+
+"\epoc32\release\thumb\urel\About.app"-"!:\system\apps\About\About.app"
+"\epoc32\release\thumb\urel\About.rsc"-"!:\system\apps\About\About.rsc"
+"\epoc32\release\thumb\urel\About_caption.rsc"-"!:\system\apps\About\About_caption.rsc"
+"\epoc32\release\thumb\urel\About.aif"-"!:\system\apps\About\About.aif"
+"\epoc32\release\thumb\urel\About.mbm"-"!:\system\apps\About\About.mbm"
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/about.mmp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Project specification file of  about
+*
+*/
+
+#include "../inc/about_test.hrh"
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+	TARGET 			about.exe
+	TARGETTYPE 		exe
+UID             0x100039CE  0x10005A22
+VENDORID	VID_DEFAULT
+
+// Modified by build team
+CAPABILITY 	CAP_APPLICATION
+
+
+SOURCEPATH     ../src
+SOURCE         AboutApp.cpp 
+SOURCE         AboutAppUi.cpp
+SOURCE         AboutDocument.cpp
+SOURCE         AboutContainer.cpp
+SOURCE         AboutImage.cpp
+
+APP_LAYER_SYSTEMINCLUDE
+START RESOURCE ../data/about.rss
+HEADER
+	TARGETPATH APP_RESOURCE_DIR
+LANGUAGE_IDS
+END
+
+	START RESOURCE ../data/about_reg.rss
+DEPENDS about.rsg
+	TARGETPATH /private/10003a3f/apps
+	END
+
+USERINCLUDE    ../inc
+
+
+LIBRARY        apparc.lib
+LIBRARY        avkon.lib
+LIBRARY        bafl.lib
+LIBRARY        cone.lib
+LIBRARY        eikcoctl.lib
+LIBRARY        eikcore.lib 
+LIBRARY        euser.lib
+LIBRARY        fbscli.lib
+LIBRARY		   efsrv.lib	
+LIBRARY         aknskins.lib //for skin sbackground
+LIBRARY         cdlengine.lib  //for scalable ui
+LIBRARY         gdi.lib
+LIBRARY			aknicon.lib
+LIBRARY         egul.lib
+LIBRARY         aknlayout2scalable.lib
+LIBRARY         sysversioninfo.lib
+LIBRARY         commonengine.lib
+LIBRARY         apgrfx.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/about_icons.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project about
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR1=$(ZDIR)\system\apps\about
+
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR1)\about.mif
+
+HEADERFILENAME =$(HEADERDIR)\about.mbg
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_menu_about_cxt.svg \
+	/c8 qgn_graf_java_logo.svg
+
+
+		
+		
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/about_icons_aif_bitmaps.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project about
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\system\apps\about
+ICONTARGETFILENAME=$(TARGETDIR)\about_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_about_lst.bmp \
+		/c8,8 qgn_menu_about_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/about_icons_aif_bitmaps_dc.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project about
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\about_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_about_lst.bmp \
+		/c8,8 qgn_menu_about_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/about_icons_aif_scalable.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project about
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#  Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\system\apps\about
+ICONTARGETFILENAME=$(TARGETDIR)\about_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_about.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/about_icons_aif_scalable_dc.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project about
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\about_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#  Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_about.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/about_icons_dc.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project about
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR1=$(ZDIR)\resource\apps
+
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR1)\about.mif
+
+HEADERFILENAME =$(HEADERDIR)\about.mbg
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_menu_about_cxt.svg \
+	/c8 qgn_graf_java_logo.svg\
+	/c8,8 qgn_graf_s60_logo.svg
+
+		
+		
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/group/bld.inf	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:   This file provides the information required for building About
+*               
+*/
+
+
+#include <platform_paths.hrh>
+#include "../aboutgsplugin/group/bld.inf"
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+// export localised loc file
+../loc/about.loc APP_LAYER_LOC_EXPORT_PATH(about.loc)
+
+// export IBY files
+../rom/About.iby          CORE_APP_LAYER_IBY_EXPORT_PATH(about.iby)
+../rom/AboutResources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(aboutresources.iby)
+
+PRJ_MMPFILES
+
+about.mmp
+
+PRJ_EXTENSIONS
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE about.mif
+OPTION HEADERFILE about.mbg
+OPTION SOURCES -c8,8 qgn_menu_about_cxt\
+               -c8 qgn_graf_java_logo
+END
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE about_aif.mif
+OPTION SOURCES -c8,8 qgn_menu_about
+END
+
+//PRJ_TESTMMPFILES
+//../tsrc/CVTAbout.mmp  // CVT test case(s)
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/inc/AboutApp.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Declares main application class
+*
+*/
+
+
+#ifndef ABOUTAPP_H
+#define ABOUTAPP_H
+
+// INCLUDES
+#include <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidabout = { 0x10005A22 };
+
+// CLASS DECLARATION
+
+/**
+* CAboutApp application class.
+* Provides factory to create concrete document object.
+* 
+*/
+class CAboutApp : public CAknApplication
+    {
+    
+    public: // Functions from base classes
+    private:
+
+        /**
+        * From CApaApplication, creates CAboutDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidabout).
+        * @return The value of KUidabout.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/inc/AboutAppUi.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Declares UI class for application.
+*
+*/
+
+
+#ifndef ABOUTAPPUI_H
+#define ABOUTAPPUI_H
+
+// INCLUDES
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <e32std.h>
+#include <coeccntx.h>
+#include <aknappui.h>
+#include <aknnavide.h>                 
+
+// FORWARD DECLARATIONS
+class CAboutContainer;
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* Application UI class.
+* Provides support for the following features:
+* - EIKON control architecture
+* 
+*/
+class CAboutAppUi : public CAknAppUi
+    {
+    public: // // Constructors and destructor
+
+        /**
+        * EPOC default constructor.
+        */      
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */      
+        ~CAboutAppUi();
+        
+    public: // New functions
+
+    public: // Functions from base classes
+
+    private:
+        /**
+        * From CEikAppUi, takes care of command handling.
+        * @param aCommand command to be handled
+        */
+        void HandleCommandL( TInt aCommand );
+        
+        /**
+        * Set the name of the product to navi pane.
+        */        
+        void SetNaviPaneLabelL();
+
+    private: // Data
+        CAboutContainer* iAppContainer; 
+        CAknNavigationDecorator* iNaviDecorator; 
+        
+        // record whether server is required or not.
+        TBool iSettingType;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/inc/AboutContainer.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Declares container control for application.
+*
+*/
+
+
+#ifndef ABOUTCONTAINER_H
+#define ABOUTCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <gdi.h>  
+#include <eiksbobs.h> 
+// FORWARD DECLARATIONS
+class CEikScrollBarFrame;
+class CAboutImage;
+class CFont;
+class TRect;
+class TBidiText;
+class   CAknsBasicBackgroundControlContext;
+#include <gulicon.h>
+
+// CLASS DECLARATION
+
+/**
+*  CAboutContainer  container control class.
+*  
+*/
+//About container derived from scrollbarobserver to get events on scrollbar movements
+class CAboutContainer : public CCoeControl, public MEikScrollBarObserver
+    {
+    public: // Constructors and destructor
+        CAboutContainer();
+        void ConstructL( const TRect& aRect );
+
+		void CalculateL(const TRect& aRect);
+		void HandleResourceChange(TInt aType);
+        /**
+        * From MEikScrollBarObserver
+        */
+        void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType); 
+
+        ~CAboutContainer();
+
+    private: // from CCoeControl
+		
+		/**
+        * From CCoeControl : Control size is set.
+        */
+        void SizeChanged();
+
+        void Draw( const TRect& aRect ) const;
+        void ActivateL();
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                     TEventCode aModifiers );
+
+		TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
+    private: // new functions
+
+        void SetTextL( const TDesC& aText , const TInt aItem );
+        void SetImageL( const TDesC& aFileName, TInt aBitmapId );
+        void UpdateScrollIndicatorL();
+
+        // text wrapping
+
+    private: // Data
+
+        CArrayPtr<HBufC>* iText;
+        CArrayPtr<CAboutImage>* iImages;
+        CArrayFixFlat<TInt>* iScreenStarts;
+        TInt iCurrentScreen;
+        TBool iDoNotShowLastLineAgain;
+        CGraphicsContext::TTextAlign iTextAlign;
+        CEikScrollBarFrame* iSBFrame;
+        const CFont* iFont; // not owned
+        TInt iLineWidth;
+        TInt iBaseLineDelta;
+		TInt iTopBaseLineX;
+		TInt iTopBaseLineY;
+		TInt iLinesPerScreen;
+		CAknsBasicBackgroundControlContext* iSkinContext; // skin data
+		CGulIcon* iIcon;
+		
+        // Judge whether scroll bar is dragged. 
+        TBool iScrollBarDragged;
+        TInt iNumItem;
+        // Judge the break between "real" about box language and the full OSS texts 
+        TBool iBreakFlag;
+        TBool iIsSvg;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/inc/AboutDocument.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Application Document
+*
+*/
+
+
+#ifndef ABOUTDOCUMENT_H
+#define ABOUTDOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+   
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class  CEikAppUi;
+
+// CLASS DECLARATION
+
+/**
+*  CAboutDocument application class.
+*/
+class CAboutDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CAboutDocument* NewL( CEikApplication& aApp );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CAboutDocument();
+
+    private:
+
+        /**
+        * Constructor.
+        */
+        CAboutDocument( CEikApplication& aApp );
+
+        /**
+        * From CEikDocument, create CAboutAppUi "App UI" object.
+        */
+        CEikAppUi* CreateAppUiL();
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/inc/AboutImage.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Image to be shown in about screen.
+*
+*/
+
+
+#ifndef ABOUTIMAGE_H
+#define ABOUTIMAGE_H
+
+// INCLUDES
+
+// FORWARD DECLARATIONS
+class CFbsBitmap;
+
+// CONSTANTS
+
+const TInt KImageTopMargin = 4 ;
+const TInt KImageBottomMargin = 4;
+
+// CLASS DECLARATION
+
+/**
+*  
+*/
+class CAboutImage : public CBase
+    {
+    public: // Constructors and destructor
+        
+        static CAboutImage* NewLC( const TDesC& aFileName, TInt aBitmapId,
+                                   TInt aStartLine, TInt aBaseLineDelta, TBool aTypeFlag );
+
+        /**
+        * Destructor
+        */
+        ~CAboutImage();
+
+    public: // New functions
+
+        TInt HeightInPixels() const;
+        TInt WidthInPixels() const;
+        TInt StartLine() const;
+        TInt EndLine() const;
+        TInt Lines() const;
+        const CFbsBitmap* Bitmap() const;
+        const CFbsBitmap* BitmapMask() const;
+
+    private: // private constructor
+
+        /**
+        * C++ default constructor.
+        */
+        CAboutImage();
+
+    private:  // Data
+
+        CFbsBitmap* iBitmap; // owned
+        CFbsBitmap* iBitmapMask; //owned
+        TInt iStartLine;
+        TInt iEndLine;
+    };
+
+#endif // ABOUTIMAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/inc/about.hrh	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  define enumerate for application 
+*
+*/
+
+
+#ifndef ABOUT_HRH
+#define ABOUT_HRH
+
+enum TAboutItemType
+    {
+    EAboutTextItem,
+    EAboutImageItem
+    };
+
+enum TAboutUpdateTimeFlag
+    {    
+    EAboutUpdateTime,
+    EAboutUnUpdateTime	
+    };
+
+#endif // ABOUT_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/inc/about.rh	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  define struct for application
+*
+*/
+
+
+#ifndef ABOUT_RH
+#define ABOUT_RH
+
+#include "about.hrh"
+
+STRUCT ABOUT_TEXT
+    {
+    BYTE type = EAboutTextItem;
+    BYTE updatetimeflag = EAboutUnUpdateTime;
+    LLINK txt; // set this
+    }
+
+STRUCT ABOUT_IMAGE
+    {
+    BYTE type = EAboutImageItem;
+    LTEXT16 bmpfile = ""; // set this
+    WORD bmpid = 0xffff;  // set this
+    }
+    
+STRUCT ABOUT_SVGIMAGE
+    {    
+    WORD svgid = 0xffff;        // set this
+    WORD svgmaskid = 0xffff;    // set this
+    WORD height = 32;           // set this
+    WORD width = 32;            // set this
+    }
+
+STRUCT ABOUT_ITEM_LIST
+    {
+    STRUCT items[]; // text or image items
+    }
+
+#endif // ABOUT_RH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/inc/about_test.hrh	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  ABOUT_TEST_HRH
+*
+*/
+
+
+#ifndef ABOUT_TEST_HRH
+#define ABOUT_TEST_HRH
+
+/**
+* Define this to use test resources.
+*/
+// #define __ABOUT_USE_TEST_RESOURCE__
+
+#endif // ABOUT_TEST_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/loc/about.loc	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,1192 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description: Localization strings for about
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: app name in list
+// l: list_single_large_graphic_pane_t1
+//
+#define qtn_apps_about_list "About Product"
+
+// d: app name in grid
+// l: cell_app_pane_t1
+//
+#define qtn_apps_about_grid "About"
+
+// d: Displayed in title pane
+// l: title_pane_t2/opt9
+//
+#define qtn_about_title_text "Nokia"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_1 "Nokia and Nokia Connecting People are trademarks or registered trademarks of Nokia Corporation."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_2 "Copyright %N Nokia. All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_3 "This product is based on Symbian^3."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_4 "Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_5 "JavaTM ME environment: MIDP 2.1, CLDC 1.1."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_6 "Other product and company names mentioned herein may be trademarks or tradenames of their respective owners."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_7 "This product includes certain open source software. The exact terms of the licenses, disclaimers, acknowledgements and notices are provided below. Nokia offers to provide you with the source code as defined in the applicable license. Please send an e-mail to sourcecode.request@nokia.com or a written request to:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_8 "Source Code Requests"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_9 "Nokia Corporation"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_10 "P.O.Box 407"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_11 "FI-00045 Nokia Group"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_12 "Finland"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_13 "This offer is valid for a period of three (3) years from the date of the distribution of this product by Nokia."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_14 "GNU LESSER GENERAL PUBLIC LICENSE"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_15 "Version 2.1, February 1999"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_16 " Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_17 "[This is the first released version of the Lesser GPL.  It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_18 "Preamble"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_19 "The licenses for most software are designed to take away your freedom to share and change it.  By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_20 "This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it.  You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_21 "When we speak of free software, we are referring to freedom of use, not price.  Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_22 "To protect your rights, we need to make restrictions that forbid distributors to deny you these right or to ask you to surrender these rights.  These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_23 "For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you.  You must make sure that they, too, receive or can get the source code.  If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it.  And you must show them these terms so they know their rights."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_24 " We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_25 "To protect each distributor, we want to make it very clear that there is no warranty for the free library.  Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_26 "Finally, software patents pose a constant threat to the existence of any free program.  We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder.  Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_27 "Most GNU software, including some libraries, is covered by the ordinary GNU General Public License.  This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License.  We use this license for certain libraries in order to permit linking those libraries into non-free programs."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_28 "When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library.  The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom.  The Lesser General Public License permits more lax criteria for linking other code with the library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_29 "We call this license the \"Lesser\" General Public License because it does Less to protect the user's freedom than the ordinary General Public License.  It also provides other free software developers Less of an advantage over competing non-free programs.  These disadvantages are the reason we use the ordinary General Public License for many libraries.  However, the Lesser license provides advantages in certain special circumstances."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_30 "For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard.  To achieve this, non-free programs must be allowed to use the library.  A more frequent case is that a free library does the same job as widely used non-free libraries.  In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_31 "In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software.  For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_32 "Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_33 "The precise terms and conditions for copying, distribution and modification follow.  Pay close attention to the difference between a \"work based on the library\" and a \"work that uses the library\".  The former contains code derived from the library, whereas the latter must be combined with the library in order to run."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_34 "TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_35 "0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called \"this License\"). Each licensee is addressed as \"you\"."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_36 "A \"library\" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_37 "The \"Library\", below, refers to any such software library or work which has been distributed under these terms.  A \"work based on the Library\" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language.  (Hereinafter, translation is included without limitation in the term \"modification\".)"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_38 "\"Source code\" for a work means the preferred form of the work for making modifications to it.  For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_39 "Activities other than copying, distribution and modification are not covered by this License; they are outside its scope.  The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_40 "1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_41 "You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_42 "2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_43 "a) The modified work must itself be a software library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_44 "b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_45 "c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_46 "d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_47 "(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application.  Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_48 "These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works.  But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_49 "Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_50 "In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_51 "3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library.  To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License.  (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.)  Do not make any other change in these notices."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_52 "Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_53 "This option is useful when you wish to copy part of the code of the Library into a program that is not a library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_54 "4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_55 "If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_56 "5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a \"work that uses the Library\".  Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_57 "However, linking a \"work that uses the Library\" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a \"work that uses the library\".  The executable is therefore covered by this License. Section 6 states terms for distribution of such executables."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_58 "When a \"work that uses the Library\" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library.  The threshold for this to be true is not precisely defined by law."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_59 "If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work.  (Executables containing this object code plus portions of the Library will still fall under Section 6.)"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_60 "Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_61 "6. As an exception to the Sections above, you may also combine or link a \"work that uses the Library\" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_62 "You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License.  You must supply a copy of this License.  If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License.  Also, you must do one of these things:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_63 "a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable \"work that uses the Library\", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library.  (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_64 "b) Use a suitable shared library mechanism for linking with the Library.  A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_65 "c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_66 "d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_67 "e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_68 "For an executable, the required form of the \"work that uses the Library\" must include any data and utility programs needed for reproducing the executable from it.  However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_69 "It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system.  Such a contradiction means you cannot use both them and the Library together in an executable that you distribute."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_70 "7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_71 "a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities.  This must be distributed under the terms of the Sections above."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_72 "b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_73 "8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License.  Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License.  However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_74 "9. You are not required to accept this License, since you have not signed it.  However, nothing else grants you permission to modify or distribute the Library or its derivative works.  These actions are prohibited by law if you do not accept this License.  Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_75 "10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions.  You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_76 "11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License.  If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all.  For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_77 "If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_78 "It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices.  Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_79 "This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_80 "12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded.  In such case, this License incorporates the limitation as if written in the body of this License."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_81 "13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_82 "Each version is given a distinguishing version number.  If the Library specifies a version number of this License which applies to it and \"any later version\", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation.  If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_83 "14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission.  For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this.  Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_84   "NO WARRANTY"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_85   "15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_86   "16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_87   "END OF TERMS AND CONDITIONS"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_88   "How to Apply These Terms to Your New Libraries"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_89   "If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change.  You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License)."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_90   "To apply these terms, attach the following notices to the library.  It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the \"copyright\" line and a pointer to where the full notice is found."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_91   "<one line to give the library's name and a brief idea of what it does.>  Copyright (C) <year>  <name of author>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_92   "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_93   "This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_94   "You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a \"copyright disclaimer\" for the library, if necessary.  Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it!"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_95   "This product includes API header files originally developed by Netscape Communications Corporation, modified by Nokia by changing certain variables for the  purpose of porting the file to Symbian operating system on May 1st, 2004, and available in source code form under the Netscape Public License, v1.1 at  http://www.forum.nokia.com/browserapi."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_96   "Copyright (C) 2005 Apple Computer, Inc.  All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_97   "Copyright (C) 2007 Apple Inc.  All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_98   "Copyright (C) 2007 Nokia Inc.  All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_99   "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_100   "1.  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. "
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_101   "2.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. "
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_102   "3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_103   "THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_104   "Copyright (C) 2004, Apple Computer, Inc. and The Mozilla Foundation. All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_105   "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_106   "1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_107   "2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_108   "3. Neither the names of Apple Computer, Inc. (\"Apple\") or The Mozilla Foundation (\"Mozilla\") nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_109   "THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, MOZILLA OR THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_110   "The author of this software is David M. Gay."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_111   "Copyright (c) 1991, 2000, 2001 by Lucent Technologies."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_112   "Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_113   "THIS SOFTWARE IS BEING PROVIDED \"AS IS\", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_114   "Copyright (c) 2004, 2005 Apple Computer, Inc."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_115   "Copyright (c) 1997-2005 University of Cambridge All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_116   "Copyright (c) 2005, Google Inc. All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_117   "Copyright (c) 2006, Nokia Corporation"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_118   "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_119   "* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_120   "* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_121   "* Neither the name of the University of Cambridge nor the name of Google Inc. nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_122   "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_123   "Copyright (c) 1994 Hewlett-Packard Company"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_124   "Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation.  Hewlett-Packard Company makes no representations about the suitability of this software for any purpose.  It is provided \"as is\" without express or implied warranty."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_125  "Copyright (c) 1996-1998 Silicon Graphics Computer Systems, Inc."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_126   "Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation.  Silicon Graphics makes no representations about the suitability of this software for any purpose.  It is provided \"as is\" without express or implied warranty."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_127   "Copyright (c) 1983, 1995, 1996 Eric P. Allman"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_128   "Copyright (c) 1988, 1993  The Regents of the University of California.  All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_129   "Copyright (C) 2007 Nokia Inc. All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_130   "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_131   "1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_132   "2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_133   "3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_134   "THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_135   "Copyright (c) 1995-2006 International Business Machines Corporation and others All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_136   "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_137   "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_138   "Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_139   "Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_140   "Copyright (C) 2006, 2007 Alexey Proskuryakov (ap@nypop.com)"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_141   "Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_142   "Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_143   "Copyright (C) 2006 James G. Speth (speth@end.com)"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_144   "Copyright (C) 2006 Jonas Witt <jonas.witt@gmail.com>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_145   "Copyright (C) 2006, 2007 Trolltech ASA"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_146   "Copyright (C) 2005, 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_147   "Copyright (C) 2006 Zack Rusin <zack@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_148   "Copyright (C) 2007 Alp Toker <alp@atoker.com>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_149   "Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_150   "Copyright (C) 2007 Graham Dennis (graham.dennis@gmail.com)"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_151   "Copyright (C) 2006 Don Gibson <dgibson77@gmail.com>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_152   "Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com "
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_153   "Copyright (C) 2007 Holger Hans Peter Freyther"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_154   "Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com)."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_155   "Copyright (C) 2006 David Smith (catfish.man@gmail.com)"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_156   "Copyright (C) 2006 George Staikos <staikos@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_157   "Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_158   "Copyright (C) 2006 Rob Buis <buis@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_159   "Copyright (C) 2006 Dirk Mueller <mueller@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_160   "Copyright (C) 2000-2001 Dawit Alemayehu <adawit@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_161   "Copyright (C) 2006, 2007 Eric Seidel <eric@webkit.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_162   "Copyright (C) 2005, 2006 Alexander Kellett <lypanov@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_163   "Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>.  All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_164   "Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com "
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_165   "Copyright (C) 2006 Enrico Ros <enrico.ros@m31engineering.it>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_166   "Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_167   "Copyright (C) 2006 Charles Samuels <charles@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_168   "Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_169   "Copyright (C) 2007 Robin Dunn.  All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_170   "Copyright     2005 Frerich Raabe <raabe@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_171   "Copyright     2005 Maksim Orlovich <maksim@kde.org>"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_172   "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_173 "1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_174 "2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_175 "THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_176 "Copyright (C) 2007 Apple Inc.  All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_177 "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_178 "1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_179 "2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_180 "3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_181 "THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_182 "Open Dynamics Engine Copyright (c) 2001-2004, Russell L. Smith.All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_183 "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_184 "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_185 "Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_186 "Neither the names of ODE's copyright owner nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_187 "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_188 "Copyright (c) 1998 - 2008, Paul Johnston & Contributors All rights reserved."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_189 "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_190 "Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_191 "Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_192 "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_193 "Manufactured under license from Dolby Laboratories. Dolby' and the 'double-D' symbol are trademarks of Dolby Laboratories. This product contains one or more programs protected under international and U.S. copyright laws as unpublished works. They are confidential and proprietary to Dolby Laboratories. The reproduction or disclosure, in whole or part, or the production of derivative works therefrom without the express permission of Dolby Laboratories is prohibited. Copyright 2003-2010 by Dolby Laboratories. All rights reserved."
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/rom/About.iby	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Image description file for About
+*
+*/
+
+
+#ifndef __ABOUT_IBY__
+#define __ABOUT_IBY__
+
+S60_APP_EXE(ABOUT)
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,About)
+
+
+
+S60_APP_AIF_ICONS(ABOUT)
+S60_APP_AIF_RSC(ABOUT)
+
+#ifdef RD_CONTROL_PANEL  
+	
+	ECOM_PLUGIN( aboutgsplugin.dll, aboutgsplugin.rsc)
+	data=DATAZ_\APP_RESOURCE_DIR\aboutgsplugin.mif 	APP_RESOURCE_DIR\aboutgsplugin.mif
+
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/rom/AboutResources.iby	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Image description file for About
+*
+*/
+
+
+
+#ifndef __ABOUT_RESOURCES_IBY__
+#define __ABOUT_RESOURCES_IBY__
+
+
+//Resource file(s) for ABOUT
+
+S60_APP_RESOURCE(About)
+
+#ifdef RD_CONTROL_PANEL  
+	data=DATAZ_\ECOM_RESOURCE_DIR\aboutgspluginrsc.rsc      ECOM_RESOURCE_DIR\aboutgspluginrsc.rsc
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/src/AboutApp.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  About Application
+*
+*/
+
+
+// INCLUDE FILES
+#include "AboutApp.h"
+#include "AboutDocument.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CAboutApp::AppDllUid()
+// Returns application UID
+// ---------------------------------------------------------
+//
+TUid CAboutApp::AppDllUid() const
+    {
+    return KUidabout;
+    }
+
+   
+// ---------------------------------------------------------
+// CAboutApp::CreateDocumentL()
+// Creates CAboutDocument object
+// ---------------------------------------------------------
+//
+CApaDocument* CAboutApp::CreateDocumentL()
+    {
+    return CAboutDocument::NewL( *this );
+    }
+
+#include <eikstart.h>
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CAboutApp;
+    }
+
+// ---------------------------------------------------------
+// E32Main()
+//  Main startup entry point
+// Returns: KErrNone
+// ---------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+
+// End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/src/AboutAppUi.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description: Application UI. 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "AboutAppUi.h"
+#include "AboutContainer.h" 
+#include <avkon.hrh>
+#include <sysversioninfo.h>                       
+
+// local constant
+const TUint32 KSettingAppID = 0x100058EC;
+
+// ================= MEMBER FUNCTIONS =======================
+//
+// ----------------------------------------------------------
+// CAboutAppUi::ConstructL()
+// Default constructor
+// ----------------------------------------------------------
+//
+void CAboutAppUi::ConstructL()
+    {
+    BaseConstructL();
+    
+    // Gets whether server is required or not.
+    iSettingType = iEikonEnv->StartedAsServerApp();
+    
+    iAppContainer = new( ELeave ) CAboutContainer;
+    iAppContainer->SetMopParent( this );
+    iAppContainer->ConstructL( ClientRect() );
+    AddToStackL( iAppContainer );
+    SetNaviPaneLabelL();                                     
+    }
+
+// ----------------------------------------------------
+// CAboutAppUi::~CAboutAppUi()
+// Destructor
+// Frees reserved resources
+// ----------------------------------------------------
+//
+CAboutAppUi::~CAboutAppUi()
+    {
+    if ( iAppContainer )
+        {
+        RemoveFromStack( iAppContainer );
+        delete iAppContainer;
+        }
+    if ( iNaviDecorator )
+        {
+        delete iNaviDecorator;
+        iNaviDecorator = NULL;
+        }
+    }
+
+// ----------------------------------------------------
+// CAboutAppUi::HandleCommandL( TInt aCommand )
+// Takes care of command handling
+// ----------------------------------------------------
+//
+void CAboutAppUi::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EAknSoftkeyExit:
+        case EAknSoftkeyBack:
+        	{
+            Exit();
+            break;        	
+        	}
+        case EEikCmdExit:
+            {
+            // Close Ctrl.panel after pressing call terminal key.
+            if ( iSettingType )
+                {
+                RWsSession& ws = iCoeEnv->WsSession();
+                TApaTaskList taskList( ws );
+                TUid appUid = { KSettingAppID };
+                TApaTask task = taskList.FindApp( appUid );
+                if ( task.Exists() )
+                    {
+                    task.SendToBackground();
+                    task.EndTask();
+                    }
+                }
+            Exit();
+            break;
+            }
+
+        default:
+            break;
+        }
+    }
+
+// ----------------------------------------------------
+// CAboutAppUi::SetNaviPaneLabel()
+// Set the name of the product to navi pane.
+// ----------------------------------------------------
+//    
+void CAboutAppUi::SetNaviPaneLabelL()
+    {
+    TUid naviPaneUid;
+    naviPaneUid.iUid = EEikStatusPaneUidNavi;
+    CEikStatusPane* statusPane = StatusPane();
+    CEikStatusPaneBase::TPaneCapabilities subPane = statusPane->PaneCapabilities( naviPaneUid );
+  
+    if ( subPane.IsPresent() && subPane.IsAppOwned() )
+        {
+        CAknNavigationControlContainer* naviPane = dynamic_cast<CAknNavigationControlContainer*>
+                                ( statusPane->ControlL( naviPaneUid ) );
+        if ( naviPane )
+            {    
+            TBuf<KSysVersionInfoTextLength> name;
+            SysVersionInfo::TProductVersion info;
+            SysVersionInfo::GetVersionInfo( info );
+            name.Append( info.iModel );
+            
+            if ( iNaviDecorator )
+                {
+                delete iNaviDecorator;
+                iNaviDecorator = NULL;
+                }
+           
+            //set label for the pane
+            iNaviDecorator = naviPane->CreateNavigationLabelL( name );      
+            naviPane->PushL( *iNaviDecorator );      
+            }
+        }
+    }
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/src/AboutContainer.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,808 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description: application container control.  
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "AboutContainer.h"
+#include "AboutImage.h"
+#include "about.hrh"
+#include "about_test.hrh"
+#include <layoutmetadata.cdl.h>
+#include <about.rsg>
+#include <eiksbfrm.h>
+#include <eikscrlb.h>
+#include <eikrted.h>
+#include <txtrich.h>
+#include <barsread.h>
+#include <eikenv.h>
+#include <aknenv.h>
+#include <AknUtils.h>
+#include <aknconsts.h>
+#include <txtfrmat.h>
+#include <AknBidiTextUtils.h>
+#include <data_caging_path_literals.hrh>
+#include <f32file.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <aknappui.h>
+#include <AknsDrawUtils.h> 
+#include    <AknsBasicBackgroundControlContext.h>
+#include    <AknsConstants.h>
+#include <AknDef.h>
+#include <about.mbg>
+#include <StringLoader.h> 
+
+// CONSTANTS
+
+_LIT( KAboutPanicCategory, "About" );
+
+enum TAboutPanic
+    {
+    EAboutNotSupported = 0
+    };
+
+/**
+* SCROLLING:
+*
+* Scrolling is implemented according to the following rules
+* when scrolling down:
+*
+* (same screens are shown again when scrolling up)
+*
+* - If the last line in previous screen was a text line,
+*   next screen is started with that line, ie. the last
+*   line is shown again in the next screen.
+*
+* - If previous screen ended with an image that did not
+*   fully fit, next screen is started with that image so
+*   that it can be seen as a whole.
+*
+* - If previous screen ended with an image that fit there fully,
+*   next screen is started with next text line or image.
+*/
+
+// constructors
+
+CAboutContainer::CAboutContainer():iNumItem( 0 )
+    {
+    }
+
+void CAboutContainer::ConstructL( const TRect& aRect )
+    {
+    CreateWindowL();
+
+    iScrollBarDragged = EFalse;
+    iBreakFlag = EFalse;
+    iIsSvg = EFalse;
+	iSkinContext = NULL;
+	iText = NULL;
+	iImages = NULL;
+	iScreenStarts = NULL;
+	iSBFrame = NULL;
+    CalculateL(aRect); 
+    ActivateL();
+    }
+
+// destructor
+
+CAboutContainer::~CAboutContainer()
+    {
+	delete iSkinContext;
+    delete iSBFrame;
+    delete iScreenStarts;
+    delete iIcon;
+
+    if ( iText )
+        {
+        iText->ResetAndDestroy();
+        delete iText;
+        }
+
+    if ( iImages )
+        {
+        iImages->ResetAndDestroy();
+        delete iImages;
+        }
+    }
+
+void CAboutContainer::SizeChanged()
+    {
+    TRect parentRect(Rect());
+	if (iSkinContext)
+        {
+        iSkinContext->SetRect(parentRect);
+        }
+	}
+// -----------------------------------------------------------------------------
+// CAboutContainer::Draw()
+// -----------------------------------------------------------------------------
+
+void CAboutContainer::Draw( const TRect& aRect ) const
+    {
+    CWindowGc& gc = SystemGc();
+	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+	if (iSkinContext)
+		{//Draw the skin background
+		AknsDrawUtils::Background(
+			skin, iSkinContext, this, gc, aRect);
+		}
+	else
+		{//  clear the area
+		gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) );
+		gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+		gc.Clear( aRect );
+		}
+
+    // draw text
+    gc.UseFont( iFont );
+    // index of the first line on the screen in the text array
+    TInt firstLine = 0 ;
+
+    // The value of firstLine can not be the same.
+    if ( !iScrollBarDragged )
+        {
+        if ( ( iScreenStarts ) && (iScreenStarts->Count() >= iCurrentScreen ) )
+            {
+    	    firstLine = ( ( *iScreenStarts )[ iCurrentScreen ] ); 	
+            }        
+        }
+    else
+        {                    
+        if ( iCurrentScreen <= ( ( *iScreenStarts )[ iScreenStarts->Count() - 1 ] ) )
+            {
+            firstLine = iCurrentScreen ;
+            }
+        }
+    // index of the last line on the screen in the text array
+    TInt lastLine( firstLine + iLinesPerScreen - 1 );
+
+    gc.SetBrushStyle( CGraphicsContext::ENullBrush );
+    TPoint position( iTopBaseLineX, iTopBaseLineY );
+    TPoint topLeft;
+    TSize rectSize( iLineWidth, iBaseLineDelta +iFont->DescentInPixels() );
+
+    for ( TInt index = firstLine ;
+          index < iText->Count() && index <= lastLine ;
+          index++, position.iY += iBaseLineDelta )
+        {
+        HBufC* text = (*iText)[ index ];
+
+        if ( text )
+            {
+            topLeft = TPoint( position.iX, position.iY-iBaseLineDelta );
+			TRgb color;			
+			TInt error = AknsUtils::GetCachedColor( skin, 
+							color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
+			
+			if(error == KErrNone)
+				{
+				gc.SetPenColor(color);
+				}		
+            gc.DrawText( *text,
+                         TRect( topLeft, rectSize ),
+                         iBaseLineDelta,
+                         iTextAlign );
+            }
+        }
+
+    gc.DiscardFont();
+
+    // draw images
+
+    for ( TInt i = 0 ; i < iImages->Count() ; i++ )
+        {
+        CAboutImage* image = (*iImages)[ i ];
+
+        // If part of the image resides in visible lines, draw it.
+        if ( image->StartLine() <= lastLine && image->EndLine() >= firstLine )
+            {
+            position.SetXY( iTopBaseLineX, iTopBaseLineY );
+            position.iY += ( image->StartLine() - firstLine ) * iBaseLineDelta;
+
+            position.iY -= iBaseLineDelta - iFont->DescentInPixels();
+            // Now iY is the top line of rectangle where the picture is
+            // centered in.
+            position.iY += ( (image->Lines()+1) * iBaseLineDelta -
+                             iFont->HeightInPixels() -
+                             image->HeightInPixels() ) / 2;
+
+            // If text is right-aligned, also align images to the right.
+
+            if ( iTextAlign == CGraphicsContext::ERight )
+                {
+                position.iX += ( iLineWidth - image->WidthInPixels() );
+                }
+
+            gc.BitBlt( position, image->Bitmap(), aRect );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutContainer::ActivateL()
+// -----------------------------------------------------------------------------
+
+void CAboutContainer::ActivateL()
+    {
+    CCoeControl::ActivateL();
+    UpdateScrollIndicatorL();
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutContainer::SetTextL()
+// -----------------------------------------------------------------------------
+
+void CAboutContainer::SetTextL( const TDesC& aText , const TInt aItem )
+    {
+    CArrayFix<TPtrC>* wrappedArray =
+        new( ELeave ) CArrayFixFlat<TPtrC>( 10 );
+
+    CleanupStack::PushL( wrappedArray );
+
+    HBufC* dataToDestroy =
+        AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
+            aText, iLineWidth, *iFont, *wrappedArray
+        );
+
+    TInt numLines( wrappedArray->Count() );
+    for ( TInt i = 0 ; i < numLines ; i++ )
+        {
+        HBufC* line = (*wrappedArray)[i].AllocLC();
+
+		switch( aItem )
+			{
+			// The fourteen string's setting
+			case 14:
+				{
+				iBreakFlag = ETrue;
+				break;
+				}
+			default:
+				break;
+			}
+        if(!line->Length())
+            {
+            iText->AppendL( NULL );
+			
+            CleanupStack::PopAndDestroy(line);  // line
+            }
+        else
+            {
+            if( iBreakFlag && ( numLines - 1 ) == i )
+            	{
+                iText->AppendL( line );
+                // Get the text's lines' count for set break
+                TInt textCount = iText->Count();
+                TInt count = iLinesPerScreen - ( textCount % ( iLinesPerScreen - 1 ) ) - 1;
+                if( iLinesPerScreen == count + 1 )
+                	{
+                	// When the last line has content, we should set count zero 
+                	count = 0;
+                	}
+                for( TInt j = 0; j < count; j++ )
+                	{
+                	iText->AppendL( NULL );
+                	}
+                CleanupStack::Pop( line );  // line
+                iBreakFlag = EFalse;
+            	}
+            else
+            	{
+                iText->AppendL( line );
+                CleanupStack::Pop( line );  // line
+            	}
+            }
+        }
+	iText->AppendL( NULL );
+
+    // If the last char was newline, add one extra, since
+    // wrapping automatically removes it.
+    if ( aText[ aText.Length() - 1 ] == '\n' )
+        {
+        iText->AppendL( NULL );
+		}
+
+    CleanupStack::PopAndDestroy(wrappedArray); // wrappedArray
+    delete dataToDestroy;
+
+    // update screen scrolling info array
+
+    TInt lastLine( iText->Count() - 1 );
+    TInt screenStart( (*iScreenStarts)[ iScreenStarts->Count() - 1 ] );
+
+    TBool firstNewScreenHandled( EFalse );
+
+    while ( lastLine >= screenStart + iLinesPerScreen )
+        {
+        if ( !firstNewScreenHandled && iDoNotShowLastLineAgain )
+            {
+            screenStart++;
+            firstNewScreenHandled = ETrue;
+            }
+
+        screenStart += iLinesPerScreen - 1;
+        iScreenStarts->AppendL( screenStart );
+        if ( ( lastLine == screenStart + 1 ) && ( aItem == iNumItem - 1 ) )
+        	{
+        	iScreenStarts->Delete( iScreenStarts->Count() - 1 );
+        	}
+        }
+
+    // if text, last line is shown again in next screen
+    iDoNotShowLastLineAgain = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutContainer::SetImageL()
+// -----------------------------------------------------------------------------
+
+void CAboutContainer::SetImageL( const TDesC& aFileName, TInt aBitmapId )
+    {
+    TInt firstLineOfImage( iText->Count() );
+
+    // If flag is ETrue, the file type is bmp 
+    CAboutImage* image =
+    CAboutImage::NewLC( aFileName, aBitmapId, firstLineOfImage, iBaseLineDelta, ETrue );
+
+    // new lines to make room for the picture
+
+    for ( TInt i = 0 ; i < image->Lines() ; i++ )
+        {
+        iText->AppendL( NULL );
+        }
+
+    iImages->AppendL( image );
+    CleanupStack::Pop(image); // image
+
+    // update screen scrolling info array
+
+    TInt lastLineOfImage( iText->Count() - 1 );
+    TInt screenStart( (*iScreenStarts)[ iScreenStarts->Count() - 1 ] );
+
+    TBool firstNewScreenHandled( EFalse );
+
+    // If the image was not fully shown in the first screen,
+    // start the next screen with the image.
+
+    if ( firstLineOfImage < screenStart + iLinesPerScreen &&
+         lastLineOfImage >= screenStart + iLinesPerScreen )
+        {
+        screenStart = firstLineOfImage;
+        iScreenStarts->AppendL( screenStart );
+        firstNewScreenHandled = ETrue;
+        }
+
+    while ( lastLineOfImage >= screenStart + iLinesPerScreen )
+        {
+        if ( !firstNewScreenHandled && iDoNotShowLastLineAgain )
+            {
+            screenStart++;
+            firstNewScreenHandled = ETrue;
+            }
+
+        screenStart += iLinesPerScreen - 1;
+        iScreenStarts->AppendL( screenStart );
+        }
+
+    if ( lastLineOfImage == screenStart + iLinesPerScreen - 1 )
+        {
+        iDoNotShowLastLineAgain = ETrue;
+        }
+    else
+        {
+        iDoNotShowLastLineAgain = EFalse;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutContainer::OfferKeyEventL()
+// -----------------------------------------------------------------------------
+
+TKeyResponse CAboutContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                              TEventCode aType )
+    {
+    // Operation is different in dragging and thumbing.
+    if ( ( iScrollBarDragged ) && ( aType == EEventKey ) )
+        {
+        for( TInt i=0; i<iScreenStarts->Count(); i++ )
+            {
+            if ( iCurrentScreen <= ( ( *iScreenStarts )[i] ) ) 
+                {
+                // if last state is dragging, value of iCurrentScreen should be adjusted.
+                switch ( aKeyEvent.iCode )
+                    {
+                    case EKeyUpArrow:
+                        {
+                        iScrollBarDragged = EFalse;
+                        // Do nothing if the scroll bar is on the top, when pressing arrow up.
+                        if ( i != 0 )
+                            {
+                            iCurrentScreen =  ( i - 1 );
+                            }
+                        DrawNow();
+                        UpdateScrollIndicatorL();
+                        break;
+                        }
+                    case EKeyDownArrow:
+                        {
+                        iScrollBarDragged = EFalse;
+                        if ( ( iCurrentScreen == ( *iScreenStarts )[i] )
+                            // Do nothing if the scroll bar is on the bottom, when pressing arrow down.
+                            && ( i != ( iScreenStarts->Count() - 1 ) ) )
+                            {
+                            iCurrentScreen = ( i + 1 );
+                            }
+                       	else
+                            {
+                            iCurrentScreen = i;
+                            }
+                        DrawNow();
+                        UpdateScrollIndicatorL();
+                        break;
+                        }
+                    default:
+                        break;
+                    }
+                return EKeyWasConsumed;
+                }
+            } 
+        }
+        
+    if ( aType == EEventKey && iScreenStarts->Count() > 1 )
+        {
+        switch ( aKeyEvent.iCode )
+            {
+            case EKeyUpArrow:
+                {
+                if ( iCurrentScreen > 0 )
+                    {
+                    iCurrentScreen--;
+                    DrawNow();
+                    UpdateScrollIndicatorL();
+                    }
+                }
+                break;
+
+            case EKeyDownArrow:
+                {
+                if ( iCurrentScreen < iScreenStarts->Count() - 1 )
+                    {
+                    iCurrentScreen++;
+                    DrawNow();
+                    UpdateScrollIndicatorL();
+                    }
+                }
+                break;
+
+            default:
+                break;
+            }
+        return EKeyWasConsumed;
+        }
+
+    // When pressing the Send Key and the event's type is not EEvenKey return EKeyWasNotConsumed
+    return EKeyWasNotConsumed;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutContainer::UpdateScrollIndicatorL()
+// -----------------------------------------------------------------------------
+
+void CAboutContainer::UpdateScrollIndicatorL()
+ {
+    if ( iScreenStarts->Count() <= 1 )
+    {
+        return;
+    }
+
+    if ( !iSBFrame )
+    {
+        iSBFrame = new( ELeave ) CEikScrollBarFrame( this,this, ETrue );
+        
+		// Decide which type of scrollbar is to be shown
+        CAknAppUi* appUi = iAvkonAppUi;
+		if (AknLayoutUtils::DefaultScrollBarType(appUi) == CEikScrollBarFrame::EDoubleSpan)
+		{
+			// For EDoubleSpan type scrollbar
+			iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse); // non-window owning scrollbar            
+			iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
+		}
+		else
+		{
+			// For EArrowHead type scrollbar
+			iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead);
+		}  
+		iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+    }
+
+	TEikScrollBarModel hSbarModel;
+    TEikScrollBarModel vSbarModel;
+
+    // The member of vSbarModel shoul be changed because the state when dragging scroll bar shoul be considered.
+    TInt spanAdjust = iLinesPerScreen - ( iText->Count() - ( *iScreenStarts )[ iScreenStarts->Count() - 1 ] + 1 );
+    if ( iScrollBarDragged )
+    {
+    vSbarModel.iThumbPosition = iCurrentScreen;
+    }
+    else
+    {
+        vSbarModel.iThumbPosition = iCurrentScreen * ( iLinesPerScreen - 1 );
+    }
+    vSbarModel.iScrollSpan = iText->Count() + spanAdjust;
+    vSbarModel.iThumbSpan = ( iLinesPerScreen - 1 );
+	
+	TRect rect(Rect());  
+    TEikScrollBarFrameLayout layout;
+	layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
+
+    if (iSBFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan)
+    {    
+        // For EDoubleSpan type scrollbar
+        if (vSbarModel.iThumbPosition + vSbarModel.iThumbSpan > vSbarModel.iScrollSpan)
+        {
+            // Not let scrollbar values overflow
+            vSbarModel.iThumbPosition = vSbarModel.iScrollSpan - vSbarModel.iThumbSpan;
+        }
+		
+        TAknDoubleSpanScrollBarModel hDsSbarModel(hSbarModel);
+        TAknDoubleSpanScrollBarModel vDsSbarModel(vSbarModel);
+       
+        // When resolution is changed, changing the drawing area of layout for the text.
+        TRect currentRect( iAvkonAppUi->ClientRect() );
+        iSBFrame->TileL(&hDsSbarModel, &vDsSbarModel, currentRect, rect, layout);        
+        iSBFrame->SetVFocusPosToThumbPos(vDsSbarModel.FocusPosition());
+	}  
+	else
+	{
+		iSBFrame->TileL( &hSbarModel, &vSbarModel, rect, rect, layout );
+		iSBFrame->SetVFocusPosToThumbPos( vSbarModel.iThumbPosition );
+	}
+}
+
+
+// End of File
+
+void CAboutContainer::CalculateL(const TRect& aRect)
+    {
+    TRect rect( 0, 0, 0, 0 );
+    iCurrentScreen = 0;
+	
+    if ( iSkinContext )
+        {
+        delete iSkinContext;
+        iSkinContext = NULL;
+        }  
+	
+    // Temporary rect is passed. Correct rect is set in SizeChanged.
+    iSkinContext = CAknsBasicBackgroundControlContext::NewL(
+    KAknsIIDQsnBgAreaMain , rect, EFalse );
+
+    iFont = AknLayoutUtils::FontFromId( EAknLogicalFontSecondaryFont );
+
+    // Calculate various text positioning parameters
+    iBaseLineDelta = iFont->HeightInPixels() * 4 / 3;
+
+    TInt mainPaneWidth( aRect.iBr.iX - aRect.iTl.iX );
+    TInt mainPaneHeight( aRect.iBr.iY - aRect.iTl.iY );
+    // Line width is 87% of client rect, horizontal margins 13%
+    iLineWidth = mainPaneWidth * 87 / 100;
+    iTopBaseLineX = ( mainPaneWidth - iLineWidth ) / 2;
+
+    // top margin is 6.5% of the client rect
+    TInt topMargin = mainPaneHeight * 65 / 1000;    
+    iTopBaseLineY = topMargin + iFont->AscentInPixels();
+
+    // minimum bottom margin is 3% of the client rect
+    TInt bottomMargin = mainPaneHeight * 3 / 100;
+    iLinesPerScreen =
+        ( mainPaneHeight - topMargin - bottomMargin ) / iBaseLineDelta;
+    
+    TInt uiLanguage = User::Language();
+    
+    if( uiLanguage == ELangArabic || uiLanguage == ELangFarsi || 
+        uiLanguage == ELangHebrew || uiLanguage == ELangUrdu )
+    	{
+        iTextAlign = CGraphicsContext::ERight;
+    	}
+    else
+    	{
+        iTextAlign = CGraphicsContext::ELeft;
+    	}
+
+   
+    if ( iText )
+        {
+        iText->ResetAndDestroy();
+        delete iText;
+        iText = NULL;
+        }
+
+    // Every text line on screen is one entry in this array
+    iText = new( ELeave ) CArrayPtrFlat<HBufC>( 20 );
+
+    if ( iImages )
+        {
+        iImages->ResetAndDestroy();
+        delete iImages;
+        iImages = NULL;
+        }
+
+    // Every image on screen is one entry in this array
+    iImages = new( ELeave ) CArrayPtrFlat<CAboutImage>( 1 );
+
+    if ( iScreenStarts )
+        {
+        delete iScreenStarts;
+        iScreenStarts = NULL;
+        }
+    // This array contains indices for lines that start the subsequent
+    // screens, for custom scrolling
+    iScreenStarts = new( ELeave ) CArrayFixFlat<TInt>( 5 );
+    // Initialisation: first screen starts at line 0.
+    iScreenStarts->AppendL( 0 );
+
+    // Read text and image items to be shown on the screen from a resource file.
+#ifdef __ABOUT_USE_TEST_RESOURCE__
+    #include <about_test.rsg>
+    // test resource
+    _LIT(KDirAndFile, "Z:about_test.rsc");
+    TParse* fp = new(ELeave) TParse ();
+    fp->Set (KDirAndFile, &KDC_APP_RESOURCE_DIR, NULL);
+    TBuf<254> KAboutTestResourceFileName;
+    KAboutTestResourceFileName.Copy(fp ->FullName());
+    delete fp;
+    fp=NULL;
+
+    TFileName fileName( KAboutTestResourceFileName );
+    BaflUtils::NearestLanguageFile( iEikEnv->FsSession(), filename );
+    TInt testResourceFileOffset = iCoeEnv->AddResourceFileL( fileName );
+    TResourceReader reader;
+    iEikonEnv->CreateResourceReaderLC( reader, R_ABOUT_TEST_MAIN_TEXT );
+#else
+    // real resource
+    TResourceReader reader;
+    iEikonEnv->CreateResourceReaderLC( reader, R_ABOUT_MAIN_TEXT );
+#endif
+ 
+    TInt NumItem( reader.ReadInt16() );
+    iNumItem = NumItem;
+
+    for ( TInt i = 0 ; i < iNumItem ; i++ )
+        {
+        TInt type = reader.ReadInt8();
+        if ( type == EAboutTextItem )    
+            { 
+            HBufC* text;  
+            if ( reader.ReadInt8() == EAboutUpdateTime )
+                {  
+                TTime time;
+                time.UniversalTime();
+                TDateTime currentTime = time.DateTime();
+                text = StringLoader::LoadLC( reader.ReadInt32(), 
+                                            currentTime.Year(), CEikonEnv::Static() );
+                }
+            else
+                {
+                text = iEikonEnv->AllocReadResourceLC( reader.ReadInt32() );
+                }
+			SetTextL( *text , i );
+			CleanupStack::PopAndDestroy( text );
+            }
+        else if ( type == EAboutImageItem )
+            {
+            TPtrC bitmapFile = reader.ReadTPtrC();
+            TInt bitmapId = reader.ReadInt16();
+            if( iIsSvg )
+            	{
+            	TFileName svgPath;
+            	_LIT( KSvgFileName, "Z:about.mif" );
+            	TParse* fpSvg = new( ELeave ) TParse ();
+            	fpSvg->Set( KSvgFileName, &KDC_APP_BITMAP_DIR, NULL );
+            	svgPath.Copy( fpSvg ->FullName() );
+            	delete fpSvg;
+            	fpSvg = NULL;    
+            	SetImageL( svgPath, EMbmAboutQgn_graf_java_logo );
+            	}
+            else
+            	{
+            	SetImageL( bitmapFile, bitmapId );
+            	}
+            }
+        else
+            {
+            User::Panic( KAboutPanicCategory, EAboutNotSupported );
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // reader
+
+#ifdef __ABOUT_USE_TEST_RESOURCE__
+    if ( testResourceFileOffset )
+        {
+        iCoeEnv->DeleteResourceFile( testResourceFileOffset );
+        }
+#endif
+
+    SetRect( aRect );  
+    UpdateScrollIndicatorL();
+    }
+
+
+ void CAboutContainer::HandleResourceChange(TInt aType)
+ {
+
+switch ( aType )
+  {
+  case KEikDynamicLayoutVariantSwitch :
+       {
+       TRAP_IGNORE(CalculateL(iAvkonAppUi->ClientRect()));   
+       DrawNow();
+       }
+       break;
+  case KEikMessageUnfadeWindows :
+  case KAknsMessageSkinChange :
+       {
+       TRAP_IGNORE(iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse)); // window owning scrollbar            
+       iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
+ 	   TRAP_IGNORE(iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EOn));
+	   TRAP_IGNORE(UpdateScrollIndicatorL());
+       }
+        
+  default:
+       {
+       CCoeControl::HandleResourceChange(aType);
+       }
+	   break;
+  }
+}  
+// ---------------------------------------------------------
+// CAboutContainer::MopSupplyObject()
+// Pass skin information if need.
+// ---------------------------------------------------------
+
+TTypeUid::Ptr CAboutContainer::MopSupplyObject(TTypeUid aId)
+    {
+    if (aId.iUid == MAknsControlContext::ETypeId && iSkinContext)
+        {
+        return MAknsControlContext::SupplyMopObject(aId, iSkinContext);
+        }
+
+    return CCoeControl::MopSupplyObject(aId);
+    }
+
+// ---------------------------------------------------------
+// CAboutContainer::HandleScrollEventL()
+// Capture Touch Events on the Scroll Bar
+// ---------------------------------------------------------
+void CAboutContainer::HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType)
+{
+    //Only on page up/down,scroll up/down and drag events
+    if((aEventType == EEikScrollPageDown) || (aEventType == EEikScrollPageUp) || 
+       (aEventType == EEikScrollThumbDragVert) || (aEventType == EEikScrollUp) ||
+       (aEventType == EEikScrollDown))
+    {
+        //Get the current position from the scroll bar
+        iCurrentScreen = aScrollBar->ThumbPosition();
+        
+        // Reset flag when dragging scroll bar
+        iScrollBarDragged = ETrue;
+        //Refresh now
+        DrawNow();
+        UpdateScrollIndicatorL();
+    }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/src/AboutDocument.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Application Document.
+*
+*/
+
+
+// INCLUDE FILES
+#include "AboutDocument.h"
+#include "AboutAppUi.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// constructor
+CAboutDocument::CAboutDocument( CEikApplication& aApp ) : CAknDocument( aApp )
+    {
+    }
+
+// destructor
+CAboutDocument::~CAboutDocument()
+    {
+    }
+
+// Two-phased constructor.
+CAboutDocument* CAboutDocument::NewL( CEikApplication& aApp )
+    {
+    return new( ELeave ) CAboutDocument( aApp );
+    }
+    
+// -----------------------------------------------------------------------------
+// CAboutDocument::CreateAppUiL()
+// constructs CAboutAppUi
+// -----------------------------------------------------------------------------
+//
+CEikAppUi* CAboutDocument::CreateAppUiL()
+    {
+    return new( ELeave ) CAboutAppUi;
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/about/src/AboutImage.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description: offer bitmap for application.
+*
+*/
+
+
+// INCLUDE FILES
+#include <fbs.h>
+#include "AboutImage.h"
+#include <AknIconUtils.h>
+#include <aknenv.h>
+#include <AknUtils.h>
+#include <aknconsts.h>
+#include <AknBidiTextUtils.h>
+#include <AknsDrawUtils.h> 
+#include <AknsBasicBackgroundControlContext.h>
+#include <AknsConstants.h>
+#include <AknDef.h>
+
+
+const TInt QtnJavaLogoWidth  = 46;
+const TInt QtnJavaLogoHeight = 70;
+
+// ================= MEMBER FUNCTIONS ==========================================
+
+CAboutImage::CAboutImage()
+    {
+    }
+
+CAboutImage::~CAboutImage()
+    {
+    delete iBitmap;
+    delete iBitmapMask;
+    }
+
+CAboutImage* CAboutImage::NewLC( const TDesC& aFileName,
+                                 TInt aBitmapId,
+                                 TInt aStartLine,
+                                 TInt aBaseLineDelta,
+                                 TBool aTypeFlag )
+    {
+    CAboutImage* self = new( ELeave ) CAboutImage();
+    CleanupStack::PushL( self );
+
+    if( aTypeFlag )
+    	{
+    	// bmp files
+	self->iBitmap  = AknIconUtils::CreateIconL(aFileName, aBitmapId );
+    	}
+    else
+    	{
+    	// svg files
+    	MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+    	AknsUtils::CreateIconL( skinInstance, KAknsIIDQgnMenuSmsvoLst, self->iBitmap, self->iBitmapMask, 
+					aFileName, aBitmapId, aBitmapId + 1 );
+    	AknIconUtils::SetSize( self->iBitmap, TSize( QtnJavaLogoWidth, QtnJavaLogoHeight ) );
+    	AknIconUtils::SetSize( self->iBitmapMask, TSize( QtnJavaLogoWidth, QtnJavaLogoHeight ) );
+    	}
+    self->iStartLine = aStartLine;
+
+    // enough lines so that image and margins fit in them.
+
+    TInt lines( ( self->HeightInPixels() + 
+                  KImageTopMargin + 
+                  KImageBottomMargin +
+                  aBaseLineDelta - 1 ) / aBaseLineDelta );
+
+    self->iEndLine = aStartLine + lines - 1;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutImage::HeightInPixels()
+// -----------------------------------------------------------------------------
+
+TInt CAboutImage::HeightInPixels() const
+    {
+    return iBitmap->SizeInPixels().iHeight;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutImage::WidthInPixels()
+// -----------------------------------------------------------------------------
+
+TInt CAboutImage::WidthInPixels() const
+    {
+    return iBitmap->SizeInPixels().iWidth;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutImage::StartLine()
+// -----------------------------------------------------------------------------
+
+TInt CAboutImage::StartLine() const
+    {
+    return iStartLine;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutImage::EndLine()
+// -----------------------------------------------------------------------------
+
+TInt CAboutImage::EndLine() const
+    {
+    return iEndLine;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutImage::Lines()
+// -----------------------------------------------------------------------------
+
+TInt CAboutImage::Lines() const
+    {
+    return iEndLine - iStartLine + 1;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutImage::Bitmap()
+// -----------------------------------------------------------------------------
+
+const CFbsBitmap* CAboutImage::Bitmap() const
+    {
+    return iBitmap;
+    }
+
+// -----------------------------------------------------------------------------
+// CAboutImage::BitmapMask()
+// -----------------------------------------------------------------------------
+
+const CFbsBitmap* CAboutImage::BitmapMask() const
+	{
+	return iBitmapMask;
+	}
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/aif/CalcAif.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  RSS for creating the aif file for Calculator.
+*
+*/
+
+
+#include <aiftool.rh>
+
+#include <Calc.loc>
+
+RESOURCE AIF_DATA
+    {
+    // Application UID
+    app_uid = 0x10005902;
+
+    // Number of icons
+    num_icons = 1;
+
+    // Application capabilities
+    embeddability = KAppNotEmbeddable;
+
+    newfile = KAppDoesNotSupportNewFile;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/aif/Calcsoft_caption.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Define text for application grid and list.
+*
+*/
+
+
+#include <calc.loc>
+#include <apcaptionfile.rh>
+
+RESOURCE CAPTION_DATA
+    {
+    caption = qtn_apps_calculator_list;
+    shortcaption = qtn_apps_calculator_grid;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/Calcsoft.mmp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Project specfication file.
+*                Write all source and resource files, all using libraries, 
+*                all bitmaps.
+*
+*/
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET 			calcsoft.exe
+TARGETTYPE 		exe
+UID             0x100039ce 0x10005902
+
+VENDORID	VID_DEFAULT
+CAPABILITY 	CAP_APPLICATION
+
+APP_LAYER_SYSTEMINCLUDE
+
+START RESOURCE Calcsoft.rss
+	HEADER
+	TARGETPATH APP_RESOURCE_DIR
+	LANGUAGE_IDS	
+END 
+
+USERINCLUDE     ../inc ../src
+
+
+SOURCEPATH      ../src
+SOURCE          CalcApp.cpp   
+SOURCE          CalcDoc.cpp  
+SOURCE          CalcAppUi.cpp
+SOURCE          CalcView.cpp
+SOURCE          CalcCont.cpp
+SOURCE          CalcEdit.cpp 
+SOURCE          CalcOutSheet.cpp
+SOURCE          CalcFunc.cpp
+//SOURCE          CalcCmdBtn.cpp
+SOURCE			CalcEnv.cpp
+SOURCE          CalcHistory.cpp
+SOURCE          CalcEditline.cpp 
+
+STATICLIBRARY    edllstub.lib 
+
+LIBRARY         euser.lib   
+LIBRARY         eikcore.lib    
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         estor.lib
+LIBRARY         eikcoctl.lib
+LIBRARY         avkon.lib
+LIBRARY         bafl.lib
+LIBRARY         egul.lib
+LIBRARY		efsrv.lib
+LIBRARY         aknskins.lib
+LIBRARY         servicehandler.lib // For the AiwServiceHandler
+LIBRARY         hlplch.lib  // for "Help" options menu
+LIBRARY         featmgr.lib
+LIBRARY         cdlengine.lib //For Scalable UI
+LIBRARY         aknicon.lib
+LIBRARY		fbscli.lib
+LIBRARY			ptiengine.lib
+LIBRARY         centralrepository.lib
+LIBRARY         cenrepnotifhandler.lib
+LIBRARY		aknlayout2scalable.lib
+
+
+SOURCEPATH      ../group
+START RESOURCE  ./Calcsoft_reg.rss
+DEPENDS calcsoft.rsg
+TARGETPATH /private/10003a3f/apps
+END
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/Calcsoft.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,519 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Resource file for Calculator.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    CALC
+
+
+//  INCLUDES
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.rh>
+#include <avkon.hrh>
+#include <avkon.rsg>
+#include <fontids.hrh>
+#include <apcaptionfile.rh>
+#include <avkon.loc>
+#include <AiwCommon.rh>
+
+#include "calc.hrh"
+#include <calc.loc>
+#include "CalcDrawingConst.laf"
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+//  RESOURCE DEFINITIONS 
+
+// ---------------------------------------------------------
+//   
+//    Define the resource file signature 
+//    This resource should be empty.
+//
+// ---------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+
+// ---------------------------------------------------------
+//   
+//    Default Document FileName
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF32
+    {
+    buf = "C:\\system\\data\\Calcsoft";      
+    }
+
+// ---------------------------------------------------------
+//   
+//  Define UI's menu, CBA-key, and status pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    status_pane = r_calc_status_pane;
+    }
+
+// ---------------------------------------------------------
+//   
+//  r_calc_status_pane
+//  Define status pane of Calculator.
+//
+// ---------------------------------------------------------
+//
+RESOURCE STATUS_PANE_APP_MODEL r_calc_status_pane
+    {
+   //  layout = R_AVKON_STATUS_PANE_LAYOUT_EMPTY;
+    }
+    
+// ---------------------------------------------------------
+//   
+//    r_calc_view_info
+//    Define menubar and cba key of Calculator  
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_calc_cba_center_softkey
+{
+	buttons =
+	        {
+	        CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;},
+	        CBA_BUTTON {id=EAknSoftkeyExit; txt = text_softkey_exit; },
+	        CBA_BUTTON {id=EAknSoftkeySelect; txt =	text_softkey_select;}
+	        };
+}
+RESOURCE AVKON_VIEW r_calc_view_info
+    {
+    menubar = r_calc_menubar;      // menubar
+    cba = r_calc_cba_center_softkey;//R_AVKON_SOFTKEYS_OPTIONS_EXIT;    // CBA
+    }
+
+
+// ---------------------------------------------------------
+//   
+//   r_calc_menubar
+//   Menubar for Calculator
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_BAR r_calc_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_calc_popupmenu;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//   r_calc_popupmenu
+//   Menu for "Options"
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_calc_popupmenu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = ECalcCmdLastResult;
+            txt = qtn_calc_om_last_result;
+            },
+        MENU_ITEM
+            {
+            command = ECalcCmdMemory;
+            txt = qtn_calc_om_sub_mem;
+            cascade = r_calc_memory_menu;
+            },
+        MENU_ITEM
+            {
+            command = ECalcCmdClearCalcAndHistory;
+            txt = qtn_calc_clear_sheet;
+            },
+       
+        MENU_ITEM
+            {
+            command = ECalcCmdHelp;
+            txt = qtn_options_help;
+            },
+        MENU_ITEM
+            {
+            command=ECmdAiwPlaceHolder;
+            txt = "Place Holder";
+         	cascade = AIW_INTELLIGENT_CASCADE_ID;       
+            },
+        
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+// ---------------------------------------------------------
+//   
+//   r_calc_popupmenu_aiw
+//   Menu for "Options"
+//
+// ---------------------------------------------------------
+//
+
+RESOURCE MENU_PANE r_help_submenu
+{
+    items=
+    {
+        MENU_ITEM { command = ECmdAiwPlaceHolderShowHelp; txt = ""; }
+    };
+}
+
+
+    // To let know what are the services that are provided
+
+RESOURCE AIW_INTEREST r_aiwhelpapp_interest
+
+	{	
+
+		items =
+		
+		{
+		 AIW_CRITERIA_ITEM
+		 
+		 	{
+		 		id = ECmdAiwPlaceHolder;
+		 		// Show help content
+		 		serviceCmd = KAiwCmdHelp;   //from aiwcommon.hrh  
+		 		serviceClass = KAiwClassMenu;   //from aiwcommon.hrh
+		 		contentType = "*";
+		 		// Here, the dll's implementation uid is being used instead of the dll uid.
+		 		// Also the maxProviders can be removed as the dll will be loaded automatically if
+		 		// it is provided.
+		 		defaultProvider = 0x10207465; //AiwHelpProvider.dll uid
+		 		//maxProviders =1;	 		
+		 		
+		 	}
+		
+		
+		};
+
+
+	}
+
+
+//----------------------------------------------------
+//   
+//    r_calc_memory_menu
+//    Define menu about memory
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_calc_memory_menu
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = ECalcCmdMemorySave;
+            txt = qtn_calc_om_mem_save;
+            },
+        MENU_ITEM
+            {
+            command = ECalcCmdMemoryRecall;
+            txt = qtn_calc_om_mem_recall;
+            },
+        MENU_ITEM
+            {
+            command = ECalcCmdMemoryClear;
+            txt = qtn_calc_om_mem_clear;
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//   
+//   r_calc_error_outofrange
+//   Error message for overflow  
+//
+// ---------------------------------------------------------
+//
+//Localisation of scalable UI.
+//RESOURCE TBUF256 r_calc_error_outofrange
+RESOURCE TBUF r_calc_error_outofrange
+    {
+    buf = text_out_of_range;
+    }
+
+
+// ---------------------------------------------------------
+//   
+//   r_calc_error_divisionbyzero
+//   Error message for division by zero  
+//
+// ---------------------------------------------------------
+////Localisation of scalable UI.
+//RESOURCE TBUF256 r_calc_error_divisionbyzero
+RESOURCE TBUF r_calc_error_divisionbyzero
+    {
+    buf = text_calc_division_by_zero;
+    }
+
+
+// ---------------------------------------------------------
+//   
+//   r_calc_error_negativevaluesqrt
+//   Error message for negative value for square root  
+//
+// ---------------------------------------------------------
+////Localisation of scalable UI.
+//RESOURCE TBUF256 r_calc_error_negativevaluesqrt
+RESOURCE TBUF r_calc_error_negativevaluesqrt
+    {
+    buf = text_calc_negative_value_for_sqrt;
+    }
+
+
+// ---------------------------------------------------------
+//   
+//   r_calc_outsheet_operator_array
+//   Operator array for OutputSheet.  
+//
+// ---------------------------------------------------------
+//
+RESOURCE ARRAY r_calc_outsheet_operator_array
+    {
+    items=
+        {
+        INT16
+            {
+            value = '+'; 
+            },      
+        INT16
+            {
+            value = 0x2212; 
+            },      
+        INT16
+            {
+            value = 0xD7; 
+            },      
+        INT16
+            {
+            value = 0xF7;
+            },
+        INT16
+            {
+            value = '='; 
+            },
+        INT16
+            {
+            value = 0x221A;
+            },
+        INT16
+            {
+            value = '%'; 
+            },
+        INT16
+            {
+            value = ' ';
+            },
+        INT16
+            {
+            value = '*'; 
+            },
+        INT16
+            {
+            value = '/';
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//   
+//   r_calc_editor_operator_array
+//   Operator array for editor.  
+//
+// ---------------------------------------------------------
+//
+RESOURCE ARRAY r_calc_editor_operator_array
+    {
+    items=
+        {
+        INT16
+            {
+            value = '+'; 
+            },      
+        INT16
+            {
+            value = 0x2212; 
+            },      
+        INT16
+            {
+            value = 0xD7; 
+            },      
+        INT16 
+            {
+            value = 0xF7;
+            },
+        INT16
+            {
+            value = '='; 
+            },
+        INT16
+            {
+            value = 0x221A;
+            },
+        INT16
+            {
+            value = '%';  
+            },
+        INT16
+            {
+            value = ' ';
+            },
+        INT16
+            {
+            value = '*'; 
+            },
+        INT16
+            {
+            value = '/';
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//   
+//   r_calc_sttus_saved_to_mem
+//   indicator for memory saved status  
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_calc_sttus_saved_to_mem
+    {
+    buf = qtn_calc_sttus_saved_to_mem;
+    }
+
+// ---------------------------------------------------------
+//   
+//   r_calc_sttus_saved_to_mem_sha
+//   indicator of shadow for memory saved status  
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_calc_sttus_saved_to_mem_sha
+    {
+    buf = qtn_calc_sttus_saved_to_mem_sha;
+    }
+
+// ---------------------------------------------------------
+//   
+//   r_calc_minus_indicator
+//   Minus indicator, e.g "-"  
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_calc_minus_indicator
+    {
+    buf = "-";
+    }
+
+//----------------------------------------------------
+//   
+//    r_calc_editor_numberentry_shadow_fontid
+//    Define font id for editor number shadow.
+//
+//----------------------------------------------------
+//
+RESOURCE FONT r_calc_editor_numberentry_shadow_fontid
+    {
+    fontid = CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_FONTID;
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_calc_editor_numberentry_fontid
+//    Define font id for editor number.
+//
+//----------------------------------------------------
+//
+RESOURCE FONT r_calc_editor_numberentry_fontid
+    {
+    fontid = CALC_DRAWCONST_EDITOR_NUMBER_FONTID;
+    }
+
+//----------------------------------------------------
+//   
+//    r_calc_editor_operator_shadow_fontid
+//    Define font id for editor operator shadow.
+//
+//----------------------------------------------------
+//
+RESOURCE FONT r_calc_editor_operator_shadow_fontid
+    {
+    fontid = CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_FONTID; 
+    }
+
+//----------------------------------------------------
+//   
+//    r_calc_editor_operator_fontid
+//    Define font id for editor operator.
+//
+//----------------------------------------------------
+//
+RESOURCE FONT r_calc_editor_operator_fontid
+    {
+    fontid = CALC_DRAWCONST_EDITOR_OPERATOR_FONTID; 
+    }
+
+//----------------------------------------------------
+//   
+//    r_calc_outsheet_operator_fontid
+//    Define font id for outputsheet operator.
+//
+//----------------------------------------------------
+//
+RESOURCE FONT r_calc_outsheet_operator_fontid
+    {
+    fontid = CALC_DRAWCONST_OSHEET_OPERATOR_FONTID;  
+    }
+
+RESOURCE LOCALISABLE_APP_INFO r_calcsoft_localisable_app_info
+    {
+    short_caption = qtn_apps_calculator_grid; //qtn_my_app_short_caption;
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_apps_calculator_list;  //qtn_my_app_caption;
+#ifdef __SCALABLE_ICONS
+        number_of_icons = 1;
+ 		icon_file = APP_BITMAP_DIR"\\Calcsoft_aif.mif";
+ #else
+        number_of_icons = 2;
+		icon_file = APP_BITMAP_DIR"\\Calcsoft_aif.mbm";
+ #endif
+        };
+       
+    }
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/Calcsoft_reg.rss	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  This file contains the application registration resource.
+* 
+*
+*/
+
+
+#include <appinfo.rh>
+#include <Calcsoft.rsg>
+#include <data_caging_paths_strings.hrh>
+
+UID2 KUidAppRegistrationResourceFile
+
+UID3 0x10005902
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "Calcsoft";
+    localisable_resource_file = APP_RESOURCE_DIR"\\Calcsoft";
+    localisable_resource_id = R_CALCSOFT_LOCALISABLE_APP_INFO;
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/backup_registration.xml	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+    <passive_backup>
+      <include_directory name = "\"/>
+    </passive_backup>
+    <restore requires_reboot = "no"/>
+</backup_registration>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/bld.inf	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  This file provides the information required for building 
+*                Calculator.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+//  Help exports
+#include "../help/group/bld.inf"
+
+PRJ_EXPORTS
+// export localised loc file 
+../loc/calc.loc        APP_LAYER_LOC_EXPORT_PATH(calc.loc)
+
+./backup_registration.xml /epoc32/data/z/private/10005902/backup_registration.xml
+./backup_registration.xml /epoc32/release/winscw/udeb/z/private/10005902/backup_registration.xml
+./backup_registration.xml /epoc32/release/winscw/urel/z/private/10005902/backup_registration.xml
+
+// export IBY files
+../rom/Calcsoft.iby                 CORE_APP_LAYER_IBY_EXPORT_PATH(calcsoft.iby)
+../rom/CalculatorResources.iby      LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(calculatorresources.iby)
+
+PRJ_MMPFILES
+
+
+
+//#ifdef __SCALABLE_ICONS
+//gnumakefile icons_scalable_calcsoft.mk
+//gnumakefile icons_aif_scalable_calcsoft.mk
+//#else
+//gnumakefile icons_calcsoft.mk
+//gnumakefile icons_aif_bitmaps_calcsoft.mk
+//#endif
+
+
+./Calcsoft.mmp
+
+PRJ_EXTENSIONS
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE calcsoft.mif
+OPTION HEADERFILE calcsoft.mbg
+OPTION SOURCES  -c8,1 qgn_graf_calc_display\
+                -c8,8 qgn_graf_calc_paper\
+                -c8,8 qsn_fr_calc_display_side_l\
+                -c8,8 qsn_fr_calc_display_center\
+                -c8,8 qsn_fr_calc_display_side_r\
+                -c8,8 qgn_graf_calc_results_line\
+                -c8,8 qsn_fr_calc_paper_center\
+                -c8,8 qsn_fr_calc_paper_corner_tl\
+                -c8,8 qsn_fr_calc_paper_corner_tr\
+                -c8,8 qsn_fr_calc_paper_corner_bl\
+                -c8,8 qsn_fr_calc_paper_corner_br\
+                -c8,8 qsn_fr_calc_paper_side_t\
+                -c8,8 qsn_fr_calc_paper_side_b\
+                -c8,8 qsn_fr_calc_paper_side_l\
+                -c8,8 qsn_fr_calc_paper_side_r\
+                -c8,8 qgn_indi_calc_cancel\
+                -c8,8 qgn_indi_calc_seven\
+                -c8,8 qgn_indi_calc_four\
+                -c8,8 qgn_indi_calc_one\
+                -c8,8 qgn_indi_calc_zero\
+                -c8,8 qgn_indi_calc_squareroot\
+                -c8,8 qgn_indi_calc_eight\
+                -c8,8 qgn_indi_calc_five\
+                -c8,8 qgn_indi_calc_two\
+                -c8,8 qgn_indi_calc_separator\
+                -c8,8 qgn_indi_calc_percent\
+                -c8,8 qgn_indi_calc_nine\
+                -c8,8 qgn_indi_calc_six\
+                -c8,8 qgn_indi_calc_three\
+                -c8,8 qgn_indi_calc_sign\
+                -c8,8 qgn_indi_calc_divide\
+                -c8,8 qgn_indi_calc_multiply\
+                -c8,8 qgn_indi_calc_subtract\
+                -c8,8 qgn_indi_calc_add\
+                -c8,8 qgn_indi_calc_equals\
+                -c8,1 qgn_indi_calc_button_plus\
+                -c8,1 qgn_indi_calc_button_minus\
+                -c8,1 qgn_indi_calc_button_multiply\
+                -c8,1 qgn_indi_calc_button_divide\
+                -c8,1 qgn_indi_calc_button_sign\
+                -c8,1 qgn_indi_calc_button_equals\
+                -c8,1 qgn_indi_calc_button_squareroot\
+                -c8,1 qgn_indi_calc_button_percent\
+                -c8,1 qgn_indi_calc_button_up\
+                -c8,1 qgn_indi_calc_button_down\
+                -c8,1 qgn_indi_calc_button_plus_pressed\
+                -c8,1 qgn_indi_calc_button_minus_pressed\
+                -c8,1 qgn_indi_calc_button_multiply_pressed\
+                -c8,1 qgn_indi_calc_button_divide_pressed\
+                -c8,1 qgn_indi_calc_button_sign_pressed\
+                -c8,1 qgn_indi_calc_button_equals_pressed\
+                -c8,1 qgn_indi_calc_button_squareroot_pressed\
+                -c8,1 qgn_indi_calc_button_percent_pressed\
+                -c8,1 qgn_indi_calc_button_up_pressed\
+                -c8,1 qgn_indi_calc_button_down_pressed\
+                -c8,8 qgn_indi_calc_button_up_inactive\
+                -c8,8 qgn_indi_calc_button_down_inactive\
+                -c8,8 qgn_indi_calc_button_sign_inactive\
+                -c8,8 qgn_indi_calc_button_squareroot_inactive\
+                -c8,8 qgn_indi_calc_button_percent_inactive
+END
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE calcsoft_aif.mif
+OPTION SOURCES -c8,8 qgn_menu_calc
+END
+
+PRJ_TESTMMPFILES
+//../tsrc/CVTCalcsoft.mmp  // CVT test case(s)
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/iconlist.txt	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,29 @@
+
+/*
+*
+========================================================================
+====
+*  Name     : iconlist.txt
+*  Part of  : Calcsoft
+*
+*  Description:
+*  Version:
+*
+*  Copyright C 2002 Nokia Corporation.
+*  This material, including documentation and any related 
+*  computer programs, is protected by copyright controlled by 
+*  Nokia Corporation. All rights are reserved. Copying, 
+*  including reproducing, storing,  adapting or translating, any 
+*  or all of this material requires the prior written consent of 
+*  Nokia Corporation. This material also contains confidential 
+*  information which may not be disclosed to others without the 
+*  prior written consent of Nokia Corporation.
+*
+========================================================================
+====
+*/
+
+
+/c8,8 ..\data\qgn_menu_note.svg
+/c8,8 ..\data\qgn_menu_phob.svg
+/c8,8 ..\data\qgn_menu_pinb.svg
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/icons_aif_bitmaps_calcsoft.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description:  Icons makefile for project Calcsoft
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\calcsoft_aif.mbm
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME)	\
+	/c8,8 qgn_menu_calc_lst.bmp
+	
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/icons_aif_scalable_calcsoft.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project Calcsoft
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\calcsoft_aif.mif
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME)	\
+		/c8,8 qgn_menu_calc.svg
+		
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/icons_calcsoft.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,108 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project Calcsoft
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\calcsoft.mif
+HEADERFILENAME=$(HEADERDIR)\calcsoft.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME)  /h$(HEADERFILENAME) \
+/c8,1 qgn_graf_calc_display.svg\
+/c8,8 qgn_graf_calc_paper.svg\
+/c8,8 qsn_fr_calc_display_side_l.svg\
+/c8,8 qsn_fr_calc_display_center.svg\
+/c8,8 qsn_fr_calc_display_side_r.svg\
+/c8,8 qsn_fr_calc_paper_center.svg\
+/c8,8 qsn_fr_calc_paper_corner_tl.svg\
+/c8,8 qsn_fr_calc_paper_corner_tr.svg\
+/c8,8 qsn_fr_calc_paper_corner_bl.svg\
+/c8,8 qsn_fr_calc_paper_corner_br.svg\
+/c8,8 qsn_fr_calc_paper_side_t.svg\
+/c8,8 qsn_fr_calc_paper_side_b.svg\
+/c8,8 qsn_fr_calc_paper_side_l.svg\
+/c8,8 qsn_fr_calc_paper_side_r.svg\
+/c8,1 qgn_indi_calc_button_plus.svg\
+/c8,1 qgn_indi_calc_button_minus.svg\
+/c8,1 qgn_indi_calc_button_multiply.svg\
+/c8,1 qgn_indi_calc_button_divide.svg\
+/c8,1 qgn_indi_calc_button_sign.svg\
+/c8,1 qgn_indi_calc_button_equals.svg\
+/c8,1 qgn_indi_calc_button_squareroot.svg\
+/c8,1 qgn_indi_calc_button_percent.svg\
+/c8,1 qgn_indi_calc_button_up.svg\
+/c8,1 qgn_indi_calc_button_down.svg\
+/c8,1 qgn_indi_calc_button_plus_pressed.svg\
+/c8,1 qgn_indi_calc_button_minus_pressed.svg\
+/c8,1 qgn_indi_calc_button_multiply_pressed.svg\
+/c8,1 qgn_indi_calc_button_divide_pressed.svg\
+/c8,1 qgn_indi_calc_button_sign_pressed.svg\
+/c8,1 qgn_indi_calc_button_equals_pressed.svg\
+/c8,1 qgn_indi_calc_button_squareroot_pressed.svg\
+/c8,1 qgn_indi_calc_button_percent_pressed.svg\
+/c8,1 qgn_indi_calc_button_up_pressed.svg\
+/c8,1 qgn_indi_calc_button_down_pressed.svg\
+/c8,8 qgn_indi_calc_button_up_inactive.svg\
+/c8,8 qgn_indi_calc_button_down_inactive.svg\
+/c8,8 qgn_indi_calc_button_sign_inactive.svg\
+/c8,8 qgn_indi_calc_button_squareroot_inactive.svg\
+/c8,8 qgn_indi_calc_button_percent_inactive.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/group/icons_scalable_calcsoft.mk	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,130 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+#
+# Description: Icons makefile for project Calcsoft
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\calcsoft.mif
+HEADERFILENAME=$(HEADERDIR)\calcsoft.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# Configure these.
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME)  /h$(HEADERFILENAME) \
+/c8,1 qgn_graf_calc_display.svg\
+/c8,8 qgn_graf_calc_paper.svg\
+/c8,8 qsn_fr_calc_display_side_l.svg\
+/c8,8 qsn_fr_calc_display_center.svg\
+/c8,8 qsn_fr_calc_display_side_r.svg\
+/c8,8 qgn_graf_calc_results_line.svg\
+/c8,8 qsn_fr_calc_paper_center.svg\
+/c8,8 qsn_fr_calc_paper_corner_tl.svg\
+/c8,8 qsn_fr_calc_paper_corner_tr.svg\
+/c8,8 qsn_fr_calc_paper_corner_bl.svg\
+/c8,8 qsn_fr_calc_paper_corner_br.svg\
+/c8,8 qsn_fr_calc_paper_side_t.svg\
+/c8,8 qsn_fr_calc_paper_side_b.svg\
+/c8,8 qsn_fr_calc_paper_side_l.svg\
+/c8,8 qsn_fr_calc_paper_side_r.svg\
+/c8,8 qgn_indi_calc_cancel.svg\
+/c8,8 qgn_indi_calc_seven.svg\
+/c8,8 qgn_indi_calc_four.svg\
+/c8,8 qgn_indi_calc_one.svg\
+/c8,8 qgn_indi_calc_zero.svg\
+/c8,8 qgn_indi_calc_squareroot.svg\
+/c8,8 qgn_indi_calc_eight.svg\
+/c8,8 qgn_indi_calc_five.svg\
+/c8,8 qgn_indi_calc_two.svg\
+/c8,8 qgn_indi_calc_separator.svg\
+/c8,8 qgn_indi_calc_percent.svg\
+/c8,8 qgn_indi_calc_nine.svg\
+/c8,8 qgn_indi_calc_six.svg\
+/c8,8 qgn_indi_calc_three.svg\
+/c8,8 qgn_indi_calc_sign.svg\
+/c8,8 qgn_indi_calc_divide.svg\
+/c8,8 qgn_indi_calc_multiply.svg\
+/c8,8 qgn_indi_calc_subtract.svg\
+/c8,8 qgn_indi_calc_add.svg\
+/c8,8 qgn_indi_calc_equals.svg\
+/c8,1 qgn_indi_calc_button_plus.svg\
+/c8,1 qgn_indi_calc_button_minus.svg\
+/c8,1 qgn_indi_calc_button_multiply.svg\
+/c8,1 qgn_indi_calc_button_divide.svg\
+/c8,1 qgn_indi_calc_button_sign.svg\
+/c8,1 qgn_indi_calc_button_equals.svg\
+/c8,1 qgn_indi_calc_button_squareroot.svg\
+/c8,1 qgn_indi_calc_button_percent.svg\
+/c8,1 qgn_indi_calc_button_up.svg\
+/c8,1 qgn_indi_calc_button_down.svg\
+/c8,1 qgn_indi_calc_button_plus_pressed.svg\
+/c8,1 qgn_indi_calc_button_minus_pressed.svg\
+/c8,1 qgn_indi_calc_button_multiply_pressed.svg\
+/c8,1 qgn_indi_calc_button_divide_pressed.svg\
+/c8,1 qgn_indi_calc_button_sign_pressed.svg\
+/c8,1 qgn_indi_calc_button_equals_pressed.svg\
+/c8,1 qgn_indi_calc_button_squareroot_pressed.svg\
+/c8,1 qgn_indi_calc_button_percent_pressed.svg\
+/c8,1 qgn_indi_calc_button_up_pressed.svg\
+/c8,1 qgn_indi_calc_button_down_pressed.svg\
+/c8,8 qgn_indi_calc_button_up_inactive.svg\
+/c8,8 qgn_indi_calc_button_down_inactive.svg\
+/c8,8 qgn_indi_calc_button_sign_inactive.svg\
+/c8,8 qgn_indi_calc_button_squareroot_inactive.svg\
+/c8,8 qgn_indi_calc_button_percent_inactive.svg
+
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
Binary file extras/calcsoft/help/data/xhtml.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/help/group/bld.inf	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* 
+* 
+* Description:
+* Export help related files.
+*
+*/
+
+#include <platform_paths.hrh>				
+PRJ_EXPORTS
+:zip ../data/xhtml.zip   /epoc32/data/z/resource/ overwrite
+:zip ../data/xhtml.zip   /epoc32/winscw/c/resource/ overwrite
+
+../inc/calc.hlp.hrh	MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/calc.hlp.hrh)
+../rom/calcsofthelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(calcsofthelps_variant.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/help/inc/calc.hlp.hrh	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* 
+* Description:
+*
+*/
+	
+//
+// calc.hlp.hrh generated by CSXHelp Utilities.
+//           
+
+#ifndef __CALC_HLP_HRH__
+#define __CALC_HLP_HRH__
+
+_LIT(KCALC_HLP_MAIN, "CALC_HLP_MAIN"); // 
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/help/rom/calcsofthelps_variant.iby	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description: 
+*
+*/
+
+#ifndef __CALCSOFTHELPS_VARIANT_IBY__
+#define __CALCSOFTHELPS_VARIANT_IBY__
+
+#if defined(FF_S60_HELPS_IN_USE)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005902\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x10005902\contents.zip)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005902\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005902\index.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005902\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005902\keywords.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10005902\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10005902\meta.xml)
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcApp.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  An application class, CCalcApplication, 
+*                derived from CEikApplication
+*
+*/
+
+
+#ifndef     CALCAPP_H
+#define     CALCAPP_H
+
+
+//  INCLUDES
+#include <aknapp.h>
+
+// UID of app
+const   TUid    KUidCalc = { 0x10005902 };
+
+//  FORWARD DECLARATIONS
+class CApaDocument;
+
+
+//  CLASS DEFINITIONS 
+
+/**
+CCalcApplication : Application class
+*/
+
+class   CCalcApplication
+        :public CAknApplication
+    {
+    private: // Functions from base classes 
+        /**
+        * From CApaApplication, Create CApaDocument object   
+        * @return Pointer of document class.
+        */
+        CApaDocument* CreateDocumentL(); 
+        
+        /**
+        * From CApaApplication, return Uid of Calculator application 
+        * @return Uid of Calculator application 
+        */
+        TUid AppDllUid() const; 
+    };
+
+#endif      //  CALCAPP_H   
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcAppUi.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  An App UI class, CCalcAppUi, derived from CAknViewAppUi
+*
+*/
+
+
+#ifndef     CALCAPPUI_H
+#define     CALCAPPUI_H
+
+
+//  INCLUDES
+#include <aknViewAppUi.h>
+
+
+//  FORWARD DECLARATIONS
+class   CCalcAppEnv;
+class   CEnvironmentChangeNotifier;
+
+//  CLASS DEFINITIONS 
+
+/**
+CCalcAppUi : 'AppUi' class
+*/
+
+class   CCalcAppUi
+      :public CAknViewAppUi
+
+    {
+    public:     // Constructors and destructor
+        /**
+        * C++ default constructor.
+        */
+        CCalcAppUi();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcAppUi();
+
+    public: // New functions
+        /**
+        * Exit Calculator application.
+        */
+        void ExitCalculator();
+
+		/**
+		* Returns ETrue value when the skin change event has occured.
+		*/
+		inline TBool IsSkinChanged()const;
+
+		/**
+		* Sets the value to ETrue when the skin changes
+		* @param aETrue : Boolean value to set the iIsSkinChanged variable to ETtrue.
+        */
+		inline void SetSkinChanged(TBool aETrue); 
+
+    private: // New functions
+        /**
+        * This function is called when locale is changed.
+        * @param aThisPtr : Specified in TCallback constructor.
+        * @return EFalse
+        */
+        static TInt LocaleCallback(TAny* aThisPtr);
+
+        /**
+        * Handle locale change event.
+        */
+        void HandleLocaleChangeEvent();
+        
+    private: // Functions from base classes
+        /**
+        * From CEikAppUi, default constructor
+        */
+        void ConstructL(); 
+
+        /**
+        * From CEikAppUi, Handle Exit command.
+        * Other command is handled in CCalcView::HandleCommandL().
+        * @param : aCommand : command ID
+        */
+        void HandleCommandL(TInt aCommand);
+
+		/**
+		*To handle the event when the skin changes.
+		*@param aType :This is used to check whether the skin changes or not.
+        */
+		void HandleResourceChangeL(TInt aType);
+
+		/**
+		*Handles events sent to the application by the window server.
+		*@param aEvent : window server event.
+		*@param aDestination : The control associated with the event. 
+		**/
+        void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
+              
+    private:    // Data
+        CCalcAppEnv* iCalcAppEnv; // Calculator environment
+        CEnvironmentChangeNotifier* iLocaleChangeNotifier;
+                                        // For locale change notifier
+		TBool			iIsSkinChanged; // For Skin change notification
+    };
+
+#include"CalcAppUi.inl"
+#endif      //  CALCAPPUI_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcAppUi.inl	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Implemented all inline functions for CCalcAppUi.  
+*
+*/
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+//----------------------------------------------------------
+//CCalcAppUi::IsSkinChanged
+// Get the boolean value of iIsSkinChanged
+//----------------------------------------------------------
+inline TBool CCalcAppUi::IsSkinChanged()const
+{
+	return iIsSkinChanged;
+}
+
+//----------------------------------------------------------
+//CCalcAppUi::SetSkinChanged
+// Set the boolean value to iIsSkinChanged
+//----------------------------------------------------------
+inline void CCalcAppUi::SetSkinChanged(TBool aETrue)
+{
+	iIsSkinChanged = aETrue;
+}
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcCmdBtn.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  The Function-Map's button class, CCalcCommandButton
+*                Derived from CEikCommandButtonBase
+*                The CCalcCommandButton is flat button.
+*                In making disable, it calls SetDimmed() function.
+*
+*/
+
+
+#ifndef     CALCCMDBTN_H
+#define     CALCCMDBTN_H
+
+
+#include <coecntrl.h>
+#include <aknutils.h>
+
+//  CLASS DEFINITIONS 
+class CCalcFuncmapSubPane;
+
+/**
+CCalcCommandButton : The button class for FunctionMap of a calculator
+*/
+
+class CCalcCommandButton 
+      : public CCoeControl
+    {
+    public:
+        enum TState  // Button state for bitmap.
+            {
+            ENormal,    // Button is normal.
+            EPressed,   // Button is pushed.
+            EDimmed     // Button is dimmed.
+            };
+
+    public: // Constructors and destructor 
+        /**
+        * Two-phased constructor.
+        * @param aFuncmapSubPane : CCalcFuncmapSubPane pointer 
+        * @param aUnpressedBmp : Bitmap for unpressed button
+        * @param aPressedBmp : Bitmap for pressed button
+        * @param aInactiveBmp : Bitmap for inactive button
+        */
+        static CCalcCommandButton* NewL(
+            CCalcFuncmapSubPane* aFuncmapSubPane,
+            const CGulIcon* aUnpressedBmp,
+            const CGulIcon* aPressedBmp,
+            const CGulIcon* aInactiveBmp); 
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcCommandButton();
+        
+        
+    public: // New functions
+        /**
+        * Button state is set and re-draw.
+        * @param aState : State of a button (ENormal || EPressed || ESelected)
+        */
+        void SetStateAndRedraw(const TState& aState);
+
+        /**
+        * Set flag which button is selected or not, and redraw.
+        * @param aIsSelected : Button is selected or not.
+        */
+        void SetIsSelectedAndRedraw(TBool aIsSelected);
+
+        /**
+        * Return Current state of a button.
+        * @return Current state of a button (ENormal || EPressed || ESelected)
+        */
+        TState State() const;
+
+		/**
+		 *Sets iUnpressedButton, iPressedButton, iInactiveButton bitmap arrays to the current bitmaps.
+		 * @param aUnpressedButtonIcon: Icon for Unpressed button 
+         * @param aPressedButtonIcon :  Icon for  pressed button
+         * @param aInactiveButtonIcon : Icon for Inactive button        
+		*/
+		void SetBitmapIcons(CGulIcon* aUnpressedButtonIcon,
+                    CGulIcon* aPressedButtonIcon,
+                    CGulIcon* aInactiveButtonIcon);
+        /**
+        * Gets the button layout
+        * Used for touch support.
+        */
+        TRect ButtonLayout();
+    
+    private: // New functions
+        /**
+        * C++ default constructor.
+        */
+        CCalcCommandButton();
+       
+        /**
+        * Second-phase constructor.
+        * @param aFuncmapSubPane : CCalcFuncmapSubPane pointer 
+        * @param aUnpressedBmp : Bitmap for unpressed button
+        * @param aPressedBmp : Bitmap for pressed button
+        * @param aInactiveBmp : Bitmap for inactive button
+        */
+        void ConstructL(
+                CCalcFuncmapSubPane* aFuncmapSubPane,
+                const CGulIcon* aUnpressedBmp,
+                const CGulIcon* aPressedBmp,
+                const CGulIcon* aInactiveBmp); 
+        
+        
+    private:  // Functions from base classes
+        /**
+        * From CCoeControl : Data of control is set.
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl : Draw a button
+        * @param aRect : Size of a button
+        */
+        void Draw(const TRect& aRect) const;
+
+        
+    private:  // Data
+        TState  iState;      // Current state of a button
+        TBool   iIsSelected; // If Button selected TRUE
+        const CGulIcon*   iUnpressedButton;   // Unpressed button bitmap
+        const CGulIcon*   iPressedButton;     // Pressed button bitmap
+        const CGulIcon*   iInactiveButton;    // Inactive button bitmap
+        TAknLayoutRect    iLayoutRect;        // rectangle of button 
+    };
+
+
+#endif      //  CALCCMDBTN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcCont.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Header file of "CCalcContainer",  CCalcContainer class 
+*                which derived from CCoeControl class. Role of this class 
+*                is to update the calculator data and display on user's input.
+*
+*/
+
+
+#ifndef     CALCCONT_H
+#define     CALCCONT_H
+
+
+//  INCLUDES
+#include <coecntrl.h>
+
+#include "CalcEditline.h"
+#include "CalcView.h"
+
+
+//  FORWARD DECLARATIONS
+class   CCalcEditorSubPane;
+class   CCalcFuncmapSubPane;
+class   CCalcOutputSheet; 
+class   CCalcView;
+class   CCalcDocument;
+class   CPeriodic;
+class   CAknsBasicBackgroundControlContext;
+//Enum declarations for touch values
+enum enlayout_values
+{
+    enTouch_disabled = 0,
+    enTouch_enabled,
+    enTouch_with_prt,
+    enTouch_with_lsc
+};
+//  CLASS DEFINITIONS 
+
+/**
+CCalcContainer : 'Main-Pane' class
+*/
+class   CCalcContainer
+        :public CCoeControl
+    {
+    public:  // Constructors and destructor   
+        /**
+        * Two-phased constructor.
+        */
+        static CCalcContainer* NewL(CCalcView* aView); 
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcContainer();  
+
+
+    public:  // New functions
+        /**
+        * Return pointer of FunctionMap subpane class
+        * @return Pointer of FunctionMap subpane class 
+        */
+        inline CCalcFuncmapSubPane* FuncmapSubPane() const; 
+
+        /**
+        * Return pointer of editor subpane.
+        * @return Pointer of Editor subpane class 
+        */
+        inline CCalcEditorSubPane* EditorPane() const;
+        
+        /**
+        * Return pointer of OutputSheet.
+        * @return Pointer of OutputSheet class 
+        */
+        inline CCalcOutputSheet* OutputSheet() const;
+        
+        /**
+        * Return pointer of CCalcView.
+        * @return Pointer of CCalcView class 
+        */
+        inline CCalcView* View() const;
+
+        /**
+        * The pretreatment of a numerical input is performed.
+        */
+        void ProcessPreinputL();
+        
+        /**
+        * Clear editor,
+        * and if need, empty line is added to calculation history. 
+        */
+        void InputClearL();
+        
+        /**
+        * Redraw scroll-up and down button on scrolling enable.
+        */
+        void ScrollArrowUpdate();
+
+        /**
+        * Redraw ChangeSign button on ChangeSign enable.
+        */
+        void SetChangeSignEnableL();
+        
+        /**
+        * Redraw ChangeSign button on ChangeSign disable.
+        */
+        void SetChangeSignDisable();
+  
+        /**
+        * Redraw Clear button on ClearKey enable.
+        */
+        void SetClearKeyEnable();
+
+        /**
+        * Show square root button only if no 0 in editor.
+        */
+        void SetSqrtEnableL();
+
+        /**
+        * Show percent button only if no 0 in editor.
+        */
+        void SetPercentEnableL();
+
+        /**
+        * Redraw square root button.
+        */
+        void ShowSqrtButton(TBool aEnable);
+
+        /**
+        * Redraw percent button.
+        */
+        void ShowPercentButton(TBool aEnable);
+
+        /**
+        * Returns the state of the calculator.
+        */
+        CCalcView::TStateNo GetState();
+
+        /**
+        * Time out CallBack function for *-key press
+        * @param aObject this class.
+        * @return always 0
+        */
+        static TInt TimeoutCallbackL(TAny* aObject);
+     
+        /**
+        * Time out CallBack function for * /key press
+        * @param aObject this class.
+        * @return always 0
+        */
+        static TInt TimeoutCallbackChrL( TAny* aObject );
+        /**
+        * Time out CallBack function for +#key press
+        * @param aObject this class.
+        * @return always 0
+        */
+        static TInt TimeoutCallbackShiftL( TAny* aObject );
+        
+        /**
+        * Notify changing decimal separator.
+        * @param aOld : Old decimal separator
+        * @param aNew : New decimal separator  
+        */
+        void NotifyChangeDecimal(TChar aOld, TChar aNew);
+        
+        /**
+        * Called  when an error is displayed.
+        * @param aErrorCode : an error code  from  CCalcContainer
+        */
+        void SetErrorCode(TInt aErrorCode);
+        
+    public: // Functions from base classes
+        /**
+        * From CCoeControl : Get help context
+        * @param aContext : help context. 
+        */
+        void GetHelpContext(TCoeHelpContext& aContext) const;
+
+        /**
+        *Returns functionMap subpane
+        */
+        inline CCalcFuncmapSubPane* FunctionSubPane() const; 
+        
+        /**
+        * HandleMiddleSoftKey
+        * Handled when MSK is selected 
+        */    
+        void HandleMiddleSoftKey();
+
+        /**
+        * SetOperatorFromTouch
+        * To handle the addition of Touch Input values for digits
+        */    
+        void SetOperatorFromTouchL(TInt akey);
+        
+        /**
+        * ClearInputKey
+        * To handle the clear input key through the touch UI 
+        */    
+        void ClearInputKeyL(TInt aRepeat = 0);
+        
+        /**
+        * ClearInputKey
+        * To handle the '.' key press
+        */    
+        
+        void SetSeparatorFromTouchL();
+
+        // From CCoeControl        
+        void ActivateL();
+    private:  // New functions 
+        /**
+        * C++ default constructor.
+        * @param aView : Pointer of CCalcView
+        */
+        CCalcContainer();  
+
+        /**
+        * Second-phase constructor.
+        */
+        void ConstructL(CCalcView* aView);   
+
+        /**
+        * If no key is pressed until timeout of *-key,
+        * this function is called.
+        */
+        void DoTimeoutL();
+
+        /**
+        * If no key is pressed until timeout of * /key,
+        * this function is called.
+        */
+        void DoTimeoutChrL();
+        /**
+        * If no key is pressed until timeout of +#key,
+        * this function is called.
+        */
+        void DoTimeoutShiftL();        
+
+        /**
+        * Called when any key is pressed.
+        * If timeout notifier for *-key is active, make calculation or
+        * stop notifier according to user's input.
+        * @param aKeyEvent : The key event
+        * @param aType     : The type of the event
+        * @return : If ETrue, the key event is used only for *-key timeout.
+        *           If EFalse, the key event is used not only for *-key 
+        *           timeout but also for other effect of each key. 
+        */
+        TBool HandleAsterKeyTimeoutForKeyPressL(
+             const TKeyEvent& aKeyEvent, TEventCode aType);
+        
+        /**
+        * Called when any key is pressed.
+        * If timeout notifier for * /key is active, make calculation or
+        * stop notifier according to user's input.
+        * @param aKeyEvent : The key event
+        * @param aType     : The type of the event
+        * @return : If ETrue, the key event is used only for * /key timeout.
+        *           If EFalse, the key event is used not only for *+key 
+        *           timeout but also for other effect of each key. 
+        */
+        TBool HandleChrKeyTimeoutForKeyPressL(
+             const TKeyEvent& aKeyEvent, TEventCode aType );
+        /**
+        * Called when any key is pressed.
+        * If timeout notifier for +#key is active, make calculation or
+        * stop notifier according to user's input.
+        * @param aKeyEvent : The key event
+        * @param aType     : The type of the event
+        * @return : If ETrue, the key event is used only for +#key timeout.
+        *           If EFalse, the key event is used not only for +#key 
+        *           timeout but also for other effect of each key. 
+        */
+        TBool HandleShiftKeyTimeoutForKeyPressL(
+             const TKeyEvent& aKeyEvent, TEventCode aType );    
+
+    private:  // Functions from base classes 
+        /**
+        * From CCoeControl : Return count of controls contained in a compound control.
+        * @return Count of controls contained in a compound control 
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl : Get the components of a compound control
+        * @param aIndex : index of control
+        * @return Control of argument aIndex  
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+        
+        /**
+        * From CCoeControl : Handling key event
+        * @param aKeyEvent : The key event
+        * @param aType     : The type of the event
+        * @return EKeyWasConsumed    : Key event is used. 
+        *         EKeyWasNotConsumed : Key event is not used.
+        */
+        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                    TEventCode aType);
+
+        /**
+        * From CCoeControl : Notifier for changing language
+        * @param aType : Type of resource change
+        */
+        void HandleResourceChange(TInt aType);
+        
+        /**
+        * @param aType : Type of resource change
+        */
+        void HandleResourceChangeCalSoftL(TInt aType);
+ 
+        /**
+        * From CCoeControl : Control size is set.
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl : Clear whole rectangle. 
+        * @param aRect : rectangle of control
+        */
+        void Draw(const TRect& aRect) const;
+
+        /**
+        * From CCoeControl.
+        * Pass skin information if need.
+        * @param aId : Type of supplied object.
+        */
+        TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
+         /**
+        * From CCoeControl : Handling pointer event
+        * @param aKeyEvent : The key event
+        * 
+        */
+        void HandlePointerEventL
+                ( const TPointerEvent& aKeyEvent );
+
+    private:    // Data
+        CCalcEditorSubPane*  iEditorPane;  // Editor subpane 
+        CCalcFuncmapSubPane* iFuncmapPane; // FunctionMap subpane
+        CCalcOutputSheet*    iSheetPane;   // OutputSheet
+        CCalcView*           iView;        // Calculator view 
+        CCalcDocument*       iCalcDocument;
+        CPeriodic*           iTimeout;     // For handling *-key
+       
+        CPeriodic*           iTimeoutChr;     // For handling */key
+        CPeriodic*           iTimeoutShift;     // For handling +#key   
+
+        TUint                iPrevInput;   // Key code of previous input
+        CAknsBasicBackgroundControlContext* iSkinContext; // skin data
+        TInt iValue ; 
+    };
+
+#include "CalcCont.inl"
+
+#endif      //  CALCCONT_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcCont.inl	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Implemented all inline functions for CCalcContainer.  
+*
+*/
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CCalcContainer::FuncmapSubPane
+// Return pointer of FunctionMap subpane class
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline CCalcFuncmapSubPane* CCalcContainer::FuncmapSubPane() const
+    {
+    return iFuncmapPane;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::EditorPane
+// Return pointer of editor subpane.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline CCalcEditorSubPane* CCalcContainer::EditorPane() const
+    {
+    return iEditorPane;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::OutputSheet
+// Return pointer of OutputSheet.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline CCalcOutputSheet* CCalcContainer::OutputSheet() const
+    {
+    return iSheetPane;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::View
+// Return pointer of CCalcView.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline CCalcView* CCalcContainer::View() const
+    {
+    return iView;
+    }
+
+
+	//EISkin2.6
+// ---------------------------------------------------------
+// CCalcContainer::FunctionSubPane
+// Gets the function subpane when the skin changes.
+// ---------------------------------------------------------
+//
+inline CCalcFuncmapSubPane* CCalcContainer::FunctionSubPane()const
+{
+	return iFuncmapPane;
+}
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcDoc.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Document class, CCalcDocument
+*                Derived from CEikDocument
+*                The history of inputted data is held.
+*                The memory of four-arithmetical-operations operation 
+*                or a calculation result is held.
+*                The last result and memory are saved at a file and 
+*                it restores.
+*
+*/
+
+
+#ifndef     CALCDOC_H
+#define     CALCDOC_H
+
+
+//  INCLUDES
+#include <eikdoc.h>
+
+#include "CalcEditline.h"
+
+#include "CalcView.h"
+//  CONSTANTS
+const TInt KCalcErrEditorSpaceFull(-10000); 
+
+//  FORWARD DECLARATIONS
+
+class  CEikAppUi;
+class  CCalcHistory;
+class  CCalcAppEnv;
+
+//  CLASS DEFINITIONS 
+
+/**
+CCalcDocument : 'Document' class
+*/
+class   CCalcDocument 
+        :public CEikDocument
+    {
+    public:  // Constructors and destructor  
+        /**
+        * Two-phased constructor.
+        * @param aApp : Reference of CEikApplication class 
+        */
+        static CCalcDocument* NewL(CEikApplication& aApp);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcDocument();
+
+        
+    public:  // New functions
+		/**
+        * Set the pointer to CalcAppEnv. 
+        */
+		void SetAppEnv(CCalcAppEnv* aCalcAppEnv);
+
+        /**
+        * Set the pointer to CalcAppEnv. 
+        */		
+        void SetCalcView( CCalcView* aCCalcView );
+        
+		/**
+        * Make calculation, and add result to calcluation history.
+        * Leave may occur, causes KErrOverflow or KErrDivideByZero or KErrNotSupported (negative value with square root).
+        * @param aOperand : operand.
+        * @param aLine : inputted edit line
+        * @return TReal64: Provisional result.
+        */
+        TReal64 CalculateAndAddHistoryL(
+                TReal64 aOperand,
+               const TCalcEditLine& aLine);  
+		
+		/**
+        * Make calculation, nothing is added to the calculation history.
+        * Leave may occur, causes KErrOverflow or KErrDivideByZero or KErrNotSupported (negative value with square root).
+        * @param aOperand : operand.
+        * @param aLine : inputted edit line
+        * @return TReal64: Provisional result.
+        */
+		TReal64 CalculateAndNoHistoryL(
+				TReal64 aOperand,
+               const TCalcEditLine& aLine);  
+
+		/**
+        * Make calculation, and modify the operator
+		* before adding anything to the calculation history.
+        * Leave may occur, causes KErrOverflow or KErrDivideByZero or KErrNotSupported (negative value with square root).
+        * @param aOperand : operand.
+        * @param aLine : inputted edit line
+        * @return TReal64: Provisional result.
+        */
+		TReal64 CalculateAndModifyHistoryL(
+				TReal64 aOperand,
+               TCalcEditLine& aLine,
+			   TCalcEditLine::TCalcOperatorType aOperator); 
+
+        /**
+        * Add a line which is "= (provisional result)" to calculation history.
+        * And Last Result is updated to provisional result
+        */
+        void AddEqualLineAndUpdateLastResultL();
+
+        /**
+        * Empty line is added to calculation history.
+        */
+        void AddEmptyLine();
+        
+        /**
+        * Memory is saved.
+        * @param aNewMemory : New memory, current operand.
+        */
+        void MemorySaveL(TReal64 aNewMemory); 
+
+        /**
+        * Memory is saved.
+        * @param aLine : Current value of editor
+        */
+        TBool HasMemory() const;
+
+        /**
+        * Return current memory.
+        * @return TReal64 : current memory.
+        */
+        TReal64 Memory() const; 
+
+        /**
+        * Clear memory.
+        */
+        void MemoryClearL();
+        
+        /**
+        * Return last result
+        * @param TReal64 : Last result.
+        */
+        TReal64 LastResult() const;  
+
+        /**
+        * Return provisional result
+        * @param aLine : For getting provisional result.
+        */
+        TReal64 ProvisionalResult() const;
+
+        /**
+        * Return pointer of CCalcHistory class. 
+        * @return Pointer of CCalcHistory class
+        */
+        CCalcHistory* History() const;
+        
+        /**
+        * Restore memory and last result
+        */
+        void LoadStateL();
+        
+        /**
+        * Store memory and last result
+        */
+		void SaveStateL();
+        
+    private:   //  New functions
+        /**
+        * By default constructor is private.
+        * @param aApp: Reference of CEikApplication class
+        */
+        CCalcDocument(CEikApplication& aApp); 
+
+        /**
+        * Second-phase constructor
+        */
+        void ConstructL();
+
+        /**
+        * Make calculation by using argument aLine 
+        * Leave may occur, causes KErrOverflow or KErrDivideByZero.
+        * @param aOperand : operand
+        * @param aOperator : Operator type enum.
+        * @return Result of calculation
+        */
+        TReal64 CalculateL(TReal64 aOperand,
+            TCalcEditLine::TCalcOperatorType aOperator);
+        
+        /**
+        * Check overflow and underflow 
+        * Leave may occur, causes KErrOverflow
+        * @param aResult : result of calculation
+        */
+        void CheckResultL(TReal64* aResult);  
+
+        /**
+        * Write last result and memory to document file.
+        * @param aStream : Interface of write steam
+        */
+        void ExternalizeL(RWriteStream& aStream) const;
+        
+        /**
+        * Read last result and memory from document file.
+        * @param aStream : Interface of read steam
+        */
+        void InternalizeL(RReadStream& aStream);
+
+        
+    private:  // Functions from base classes  
+        /**
+        * From CEikDocument : Create CCalcAppUi object
+        */
+        CEikAppUi* CreateAppUiL();  
+
+    private:    // Data
+	    CCalcAppEnv* iCalcAppEnv;  // Not own
+        TReal64 iProvisionalResult; // Provisional result
+        TReal64 iMemory;        // Memory
+        TReal64 iLastResult;    // Last result
+        CCalcHistory* iHistory; // History
+        CCalcView* iCCalcView;  // Not own
+    };
+
+#endif      //  CALCDOC_H
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcDrawingConst.laf	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,181 @@
+/*
+* ============================================================================
+*  Name        : CalcDrawingConst.laf
+*  Part of     : Calcsoft / Calcsoft.app
+*  Interface   : ?Interface_category, ?Interface_name
+*  Description : This file contains constants for drawing.
+*  Version     :
+*
+*  Copyright © 2002 Nokia Corporation.
+*  This material, including documentation and any related 
+*  computer programs, is protected by copyright controlled by 
+*  Nokia Corporation. All rights are reserved. Copying, 
+*  including reproducing, storing, adapting or translating, any 
+*  or all of this material requires the prior written consent of 
+*  Nokia Corporation. This material also contains confidential 
+*  information which may not be disclosed to others without the 
+*  prior written consent of Nokia Corporation.
+* ============================================================================
+*/
+
+#ifndef     CALCDRAWINGCONST_HRH
+#define     CALCDRAWINGCONST_HRH
+
+//  CONSTANTS
+
+// ==============================
+// Following is constants for drawing.
+// ==============================
+//
+
+//d:Whole rectangle of Editor SubPane.
+//l:main_pane_1
+//
+#define CALC_DRAWCONST_EDITOR_TOPLEFT_X      3
+#define CALC_DRAWCONST_EDITOR_TOPLEFT_Y      146
+#define CALC_DRAWCONST_EDITOR_WIDTH          170
+#define CALC_DRAWCONST_EDITOR_HEIGHT         32
+
+//d:Whole rectangle of Output Sheet.
+//l:main_pane_2
+//
+#define CALC_DRAWCONST_OSHEET_TOPLEFT_X      3 
+#define CALC_DRAWCONST_OSHEET_TOPLEFT_Y      8
+#define CALC_DRAWCONST_OSHEET_WIDTH          108
+#define CALC_DRAWCONST_OSHEET_HEIGHT         130
+
+//d:Whole rectangle of FunctionMap SubPane.
+//l:main_pane_4
+//
+#define CALC_DRAWCONST_FUNCMAP_TOPLEFT_X     113 
+#define CALC_DRAWCONST_FUNCMAP_TOPLEFT_Y     5 
+#define CALC_DRAWCONST_FUNCMAP_WIDTH         60 
+#define CALC_DRAWCONST_FUNCMAP_HEIGHT        134 
+
+//d:LAF data for drawing number shadow of editor.
+//l:main_pane_1
+//
+#define CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_FONTID       KScreenFontUidAcalc21
+#define CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_CUSTOMFONT   EFontCustom         
+#define CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_COLOR        219
+#define CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_LMARGIN      47 
+#define CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_RMARGIN      8
+#define CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_BASELINE     172
+#define CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_WIDTH        121
+#define CALC_DRAWCONST_EDITOR_NUMBER_SHADOW_J            ELayoutAlignRight
+
+//d:LAF data for drawing number of editor.
+//l:main_pane_2
+//
+#define CALC_DRAWCONST_EDITOR_NUMBER_FONTID            KScreenFontUidAcalc21 
+#define CALC_DRAWCONST_EDITOR_NUMBER_CUSTOMFONT        EFontCustom         
+#define CALC_DRAWCONST_EDITOR_NUMBER_COLOR             210
+#define CALC_DRAWCONST_EDITOR_NUMBER_LMARGIN           46 
+#define CALC_DRAWCONST_EDITOR_NUMBER_RMARGIN           9
+#define CALC_DRAWCONST_EDITOR_NUMBER_BASELINE          171
+#define CALC_DRAWCONST_EDITOR_NUMBER_WIDTH             121
+#define CALC_DRAWCONST_EDITOR_NUMBER_J                 ELayoutAlignRight
+
+//d:LAF data for drawing operator shadow of editor.
+//l:main_pane_3
+//
+#define CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_FONTID        KScreenFontUidAco21
+#define CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_CUSTOMFONT    EFontCustom         
+#define CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_COLOR         219
+#define CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_LMARGIN       21 
+#define CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_RMARGIN       142
+#define CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_BASELINE      172
+#define CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_WIDTH         13  
+#define CALC_DRAWCONST_EDITOR_OPERATOR_SHADOW_J             ELayoutAlignLeft
+
+//d:LAF data for drawing operator of editor.
+//l:main_pane_4
+//
+#define CALC_DRAWCONST_EDITOR_OPERATOR_FONTID            KScreenFontUidAco21
+#define CALC_DRAWCONST_EDITOR_OPERATOR_CUSTOMFONT        EFontCustom         
+#define CALC_DRAWCONST_EDITOR_OPERATOR_COLOR             215
+#define CALC_DRAWCONST_EDITOR_OPERATOR_LMARGIN           20 
+#define CALC_DRAWCONST_EDITOR_OPERATOR_RMARGIN           143
+#define CALC_DRAWCONST_EDITOR_OPERATOR_BASELINE          171
+#define CALC_DRAWCONST_EDITOR_OPERATOR_WIDTH             13  
+#define CALC_DRAWCONST_EDITOR_OPERATOR_J                 ELayoutAlignLeft
+    
+//d:LAF data for drawing memory indicator shadow of editor.
+//l:main_pane_5
+//
+#define CALC_DRAWCONST_EDITOR_M_INDI_SHADOW_FONTID    ELatinBold12
+#define CALC_DRAWCONST_EDITOR_M_INDI_SHADOW_COLOR     219  
+#define CALC_DRAWCONST_EDITOR_M_INDI_SHADOW_LMARGIN   8
+#define CALC_DRAWCONST_EDITOR_M_INDI_SHADOW_RMARGIN   156 
+#define CALC_DRAWCONST_EDITOR_M_INDI_SHADOW_BASELINE  160
+#define CALC_DRAWCONST_EDITOR_M_INDI_SHADOW_WIDTH     12 
+#define CALC_DRAWCONST_EDITOR_M_INDI_SHADOW_J         ELayoutAlignLeft
+
+//d:LAF data for drawing memory indicator of editor.
+//l:main_pane_6
+//
+#define CALC_DRAWCONST_EDITOR_M_INDI_FONTID         ELatinBold12
+#define CALC_DRAWCONST_EDITOR_M_INDI_COLOR          35  
+#define CALC_DRAWCONST_EDITOR_M_INDI_LMARGIN        7
+#define CALC_DRAWCONST_EDITOR_M_INDI_RMARGIN        157 
+#define CALC_DRAWCONST_EDITOR_M_INDI_BASELINE       159
+#define CALC_DRAWCONST_EDITOR_M_INDI_WIDTH          12
+#define CALC_DRAWCONST_EDITOR_M_INDI_J              ELayoutAlignLeft
+
+//d:LAF data for drawing operand of OutputSheet.
+//l:main_pane_7
+//
+#define CALC_DRAWCONST_OSHEET_OPERAND_FONTID           ELatinBold13
+#define CALC_DRAWCONST_OSHEET_OPERAND_COLOR            215
+#define CALC_DRAWCONST_OSHEET_OPERAND_LMARGIN          19
+#define CALC_DRAWCONST_OSHEET_OPERAND_RMARGIN          71
+#define CALC_DRAWCONST_OSHEET_OPERAND_BTMLINE_BASELINE 126
+#define CALC_DRAWCONST_OSHEET_OPERAND_LINE_HEIGHT      17
+#define CALC_DRAWCONST_OSHEET_OPERAND_WIDTH            86 
+#define CALC_DRAWCONST_OSHEET_OPERAND_J                ELayoutAlignRight
+
+//d:LAF data for drawing operator of OutputSheet.
+//l:main_pane_8
+//
+#define CALC_DRAWCONST_OSHEET_OPERATOR_FONTID           KScreenFontUidAco13
+#define CALC_DRAWCONST_OSHEET_OPERATOR_CUSTOMFONT       EFontCustom         
+#define CALC_DRAWCONST_OSHEET_OPERATOR_COLOR            215  
+#define CALC_DRAWCONST_OSHEET_OPERATOR_LMARGIN          11
+#define CALC_DRAWCONST_OSHEET_OPERATOR_RMARGIN          157 
+#define CALC_DRAWCONST_OSHEET_OPERATOR_BTMLINE_BASELINE 126
+#define CALC_DRAWCONST_OSHEET_OPERATOR_LINE_HEIGHT      17
+#define CALC_DRAWCONST_OSHEET_OPERATOR_WIDTH            8
+#define CALC_DRAWCONST_OSHEET_OPERATOR_J                ELayoutAlignCenter
+
+//d:LAF data for drawing eqaul line of OutputSheet.
+//l:main_pane_3
+//
+#define CALC_DRAWCONST_OSHEET_EQUALLINE_COLOR          107
+#define CALC_DRAWCONST_OSHEET_EQUALLINE_TOPLEFT_X      9
+#define CALC_DRAWCONST_OSHEET_EQUALLINE_BTM_TOPLEFT_Y  112
+#define CALC_DRAWCONST_OSHEET_EQUALLINE_LINE_HEIGHT    17 
+#define CALC_DRAWCONST_OSHEET_EQUALLINE_WIDTH          96
+#define CALC_DRAWCONST_OSHEET_EQUALLINE_HEIGHT         1
+
+//d:Whole rectangle of Functionmap button.
+//l:cell_calc_pane_4
+//
+#define CALC_DRAWCONST_FUNCMAP_LEFT_BUTTON_TOPLEFT_X    0
+#define CALC_DRAWCONST_FUNCMAP_RIGHT_BUTTON_TOPLEFT_X   30
+#define CALC_DRAWCONST_FUNCMAP_TOP_BUTTON_TOPLEFT_Y     0
+#define CALC_DRAWCONST_FUNCMAP_BUTTON_OFFSET            27
+#define CALC_DRAWCONST_FUNCMAP_BUTTON_WIDTH             30
+#define CALC_DRAWCONST_FUNCMAP_BUTTON_HEIGHT            26 
+
+//d:LAF data for drawing cursor of FunctionMap.
+//l:cell_calc_pane_4
+//
+#define CALC_DRAWCONST_FUNCMAP_CURSOR_COLOR      215
+#define CALC_DRAWCONST_FUNCMAP_CURSOR_TOPLEFT_X  0
+#define CALC_DRAWCONST_FUNCMAP_CURSOR_TOPLEFT_Y  0
+#define CALC_DRAWCONST_FUNCMAP_CURSOR_WIDTH      30
+#define CALC_DRAWCONST_FUNCMAP_CURSOR_HEIGHT     26
+
+#endif      //  CALCDRAWINGCONST_HRH
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcEdit.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,267 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Header file of "editor sub-pane", CCalcEditorSubPane class 
+*                which derived from CCoeControl class. Role of this class 
+*                is to draw editor.
+*
+*/
+
+
+#ifndef     CALCEDIT_H
+#define     CALCEDIT_H
+
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <AknUtils.h>  // for TAknLayoutRect
+
+#include "CalcView.h"
+#include "CalcEnv.h"
+#include <PtiDefs.h>
+#include <centralrepository.h>
+#include <cenrepnotifyhandler.h>
+#include <e32property.h> 
+#endif
+
+//  CONSTANTS
+const TInt KCalcCountOfEditorComponent(6);
+_LIT(KAllowedDecimal, ".,");
+
+//  FORWARD DECLARATIONS
+class CCalcContainer;
+class   CPtiEngine;
+class   CPtiQwertyKeyMappings;
+class 	CPtiCoreLanguage;
+//class CCalcAppEnv;
+#ifdef RD_INTELLIGENT_TEXT_INPUT 
+class   CPtiHalfQwertyKeyMappings;
+#endif
+
+//  CLASS DEFINITIONS 
+
+/**
+CCalcEditorSubPane : 'Editor Sub-Pane' class
+*/
+
+class   CCalcEditorSubPane
+        :public CCoeControl
+    {
+    // Enlarge size for rect.
+    public:
+         enum  RectEnlargeSizeID
+            {
+               EEnlargeFive = 5,   
+               EEnlargeTwenty = 20
+            };
+            
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        * @param aContainer : Pointer of CCalcContainer class 
+        */
+        static CCalcEditorSubPane* NewL(CCalcContainer* aContainer); 
+       
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcEditorSubPane();
+        
+        
+    public:     // New functions
+        /**
+        * Return curent value of editor
+        * @return Reference of TCalcEditLine : curent value of editor
+        */
+        const TCalcEditLine& EditLine() const; 
+
+        /**
+        * Set operator to editor.
+        * @param aType : new operator type.  
+        */
+        void SetOperator(TCalcEditLine::TCalcOperatorType aType);
+
+        /**
+        * Set TReal64 type editor number.
+        * @param aNewNumber : new editor number.  
+        */
+        void SetEditorNumber(TReal64 aNewNumber);
+        
+        /**
+        * Return curent editor number.
+        * @return TReal64 type editor number.
+        */
+        TReal64 EditorNumber() const;
+        
+        /**
+        * Number of editor is set "0" and operator is set none.  
+        */
+        void ResetL();
+        
+        /**
+        * Operand of editor is erased.
+        */
+        void ClearOperand();
+        
+        /**
+        * Clear latest input from editor. 
+        */
+        void ClearLastInputL();
+        
+        /**
+        * Handle short-press-clear-key and CBA-clear-key event.
+        */
+        void OfferShortPressClearKeyEventL();
+
+        /**
+        * Changing sign.
+        * @param aState : Current state of Calculator
+        */
+        void DoChangeSignL(CCalcView::TStateNo aState);
+
+        /**
+        * Update editor number to memory or last result.
+        * @param aMemory : memory or last result
+        * @param aState : Current state of Calculator
+        */
+        void DoMemoryRecallOrLastResult(
+             TReal64 aMemoryOrLastResult, 
+             CCalcView::TStateNo aState);
+
+        /**
+        * Notify changing decimal separator.
+        * @param aOld : Old decimal separator
+        * @param aNew : New decimal separator  
+        */
+        void NotifyChangeDecimal(TChar aOld, TChar aNew);
+        
+        /**
+        * Gets the layout of the EditPane.
+        * Used for touch support.
+        */
+        TRect EditPaneRect();
+        
+        /**
+        * HandlePointerEventL
+        * Handles pen inputs of Editor pane.
+        */
+        void HandlePointerEventL(const TPointerEvent& aPointerEvent );
+        
+    public: // Functions from base classes
+        /**
+        
+        /**
+        * Called to find key pad is Active.
+        * 
+        */
+        TInt IsQwertyKeypadActive();
+        
+        /* From CCoeControl : Handling key event
+        * @param aKeyEvent : The key event
+        * @param aType : The type of the event
+        * @return EKeyWasConsumed : Key event is used.
+        *         EKeyWasNotConsumed : Key event is not used.
+        */
+        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);       
+
+		/**
+		 * Refresh the display bitmap when the skin change event has occured.
+		 */
+				inline void RefreshDisplaySideLBitmap();
+     			inline void RefreshDisplayCenterBitmap();
+     			inline void RefreshDisplaySideRBitmap();
+          
+    private:    // NewFunctions
+        /**
+        * C++ default constructor.
+        */
+        CCalcEditorSubPane();
+       
+        /**
+        * Second-phase constructor.
+        * @param aContainer : Pointer of CCalcContainer class 
+        */
+        void ConstructL(CCalcContainer* aContainer);
+
+        /**
+        * Delete the latest input
+        */
+        void ClearL();    // Delete the latest input
+
+    private: // Functions from base classes
+        /**
+        * From CCoeControl : Size of control is set. 
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl : Draw editor
+        * @param aRect : rectangle of editor space.
+        */
+        void Draw(const TRect& aRect) const;  
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        TBool MapDecimal( TKeyEvent aKeyEvent ); 
+#else
+        TBool MapDecimal(TPtiKey aKey, TPtiTextCase aCase); 
+#endif
+
+    private:    // Data
+       
+      	const CGulIcon* iCalcSideLDisplay;
+      	const CGulIcon* iCalcCenterDisplay;
+      	const CGulIcon* iCalcSideRDisplay;
+		TAknLayoutRect iSideLDisplayLayout;
+	    TAknLayoutRect iCenterDisplayLayout;
+	    TAknLayoutRect iSideRDisplayLayout;
+      	  
+        CCalcContainer* iCalcContainer;  // Not own
+        CCalcAppEnv*    iCalcAppEnv;     // Not own 
+        TCalcEditLine   iEditLine;  // editor data
+        TReal64         iEditorNumber;
+        TInt 			iIsQwertyActive;
+        CPtiEngine*     iEngine;
+        CRepository* 	iCRKey;
+        CPtiCoreLanguage* iCoreLanguage;
+        CPtiQwertyKeyMappings* iQwertyKeyMappings;
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        CPtiHalfQwertyKeyMappings* iHalfQwertyKeyMappings;
+#endif
+        TInt 			iLanguage;
+
+        TInt            iUiLanguage;
+        TBuf<256> 		iAllowedDecimal;
+        RProperty       iQwertyModeStatusProperty; // To check the Qwerty keypad active 
+        TInt			iDecimalCounter;
+        
+        TInt            iKeyboardType;
+     public:
+     	void IsQwertyActive();
+     	void IsQwertyNotActive(); 
+     private:   
+        enum TCalcEditorComponentIndex
+            {
+            ECalcEditorOperandShadow,
+            ECalcEditorOperand,
+            ECalcEditorMemoryShadow,
+            ECalcEditorMemory,
+            ECalcEditorOperatorShadow,
+            ECalcEditorOperator
+            };
+        TAknLayoutText iLayoutText[KCalcCountOfEditorComponent]; 
+                     // Layout of each drawing component.
+    };
+
+#include "CalcEdit.inl"
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcEdit.inl	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Implemented all inline functions for CCalcEditorSubPane.  
+*
+*/
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+inline void CCalcEditorSubPane::RefreshDisplaySideLBitmap()
+{
+	 iCalcSideLDisplay = iCalcAppEnv->DisplaySideLBitmap();
+}
+
+
+inline void CCalcEditorSubPane::RefreshDisplayCenterBitmap()
+{
+	 iCalcCenterDisplay = iCalcAppEnv->DisplayCenterBitmap();
+}
+
+
+inline void CCalcEditorSubPane::RefreshDisplaySideRBitmap()
+{
+	 iCalcSideRDisplay = iCalcAppEnv->DisplaySideRBitmap();
+}
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcEditLine.inl	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Define inline functions of CCalcEditLine.
+*
+*/
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// TCalcEditLine::NumberString
+// Return string of operand
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const TPtrC TCalcEditLine::NumberString() const 
+    {
+    return  iNumber;
+    }
+
+// ---------------------------------------------------------
+// TCalcEditLine::Operator
+// Return type of operator
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline TCalcEditLine::TCalcOperatorType TCalcEditLine::Operator() const
+    {
+    return  iOperator;
+    }
+
+
+// ---------------------------------------------------------
+// TCalcEditLine::SetOperator
+// This function exists to handle Add, Subtract, Multiply, Divide command.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline void TCalcEditLine::SetOperator
+                (const TCalcOperatorType& aType)    
+    {
+    iOperator = aType;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcEditline.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Helper class used by CalcDocument,CCalcContainer etc., 
+*                TCalcEditLine.
+*                The numerical value and the character sequence of the real 
+*                number are held. Addition of a numerical character sequence 
+*                and which clear operation are performed.
+*
+*/
+
+
+#ifndef     CALCEDITLINE_H
+#define     CALCEDITLINE_H
+
+
+//  INCLUDES
+#include <e32std.h>
+
+
+//  Define maximum charactor number per line
+const TInt KCalcMaxDigits(8);
+const TInt KCalcMaxNumberWidth(11);
+const TInt KCalcMaxEditNumberWidth( 10 );
+
+//  CLASS DEFINITIONS 
+
+/**
+TCalcEditLine is Calculation data class.
+A line data for 'Editor Sub-Pane'
+*/
+class   TCalcEditLine
+    {
+    public:
+        enum TCalcOperatorType
+            {
+            ECalcAdd,
+            ECalcSubtract,
+            ECalcMultiply,
+            ECalcDivide,
+            ECalcEqual,
+			ECalcSqrt,
+			ECalcPercent,
+            ECalcOperatorNone
+            };    
+
+    public:  // Constructors and destructor
+        /**
+        * C++ default constructor.
+        */
+        TCalcEditLine(); 
+        
+        /**
+        * Destructor.
+        */
+        virtual ~TCalcEditLine(); 
+        
+        /**
+        * Copy constructor.
+        */
+        TCalcEditLine(const TCalcEditLine& aEditLine); 
+        
+        /**
+        * Assignment operator
+        */
+        const TCalcEditLine&  operator=(const TCalcEditLine& aEditLine);  
+
+    public:     // New functions
+        /**
+        * Return string of number 
+        * @return String of number.
+        */
+        inline const TPtrC NumberString() const;
+        
+        /**
+        * Clear a line
+        */
+        void AllClear();
+        
+        /**
+        * Delete last 1 digit from a line
+        */
+        void ClearL();
+        
+        /**
+        * Clear number from a line
+        */
+        void ClearOperand();
+        
+        /**
+        * Return number of a line  
+        * @return TReal64 : Operand of a line
+        */
+        TReal64 NumberL() const;
+        
+        /**
+        * Parameter aNumber is set to a line 
+        * @param aNumber 
+        */
+        void SetNumber(TReal64 aNumber);
+        
+        /**
+        * Append a charactor to number.
+        * Leave may occur, KCalcErrEditorSpaceFull.
+        * @param aInput : A input which is Appended 
+        */
+        void AppendL(TChar aInput);
+        
+		/**
+		* Append any character to number before it is 
+		* displayed inthe output sheet.
+		* Leave may occur, KCalcErrEditorSpaceFull.
+        * @param aInput : A char which is Appended 
+        */
+	    void AppendNumberStringL(TChar aChar);
+
+        /**
+        * Change sign of number
+        */
+        void ChangeSignL();
+        
+        /**
+        * If number of editor is "iii.ddd000...", set number "iii.ddd".
+        * Example: 
+        *  Number of editor is "12",  number editor is set "12".
+        *  Number of editor is "12." or "12.000...", number editor is set "12".
+        *  Number of editor is "12.27", number editor is set "12.27".
+        *  Number of editor is "12.27000...", number editor is set "12.27".
+        * @param aLine : current editor
+        */
+        void TrimZeroL();  
+        
+        /**
+        * Return operator type of a line.
+        * @return TCalcOperatorType : ECalcAdd || ECalcSubtract || 
+                                      ECalcMultiply || ECalcDivide ||
+                                      ECalcEqual || ECalcOperatorNone
+        */
+        inline TCalcOperatorType Operator() const;
+        
+        
+        /**
+        * Set operator to a line
+        * @param aType : operator enum
+        */
+        inline void SetOperator(const TCalcOperatorType& aType);
+
+        /**
+        * Check whether buffer of editline is "0" or not. 
+        * @return ETrue :buffer of editline is "0".
+        *         EFalse:buffer of editline is not "0".
+        *         (Ex) If buffer is "0", return ETrue.
+        *              If buffer is "0.0" or "2", return EFalse. 
+        */
+        TBool CheckZeroL() const;
+
+        /**
+        * Changing decimal separator.
+        * @param aOld : Old decimal separator
+        * @param aNew : New decimal separator  
+        */
+        void ChangeDecimal(TChar aOld, TChar aNew);
+         
+
+    private:    // New functions
+        /**
+        * Return count of digits.
+        * @param aNumber : String of number
+        * @return Count of digits. 
+        *         E.g argument aNumber is "-226.89", return value is 5.
+        */
+        TInt NumberDigits() const;
+
+    private:    // Data
+        TBuf<KCalcMaxNumberWidth> iNumber; // Operand of a line
+        TCalcOperatorType   iOperator; // Operator of a line 
+    };
+
+#include "CalcEditLine.inl"
+
+#endif  // __CALCEDITLINE_H__
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcEnv.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,322 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Calculator environment class, CCalcAppEnv
+*                Derived from CBase
+*                This class maintain global data. e.g font, bitmap.
+*
+*/
+
+
+#ifndef     CALCENV_H
+#define     CALCENV_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <gulicon.h>  
+#include <eikenv.h>
+
+//Extended Icon Skin Implementation
+#include <AknsConstants.h>
+#include "CalcFunc.h"
+#include "CalcEditline.h"
+#include <AknUtils.h>
+
+// CONSTANTS
+const  TInt  KMaxMemoryIndicatorLength(4);
+const  TInt  KCalcCountOfOperatorType( 10 ); // +,-,*,/,=, sqrt, % , none ,* and /. 
+//Extended Icon Skin implementation.
+const  TInt KCalcAknsConstCount(26);
+const  TInt  KCalcCountOfButtonPressed(10);
+const  TInt  KCalcCountOfButtonInactive(16);
+const  TInt  KCountOfBitmaps(9);
+
+
+//  FORWARD DECLARATIONS
+class CCalcAppUi;
+class CFont;
+
+//  CLASS DEFINITIONS 
+
+/**
+CCalcAppEnv : Maintains global data.
+*/
+class   CCalcAppEnv 
+        : public CBase
+    {
+    public:  // Constructors and destructor
+		//Button Type
+		//Extended Icon Skin Implementation
+		enum ButtonType {EPRESSED, ENORMAL, EACTIVE_INACTIVE};
+
+
+        /**
+        * Two-phased constructor.
+        * @param aApp : Pointer of CCalcAppUi class 
+        */
+        static CCalcAppEnv* NewL(CCalcAppUi* aAppUi);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcAppEnv();
+        
+    public:     // New functions
+        /**
+        * Return pointer of CCalcAppEnv class  
+        * @return Pointer of CCalcAppEnv class
+        */
+        static CCalcAppEnv* Static();
+
+        
+        /**
+        * Return pointer of CCalcAppUi class
+        * @return Pointer of CCalcAppUi class
+        */
+        inline CCalcAppUi* AppUi() const;
+        
+        /**
+        * Return charactor for editor operator  
+        * @param Operator type enum
+        */
+        inline const TPtrC EditorOperator(
+            const TCalcEditLine::TCalcOperatorType aType) const;
+
+        /**
+        * Return charactor for OutputSheet operator  
+        * @param Operator type enum
+        */
+        inline const TPtrC OutSheetOperator(
+            const TCalcEditLine::TCalcOperatorType aType) const;
+        
+        /**
+        * Return decimal separator. 
+        * @return Decimal separator, e.g "."
+        */
+        inline const TChar DecimalSeparator() const;
+        
+        /**
+        * Set new decimal separator. 
+        * @param aChar: New decimal separator, e.g "."
+        */
+        inline void SetDecimalSeparator(TChar aChar);
+        
+        /**
+        * Return minus indicator. 
+        * @return minus indicator, e.g "-"
+        */
+        inline const TChar MinusIndicator() const;
+
+        /**
+        * Return memory indicator. 
+        * @return memory indicator, e.g "M".
+        */
+        inline TPtrC MemoryIndicator() const;
+        
+        /**
+        * Return shadow of memory indicator. 
+        * @return memory indicator, e.g "M".
+        */
+        inline TPtrC MemoryIndicatorShadow() const;
+        
+        /**
+        * Return font for number shadow in editor.
+        * @return Font for number shadow in editor
+        */
+        inline const CFont* NumberShadowFont() const;
+
+        /**
+        * Return font for number in editor.
+        * @return Font for number in editor
+        */
+        inline const CFont* NumberFont() const;
+
+        /**
+        * Return font for operator shadow in editor.
+        * @return Font for operator shadow in editor
+        */
+        inline const CFont* OperatorShadowFont() const;
+
+        /**
+        * Return font for operator in editor.
+        * @return Font for operator in editor
+        */
+        inline const CFont* OperatorFont() const;
+
+        /**
+        * Return font for operator in OutputSheet.
+        * @return Font for operator in OutputSheet
+        */
+        inline const CFont* OutSheetOperatorFont() const;
+
+        /**
+        * Return 'qsn_fr_calc_display_side_l' 'qsn_fr_calc_display_center.svg' 
+		  and 'qsn_fr_calc_display_side_r 'Bitmap pointers.
+        */
+		    inline const CGulIcon* DisplaySideLBitmap() const;
+    	    inline const CGulIcon* DisplayCenterBitmap() const;
+    	    inline const CGulIcon* DisplaySideRBitmap() const;		
+    
+        
+        /**
+        * Return 'qgn_indi_calc_paper' Bitmap pointer.
+        * @return 'qgn_indi_calc_paper' Bitmap pointer.
+        */
+        inline const CGulIcon* PaperBitmap() const;
+
+		/**
+        * Return 'qgn_fr_calc_paper' Bitmap pointers.
+        * @return 'qgn_fr_calc_paper' Bitmap pointers.
+        */
+		inline void ScalablePaperBitmaps(const CGulIcon* [])const;
+
+        /**
+        * Return 'qgn_graf_calc_results_line' Bitmap pointer.
+        * @return 'qgn_graf_calc_results_line' Bitmap pointer.
+        */
+		inline const CGulIcon* ResultsLineBitmap()const;
+
+        /**
+        * Return unpressed bitmap of correspondent index
+        * @param aIndex : index of bitmap array
+        * @return : Bitmap pointer.
+        */
+        inline CGulIcon* UnpressedButtonBmp(
+            const TInt aIndex) const;
+
+        /**
+        * Return pressed bitmap of correspondent index
+        * @param aIndex : index of bitmap array
+        * @return : Bitmap pointer.
+        */
+        inline CGulIcon* PressedButtonBmp(
+            const TInt aIndex) const;
+
+        /**
+        * Return inactive bitmap of correspondent index
+        * @param aIndex : index of bitmap array
+        * @return : Bitmap pointer. If return value is NULL,
+        *          no bitmap exists on correspondent index.
+        */
+        inline CGulIcon* InactiveButtonBmp(
+            const TInt aIndex) const;
+
+		/**
+		* To load the functionmap bitmaps when the skin change event  has occured.
+		*/
+		void LoadFuncMapBitmapSkinChangeL();
+		
+		        /**
+        * Load bitmaps for FunctionMap SubPane.
+        */
+        void LoadFuncMapBitmapL();
+
+        /*update the array when function map changed*/
+        void UpdateAknConstArrayForFuncMap();
+        
+        //Function sets value as to whether skin is changed or not		
+        void SetSkinChangedValue(TBool aValue);
+		
+    private:    // New functions
+        /**
+        * By default constructor is private.
+        * @param aApp : CCalcAppUi class pointer 
+        */
+		
+		CCalcAppEnv();
+
+		
+        CCalcAppEnv(CCalcAppUi* aAppUi);
+    	
+		
+        /**
+        * Second-phase constructor
+        */
+        void ConstructAppEnvL();
+
+
+		/**
+        * Load bitmaps for Paper Pane.
+        */
+		void LoadPaperBitmapsL();
+
+        void InitializeAppUI(CCalcAppUi* aAppUi);
+
+        /**
+        * Load bitmaps for function map button.
+        * @param aStartBitmapId : Bitmap ID of loading start  
+        * @param aStartMaskId : Mask ID of loading start  
+        * @param aStartIndex : Start index of array which is set to 
+        *                      bitmap.
+        * @param aCount : Count of loading bitmaps
+        * @param aBitmapArray : Load bitmap to this array. 
+        */
+             
+        void LoadBitmapForFuncMapL(TInt aStartBitmapId, TInt aStartMaskId, TInt aStartIndex,
+	    TInt aCount, CGulIcon* aBitmapArray[], ButtonType aType);
+	
+
+		//Extended Icon Skin Implementation
+		void UpdateAknConstArray();
+		
+		//Extended Icon Skin Implementation for Paper
+		void UpdateAknConstArrayforPaper();
+        
+        
+    private:    // Data 
+        CCalcAppUi*     iAppUi;  // Pointer of CCalcAppUi class  
+		
+	     static CCalcAppEnv iself;
+	     CEikonEnv* iEnv;
+			
+        // Text
+        CDesCArrayFlat* iEditorOperArray;  // Operator for editor
+        CDesCArrayFlat* iOutSheetOperArray;// Operator for OutputSheet
+        TChar iDecimalSeparator;  // Decimal separator
+        TChar iMinusIndicator;    // Minus indicator
+        TBuf<KMaxMemoryIndicatorLength> iMemoryIndicator;  
+        TBuf<KMaxMemoryIndicatorLength> iMemoryIndicatorShadow;  
+                                                           
+        // Font
+        CFont* iNumberShadowFont;
+        CFont* iNumberFont;
+        CFont* iOperatorShadowFont;
+        CFont* iOperatorFont;
+        CFont* iOutSheetOperatorFont;
+        // Bitmap
+         // Bitmap for background for editor
+        CGulIcon* iDisplaySideLBitmap;
+        CGulIcon* iDisplayCenterBitmap;
+        CGulIcon* iDisplaySideRBitmap;
+        CGulIcon* iPaperBitmap;     // Bitmap for background for OutputSheet
+		CGulIcon* iScalablePaperBitmap[KCountOfBitmaps];//Bitmpaps for background for outputSheet
+		CGulIcon* iResultsLineBitmap;    //  Bitmap for drawing line in OutputSheet
+        CGulIcon* iUnpressedButtonBmp[KCountOfButtonsTouch];  // Bitmap for button of FunctionMap
+        CGulIcon* iPressedButtonBmp[KCountOfButtons];
+        CGulIcon* iDimmedButtonBmp[KCountOfButtons];
+
+		//Extended Icon Skin Implementation
+		RArray<TAknsItemID> iAknsConstArray;
+		RArray<TAknsItemID> iAknsConstArrayForPaper;
+		TBool	iIsSkinChanged;
+
+    };
+
+#include    "CalcEnv.inl"
+
+#endif      //  CALCENV_H
+            
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcEnv.inl	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description: 
+*     Implemented all inline functions.
+*
+*/
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CCalcAppEnv::AppUi
+// Return pointer of CCalcAppUi class
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline CCalcAppUi* CCalcAppEnv::AppUi() const
+    { 
+    return iAppUi; 
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::EditorOperator
+// Return charactor for editor operator
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const TPtrC CCalcAppEnv::EditorOperator(
+            const TCalcEditLine::TCalcOperatorType aType ) const
+    {
+    //'r_calc_editor_operator_array' is operator array for Editor Operator. 
+    if ( ( aType == TCalcEditLine::ECalcDivide ) &&
+        AknLayoutUtils::PenEnabled() )
+        {
+        //show operator '/' instead of division operator 
+        //division move 6 is '/' in Editor Operator array
+        return ( *iEditorOperArray )[( TInt ) aType + 6];
+        }
+    return ( *iEditorOperArray )[(TInt) aType];
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::OutSheetOperator
+// Return charactor for OutputSheet operator
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const TPtrC CCalcAppEnv::OutSheetOperator(
+            const TCalcEditLine::TCalcOperatorType aType ) const
+    {
+    //'r_calc_outsheet_operator_array' is operator array for OutSheet Operator. 
+    if ( ( aType == TCalcEditLine::ECalcDivide ) &&
+        AknLayoutUtils::PenEnabled() )
+        {
+        //show operator '/' instead of division operator
+        //division move 6 is '/' in OutSheet Operator array
+        return (*iOutSheetOperArray)[( TInt ) aType + 6];
+        }
+    return (*iOutSheetOperArray)[( TInt ) aType];
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::DecimalSeparator
+// Return decimal separator.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const TChar CCalcAppEnv::DecimalSeparator() const
+    {
+    return iDecimalSeparator;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::SetDecimalSeparator
+// Set new decimal separator.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline void CCalcAppEnv::SetDecimalSeparator(TChar aChar)
+    {
+    iDecimalSeparator = aChar;    
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::MinusIndicator
+// Return minus indicator.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const TChar CCalcAppEnv::MinusIndicator() const
+    {
+    return iMinusIndicator;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::MemoryIndicator
+// Return memory indicator.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline TPtrC CCalcAppEnv::MemoryIndicator() const
+    {
+    return iMemoryIndicator;
+    }
+        
+// ---------------------------------------------------------
+// CCalcAppEnv::MemoryIndicatorShadow
+// Return shadow of memory indicator.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline TPtrC CCalcAppEnv::MemoryIndicatorShadow() const
+    {
+    return iMemoryIndicatorShadow;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::NumberShadowFont
+// Return font for number shadow in editor.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CFont* CCalcAppEnv::NumberShadowFont() const
+    {
+    return iNumberShadowFont;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::NumberShadowFont
+// Return font for number in editor.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CFont* CCalcAppEnv::NumberFont() const
+    {
+    return iNumberFont;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::OperatorShadowFont
+// Return font for operator shadow in editor.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CFont* CCalcAppEnv::OperatorShadowFont() const
+    {
+    return iOperatorShadowFont;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::OperatorFont
+// Return font for operator in editor.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CFont* CCalcAppEnv::OperatorFont() const
+    {
+    return iOperatorFont;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::OutSheetOperatorFont
+// Return font for operator in OutputSheet.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CFont* CCalcAppEnv::OutSheetOperatorFont() const
+    {
+    return iOutSheetOperatorFont; 
+    }
+
+
+// ---------------------------------------------------------
+// CCalcAppEnv::DisplaySideLBitmap
+// Return 'qsn_fr_calc_display_side_l' Bitmap pointer.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CGulIcon* CCalcAppEnv::DisplaySideLBitmap() const 
+    { 
+    return iDisplaySideLBitmap;
+    }
+
+
+// ---------------------------------------------------------
+// CCalcAppEnv::DisplayCenterBitmap
+// Return 'qsn_fr_calc_display_center' Bitmap pointer.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CGulIcon* CCalcAppEnv::DisplayCenterBitmap() const 
+    { 
+    return iDisplayCenterBitmap;
+    }
+
+
+
+// ---------------------------------------------------------
+// CCalcAppEnv::DisplaySideRBitmap
+// Return 'qsn_fr_calc_display_side_r' Bitmap pointer.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CGulIcon* CCalcAppEnv::DisplaySideRBitmap() const 
+    { 
+    return iDisplaySideRBitmap;
+    }
+
+
+// ---------------------------------------------------------
+// CCalcAppEnv::PaperBitmap
+// Return 'qgn_indi_calc_paper' Bitmap pointer.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CGulIcon* CCalcAppEnv::PaperBitmap() const 
+    { 
+    return iPaperBitmap;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::PaperBitmap
+// Return 'qsn_fr_calc_paper_center' Bitmap pointers.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+ inline  void CCalcAppEnv::ScalablePaperBitmaps(const CGulIcon* aPaperBitmap[]) const
+    { 
+	
+	for(TInt Cnt=0;Cnt < 9; Cnt++)
+		{
+		aPaperBitmap[Cnt]=iScalablePaperBitmap[Cnt];
+		}
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::ResultsLine
+// Return 'qgn_graf_calc_resultsLine' Bitmap pointer.
+// This returns a valid icon only when __SCALABLE_ICONS flag 
+// is enabled. When there is no SVG icon support the result 
+// line is drawn using DrawRect.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline const CGulIcon* CCalcAppEnv::ResultsLineBitmap() const 
+    { 
+    return iResultsLineBitmap;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::UnpressedButtonBmp
+// Return unpressed bitmap of correspondent index
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline CGulIcon* CCalcAppEnv::UnpressedButtonBmp(
+             const TInt aIndex) const
+    {
+    return iUnpressedButtonBmp[aIndex];    
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::PressedButtonBmp
+// Return pressed bitmap of correspondent index
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline CGulIcon* CCalcAppEnv::PressedButtonBmp(
+             const TInt aIndex) const
+    {
+    return iPressedButtonBmp[aIndex];
+    }
+
+// ---------------------------------------------------------
+// CCalcAppEnv::InactiveButtonBmp
+// Return inactive bitmap of correspondent index
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline CGulIcon* CCalcAppEnv::InactiveButtonBmp(
+             const TInt aIndex) const
+    {
+    return iDimmedButtonBmp[aIndex];
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcFunc.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,436 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  The Function-Map subpane class, CCalcFuncmapSubPane
+*                Derived from CCoeControl.
+*                CCalcFuncmapSubPane is container class of CCalcCommandButton.
+*
+*/
+
+
+#ifndef     CALCFUNC_H
+#define     CALCFUNC_H
+
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <e32property.h> 
+#include <PtiDefs.h> 
+
+#include <centralrepository.h>
+#include <cenrepnotifyhandler.h>
+//  CONSTANTS  
+const   TInt   KCountOfButtons(10);     // Number of buttons
+const   TInt   KCountOfButtonsTouch(20);     // Number of buttons for touch UI layout
+_LIT(KAllowedNumericChars, "0123456789.,");
+_LIT(KAllowedOperatorPlus, "+");
+_LIT(KAllowedOperatorMinus, "-");
+_LIT(KAllowedOperatorStar, "*");
+_LIT(KAllowedOperatorDivide, "/");
+_LIT(KAllowedOperatorEquals, "=");
+_LIT(KAllowedOperatorPercent, "%");
+_LIT(KAllowedOperatorDecimal, ".");
+const TInt KMaxNumCharsPerCase = 50;
+
+//  FORWARD DECLARATIONS
+//class   CCalcCommandButton;
+//Use of new AknButtons
+class     CAknButton;
+class   CCalcContainer;
+class   CCalcAppEnv;
+class   CPtiEngine;
+class   CPtiQwertyKeyMappings;
+class     CPtiCoreLanguage;
+#ifdef RD_INTELLIGENT_TEXT_INPUT 
+class   CPtiHalfQwertyKeyMappings;
+#endif
+
+//  CLASS DEFINITIONS 
+
+/**
+CCalcFuncmapSubPane : 'FunctionMap Sub-Pane' class
+                                        : Class also derived from MCoeControlObserver to get events
+                                          from Avkon buttons
+*/
+class   CCalcFuncmapSubPane
+        :public CCoeControl , public MCoeControlObserver
+    {
+   public:
+   
+   enum  TButtonTID// ButtonIDs for Touch Layout
+            {
+               ECmdTCancel = 0,   
+               ECmdTSeven,        
+               ECmdTFour,         
+               ECmdTOne,          
+               ECmdTZero,         
+               ECmdTSqrt,          
+               ECmdTEight,        
+               ECmdTFive,         
+               ECmdTTwo,          
+               ECmdTSeparator,    
+               ECmdTPercent,         
+               ECmdTNine,         
+               ECmdTSix,          
+               ECmdTThree,        
+               ECmdTChangeSign,   
+               ECmdTDivide,       
+               ECmdTMultiply,     
+               ECmdTSubtract,     
+               ECmdTAdd,          
+               ECmdTResult,       
+               ECmdTScrollUp,
+               ECmdTScrollDown
+            };
+
+  
+
+    enum TButtonID // ButtonID for non touch Layout
+            {
+            EPlusButton,            // +
+            EMinusButton,           // -
+            EMultiplyButton,        // *
+            EDivideButton,          // /
+            EChangeSignButton,      // +/-
+            EEqualButton,           // =
+            ESqrtButton,            // sqrt
+            EPercentButton,            // %
+            EScrollUp,              // << 
+            EScrollDown             // >> 
+            };
+   public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        * @param aContainer : Pointer of CCalcContainer class 
+        */
+        static CCalcFuncmapSubPane* NewL(CCalcContainer* aContainer); 
+       
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcFuncmapSubPane();
+       
+
+    public:  // New functions
+        /**
+        * Redraw scroll up and down button on scrolling enable.
+        */
+        void RedrawScrollButtons();
+
+        /**
+        * Redraw ChangeSign button on ChangeSign enable.
+        * @param aEnable : Flag of ChangeSign enable
+        */
+        void SetChangeSignEnable(TBool aEnable);
+        
+        /**
+        * Redraw Sqrt button on Sqrt enable.
+        * @param aEnable : Flag of SqrtEnable enable
+        */
+        void SetSqrtEnable (TBool aEnable);
+
+        /**
+        * Redraw Clear button on Clear enable.
+        * @param aEnable : Flag of ClearEnable enable
+        */
+        void SetClearKeyEnable( TBool aEnable );
+        
+        /**
+        * Redraw Sqrt button on Percent enable.
+        * @param aEnable : Flag of PercentEnable enable
+        */
+        void SetPercentEnable(TBool aEnable);
+
+        /**
+        * If no key is pressed until timeout of *-key,
+        * this function is called.
+        */
+        void NotifyTimeoutL();
+
+        /**
+        * Notify any key is released. If pressed button exists.
+        * command which is releated is executed.
+        */
+        void NotifyReleaseKeyL();
+
+        /**
+        * If key other than OK-key is pressed this function is called.
+        */
+        void NotifyOtherThanOkKeyPressed();
+
+        /**
+        * Called if language is changed.
+        * Change layout according to the language.
+        */
+        void NotifyLangChange();
+        
+        
+        /**
+        * Called to find key pad is Active.
+        * 
+        */
+        TInt IsQwertyKeypadActive();
+        
+        /**
+        * Called to find Key is long Pressed.
+        * 
+        */
+        TBool IsKeyLongPressed();
+        
+        /**
+        * Called  when an error is displayed.
+        * @param aErrorCode : an error code  from  CCalcContainer
+        */
+        void SetErrorCode(TInt aErrorCode);
+        
+        /**
+        * Called  when there is a release event  .
+        * @param aErrorCode : an error code ,it used to display dialog
+        */
+        void ErrorMsgL(TInt aErrorCode);
+    public:   // Functions from base classes
+    
+        /**
+        * From MCoeControlObserver.
+        * Handles events from Avkon Buttons
+        */
+        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
+        /**
+        * From CCoeControl ?member_description.
+        * @param aKeyEvent : Key event details
+        * @param aType     : EEventKeyDown || EEventKey || EEventKeyUp
+        * @return EKeyWasConsumed    : Key event was used
+        *         EKeyWasNotConsumed : Key event was not used
+        */
+        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+        /**
+        *Refresh with latest button Icons when the skin change event has occured.
+        */
+        void RefreshButtonIcons();
+        
+         /**
+        * CCalcFuncmapSubPane::GetButtonBitmapControl
+        * This function is called when the size changes.
+        * 
+        */
+            CAknButton* GetButtonBitmapControl(TInt aIndex); //Return iButtons
+        
+         /**
+        * From CCoeControl : Handling pointer event
+        * Handles all pen input events on function pane.
+        * 
+        */
+        void HandlePointerEventL
+                ( const TPointerEvent& aKeyEvent );
+        /**
+        * FunctionPaneRect
+        * Gets the layout of function pane.
+        */
+        TRect FunctionPaneRect();
+
+        /**
+        * HandleMiddleSoftKeyOREKeyOK
+        * Called to handle MSK or EKeyOk
+        */
+        void HandleMiddleSoftKeyOREKeyOKL();             
+
+                /**
+        * GetChangeSignButtonState
+        * Gets the state of the Sign Button
+        */
+        TBool GetChangeSignButtonState();
+        
+        
+                /**
+        * GetSqrtButtonState
+        * Gets the state of the Squareroot Button
+        */
+        TBool GetSqrtButtonState();
+        
+        
+        /**
+        * GetSqrtButtonState
+        * Gets the state of the Percent Button
+        */
+        TBool GetPercentButtonState();
+        
+        /**
+        * GetClearButtonState
+        * Gets the state of the Clear Button
+        */        
+        TBool GetClearButtonState();
+        
+        /**
+        * GetSelectedButtonId
+        * returns the id of current button
+        */
+        TInt GetSelectedButtonId();
+ 
+        /**
+        * SetHighlightButton
+        * set highlight button
+        */
+        void SetHighlightButton( TUint aOldId, TUint aNewId );  
+        
+        /**
+        * GetKeyboardType
+        * returns the type of keyboard
+        */
+        TInt GetKeyboardType();
+
+    private:    // New functions
+        /**
+        * C++ default constructor.
+        */
+        CCalcFuncmapSubPane();
+
+        /**
+        * Second-phase constructor
+        * @param aContainer : Pointer of CCalcContainer class
+        */
+        void ConstructL(CCalcContainer* aContainer);
+
+        /**
+        * Redraw scroll-up button on scrolling enable.
+        * @param aEnable : Flag of scroll-up  enable 
+        */
+        void SetScrollupEnable(TBool aEnable);
+        
+        /**
+        * Redraw scroll-down button on scrolling enable.
+        * @param aEnable : Flag of scroll-down  enable
+        */
+        void SetScrolldownEnable(TBool aEnable);
+
+        /**
+        * Set next cursor position whwn pressing uparrow key.
+        */
+        void SetNextCursorPosForUpArrow(TInt aOldPos);
+
+        /**
+        * Set next cursor position whwn pressing downarrow key.
+        */
+        void SetNextCursorPosForDownArrow(TInt aOldPos);
+                
+        /**
+        * An old highlight rectangle and 
+        * a new highlight rectangle are redrawn.
+        * @param aOldId : The button chosen before
+        * @param aNewId : The button chosen newly
+        */
+        void RedrawHighlight(TUint aOldId, TUint aNewId) ;
+        
+        /**
+        * An old highlight rectangle and 
+        * a new highlight rectangle are redrawn.
+        * @param aOldId : The button chosen before
+        * @param aNewId : The button chosen newly
+        * @param aShowHightlight: control hightlight display
+        */
+        void RedrawHighlight(TUint aOldId, TUint aNewId,TBool aShowHightlight) ;
+        
+        /**
+        * Set functionmap button layout. 
+        */
+        void SetLayout();
+        /**
+        * MapNumericChar. 
+        */
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        TBool MapNumericCharL( TKeyEvent aKeyEvent );
+        TBool MapNumerics( TKeyEvent aKeyEvent );
+#else 
+        TBool MapNumericCharL(TPtiKey aKey, TPtiTextCase aCase);
+        TBool MapNumerics(TPtiKey aKey, TPtiTextCase aCase);
+#endif
+
+        /**
+        * MapDataForChrShiftKey. 
+        */  
+        void MapDataForChrShiftKey( TDes& aOperators, TInt& aFirstOperator, TInt& aSecondOperator);
+        
+        /**
+        * MapOperators. 
+        */         
+        TBool MapOperators( TUint16 aOperator, TInt& aResult);
+
+      
+    private:    // Functions from base classes
+        /**
+        * From CCoeControl : Return count of controls contained 
+        * in a compound control.
+        * @return Count of buttons in FunctionMap Subpane 
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * From CCoeControl : Get the components of a compound control
+        * @param aIndex
+        * @return Control of argument aIndex  
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+        
+        /**
+        * From CCoeControl : This is called when control size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl : This is called when control size is changed.
+        */
+        TInt CalculatingCorrectButton(const TPointerEvent& aPointerEvent);
+        
+    private:     // Data
+        CAknButton* iButtons[KCountOfButtonsTouch];  // Array of buttons
+        TInt iSelected;                 // Index of the selected button
+
+        TBool    iDecimalPoint;
+
+        TUint iLastKeyCode;             // The key code inputted at the last.
+        CCalcContainer* iContainer;    // Pointer of CCalcContainer class 
+        CCalcAppEnv*    iCalcAppEnv;   // Not own
+        RProperty       iQwertyModeStatusProperty; // To check the Qwerty keypad active 
+        
+        TPtiTextCase      iShiftKeyPressed;
+        CPtiEngine*     iEngine;
+        CRepository*       iCRKey;
+        CPtiCoreLanguage* iCoreLanguage;
+        CPtiQwertyKeyMappings* iQwertyKeyMappings;
+#ifdef RD_INTELLIGENT_TEXT_INPUT       
+        CPtiHalfQwertyKeyMappings* iHalfQwertyKeyMappings;
+#endif
+
+        TInt                   iLanguage;
+        TInt                  iUiLanguage;
+        TInt                   iShiftKey;
+        TBool                 iValue;
+        TInt            iCountOfButtons;    //keeps track of the count of buttons
+        TInt            iButtonsInRow;   //Number of buttons in the row
+        TInt            iButtonsInColumn; //Number of buttons in the Column
+        TBool           iIsSqrtDimmed;  //Holds the state of the squareroot button
+        TBool           iIsPercentDimmed;  //Holds the state of the percent button 
+        TBool           iIsChangeSignDimmed; //Checks if the change sign button is dimmed or not
+        TBool           iIsOfferKeyEvent; //checks if the event on select is from Offer key or pointer
+        TBool           iIsClearKeyEnabled;  //Checks if the Clear button is Enabled or not      
+        TBool           iIsKeyLongPress;     //Checks if the button is Long Pressed or not
+        TInt            iKeyboardType;
+        TBool           iIsShiftKeyPressed;
+        TInt            iErrorCode;
+        TBool           iShowDrawHight;
+        TBool           iInputData;
+    };
+
+#endif      //  CALCFUNC_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcHistory.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Define CCalcHistory class. This class is handled historical 
+*                line of Calculator. 
+*
+*/
+
+
+#ifndef     CALCHISTORY_H
+#define     CALCHISTORY_H
+
+//  INCLUDES
+#include   <e32base.h>
+
+//  CONSTANTS  
+const TInt KCalcMaxHistoryLines(100);
+
+//  FORWARD DECLARATIONS
+class TCalcEditLine;
+
+//  CLASS DEFINITIONS 
+
+/**
+CCalcHistory handles historical line of the calculator. 
+*/
+class   CCalcHistory :
+        public CBase
+    {
+    public:  // Constructors and destructor
+        /**
+        * C++ default constructor.
+        */
+        CCalcHistory();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcHistory();
+        
+        
+    public:     // New functions
+        /**
+        * Return (aIndex + 1)th latest history line.
+        * @param aIndex  
+        * @return (aIndex + 1)th latest history line.
+        */
+        const TCalcEditLine& operator[](TInt aIndex);  
+        
+        /**
+        * Return count of historical lines. 
+        * @return Count of historical lines
+        */
+        TInt Count() const;
+        
+        /**
+        * Add newest history line
+        * @param aLine : added line  
+        */
+        void Add(const TCalcEditLine aLine); 
+
+        /**
+        * Clear calculation history.
+        */
+        void ClearHistory();
+
+        /**
+        * Notify changing decimal separator.
+        * @param aOld : Old decimal separator
+        * @param aNew : New decimal separator  
+        */
+        void NotifyChangeDecimal(TChar aOld, TChar aNew);
+        
+    private:    // New functions
+            
+    private:    // Data
+        //
+        //  historical data
+        //  Newest data index is iNewestIndex.
+        //  
+        //  <Case that iCount is smaller than KCalcMaxHistoryLines>
+        //    As data is older, index is smaller. The oldest dara index is zero.
+        //
+        //  <Case that iCount is KCalcMaxHistoryLines>
+        //    As data is older, index is smaller. But previous data index
+        //   to index zero is KCalcMaxHistoryLines-1. previous index to
+        //   KCalcMaxHistoryLines-1 is KCalcMaxHistoryLines-2. ..... 
+        //   Therefore the oldest data index is iNewestIndex+1.
+        //
+        TCalcEditLine iHistory[KCalcMaxHistoryLines]; // Calculation history
+        TInt      iCount;  // Valid historical lines
+        TInt      iNewestIndex;  // Index of newest history
+    };
+
+#endif      //  CALCHISTORY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcOutSheet.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  The OutputSheet sub-pane class, CCalcOutputSheet
+*                Derived from CCoeControl
+*                The CCalcOutputSheet displays histroy data.
+*                History data is scroll up and down.
+*
+*/
+
+
+#ifndef     CALCOUTSHEET_H
+#define     CALCOUTSHEET_H
+
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <AknUtils.h>
+#include <e32std.h>
+
+#include <eikscrlb.h>
+#include <eiksbobs.h>
+
+#include <eiksbfrm.h>
+ 
+
+// CONSTANTS
+const TInt KCountOfPaperBitmaps(9);
+//  FORWARD DECLARATIONS
+class   CCalcHistory;
+class   CCalcContainer;
+class   CCalcAppEnv;
+
+//  CLASS DEFINITIONS 
+
+/**
+CCalcOutputSheet : 'OutputSheet Sub-Pane' class
+*/
+//New scrollbar used for Touch UI layout
+class CEikScrollBarFrame;
+class CCalcOutputSheet
+      : public CCoeControl , public MEikScrollBarObserver
+    {/*Class also derived from scrollbarobserver to capture scrollbar events*/
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        * @param aContainer : Pointer of CCalcContainer class 
+        */
+        static CCalcOutputSheet* NewL(CCalcContainer* aContainer); 
+       
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcOutputSheet();
+
+    
+    public:     // New functions
+        
+        
+        /**
+        * Scroll to bottom line.
+        */
+        void ScrollToBottomL(); 
+
+        /**
+        * Called after clearing calculation history.
+        */
+        void NotifyClearHistoryL();
+        
+        /**
+        * It returns whether it can scroll up or not.
+        * @return ETrue : Scroll up can be done. 
+        *         EFalse: Scroll up cannot be done.
+        */
+        TBool CanUp() const;  
+        
+        /**
+        * It returns whether it can scroll down or not.
+        * @return ETrue : Scroll up can be done. 
+        *         EFalse: Scroll up cannot be done.
+        */
+        TBool CanDown() const; 
+        
+        /**
+        * Output Sheet is scrolled up.
+        */
+        void ScrollUp();   
+        
+        /**
+        * Output Sheet is scrolled down.
+        */
+        void ScrollDown();
+
+        /**
+        * Refresh PaperBitmap Icon when the skin change event has occured.
+        */
+        inline void RefreshPaperBitmap() ;
+        /**
+        * Refresh ScalablePaperBitmap Icon when the skin change event has occured.
+        */
+        inline void RefreshScalablePaperBitmap() ;
+
+
+        inline void RefreshResultsLineBitmap() ;
+        
+        /**
+        * From MEikScrollBarObserver: to Handle scrollbar events
+        * @param CEikScrollBar* : Pointer to the scrollbar
+        * @param TEikScrollEvent : Event on the Scrollbar
+        */
+        void HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType);
+        
+        
+        /**
+        * From CCoeControl : Notifier for changing language
+        * @param aType : Type of resource change
+        */
+        void HandleResourceChange(TInt aType);
+        void HandleResourceChangeOutSheetL(TInt aType);
+ 
+        
+    private:    // New functions
+        /**
+        * C++ default constructor.
+        */
+        CCalcOutputSheet();
+
+        /**
+        * Second-phase constructor.
+        */
+        void ConstructL(CCalcContainer* aContainer);
+
+
+    private:
+    
+            
+        /**
+        * From CCoeControl : Set control size 
+        */
+        void SizeChanged();
+        
+        void SizeChangedOutSheetL();
+
+        /**
+        * From CCoeControl : Draw Output Sheet
+        * @param aRect : rectangle of Output Sheet
+        */
+        void Draw(const TRect& aRect) const;
+        
+          /**
+        * Function used to dynamically update scrollbar indicators.
+        */
+        void UpdateScrollIndicatorL();
+        
+
+    private:    // Data
+        TInt iScrollOffset;     // Scroll position
+        const CGulIcon* iCalcPaper; // Not own
+        const CGulIcon* iCalcScalablePaper[KCountOfPaperBitmaps];
+        const CGulIcon* iCalcResultsLine;
+        CCalcHistory*   iCalcHistory;    // Not own
+        CCalcContainer* iCalcContainer;  // Not own
+        CCalcAppEnv*    iCalcAppEnv;     // Not own
+        TAknLayoutRect iCalcPaperLayout[KCountOfPaperBitmaps];
+        TInt iCalcOutputSheetLines;
+        CAknsBasicBackgroundControlContext* iOpSheetContext;
+        CArrayFixFlat<TAknLayoutText>* iOperatorLayout;
+        CArrayFixFlat<TAknLayoutText>* iOperandLayout;
+        CArrayFixFlat<TAknLayoutRect>* iResultsLineLayout;
+        CArrayFixFlat<TAknLayoutRect>* iEqualLineLayout;
+        CRepository*     iCRKey;
+        TInt             iLanguage;
+        TInt            iUiLanguage;
+        CEikScrollBarFrame *iSBFrame;        //own -> pointer used for scrollbar frame
+        TAknLayoutRect  iPaperPaneRect;
+        TInt            iPrevThumbPosition;
+                    
+        // the bottom right coordinate of scrollbar  
+        TPoint          iSBBrPoint;
+    };
+
+#include "CalcOutSheet.inl"
+
+#endif      //  CALCOUTSHEET_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcOutSheet.inl	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Implemented all inline functions for CCalcOutputSheet.  
+*
+*/
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::RefreshPaperBitmap
+// Updates iCalcPaper
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline void CCalcOutputSheet::RefreshPaperBitmap()
+{
+	iCalcPaper = iCalcAppEnv->PaperBitmap();
+}
+// ---------------------------------------------------------
+// CCalcEditorSubPane::RefreshScalablePaperBitmap
+// Updates iCalcScalablePaper
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline void CCalcOutputSheet::RefreshScalablePaperBitmap()
+{
+ 
+iCalcAppEnv->ScalablePaperBitmaps(iCalcScalablePaper);
+}
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::RefreshResultsLineBitmap
+// Updates iCalcResultsLine
+// This is used only when __SCALABLE_ICONS flag 
+// is enabled. When there is no SVG icon support the result 
+// line is drawn using DrawRect.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+inline void CCalcOutputSheet::RefreshResultsLineBitmap()
+{
+	iCalcResultsLine = iCalcAppEnv->ResultsLineBitmap();
+}
+	
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/CalcView.h	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,258 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Header file of CCalcView class 
+*                which derived from CAknView class. 
+*
+*/
+
+
+#ifndef     CALCVIEW_H
+#define     CALCVIEW_H
+
+//  INCLUDES
+
+#include <aknview.h>
+
+#include "CalcEditline.h"
+
+
+//  CONSTANTS  
+const TInt KCalcViewId(1); // view ID of CCalcView
+
+//  FORWARD DECLARATIONS
+class CCalcContainer;
+class CEikMenuPane;
+class CCalcDocument;
+class CCalcEditorSubPane;
+class CCalcOutputSheet;
+class CAiwServiceHandler;
+
+//  CLASS DEFINITIONS 
+
+/**
+View class for Calculator application
+*/
+class   CCalcView
+        : public CAknView
+    {
+    public:
+        enum TStateNo       // State number
+            {
+            EInitialMode,  // State 1 : initial mode
+            EOperandOnly,   // State 2 : operand only
+            EOperandAndOperator,  // State 3 : operand and operator
+            EOperandAndOperatorAndOperand,  // State 4 : operand,operator and operand
+            ESelectResult,   // State 5 : User has selected result
+			EOperatorOnlyResult // State 6 : sqrt and percent display result right away
+            };
+
+        enum TKindOfInput   // kind of operand or operator
+            {
+            EOperand,
+            EOperator,
+            EEqual,
+            EMemorySave,
+            EMemoryRecall, // Latest input is MR, LR, or +/- on State3.
+            EAllClear,
+			EOperatorResult // For sqrt and percent, because they displayes the result right away
+            };
+
+
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CCalcView* NewLC(); 
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CCalcView();  
+        
+    public:  // New functions
+        /**
+        * Return current state
+        * @return Current state
+        */
+        TStateNo State() const;
+        
+        /**
+        * Return type of latest input
+        */
+        TKindOfInput LatestInput() const;
+        
+        /**
+        * Update state by using kind of input
+        * @param aKind : Kind of input
+        */
+        void UpdateState(const TKindOfInput& aKind);
+        
+        /**
+        * Display error message
+        * @param aErrorCode : error code, e.g KErrOverflow.
+        */
+        void ErrorMsgL(TInt aErrorCode);
+        
+        /**
+        * Delete meaningless items from main menu.
+        * @param aMenuPane : Pointer of menu pane
+        */
+        void DynInitMainMenuPane(CEikMenuPane* aMenuPane);
+        
+        /**
+        * Delete meaningless items from menu of memory
+        * @param aMenuPane : Pointer of menu pane
+        */
+        void DynInitMemoryMenuPane(CEikMenuPane* aMenuPane);
+        
+        /**
+        * Notify changing decimal separator.
+        * @param aOld : Old decimal separator
+        * @param aNew : New decimal separator  
+        */
+        void NotifyChangeDecimal(TChar aOld, TChar aNew);
+        
+        /**
+        * Handle Memory-Recall command
+        */
+        void HandleMemoryRecallL();
+          
+    public: // Functions from base classes
+        /**
+        * From MEikMenuObserver : Handle a command
+        * @param aCommand : command ID
+        */
+        void HandleCommandL(TInt aCommand);
+
+    
+    private:    // New functions
+        /**
+        * By default constructor is private.
+        */
+        CCalcView();
+        
+        /**
+        * Second-phase constructor
+        */
+        void ConstructL();
+        
+        /**
+        * Create CCalcContainer class
+        */
+        void CreateContainerL();
+        
+        /** 
+        * Handle Result command
+        */
+        void HandleResultL();
+        
+        /**
+        * Handle Change-Sign command
+        */
+        void HandleChangeSignL();
+        
+        /**
+        * Handle Last-Result command
+        */
+        void HandleLastResultL();
+        
+        /**
+        * Handle Memory-Save command
+        */
+        void HandleMemorySaveL();
+   
+        /**
+        * Handle Memory-Clear command
+        */
+        void HandleMemoryClearL();
+        
+        /**
+        * Handle Scroll-up command
+        */
+        void HandleScrollUp();
+        
+        /**
+        * Handle Scroll-Down command
+        */
+        void HandleScrollDown();
+
+        /**
+        * Handle Clear OutputSheet command
+        */
+        void DoClearCalcAndHistoryL();
+        
+        /**
+        * Handle Add, Subtract, Multiply, Divide command
+        * @param TCalcEditLine::TCalcOperatorType : Type of operator 
+        */
+        void HandleOperatorL(TCalcEditLine::TCalcOperatorType aOperator);
+        
+        /**
+        * Common routine for handling result and handling memory save
+        * on State4 and two operands and operator.
+        * Role of this function is calculating result.  
+        * But State is not updated.
+        * @return KErrNone : Calculation error does not occur
+        *         KErrOverflow, KErrDivideByZero : Calculation error occurs
+        */
+        TInt HandleEqualSubRoutineL();
+
+    private: // From CAknView
+        /**
+        * When CCalcView becomes active, this is called.
+        * @param aPrevViewId : 
+        * @param aCustomMessageId : 
+        * @param aCustomMessage : 
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
+                         const TDesC8& aCustomMessage);
+        
+        /**
+        * When CCalcView becomes deactive, this is called.
+        */
+        void DoDeactivate();
+        
+        /**
+        * Return UID of CCalcView
+        * @return UID of CCalcView, KCalcViewId
+        */
+        TUid Id() const;
+
+        /** 
+        * From MEikMenuObserver, Delete meaningless menu item.  
+        * @param aResourceId : resource ID of menu pane
+        * @param aMenuPane : Pointer of menu pane object
+        */
+        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
+
+		/**
+		*To handle when this application comes to foreground.
+		*/
+		void HandleForegroundEventL(TBool aForeground);
+            
+    private:    // Data
+        CCalcDocument*  iCalcDocument; // Not own  
+        CCalcContainer* iContainer;    // own 
+        CCalcEditorSubPane* iEditorSubPane; // Not own
+        CCalcOutputSheet*   iOutputSheet; // Not own
+        TStateNo        iState;        // Current State 
+        TKindOfInput    iLatestInput;  // Kind of latest input
+	public:
+      	CAiwServiceHandler* iServiceHandler;
+      	TBool           iLastResultSetected;
+    };
+
+#endif      //  CALCVIEW_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/inc/calc.hrh	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  This file contains declarations for resources of Calculator.
+*                The file can be included in C++ or resource file.
+*                Constants for drawing is defined in CalcDrawingConst.laf.
+*
+*/
+
+
+#ifndef     CALC_HRH
+#define     CALC_HRH
+
+//  CONSTANTS
+
+//
+// Define command ID for menu
+//
+enum TCalcPopupMenuOption
+    {
+    ECalcCmdResult = 6200,
+    ECalcCmdAdd,
+    ECalcCmdSubtract,
+    ECalcCmdMultiply,
+    ECalcCmdDivide,
+    ECalcCmdChangeSign,
+    ECalcCmdLastResult,  
+    ECalcCmdMemory,
+    ECalcCmdMemorySave,
+    ECalcCmdMemoryRecall,
+    ECalcCmdMemoryClear,
+    ECalcCmdScrollUp,
+    ECalcCmdScrollDown,
+    ECalcCmdClearCalcAndHistory,
+	ECalcCmdPercent,
+	ECalcCmdSqrt,
+	ECalcCmdCancel,          // +
+    ECalcCmdSeven,          // +
+    ECalcCmdFour,          // +
+    ECalcCmdOne,          // +
+    ECalcCmdZero,          // +
+    ECalcCmdEight,          // +
+    ECalcCmdFive,          // +
+    ECalcCmdTwo,          // +
+    ECalcCmdSeparator,          // +
+    ECalcCmdNine,          // +
+    ECalcCmdSix,          // +
+    ECalcCmdThree,          // +
+    ECmdAiwPlaceHolder,
+	ECmdLast,
+	ECalcCmdHelp,
+	EAiwCmdHelp = 11,
+	ECmdAiwPlaceHolderShowHelp
+    };
+
+#endif      //  CALC_HRH
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/loc/calc.loc	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Define localization string.
+*
+*/
+
+
+//  LOCALISATION STRINGS  
+
+
+//d:Menu text for "Last result"
+//l:list_single_pane_t1_cp2
+//
+#define qtn_calc_om_last_result         "Last result"
+
+//d:Menu text for handling memory
+//l:list_single_pane_t1_cp2/opt3
+//
+#define qtn_calc_om_sub_mem             "Memory"
+
+//d:Menu text for "Memory save"
+//l:list_single_popup_submenu_pane_t1
+//
+#define qtn_calc_om_mem_save            "Memory save"
+
+//d:Menu text for "Memory recall"
+//l:list_single_popup_submenu_pane_t1
+//
+#define qtn_calc_om_mem_recall          "Memory recall"
+
+//d:Menu text for "Memory clear"
+//d:If memory is zero, this item is not shown.
+//l:list_single_popup_submenu_pane_t1
+//
+#define qtn_calc_om_mem_clear           "Memory clear"
+
+//d:Menu text for "Clear sheet"
+//l:list_single_pane_t1_cp2
+//
+#define qtn_calc_clear_sheet            "Clear sheet" 
+
+//d:Indicator of memory in editor space.
+//d:If memory is not zero, this indicator is shown.
+//d:Otherwise, this is not shown.  
+//l:calc_display_pane_t3
+//
+#define qtn_calc_sttus_saved_to_mem     "M"
+
+//d:Indicator of memory shadow in editor space.
+//d:If memory is not zero, this indicator is shown.
+//d:Otherwise, this is not shown.  
+//l:calc_display_pane_t3
+//
+#define qtn_calc_sttus_saved_to_mem_sha "M"
+
+//d:Text for application list.
+//l:list_single_large_graphic_pane_t1
+//
+#define qtn_apps_calculator_list        "Calculator" 
+
+//d:Text for application grid.
+//l:cell_app_pane_t1
+//
+#define qtn_apps_calculator_grid        "Calculator"
+
+//d:Error message for overflow
+//l:popup_note_window
+//
+#define text_out_of_range               "Result is out of range"
+
+//d:Error message for division by zero
+//l:popup_note_window
+//
+#define text_calc_division_by_zero      "Division by zero"
+
+//d:Error message for negative value for square root
+//l:popup_note_window
+//
+#define text_calc_negative_value_for_sqrt      "Invalid input for function"
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/rom/Calcsoft.iby	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  IBY file for non-localizable elements of Calculator.app
+*
+*/
+
+
+#ifndef __Calcsoft_IBY__
+#define __Calcsoft_IBY__
+
+S60_APP_EXE(Calcsoft)
+
+
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,Calcsoft)
+
+
+S60_APP_AIF_ICONS(CalcSoft)
+S60_APP_AIF_RSC(CalcSoft)
+data=DATAZ_\private\10005902\backup_registration.xml private\10005902\backup_registration.xml
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/rom/CalculatorResources.iby	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description: Resource file(s) for CALCSOFT application (Calcsoft.iby)
+*
+*/
+
+
+#ifndef CALCULATORRESOURCES_IBY
+#define CALCULATORRESOURCES_IBY
+
+//Resource file(s) for CALCSOFT application (Calcsoft.iby)
+#ifndef NO_PIMS_IN_ROM
+S60_APP_CAPTION(calcsoft)
+S60_APP_RESOURCE(Calcsoft)
+#endif
+
+#endif // CALCULATORRESOURCES_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcApp.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  An application class, CCalcApplication, 
+*                derived from CEikApplication
+*
+*/
+
+
+
+// INCLUDE FILES 
+
+#include    "CalcDoc.h"
+#include    "CalcApp.h"
+
+// EXTERNAL FUNCTION PROTOTYPES  
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// CCalcApplication::CreateDocumentL
+// This function is called by framework when this calculator is opened. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CApaDocument* CCalcApplication::CreateDocumentL()
+    {
+    return CCalcDocument::NewL(*this);
+    }
+
+
+// ---------------------------------------------------------
+// CCalcApplication::AppDllUid
+// This function is called by framework
+// when this calculator is opened or closed. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TUid  CCalcApplication::AppDllUid() const
+    {
+    return KUidCalc;
+    }
+
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+#include <eikstart.h>
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CCalcApplication;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcAppUi.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,205 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  An App UI class, CCalcAppUi, derived from CAknAppUi
+*                Mainly menu command is handled.
+*
+*/
+
+
+
+// INCLUDE FILES  
+#include    <avkon.hrh>
+#include    <bacntf.h>   // For CEnvironmentChangeNotifier
+#include    <Calcsoft.rsg>
+#include    <featmgr.h>
+
+#include    "CalcApp.h"
+#include    "CalcAppUi.h"
+#include    "CalcDoc.h"
+#include    "CalcHistory.h"
+#include	 "CalcEnv.h"
+#include    "CalcView.h"
+#include    "calc.hrh"
+
+//  LOCAL CONSTANTS AND MACROS  
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcAppUi::CCalcAppUi()
+    {
+    }
+
+// Destructor
+CCalcAppUi::~CCalcAppUi()
+    {
+		delete iCalcAppEnv;
+		iCalcAppEnv = NULL;
+    
+    if (iLocaleChangeNotifier)
+        {
+        iLocaleChangeNotifier->Cancel();
+        }
+    
+    if	(iLocaleChangeNotifier)
+    	{
+   		delete iLocaleChangeNotifier;
+    	iLocaleChangeNotifier = NULL;
+    	}
+    FeatureManager::UnInitializeLib();
+    }
+
+
+// ---------------------------------------------------------
+// CCalcAppUi::ExitCalculator
+// Exit Calculator application.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcAppUi::ExitCalculator()
+    {
+    TRAP_IGNORE(CEikAppUi::SaveL()); // Save memory and last result
+    Exit();
+    }
+
+// ---------------------------------------------------------
+// CCalcAppUi::LocaleCallback
+// Called when locale is changed or application is launched.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CCalcAppUi::LocaleCallback
+                    (TAny* aThisPtr)
+    {
+    STATIC_CAST(CCalcAppUi*, aThisPtr)->HandleLocaleChangeEvent();
+    return 0;
+    }
+
+// ---------------------------------------------------------
+// CCalcAppUi::HandleLocaleChangeEvent
+// Handle locale change event.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcAppUi::HandleLocaleChangeEvent()
+    {
+    TLocale locale;
+    TChar newDecimal(locale.DecimalSeparator());
+    TChar oldDecimal(iCalcAppEnv->DecimalSeparator());
+
+    if (newDecimal != oldDecimal)
+        {
+        iCalcAppEnv->SetDecimalSeparator(newDecimal);
+        CCalcView* view = STATIC_CAST(CCalcView*, iView);
+        view->NotifyChangeDecimal(oldDecimal, newDecimal);
+        CCalcDocument* doc = STATIC_CAST(CCalcDocument*, Document());
+        doc->History()->NotifyChangeDecimal(oldDecimal, newDecimal);
+        }
+    }
+
+// Second-phase constructor.
+void CCalcAppUi::ConstructL()
+    {
+    // Allow base class (CEikAppUi) to perform necessary construction
+    BaseConstructL(CAknAppUi::EAknEnableSkin | EAknEnableMSK);
+
+    FeatureManager::InitializeLibL();
+    
+    iCalcAppEnv = CCalcAppEnv::NewL(this);
+    
+    CCalcView* calcView = CCalcView::NewLC();
+    AddViewL(calcView);
+    CleanupStack::Pop(calcView); 
+    
+	// Get pointer to CCalcDocument
+	CCalcDocument* doc = STATIC_CAST(CCalcDocument*, Document());
+	// CCalcDocument needs the pointer to the iCalcAppEnv
+	doc->SetAppEnv(iCalcAppEnv);	
+
+    // Set locale change notifier 
+    TCallBack callBack(LocaleCallback, this);
+    iLocaleChangeNotifier = CEnvironmentChangeNotifier::NewL
+                            (EActivePriorityLogonA, callBack);
+                            
+     if(iLocaleChangeNotifier->IsActive())
+     	iLocaleChangeNotifier->Cancel();
+    iLocaleChangeNotifier->Start();
+
+	//EISkin2.6
+	//Set IsSkinchanged value to EFalse when the application launches.
+	SetSkinChanged(EFalse);
+
+	TFileName path;
+    iEikonEnv->FsSession().PrivatePath(path);
+    iEikonEnv->FsSession().MkDirAll(path);
+    }
+
+// ---------------------------------------------------------
+// CCalcAppUi::HandleCommandL
+// Handle Exit command. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcAppUi::HandleCommandL(TInt aCommand)
+    {
+    if (aCommand == EEikCmdExit)
+        {
+        ExitCalculator();
+        }
+    }
+//EISkin2.6
+//----------------------------------------------------------
+//CCalcAppUi::HandleResourceChangeL
+// To Handle Skin Change event
+// Update Bitmaps
+//----------------------------------------------------------
+void CCalcAppUi::HandleResourceChangeL(TInt aType)
+{
+	if (aType == KAknsMessageSkinChange)
+		{
+			iCalcAppEnv->LoadFuncMapBitmapSkinChangeL();
+			SetSkinChanged(ETrue);
+		}
+	else
+	{
+		CAknViewAppUi::HandleResourceChangeL(aType);
+	}
+}
+
+//----------------------------------------------------------
+//CCalcAppUi::HandleWsEventL
+// Handles events sent to the application by the window server.
+// When EKeyOK is long pressed, to avoid being filtered by the AppUi, 
+// send this event directly to the container. 
+// Thus the container can get the EKeyOK key event.
+//----------------------------------------------------------
+void CCalcAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination )     
+    {                                                                                     
+    CAknViewAppUi::HandleWsEventL(aEvent, aDestination);   //pass the event to appui
+    if ( aEvent.Type() == EEventKey)
+        {
+        //judge the key is EKeyOK or not and the key is long pressed or not
+        TKeyEvent* key = aEvent.Key();
+        if ( key->iCode == EKeyOK && key->iRepeats )       
+            {
+            //send EEventKey to the Container                                              
+            TopFocusedControl()->OfferKeyEventL( *key, EEventKey ); 
+            }                                                      
+        }
+    }
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcCmdBtn.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,270 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:The Function-Map's button class, CCalcCommandButton
+*                Derived from CEikCommandButtonBase
+*                The CCalcCommandButton is flat button.
+*                In making disable, it calls SetDimmed() function.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <gulicon.h>
+#include    <calcsoft.rsg>
+#include    <aknutils.h>
+
+#include    "CalcFunc.h"
+#include    "CalcCmdBtn.h"
+#include    "CalcDrawingConst.laf"
+#include <AppLayout.cdl.h>
+#include <AknIconUtils.h>
+#include "fbs.h"
+
+// skin support
+#include    <AknsDrawUtils.h>
+#include  <AknLayoutScalable_Avkon.cdl.h>  
+#include <aknlayoutscalable_avkon.cdl.common.h>
+#include <AknLayout2ScalableDef.h>
+
+#include <aknsconstants.h>
+#include <AknLayoutScalable_Apps.cdl.h>
+
+// skin support
+#include    <AknsDrawUtils.h>
+
+
+//  LOCAL CONSTANTS AND MACROS  
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Two-phased constructor.
+CCalcCommandButton* CCalcCommandButton::NewL(
+                    CCalcFuncmapSubPane* aFuncmapSubPane,
+                    const CGulIcon* aUnpressedBmp,
+                    const CGulIcon* aPressedBmp,
+                    const CGulIcon* aInactiveBmp) 
+    {
+    CCalcCommandButton* self = new (ELeave) CCalcCommandButton();
+    CleanupStack::PushL(self);
+    self->ConstructL(aFuncmapSubPane, aUnpressedBmp,
+                     aPressedBmp, aInactiveBmp);
+    CleanupStack::Pop(self); 
+    return self;
+    }
+
+// Destructor
+CCalcCommandButton::~CCalcCommandButton()
+    {
+    }
+
+
+
+// ---------------------------------------------------------
+// CCalcCommandButton::SetStateAndRedraw
+// Button state is set and re-draw.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcCommandButton::SetStateAndRedraw
+      (const TState& aState)      
+    {
+    iState = aState;
+    DrawNow();
+    }
+
+
+// ---------------------------------------------------------
+// CCalcCommandButton::SetIsSelectedAndRedraw
+// Set flag which button is selected or not, and redraw.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcCommandButton::SetIsSelectedAndRedraw(TBool aIsSelected)
+    {
+    iIsSelected = aIsSelected;
+    DrawNow();    
+    }
+
+
+// ---------------------------------------------------------
+// CCalcCommandButton::State
+// Button state is returned.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CCalcCommandButton::TState CCalcCommandButton::State() const
+    {
+    return iState;
+    }
+
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcCommandButton::CCalcCommandButton()
+        : iState(ENormal),
+          iIsSelected(EFalse)
+    {
+    }
+
+// Second-phase constructor
+void CCalcCommandButton::ConstructL
+            (CCalcFuncmapSubPane* aFuncmapSubPane,
+             const CGulIcon* aUnpressedButtonIcon,
+             const CGulIcon* aPressedButtonIcon,
+             const CGulIcon* aInactiveButtonIcon)  
+    {
+    iUnpressedButton = aUnpressedButtonIcon;
+    iPressedButton = aPressedButtonIcon;
+    iInactiveButton = aInactiveButtonIcon;
+    SetContainerWindowL(*aFuncmapSubPane);
+    }
+
+
+// ---------------------------------------------------------
+// CCalcCommandButton::SizeChanged
+// Data of control is set.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcCommandButton::SizeChanged()
+    {
+    TRect buttonRect(Rect());
+    TRect aParentRect;
+    TAknWindowLineLayout area;
+    TAknWindowLineLayout cursor_color;
+    
+    if (AknLayoutUtils::ScalableLayoutInterfaceAvailable())
+		{
+	
+	area = AknLayoutScalable_Apps::cell_calc_pane_g1().LayoutLine();
+	
+	// For drawing cursor color.     
+    cursor_color = AknLayoutScalable_Apps::grid_highlight_pane_cp02().LayoutLine();
+    
+    	
+		}
+	
+	else
+	{
+			
+    area = AppLayout::Cell_pane_elements__calc__Line_1();
+// For drawing cursor color.     
+    cursor_color = AppLayout::Cell_pane_highlight_elements__various__Line_1(aParentRect);
+    
+	}
+	
+	area.iC = cursor_color.iC;
+    iLayoutRect.LayoutRect(buttonRect,area); 
+              
+    }
+
+// ---------------------------------------------------------
+// CCalcCommandButton::Draw
+// Draw a button
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcCommandButton::Draw
+      (const TRect& /* aRect */) const  
+    {
+    const CGulIcon* drawButton = iUnpressedButton;
+    
+    switch (iState)
+        {
+        case EPressed:
+            {
+            drawButton = iPressedButton;
+            break;
+            }
+        case EDimmed:
+            {
+            drawButton = iInactiveButton;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    CWindowGc& gc = SystemGc();
+
+    // Clear with skin background
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    AknsDrawUtils::Background( skin, AknsDrawUtils::ControlContext(this), this, gc, Rect());
+
+	if (AknLayoutUtils::ScalableLayoutInterfaceAvailable())
+		{
+		TAknWindowLineLayout layout = AknLayoutScalable_Apps::grid_highlight_pane_cp02().LayoutLine();
+		TAknWindowLineLayout area = AknLayoutScalable_Apps::cell_calc_pane_g1().LayoutLine();
+
+		TAknLayoutRect topLeft;
+		topLeft.LayoutRect(Rect(), area);
+
+		TAknLayoutRect bottomRight;
+		bottomRight.LayoutRect(Rect(),area);
+
+		TRect outerRect = TRect(topLeft.Rect().iTl, bottomRight.Rect().iBr);
+		TRect innerRect = outerRect;
+		innerRect.Shrink(TSize(5,5));
+		gc.SetPenStyle(CGraphicsContext::ENullPen);
+		 if (iIsSelected)
+			TBool highlightDrawn = AknsDrawUtils::DrawFrame(skin, gc, outerRect, innerRect,
+			KAknsIIDQsnFrGrid, KAknsIIDNone); 
+		}
+	else
+		{
+		if (iIsSelected)
+			{
+			iLayoutRect.DrawOutLineRect(gc);
+			}
+
+		}
+
+
+
+	//Set the size of the bitmap. SVG-T upgrade.
+	TRect rect(Rect()); 
+	 AknIconUtils::SetSize(drawButton->Bitmap(),rect.Size()); 
+	 AknIconUtils::SetSize(drawButton->Mask(), rect.Size());
+    iLayoutRect.DrawImage(gc, drawButton->Bitmap(), drawButton->Mask());
+
+    }
+ 
+// ---------------------------------------------------------
+// CCalcCommandButton::SetBitmapIcons
+// Sets the button bitmap Icons when the skin changes.
+// ---------------------------------------------------------
+//
+void CCalcCommandButton::SetBitmapIcons(CGulIcon* aUnpressedBmp,
+                    CGulIcon* aPressedBmp,
+                    CGulIcon* aInactiveBmp)
+{
+	iUnpressedButton = aUnpressedBmp;
+    iPressedButton = aPressedBmp;
+    iInactiveButton = aInactiveBmp;
+}
+
+// ---------------------------------------------------------
+// CCalcCommandButton::ButtonLayout
+// Gets the button layout. Used for pen input.
+// ---------------------------------------------------------
+//
+TRect CCalcCommandButton::ButtonLayout()
+	{
+	TRect buttonRect(Rect());
+	return buttonRect;
+	}
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcCont.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,1184 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Source file of "CCalcContainer",  CCalcContainer class 
+*                which derived from CCoeControl class. Role of this class 
+*                is to update the calculator data and display on user's input.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <aknkeys.h>
+#include    <AknUtils.h>   // AknLayoutUtils::LayoutControl 
+#include    <Calcsoft.rsg>
+
+#include    <layoutmetadata.cdl.h>
+
+// For skin support. 
+#include    <AknsDrawUtils.h>
+#include    <AknsConstants.h>
+#include    <AknsUtils.h>
+#include    <AknsBasicBackgroundControlContext.h>
+#include    <applayout.cdl.h>
+#include    <aknlayoutscalable_apps.cdl.h>
+#include    <csxhelp/calc.hlp.hrh> // for help context of Calculator
+#include    "CalcApp.h" 
+
+#include    "CalcAppUi.h"
+#include    "CalcCont.h"
+#include    "CalcDoc.h"
+#include    "CalcEdit.h"
+#include    "CalcFunc.h"
+#include    "CalcOutSheet.h"
+#include    "calc.hrh"
+#include    "CalcView.h"
+#include    "CalcEnv.h"
+#include    "CalcHistory.h"
+#include    "CalcDrawingConst.laf" // for layout information
+
+
+#include <AknDef.h>
+#include <eiksbfrm.h> 
+#include <eikscrlb.h>
+
+
+#define KEY_CODE_VAL 57 //for all number inputs
+#define ASCII_ZERO 48
+
+//  LOCAL CONSTANTS AND MACROS  
+const TInt KCallBackDelay(1000000); // In microseconds
+const TInt KCallBackInterval(1000000); // In microseconds
+const TInt KCallBackPriority(CActive::EPriorityUserInput);
+
+// Count of controls in Calculator.
+// Controls are editor pane, output sheet, and function map.
+// Therefore, this count is 3.  
+const TInt KCalcCountOfControls(3);
+
+// Define index of control
+enum TCalcControlIndex
+    {
+    ECalcControlFunctionMap,
+    ECalcControlOutputSheet,
+    ECalcControlEditorPane
+    };
+
+// If const TChar is used, complie error occurs in THUMB build.
+// To avoid this, #define is used.
+#define KCalcAsteriskBtn '*'
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Two-phased constructor.
+CCalcContainer* CCalcContainer::NewL(
+                    CCalcView* aView)
+    {
+    CCalcContainer* self = new (ELeave) CCalcContainer();
+    CleanupStack::PushL(self);
+    self->ConstructL(aView);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// Destructor
+CCalcContainer::~CCalcContainer()
+    {
+    delete iEditorPane;
+    delete iFuncmapPane;
+    delete iSheetPane;
+
+    delete iTimeout;
+
+    if ( iTimeoutChr )
+        {
+        delete iTimeoutChr;
+        iTimeoutChr = NULL;
+        }
+    if ( iTimeoutShift )
+        {
+        delete iTimeoutShift;
+        iTimeoutShift = NULL;
+        }
+
+    delete iSkinContext;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::ProcessPreinputL
+// This function is called when decimal point or a digit is inputted.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::ProcessPreinputL()
+    {
+    TInt currentState = iView->State();
+    CCalcView::TKindOfInput latestInput(iView->LatestInput());
+
+    if (currentState == CCalcView::ESelectResult)  
+                              // State 5 : User has selected result
+        {
+        iEditorPane->ResetL();  // Set editline "0"
+        iView->UpdateState(CCalcView::EAllClear);
+        iCalcDocument->AddEmptyLine();
+        iSheetPane->ScrollToBottomL();
+        ScrollArrowUpdate();
+        }
+    else if (currentState == CCalcView::EOperandAndOperator ||  
+                                           // State 3 : operand and operator
+             latestInput == CCalcView::EMemoryRecall  ||
+             latestInput == CCalcView::EMemorySave)
+        {   
+        iEditorPane->ClearOperand();
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::InputClearL
+// This function should be called when editor is cleared.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::InputClearL()
+    {
+    iEditorPane->ResetL();
+    iView->UpdateState(CCalcView::EAllClear);
+    
+    const TCalcEditLine lastLine((*(iCalcDocument->History()))[0]);  
+                                              // Get latest historical line.
+    const TPtrC number(lastLine.NumberString());
+    
+    //  If latest historical line is not empty,
+    // empty line is added in the history and the history is shown.
+    if ( number.Length() )
+        {
+        iCalcDocument->AddEmptyLine();
+        iSheetPane->ScrollToBottomL();
+        ScrollArrowUpdate();
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::ScrollArrowUpdate
+// This function should be called when OutputSheet is scrolled
+// or history is added.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::ScrollArrowUpdate()
+    {
+    iFuncmapPane->RedrawScrollButtons();
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::SetChangeSignEnableL
+// This function is called when number of editor is changed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::SetChangeSignEnableL()
+    {
+    TCalcEditLine editLine(iEditorPane->EditLine());
+    TBool changeSignEnable(ETrue);
+    
+    if (editLine.NumberL() == 0.0)
+        {
+        changeSignEnable = EFalse;    
+        }
+    
+    iFuncmapPane->SetChangeSignEnable(changeSignEnable);
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::SetClearKeyEnable
+// This function is called when number of editor is changed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::SetClearKeyEnable() 
+    {
+    TCalcEditLine editLine( iEditorPane->EditLine() );
+    TBool clearKeyEnable( ETrue );
+    
+    // eitline's number is 0.0 and length is 1  and the no operator
+    TRAP_IGNORE(
+        {
+        if ( editLine.CheckZeroL() && ( editLine.Operator() ==
+            TCalcEditLine::ECalcOperatorNone ) )
+            {
+            clearKeyEnable = EFalse; 
+            }
+        }
+    )
+    iFuncmapPane->SetClearKeyEnable( clearKeyEnable );
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::SetChangeSignDisable
+// This function is called when Operator +, - , *, / key is pressed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::SetChangeSignDisable()
+    {
+    
+    TBool changeSignEnable(EFalse);
+    iFuncmapPane->SetChangeSignEnable(changeSignEnable);
+    
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::SetSqrtEnableL
+// This function is called when number of editor is changed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::SetSqrtEnableL()
+    {
+    TCalcEditLine editLine(iEditorPane->EditLine());
+    TBool sqrtEnable(ETrue);
+    
+    if ( editLine.NumberL() == 0.0 )
+        {
+        sqrtEnable = EFalse;    
+        }
+    iFuncmapPane->SetSqrtEnable(sqrtEnable);
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::SetPercentEnableL
+// This function is called when number of editor is changed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::SetPercentEnableL()
+    {
+    TCalcEditLine editLine(iEditorPane->EditLine());
+    TBool percentEnable(ETrue);
+    
+    if (editLine.NumberL() == 0.0)
+        {
+        percentEnable = EFalse;    
+        }
+    iFuncmapPane->SetPercentEnable(percentEnable);
+    }
+
+
+// ---------------------------------------------------------
+// CCalcContainer::TimeoutCallbackL
+// If no key is pressed after pressing *-button and a few time
+// passes, this function is called    
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CCalcContainer::TimeoutCallbackL(
+                         TAny* aObject)
+    {
+    STATIC_CAST(CCalcContainer*, aObject)->DoTimeoutL();
+    return 0;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::TimeoutCallbackL
+// If no key is pressed after pressing */button and a few time
+// passes, this function is called    
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CCalcContainer::TimeoutCallbackChrL(
+                         TAny* aObject)
+    {
+    STATIC_CAST( CCalcContainer*, aObject )->DoTimeoutChrL();
+    return 0;
+    }
+// ---------------------------------------------------------
+// CCalcContainer::TimeoutCallbackL
+// If no key is pressed after pressing +#button and a few time
+// passes, this function is called    
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CCalcContainer::TimeoutCallbackShiftL(
+                         TAny* aObject)
+    {
+    STATIC_CAST(CCalcContainer*, aObject)->DoTimeoutShiftL();
+    return 0;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::NotifyChangeDecimal
+// Call when decimal separator is changed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::NotifyChangeDecimal(TChar aOld, TChar aNew)
+    {
+    iEditorPane->NotifyChangeDecimal(aOld, aNew);
+    iSheetPane->DrawNow();
+    }
+    
+// ---------------------------------------------------------
+// CCalcContainer::SetErrorCode
+// Call from view  when an error code is display.
+// ---------------------------------------------------------
+//        
+void  CCalcContainer::SetErrorCode(TInt aError)
+    {
+    iFuncmapPane->SetErrorCode( aError );
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::GetHelpContext
+// This function is called when Help application is launched.  
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::GetHelpContext(
+                TCoeHelpContext& aContext) const
+    {
+    aContext.iMajor = KUidCalc;
+    aContext.iContext = KCALC_HLP_MAIN;
+    }
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcContainer::CCalcContainer():
+    iPrevInput(EKeyNull) 
+    {
+    }
+
+// Second-phase constructor
+void CCalcContainer::ConstructL(
+                     CCalcView* aView)
+    {
+    iView = aView;
+    CCalcAppUi* appui = CCalcAppEnv::Static()->AppUi();
+    iCalcDocument = STATIC_CAST(CCalcDocument*, appui->Document());
+    
+    // Make a window-owning control.
+    CreateWindowL();
+    
+    
+    
+    iFuncmapPane = CCalcFuncmapSubPane::NewL(this);
+    iSheetPane = CCalcOutputSheet::NewL(this);
+    iEditorPane = CCalcEditorSubPane::NewL(this);
+
+    iTimeout = CPeriodic::NewL(KCallBackPriority);
+ 
+    iTimeoutChr = CPeriodic::NewL( KCallBackPriority );
+    iTimeoutShift = CPeriodic::NewL( KCallBackPriority );
+
+    TRect rect(0, 0, 0, 0); 
+    // Temporary rect is passed. Correct rect is set in SizeChanged.
+    iSkinContext = CAknsBasicBackgroundControlContext::NewL(
+        KAknsIIDQsnBgAreaMainCalc, rect, EFalse);
+        iValue = 0;
+
+    // Set status pane layout usual.
+    CEikonEnv::Static()->AppUiFactory()->StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ); 
+    }
+    
+void CCalcContainer::ActivateL()
+    {
+    
+    CCoeControl::ActivateL();   
+    SetChangeSignEnableL();
+    SetSqrtEnableL();
+    SetPercentEnableL();
+    ScrollArrowUpdate();
+    SetClearKeyEnable(); 
+    }
+    
+
+// ---------------------------------------------------------
+// CCalcContainer::DoTimeoutL
+// If no key is pressed until timeout of *-key,
+// this function is called.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::DoTimeoutL()
+    {
+    iTimeout->Cancel();
+    iFuncmapPane->NotifyTimeoutL(); 
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::DoTimeoutL
+// If no key is pressed until timeout of */key,
+// this function is called.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::DoTimeoutChrL()
+    {
+    iTimeoutChr->Cancel();
+    iFuncmapPane->NotifyTimeoutL(); 
+    }
+// ---------------------------------------------------------
+// CCalcContainer::DoTimeoutL
+// If no key is pressed until timeout of +#key,
+// this function is called.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::DoTimeoutShiftL()
+    {
+    iTimeoutShift->Cancel();
+    iFuncmapPane->NotifyTimeoutL(); 
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::HandleAsterKeyTimeoutForKeyPressL
+// Called when any key is pressed.
+// If timeout notifier for *-key is active, make calculation or
+// stop notifier according to user's input.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CCalcContainer::HandleAsterKeyTimeoutForKeyPressL(
+     const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    if (!(iTimeout->IsActive()))
+        {
+        return EFalse;
+        }
+
+    TBool ret(EFalse);
+    
+    if (aKeyEvent.iModifiers & EModifierShift)
+        {
+        // Stop timer for *-key and make calculaiton.
+        DoTimeoutL();
+        }
+
+    if (aType == EEventKey)
+        {
+        switch (aKeyEvent.iCode)
+            {
+            // Stop timer and no calculation is made 
+            // if pressed arrow or OK key.
+            // This depends on spec of Editing.
+            case EKeyLeftArrow:
+            case EKeyRightArrow:
+            case EKeyUpArrow:
+            case EKeyDownArrow:
+            case EKeyOK:
+                {
+                DoTimeoutL();
+                ret = ETrue;
+                break;
+                }
+            // Stop timer if *-key is pressed. 
+            // If release *-key, reset timer for the key.       
+            case KCalcAsteriskBtn:
+                {
+                iTimeout->Cancel();
+                break;
+                }
+            default:
+                {
+                // Stop timer for *-key and make calculaiton.
+                DoTimeoutL();
+                break;
+                }
+            }
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::HandleAsterKeyTimeoutForKeyPressL
+// Called when any key is pressed.
+// If timeout notifier for */key is active, make calculation or
+// stop notifier according to user's input.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CCalcContainer::HandleChrKeyTimeoutForKeyPressL(
+     const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    if ( !( iTimeoutChr->IsActive() ) )
+        {
+        return EFalse;
+        }
+
+    TBool ret( EFalse );
+    
+    if ( aKeyEvent.iModifiers & EModifierShift )
+        {
+        DoTimeoutChrL();
+        }
+    if ( aKeyEvent.iModifiers & EModifierFunc )
+        {
+        // Stop timer for */key and make calculaiton.
+        iTimeoutChr->Cancel();
+        } 
+
+    if ( aType == EEventKey )
+        {
+        switch ( aKeyEvent.iCode )
+            {
+            // Stop timer and no calculation is made 
+            // if pressed arrow or OK key.
+            // This depends on spec of Editing.
+            case EKeyLeftArrow:
+            case EKeyRightArrow:
+            case EKeyUpArrow:
+            case EKeyDownArrow:
+            case EKeyOK:
+                {
+                DoTimeoutChrL();
+                ret = ETrue;
+                break;
+                }
+            default:
+                {
+                // Stop timer for */key and make calculaiton.
+                DoTimeoutChrL();
+                break;
+                }
+            }
+        }
+    return ret;
+    }
+// ---------------------------------------------------------
+// CCalcContainer::HandleAsterKeyTimeoutForKeyPressL
+// Called when any key is pressed.
+// If timeout notifier for +#key is active, make calculation or
+// stop notifier according to user's input.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CCalcContainer::HandleShiftKeyTimeoutForKeyPressL(
+     const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    if ( !( iTimeoutShift->IsActive() ) )
+        {
+        return EFalse;
+        }
+
+    TBool ret( EFalse );
+    
+    if ( aKeyEvent.iModifiers & EModifierShift )
+        {
+        // Stop timer for +#key and make calculaiton.
+        iTimeoutShift->Cancel();
+        }
+    if ( aKeyEvent.iModifiers & EModifierFunc )
+        {
+        DoTimeoutShiftL();
+        }    
+
+    if ( aType == EEventKey )
+        {
+        switch ( aKeyEvent.iCode )
+            {
+            // Stop timer and no calculation is made 
+            // if pressed arrow or OK key.
+            // This depends on spec of Editing.
+            case EKeyLeftArrow:
+            case EKeyRightArrow:
+            case EKeyUpArrow:
+            case EKeyDownArrow:
+            case EKeyOK:
+                {
+                DoTimeoutShiftL();
+                ret = ETrue;
+                break;
+                }
+            default:
+                {
+                // Stop timer for +#key and make calculaiton.
+                DoTimeoutShiftL();
+                break;
+                }
+            }
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::CountComponentControls
+// Return count of control components.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CCalcContainer::CountComponentControls() const
+    {
+    return KCalcCountOfControls ;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::ComponentControl
+// Return control pointer which correspond to argument aIndex 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CCoeControl* CCalcContainer::ComponentControl
+                ( TInt aIndex ) const   
+    {
+    CCoeControl* control = NULL; 
+        
+    switch (aIndex)
+        {
+        case ECalcControlEditorPane:
+            {
+            control = iEditorPane;
+            break;
+            }
+        case ECalcControlFunctionMap:
+            {
+            control = iFuncmapPane;
+            break;
+            }
+        case ECalcControlOutputSheet:
+            {
+            control = iSheetPane;
+            break;
+            }
+        default:
+            {         
+            break;
+            }
+        }
+
+    return control;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::OfferKeyEventL
+// This function is called when a key is pressed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TKeyResponse CCalcContainer::OfferKeyEventL
+                ( const TKeyEvent& aKeyEvent,  
+                  TEventCode aType )           
+    {
+    switch (aType)
+        {
+        case EEventKeyDown:
+        case EEventKey:
+            {
+            if (aKeyEvent.iScanCode != EStdKeyLeftArrow &&
+            aKeyEvent.iScanCode != EStdKeyRightArrow &&
+            aKeyEvent.iScanCode != EStdKeyUpArrow &&
+            aKeyEvent.iScanCode != EStdKeyDownArrow &&
+            aKeyEvent.iCode != EKeyOK &&
+            aKeyEvent.iCode != EKeyEnter &&
+            aKeyEvent.iScanCode != EStdKeyEnter )
+                {
+                iFuncmapPane->NotifyOtherThanOkKeyPressed();
+                }
+            iPrevInput = aKeyEvent.iCode;
+
+            if(!(iFuncmapPane->IsQwertyKeypadActive()))
+             {
+            if (HandleAsterKeyTimeoutForKeyPressL(aKeyEvent, aType))
+                {
+                return EKeyWasConsumed;
+                }
+            }
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+            else
+                {
+                if ( iFuncmapPane->GetKeyboardType() == EPtiKeyboardHalfQwerty )
+                    {
+                    if ( HandleChrKeyTimeoutForKeyPressL( aKeyEvent, aType ) )
+                        {
+                        return EKeyWasConsumed;
+                        }  
+                    if ( HandleShiftKeyTimeoutForKeyPressL( aKeyEvent, aType ) )
+                        {
+                        return EKeyWasConsumed;
+                        } 
+                    }
+                }
+#endif
+            iValue =1 ;
+            break;
+            }
+        case EEventKeyUp:
+            {
+            if(!(iFuncmapPane->IsQwertyKeypadActive()))
+             {
+                
+            if (iPrevInput == KCalcAsteriskBtn && !iTimeout->IsActive() && iValue ==1 )
+                {
+                TCallBack callback(TimeoutCallbackL, this);
+                iTimeout->Start((TTimeIntervalMicroSeconds32) KCallBackDelay,
+                                (TTimeIntervalMicroSeconds32) KCallBackInterval, 
+                                callback);
+                }
+            }
+#ifdef RD_INTELLIGENT_TEXT_INPUT  
+            else
+                {
+                if ( iFuncmapPane->GetKeyboardType() == EPtiKeyboardHalfQwerty )
+                    {
+                    if ( aKeyEvent.iScanCode == EStdKeyLeftFunc && !iTimeoutChr->IsActive() && iValue == 1 )
+                        {
+                        TCallBack callback( TimeoutCallbackChrL, this );
+                        iTimeoutChr->Start( ( TTimeIntervalMicroSeconds32 ) KCallBackDelay,
+                                     ( TTimeIntervalMicroSeconds32 ) KCallBackInterval, 
+                                     callback );
+                        }
+                    if ( aKeyEvent.iScanCode == EStdKeyLeftShift && !iTimeoutShift->IsActive() && iValue == 1 )
+                        {
+                        TCallBack callback( TimeoutCallbackShiftL, this );
+                        iTimeoutShift->Start( ( TTimeIntervalMicroSeconds32 ) KCallBackDelay,
+                                     ( TTimeIntervalMicroSeconds32 ) KCallBackInterval, 
+                                     callback );
+                        }
+                    }
+                }
+#endif
+
+            iFuncmapPane->NotifyReleaseKeyL();
+            iValue =0;
+            
+            DrawNow(); //redraw screen when a button up
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+
+    TKeyResponse keyResponse(iFuncmapPane->OfferKeyEventL(aKeyEvent, aType));
+    if (keyResponse == EKeyWasNotConsumed)
+        {
+        if(iFuncmapPane->IsQwertyKeypadActive())
+             {
+             iEditorPane->IsQwertyActive();
+             }
+        else
+            {
+            iEditorPane->IsQwertyNotActive();    
+            }
+        // Edit buffer of line
+        keyResponse = iEditorPane->OfferKeyEventL(aKeyEvent, aType);
+        }
+    return keyResponse;
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::HandleResourceChange
+// Notifier for changing language
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::HandleResourceChange(TInt aType)
+    {
+    TRAP_IGNORE( HandleResourceChangeCalSoftL( aType ) );
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::HandleResourceChange
+// Notifier for changing language
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::HandleResourceChangeCalSoftL(TInt aType)
+    {
+    if ((aType == KEikDynamicLayoutVariantSwitch) || (aType == KAknsMessageSkinChange) )
+        {
+                 
+         TRect mainPaneRect ;
+         TRect statusPaneRect;
+         TBool signstate = EFalse;
+         TBool sqrtstate = EFalse;
+         TBool percentstate = EFalse;
+        TBool clearstate = EFalse;
+                 
+        if ( Layout_Meta_Data::IsLandscapeOrientation() )
+            {
+            // when calculator is in Landscape layout, the statuspane displays     
+            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
+            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, statusPaneRect );
+            mainPaneRect.iTl = statusPaneRect.iTl;
+            }
+        else
+            {
+            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
+            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, statusPaneRect );
+            mainPaneRect.iTl = statusPaneRect.iTl;
+            }
+        
+        
+        //check if funcpane already exists
+
+      TInt selected = 0;
+        if(iFuncmapPane)
+        {
+            //store the  states of the buttons
+            signstate = iFuncmapPane->GetChangeSignButtonState();
+            sqrtstate = iFuncmapPane->GetSqrtButtonState();
+            percentstate = iFuncmapPane->GetPercentButtonState();
+
+            selected = iFuncmapPane->GetSelectedButtonId();
+            
+            clearstate = iFuncmapPane->GetClearButtonState(); 
+             
+             //delete the function pane
+            delete(iFuncmapPane);
+            iFuncmapPane =  NULL;
+            
+        }
+        //Reload the bitmaps
+        (CCalcAppEnv::Static())->SetSkinChangedValue(EFalse);
+        (CCalcAppEnv::Static())->UpdateAknConstArrayForFuncMap();
+        (CCalcAppEnv::Static())->LoadFuncMapBitmapL();
+        
+        //Create the new pane
+        iFuncmapPane = CCalcFuncmapSubPane::NewL(this); 
+
+        if ( AknLayoutUtils::PenEnabled() )
+        {            
+        iFuncmapPane->SetHighlightButton( 0, selected );   
+        }
+        
+        iFuncmapPane->ActivateL();
+        
+        SetRect(mainPaneRect);
+        iFuncmapPane->NotifyLangChange();
+        DrawNow();
+
+        //Restore the states of the buttons
+        iFuncmapPane->SetChangeSignEnable(signstate);
+        iFuncmapPane->SetSqrtEnable(sqrtstate);
+        iFuncmapPane->SetPercentEnable(percentstate);
+        iFuncmapPane->SetClearKeyEnable( clearstate );
+        
+        //Update scroll bar here
+        ScrollArrowUpdate();
+                iSheetPane->HandleResourceChange(aType);
+        }
+    else
+        {
+        
+        CCoeControl::HandleResourceChange(aType);
+        }
+      
+    }
+ 
+
+// ---------------------------------------------------------
+// CCalcContainer::SizeChanged
+// Control size is set.
+// This function is called when the size changes.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::SizeChanged()
+    {
+    TRect parentRect(Rect());
+    
+    if (iSkinContext)
+        {
+        iSkinContext->SetRect(parentRect);
+        }
+
+    
+    if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+        {
+             
+            // Set layout of function map subpane, output sheet  and editor sub pane.        
+            if( AknLayoutUtils::PenEnabled() )
+            {
+                if (Layout_Meta_Data::IsLandscapeOrientation())
+                {
+                
+                    AknLayoutUtils::LayoutControl(
+                    iFuncmapPane, parentRect, AknLayoutScalable_Apps::grid_calc_pane(enTouch_with_lsc).LayoutLine());
+                    
+                    AknLayoutUtils::LayoutControl(
+                    iSheetPane, parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_lsc).LayoutLine());
+                        
+                    AknLayoutUtils::LayoutControl(
+                    iEditorPane, parentRect,AknLayoutScalable_Apps::calc_display_pane(enTouch_with_lsc).LayoutLine());
+                }
+                else
+                {
+                    AknLayoutUtils::LayoutControl(
+                    iFuncmapPane, parentRect, AknLayoutScalable_Apps::grid_calc_pane(enTouch_with_prt).LayoutLine());
+                    
+                    AknLayoutUtils::LayoutControl(
+                    iSheetPane, parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_prt).LayoutLine());
+                    
+                    AknLayoutUtils::LayoutControl(
+                    iEditorPane, parentRect,AknLayoutScalable_Apps::calc_display_pane(enTouch_with_prt).LayoutLine());
+                }
+            }
+            else
+            {
+                AknLayoutUtils::LayoutControl(
+                    iFuncmapPane, parentRect, AknLayoutScalable_Apps::grid_calc_pane(enTouch_disabled).LayoutLine());
+                    
+                AknLayoutUtils::LayoutControl(
+                iSheetPane, parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_disabled).LayoutLine());
+                
+                AknLayoutUtils::LayoutControl(
+                iEditorPane, parentRect,AknLayoutScalable_Apps::calc_display_pane(enTouch_disabled).LayoutLine());
+                
+            }    
+
+        }
+    else
+        {
+    // Set layout of function map subpane.
+    AknLayoutUtils::LayoutControl(
+    iFuncmapPane, parentRect, AppLayout::grid_calc_pane());    
+    
+    
+    // Set layout of output sheet.
+    AknLayoutUtils::LayoutControl(
+         iSheetPane, parentRect,AppLayout::gqn_graf_calc_paper());
+    
+    // Set layout of editor subpane.
+    AknLayoutUtils::LayoutControl(
+        iEditorPane, parentRect,AppLayout::Calculator_elements_Line_1());
+        }    
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::Draw
+// Clear whole screen. After this, draw editor, output sheet,
+// and function map.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+    gc.Clear(aRect);
+
+    // Drawing skin
+    if (iSkinContext)
+        {
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        
+        AknsDrawUtils::Background(
+            skin, iSkinContext, this, gc, aRect);
+        }
+     
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::MopSupplyObject()
+// Pass skin information if need.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TTypeUid::Ptr CCalcContainer::MopSupplyObject(TTypeUid aId)
+    {
+    if (aId.iUid == MAknsControlContext::ETypeId && iSkinContext)
+        {
+        return MAknsControlContext::SupplyMopObject(aId, iSkinContext);
+        }
+
+    return CCoeControl::MopSupplyObject(aId);
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::ShowSqrtButton()
+// Enable (or disable) the square root button.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::ShowSqrtButton(TBool aEnable)
+    {
+    TCalcEditLine editLine( iEditorPane->EditLine() );
+    TBool sqrtEnable(ETrue);
+    TRAP_IGNORE(
+    if ( editLine.NumberL() == 0 )
+        {
+        sqrtEnable = EFalse;    
+        }
+    )
+
+    iFuncmapPane->SetSqrtEnable( sqrtEnable );
+    }    
+
+// ---------------------------------------------------------
+// CCalcContainer::ShowPercentButton()
+// Enable (or disable) the percent button.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::ShowPercentButton(TBool aEnable)
+    {
+    iFuncmapPane->SetPercentEnable(aEnable);
+    }
+
+// ---------------------------------------------------------
+// CCalcContainer::GetState()
+// Returns the state of the calculator.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CCalcView::TStateNo CCalcContainer::GetState()
+{
+    return (iView->State());
+}
+
+// ---------------------------------------------------------
+// CCalcContainer::HandlePointerEventL
+// Handled when pen input occured.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcContainer::HandlePointerEventL
+                ( const TPointerEvent& aPointerEvent )           
+    {
+    CCoeControl::HandlePointerEventL( aPointerEvent );
+    }
+    
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+// CCalcContainer::HandleMiddleSoftKey()
+// Handled when MSK is selected.
+// ---------------------------------------------------------
+//
+void CCalcContainer::HandleMiddleSoftKey()
+                
+    {
+    TRAP_IGNORE( iFuncmapPane->HandleMiddleSoftKeyOREKeyOKL() );
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+// SetOperatorFromTouchL
+// Handle digit inputs
+// ---------------------------------------------------------
+//
+void CCalcContainer::SetOperatorFromTouchL(TInt akey )
+{
+      //Simulate events as events are occurring from the KB Events
+      TKeyEvent eventkey;
+      TEventCode keycode;
+    keycode = EEventKeyDown;
+    eventkey.iCode = 0;
+    eventkey.iScanCode = ASCII_ZERO + akey;
+    
+    //First send Keydown event
+       OfferKeyEventL(eventkey,keycode);
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+    eventkey.iCode = ASCII_ZERO + akey;
+#else
+    eventkey.iCode = KEY_CODE_VAL;
+#endif
+    keycode = EEventKey;
+    
+    //Next send EventKey
+    OfferKeyEventL(eventkey,keycode);
+    
+    
+    //Finally send Keyup
+    eventkey.iScanCode = ASCII_ZERO + akey;
+    keycode = EEventKeyUp;
+    OfferKeyEventL(eventkey,keycode);
+}
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+// ClearInputKeyL
+// Handle 'c' input key from Touch
+// ---------------------------------------------------------
+//
+void CCalcContainer::ClearInputKeyL(TInt aRepeat)
+{
+      //Simulate events as events are occurring from the KB Events
+    TKeyEvent eventkey;
+    TEventCode keycode;
+    keycode = EEventKeyDown;
+    eventkey.iCode = 0; 
+    eventkey.iScanCode = 1; //for clear input key
+    eventkey.iRepeats = aRepeat;
+    
+    //First send Keydown event
+    OfferKeyEventL(eventkey,keycode);
+    eventkey.iCode = 8;  //clear input key icode
+    keycode = EEventKey;
+    
+    //Next send EventKey
+    OfferKeyEventL(eventkey,keycode);
+    keycode = EEventKeyUp;
+    
+     //Finally send Keyup
+    OfferKeyEventL(eventkey,keycode);    
+    
+}
+
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+// SetSeparatorFromTouch
+// Handle '.' input key from Touch
+// ---------------------------------------------------------
+//
+void CCalcContainer::SetSeparatorFromTouchL()
+{
+    // set the right iCode and iScanCode for
+    // decimal point
+    if ( iFuncmapPane->IsQwertyKeypadActive() )
+        {
+        // Simulate events as events are occurring from the KB Events
+        TKeyEvent eventkey;
+        TEventCode keycode = EEventKeyDown;
+        eventkey.iCode = 0;
+#ifdef RD_INTELLIGENT_TEXT_INPUT  
+        if ( iFuncmapPane->GetKeyboardType() == EPtiKeyboardHalfQwerty )
+            {
+            eventkey.iScanCode = 126;  //scan code for separator
+            }
+        else
+#endif
+            {
+            eventkey.iScanCode = 122;  //scan code for separator
+            }
+
+        // First send Keydown event
+        OfferKeyEventL( eventkey, keycode );
+        eventkey.iCode = 46;  // icode for separator
+        keycode = EEventKey;
+
+        // Next send EventKey
+        OfferKeyEventL( eventkey, keycode );
+        }
+    else
+        {
+        // Simulate events as events are occurring from the KB Events    
+        TKeyEvent eventkey;
+        TEventCode keycode = EEventKeyDown;
+        eventkey.iCode = 0;
+        eventkey.iScanCode = 127;  // scan code for separator
+
+        // First send Keydown event
+        OfferKeyEventL( eventkey, keycode );
+        eventkey.iCode = 35;  // icode for separator
+        keycode = EEventKey;
+
+        // Next send EventKey
+        OfferKeyEventL( eventkey, keycode );
+        }     
+}
+   
+//  End of File  CALCCONT_CPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcDoc.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,562 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Document class, CCalcDocument
+*                Derived from CEikDocument
+*                The history of inputted data is held.
+*                The memory of four-arithmetical-operations operation 
+*                or a calculation result is held.
+*                The last result and memory are saved at a file and 
+*                it restores.
+*
+*/
+
+
+
+// INCLUDE FILES  
+#include    "CalcDoc.h"
+#include    "CalcEditline.h"
+#include    "CalcAppUi.h"
+#include    "CalcApp.h"
+#include	"CalcEnv.h"
+#include    "CalcHistory.h"
+#include	"e32math.h"
+#include <e32cmn.h>
+#include <s32file.h>
+// CONSTANTS
+const TReal64 KCalcDefaultMemory(0.0);
+const TReal64 KCalcDefaultLastResult(0.0);
+const TReal64 KCalcDefaultZero(1E-12);
+
+_LIT( KCalculatorFilename,"Calcsoft.ini");
+_LIT(KDelimiter, ":");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Two-phased constructor.
+CCalcDocument* CCalcDocument::NewL
+                (CEikApplication& aApp) 
+    {
+    CCalcDocument* self = new (ELeave) CCalcDocument(aApp);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+CCalcDocument::~CCalcDocument()
+    {
+    delete iHistory;
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::CalculateAndAddHistoryL
+// This function is called when State is changed to State3 or State5. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TReal64 CCalcDocument::CalculateAndAddHistoryL
+                   (TReal64 aOperand,
+                    const TCalcEditLine& aLine)
+    {
+	iProvisionalResult = CalculateL(aOperand, aLine.Operator()); 
+	iHistory->Add(aLine);       // Add a line to history.	
+	return iProvisionalResult;	
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::CalculateAndNoHistoryL
+// This function is called when the calculations is not
+// written to the Outputsheet (sqrt and percent in some cases).
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TReal64 CCalcDocument::CalculateAndNoHistoryL
+                   (TReal64 aOperand,
+                    const TCalcEditLine& aLine)
+	{
+	TReal64 result = CalculateL(aOperand, aLine.Operator()); 
+	return result;
+	}
+
+// ---------------------------------------------------------
+// CCalcDocument::CalculateAndModifyHistoryL
+// This function is called when the output needs to be edited
+// before it is displayed in the Outputsheet. This function 
+// may call the CalculateL twice, because it may need to
+// calculate the percent first.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TReal64 CCalcDocument::CalculateAndModifyHistoryL
+                   (TReal64 aOperand,
+                    TCalcEditLine& aLine,
+					TCalcEditLine::TCalcOperatorType aOperator)
+	{
+	if (aOperator == TCalcEditLine::ECalcMultiply)
+		iProvisionalResult = CalculateL(aOperand, aLine.Operator()); 
+	else
+		{
+		TReal64 iTempResult = CalculateL(aOperand, aLine.Operator()); 
+		iProvisionalResult = CalculateL(iTempResult, aOperator);
+		}
+
+	aLine.SetOperator(aOperator);
+	// Get the percent character from iCalcAppEnv (it uses the resource
+	// file to get the character).
+	TChar character((iCalcAppEnv->OutSheetOperator(TCalcEditLine::ECalcPercent))[0]);
+	aLine.AppendNumberStringL(character); // Add percent to the line
+	iHistory->Add(aLine);       // Add a line to history.	
+	return iProvisionalResult;
+	}
+
+// ---------------------------------------------------------
+// CCalcDocument::AddEqualLineAndUpdateLastResult
+// This is called when "Equal" command is selected. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::AddEqualLineAndUpdateLastResultL()
+    {
+    TCalcEditLine line;
+    line.SetOperator(TCalcEditLine::ECalcEqual);
+    line.SetNumber(iProvisionalResult);
+    iHistory->Add(line);         // Add a line to history.
+    iLastResult = iProvisionalResult;
+    SaveStateL();
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::AddEmptyLine
+// Add a empty line
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::AddEmptyLine()
+    {
+    TCalcEditLine line;
+    iHistory->Add(line);       
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::MemorySave
+// Save a memory from value of current editor.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::MemorySaveL
+                   (TReal64 aNewMemory)
+    {
+    iMemory = aNewMemory;
+    SaveStateL();
+    }
+
+
+// ---------------------------------------------------------
+// CCalcDocument::HasMemory
+// Check memory non-zero.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CCalcDocument::HasMemory() const
+    {
+    return (iMemory != 0.0);
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::Memory
+// Return memory.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TReal64 CCalcDocument::Memory() const
+    {
+    return (iMemory);
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::MemoryClear
+// Clear memory.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::MemoryClearL()
+    {
+    iMemory = 0.0;
+    SaveStateL(); 	
+    }
+
+// ----------------------------------------------------
+// CCalcDocument::LastResult
+// Return Last result.
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+TReal64 CCalcDocument::LastResult() const
+    {
+    return (iLastResult);
+    }
+
+// ----------------------------------------------------
+// CCalcDocument::ProvisionalResult
+// Return provisional result
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+TReal64 CCalcDocument::ProvisionalResult() const
+    {
+    return iProvisionalResult;
+    }
+
+
+// ----------------------------------------------------
+// CCalcDocument::History
+// Return CCalcHistory class.
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+CCalcHistory* CCalcDocument::History() const
+    {
+    return iHistory;
+    }
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcDocument::CCalcDocument
+               (CEikApplication& aApp) 
+              : CEikDocument(aApp)
+    {
+    }
+
+// Second phase constructor.
+void CCalcDocument::ConstructL()
+    {
+    iHistory = new (ELeave) CCalcHistory();
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::CalculateL
+// Calculate result
+// Leave may occur, causes KErrOverflow or KErrDivideByZero.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TReal64 CCalcDocument::CalculateL
+        (TReal64 aOperand,
+         TCalcEditLine::TCalcOperatorType aOperator) 
+    {
+    TReal64  result(iProvisionalResult);
+
+    switch (aOperator)
+        {
+        case  TCalcEditLine::ECalcAdd:
+            {
+            result += aOperand;
+            if( Abs(result)<= KCalcDefaultZero )
+            	{
+            	result = 0;
+            	}
+            break;
+            }
+        case  TCalcEditLine::ECalcSubtract:
+            {
+            result -= aOperand;
+            if( Abs(result)<= KCalcDefaultZero )
+            	{
+            	result = 0;
+            	}
+            break;
+            }
+        case  TCalcEditLine::ECalcMultiply:
+            {
+            result *= aOperand;
+            break;
+            }
+        case  TCalcEditLine::ECalcDivide:
+            {
+            if ( aOperand == 0 )
+                {
+                iCCalcView->UpdateState( CCalcView::EOperator );
+                User::Leave(KErrDivideByZero); //  Error causes
+                }
+            else
+                {
+                result /= aOperand;
+                }
+            break;
+            }
+		case TCalcEditLine::ECalcSqrt:
+			{
+			if ( aOperand < 0 )
+				{
+                User::Leave(KErrNotSupported); //  Error causes
+                }
+			else
+				Math::Sqrt(result, aOperand);
+			break;
+			}
+		case TCalcEditLine::ECalcPercent:
+			{
+			result = (result * aOperand) / 100;
+			break;
+			}
+        case  TCalcEditLine::ECalcOperatorNone:
+            {
+            result = aOperand;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    //  Check Result. If overflow, Leave occurs.
+    CheckResultL(&result);
+
+    // Overflow do not occur
+    return  result;
+    }
+
+
+// ---------------------------------------------------------
+// CCalcDocument::CheckResultL
+// Check overflow and underflow  
+// Leave may occur, causes KErrOverflow.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::CheckResultL
+                   (TReal64* aResult)    
+    {
+    // Set data format 
+    TRealFormat realFormat(KCalcMaxNumberWidth, KCalcMaxDigits);  
+    if ( *aResult >= 0 )
+        {
+        realFormat.iWidth--;
+        }
+    realFormat.iType = KRealFormatNoExponent;
+    realFormat.iTriLen = 0;  //  Delimit character is nothing
+    TLocale locale;
+    TChar separator(locale.DecimalSeparator());
+    
+    realFormat.iPoint = separator;
+
+    TBuf<KCalcMaxNumberWidth> buffer;  
+    TInt code = buffer.Num(*aResult, realFormat);
+    
+    if(KErrOverflow == code || KErrUnderflow == code)
+	    {
+	    TRealFormat realFormat(KCalcMaxNumberWidth);  
+	    if ( *aResult >= 0 )
+	        {
+	        realFormat.iWidth--;
+	        }
+	    realFormat.iType = KRealFormatExponent;
+	    realFormat.iPlaces = 3;
+	    realFormat.iTriLen = 0;  //  Delimit character is nothing
+	    TLocale locale;
+	    TChar separator(locale.DecimalSeparator());
+	    
+	    realFormat.iPoint = separator;
+
+	    TBuf<KCalcMaxNumberWidth> buffer;  
+	    code = buffer.Num(*aResult, realFormat);
+	    }
+	
+	switch (code)
+        {
+        case KErrOverflow:
+            {
+            User::Leave(KErrOverflow);  
+            break;
+            }
+        case KErrUnderflow:
+            {
+            *aResult = 0.0;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+   
+    }
+
+
+// ---------------------------------------------------------
+// CCalcDocument::ExternalizeL
+// Externalising of the last result and memory.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::ExternalizeL
+        (RWriteStream& aStream) const 
+    {
+    aStream.WriteReal64L(iLastResult);  // Write last result
+    aStream.WriteReal64L(iMemory);      // Write memory
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::InternalizeL
+// Internalising of the last result and memory.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::InternalizeL
+        (RReadStream& aStream) 
+    {
+    iLastResult = aStream.ReadReal64L();    // Read last result
+    iMemory = aStream.ReadReal64L();        // Read memory
+
+    // If read value is out of range, 
+    // memory is replaced to default one.
+    TRAPD(error, CheckResultL(&iMemory));
+    if (error == KErrOverflow)
+        {
+        iMemory = KCalcDefaultMemory;
+        }
+
+    // If read value is out of range, 
+    // last result is replaced to default one.
+    TRAP(error, CheckResultL(&iLastResult));
+    if (error == KErrOverflow)
+        {
+        iLastResult = KCalcDefaultLastResult;
+        }
+
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::CreateAppUiL
+// This function is called when Calculator application is opened. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CEikAppUi* CCalcDocument::CreateAppUiL()
+    {
+    return new (ELeave) CCalcAppUi;
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::SaveStateL
+// Store memory and last result
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::SaveStateL()
+{
+		RFileWriteStream out;
+		RFs fileSession;
+			
+		User::LeaveIfError(fileSession.Connect());
+    	CleanupClosePushL(fileSession);
+    
+    	TFileName filePath;
+		TBuf<1> tempDes;
+		TChar driveChar;
+	   	
+    	User::LeaveIfError(fileSession.PrivatePath(filePath));
+    	fileSession.DriveToChar(KDefaultDrive, driveChar);
+    	tempDes.Append(driveChar);
+    	filePath.Insert(0,KDelimiter);
+    	filePath.Insert(0,tempDes);
+    	filePath.Append(KCalculatorFilename);
+    	
+    	TInt err( out.Replace( fileSession, filePath,EFileWrite ) );
+	
+	if( !err )
+		{
+		TRAP( err, ExternalizeL( out ) );
+	
+		out.Close();
+		}
+		  
+  	CleanupStack::PopAndDestroy();
+  		
+}
+
+ // ---------------------------------------------------------
+// CCalcDocument::LoadStateL
+// Restore memory and last result
+// This function is called when document file exists. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//   
+    void CCalcDocument::LoadStateL()
+    {
+    	RFileReadStream in;
+    	RFs fileSession;
+    		
+    	User::LeaveIfError(fileSession.Connect());
+    	CleanupClosePushL(fileSession);
+
+		TFileName filePath;
+		TBuf<1> tempDes;
+		TChar driveChar;
+    	User::LeaveIfError(fileSession.PrivatePath(filePath));
+    	fileSession.DriveToChar(KDefaultDrive, driveChar);
+    	tempDes.Append(driveChar);
+    	filePath.Insert(0,KDelimiter);
+    	filePath.Insert(0,tempDes);
+    	filePath.Append(KCalculatorFilename);
+  		
+		TInt err( in.Open( fileSession, filePath,
+			EFileRead ) );
+
+	if( !err )
+		{
+		TRAPD(readErr,InternalizeL( in ) );
+		
+		if ( readErr )
+        {
+        // Internalizing fails.
+        iMemory = KCalcDefaultMemory;         // Reset memoey
+        iLastResult = KCalcDefaultLastResult; // Reset last result
+        }
+        
+		in.Close();
+		}
+			CleanupStack::PopAndDestroy();
+		
+        SetChanged(EFalse);
+	
+    }
+
+// ---------------------------------------------------------
+// CCalcDocument::SetAppEnv
+// This function is used to receive a pointer to the
+// CCalcAppEnv.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::SetAppEnv(CCalcAppEnv* aCalcAppEnv)
+	{
+		iCalcAppEnv = aCalcAppEnv;
+	}
+
+// ---------------------------------------------------------
+// CCalcDocument::SetCalcView
+// This function is used to receive a pointer to the
+// SetCalcView.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcDocument::SetCalcView( CCalcView* aCCalcView )
+    {
+    iCCalcView = aCCalcView;
+    }
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcEdit.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,969 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Source file of "editor sub-pane", CCalcEditorSubPane class 
+*                which derived from CCoeControl class. 
+*                Role of this class is to draw editor.
+*
+*/
+
+
+// INCLUDE FILES
+#include <AknUtils.h>
+#include <Calcsoft.rsg>
+#include <avkon.hrh>
+#include <aknsoundsystem.h>
+#include    <applayout.cdl.h>
+#include <AknIconUtils.h>
+#include    <AknsDrawUtils.h>
+#include  <aknlayoutscalable_avkon.cdl.h>  
+
+#include <AknLayout2ScalableDef.h>
+#include <AvkonInternalCRKeys.h>
+#include    <aknlayoutscalable_apps.cdl.h>
+
+#include "CalcAppUi.h"
+#include "CalcCont.h"
+#include "CalcDoc.h"
+#include "CalcEdit.h"
+#include "CalcEnv.h"
+#include "CalcDrawingConst.laf" // for drawing information.
+#include "fbs.h"
+#include <PtiKeyMappings.h>
+
+#include <PtiDefs.h>
+#include <PtiEngine.h>
+#include <AknFepInternalCRKeys.h>
+#include <layoutmetadata.cdl.h>
+
+//  LOCAL CONSTANTS AND MACROS  
+
+// If const TChar is used, complie error occurs in THUMB build.
+// To avoid this, #define is used.
+#define KCalcHashBtn '#' 
+#define KZero 0.0 
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Two-phased constructor.
+CCalcEditorSubPane* CCalcEditorSubPane::NewL(
+                    CCalcContainer* aContainer)
+    {
+    CCalcEditorSubPane* self = new (ELeave) CCalcEditorSubPane();
+    CleanupStack::PushL(self);
+    self->ConstructL(aContainer);
+    CleanupStack::Pop(self); 
+    return self;
+    }
+
+
+
+
+// Destructor
+CCalcEditorSubPane::~CCalcEditorSubPane()
+    {
+    iQwertyModeStatusProperty.Close();
+    delete iEngine;
+    delete iCRKey;
+    }
+
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::EditLine
+// Return reference of editor line which has been edited by user.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+const TCalcEditLine& CCalcEditorSubPane::EditLine() const
+    {
+    return iEditLine;
+    }
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::SetEditorNumber
+// Set TReal64 type editor number.
+// (other items were commented in a header). 
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::SetOperator(
+     TCalcEditLine::TCalcOperatorType aType)
+    {
+    iEditLine.SetOperator(aType);
+    }
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::SetEditorNumber
+// Set TReal64 type editor number.
+// (other items were commented in a header). 
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::SetEditorNumber(TReal64 aNewNumber)
+    {
+    iEditorNumber = aNewNumber;
+    iEditLine.SetNumber(aNewNumber);
+    }
+        
+// ---------------------------------------------------------
+// CCalcEditorSubPane::EditorNumber
+// Return TReal64 type editor number
+// (other items were commented in a header). 
+// ---------------------------------------------------------
+//
+TReal64 CCalcEditorSubPane::EditorNumber() const
+    {
+    return iEditorNumber;
+    }
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::ResetL
+// Clear editor.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::ResetL()
+    {
+    iEditLine.AllClear();  
+    iEditLine.ClearL();
+    }
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::ClearOperand
+// Clear operand
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::ClearOperand()
+    {
+    iEditLine.ClearOperand();  
+    }
+
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::ClearLastInput
+// Clear last input.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::ClearLastInputL()
+    {
+    const TPtrC number(iEditLine.NumberString());
+    
+    if (number.Length() == 1 && 
+        iCalcContainer->View()->State() == CCalcView::EOperandOnly)
+        {
+        iCalcContainer->InputClearL();
+        }
+    else
+        {
+        if (iEditLine.CheckZeroL())
+            {
+            iCalcContainer->InputClearL();
+            }
+        else
+            {
+            ClearL();
+            if (iEditLine.CheckZeroL() && 
+                iCalcContainer->View()->State() == CCalcView::EOperandOnly)
+                {
+                iCalcContainer->InputClearL();
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::OfferShortPressClearKeyEventL
+// Handle short-press-clear-key and CBA-clear-key event.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::OfferShortPressClearKeyEventL()
+    {
+    CCalcView* view = iCalcContainer->View();
+    CCalcView::TStateNo state(view->State());
+    CCalcView::TKindOfInput latestInput(view->LatestInput());
+
+    switch (latestInput)
+        {
+        case (CCalcView::EMemoryRecall):
+        case (CCalcView::EOperator):
+            {
+            if (state == CCalcView::EOperandOnly ||
+                iEditLine.CheckZeroL())
+                {
+                iCalcContainer->InputClearL();
+                }
+            else 
+                {
+                ClearOperand();
+                }
+            break;
+            }
+        case (CCalcView::EMemorySave):
+            {
+            if (state != CCalcView::EOperandAndOperator ||
+                iEditLine.CheckZeroL())
+                {
+                iCalcContainer->InputClearL();
+                }
+            else
+                {
+                ClearOperand();
+                }
+            break;
+            }
+        case (CCalcView::EEqual):
+            {
+            iCalcContainer->InputClearL();
+            break;
+            }
+        default:
+            {
+            ClearLastInputL();
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::DoChangeSign
+// Changing sign.
+// This is not called when editor number is 0. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::DoChangeSignL(
+     CCalcView::TStateNo aState)
+    {
+    // If current state is other than State1, "+/-" command is ignored.
+    if (aState != CCalcView::EInitialMode)
+        {
+        if (aState == CCalcView::ESelectResult)
+            {
+            // "=" is disappeared from editor.
+            iEditLine.SetOperator(TCalcEditLine::ECalcOperatorNone);  
+            }
+        
+        iEditLine.ChangeSignL();
+        iEditorNumber = iEditorNumber * (-1);
+        DrawNow();
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::DoMemoryRecallOrLastResult
+// Update editor number to memory or last result.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::DoMemoryRecallOrLastResult(
+                    TReal64 aMemoryOrLastResult, 
+                    CCalcView::TStateNo aState)
+    {
+    if (aState == CCalcView::ESelectResult)
+        {
+        // "=" is disappeared from editor.
+        iEditLine.SetOperator(TCalcEditLine::ECalcOperatorNone);
+        }
+    
+    iEditLine.SetNumber(aMemoryOrLastResult);
+    iEditorNumber = aMemoryOrLastResult;
+    DrawNow();
+    }
+
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::NotifyChangeDecimal
+// Call when decimal separator is changed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::NotifyChangeDecimal(TChar aOld, TChar aNew)
+    {
+    iEditLine.ChangeDecimal(aOld, aNew);
+    DrawNow();
+    }
+    
+// ---------------------------------------------------------
+// CCalcEditorSubPane::IsQwertyKeypadActive
+// Called to check qwerty keypad is active or not
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+
+TInt CCalcEditorSubPane::IsQwertyKeypadActive()
+	{
+ 	TInt value = 0;
+    iQwertyModeStatusProperty.Get(value);
+    return value;
+	}
+
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::OfferKeyEventL
+// This function is called by CCalcContainer::OfferKeyEventL()
+// when inputted key is number or "#". 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TKeyResponse CCalcEditorSubPane::OfferKeyEventL
+                ( const TKeyEvent& aKeyEvent,  
+                  TEventCode aType )           
+    {
+	
+    if (aType != EEventKey)
+        {
+        return EKeyWasNotConsumed;
+        }
+	TPtiKey keyQwertyValue = (TPtiKey)aKeyEvent.iScanCode;
+    TChar decimal(iCalcAppEnv->DecimalSeparator());
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+    TChar keyCode( aKeyEvent.iCode );
+#else 
+    TChar keyCode(aKeyEvent.iScanCode);
+#endif
+    TChar decimalkey(aKeyEvent.iCode);
+    
+    if( iDecimalCounter < KCalcMaxNumberWidth  )
+    {
+    	iAllowedDecimal.Append(decimal);
+    	iDecimalCounter++;	
+    }
+    
+		if(IsQwertyKeypadActive())
+		{
+ 
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+            if( MapDecimal(aKeyEvent) || MapDecimal(aKeyEvent) ||aKeyEvent.iCode == KCalcHashBtn )
+                {
+                keyCode = decimal;
+                }		    	
+#else
+		    if(MapDecimal(keyQwertyValue,EPtiCaseUpper) || MapDecimal(keyQwertyValue,EPtiCaseLower) ||aKeyEvent.iCode == KCalcHashBtn )
+		      {
+		      keyCode = decimal;
+		      }
+#endif
+                  //}
+		}
+	else
+		{
+		if (aKeyEvent.iCode == KCalcHashBtn)
+	        {
+	        keyCode = decimal;
+	        }	
+		}
+    
+    TKeyResponse response(EKeyWasNotConsumed);
+    CCalcView* view = iCalcContainer->View();
+    
+    if (keyCode.IsDigit() || keyCode == decimal)
+        {
+        DrawDeferred();
+        iCalcContainer->ProcessPreinputL();
+        view->iLastResultSetected = EFalse;
+        // Append input to editor space if editor space is not full.
+        TRAPD(errorCode, iEditLine.AppendL(keyCode));
+
+        //  If editor space is full, error message is shown.
+        if (errorCode)  
+            {
+            CAknKeySoundSystem* soundSystem = 
+                iCalcAppEnv->AppUi()->KeySounds();
+            if (soundSystem)
+                {
+                soundSystem->PlaySound(EAvkonSIDInformationTone);
+                }
+            }
+        else
+            {
+            if (iEditLine.CheckZeroL() && 
+                iEditLine.Operator() == TCalcEditLine::ECalcOperatorNone)
+                {
+                view->UpdateState(CCalcView::EAllClear);
+                }
+            else
+                {
+                view->UpdateState(CCalcView::EOperand);
+                }
+            iEditorNumber = iEditLine.NumberL();
+            }
+		
+		// Enable ChangeSign and Square root buttons
+		// if there is no 0 in the editor.
+		iCalcContainer->SetChangeSignEnableL();
+		iCalcContainer->SetSqrtEnableL();
+        iCalcContainer->SetClearKeyEnable();
+        
+		// Enable the Percent button if the calculator
+		// is in correct state and there is no 0 in the editor.
+		if ( iCalcContainer->GetState() == CCalcView::EOperandAndOperator || 
+			 iCalcContainer->GetState() == CCalcView::EOperandAndOperatorAndOperand )
+			if (keyCode.IsDigit())
+				iCalcContainer->SetPercentEnableL();
+		
+			response = EKeyWasConsumed;
+        }
+    else if (decimalkey == EKeyBackspace)   
+        {view->iLastResultSetected = EFalse;
+        DrawDeferred();
+        //  If Clear-Key is pressed long, number editor and operand
+        // is clear and the state is set initial one.
+        if (aKeyEvent.iRepeats)  
+            {
+            iCalcContainer->InputClearL();
+            }
+        // If Clear-key is pressed short, the latest input is deleted.
+        else   
+            {
+            OfferShortPressClearKeyEventL();
+            }
+        iEditorNumber = iEditLine.NumberL();
+        iCalcContainer->SetChangeSignEnableL();
+		iCalcContainer->SetSqrtEnableL();
+        iCalcContainer->SetClearKeyEnable();
+        		
+        if ( iCalcContainer->GetState() == CCalcView::EOperandAndOperator || 
+        	 iCalcContainer->GetState() == CCalcView::EOperandAndOperatorAndOperand ||
+        	 iEditorNumber == KZero )
+            iCalcContainer->SetPercentEnableL();
+        response = EKeyWasConsumed;
+        }
+        	
+    return response;
+    }
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcEditorSubPane::CCalcEditorSubPane()
+    {
+  
+    }
+
+// Second-phase constructor
+void CCalcEditorSubPane::ConstructL
+        (CCalcContainer* aContainer) 
+    {
+    // The state is set initial one.
+    // Number editor is set "0".
+    iEditLine.ClearL();
+    iEditorNumber = 0.0;
+
+    SetContainerWindowL(*aContainer);
+    
+    iCalcContainer = aContainer;  
+    // Load calc_display bitmap 
+    iCalcAppEnv = CCalcAppEnv::Static();
+    iCalcSideLDisplay = iCalcAppEnv->DisplaySideLBitmap();
+    iCalcCenterDisplay = iCalcAppEnv->DisplayCenterBitmap();
+    iCalcSideRDisplay = iCalcAppEnv->DisplaySideRBitmap();
+    iIsQwertyActive = 0;
+    User::LeaveIfError(iQwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive));
+  
+    // Try to get the English key mappings. If those are not available, use the 
+    // mappings of the current input language. The order is this because all mappings
+    // do not necessarily contain all characters neeeded by the Calculator.
+    iLanguage = ELangEnglish;
+    iEngine = CPtiEngine::NewL(ETrue);
+    iCoreLanguage = static_cast<CPtiCoreLanguage*>(iEngine->GetLanguage( iLanguage ));
+
+    if( !iCoreLanguage )
+        {
+        iCRKey = CRepository::NewL(KCRUidAknFep);
+        TInt ret = iCRKey->Get(KAknFepInputTxtLang,iLanguage);
+        if( ret!= KErrNone )
+            {
+            //Exit application if server is busy( Error Raised )
+            iAvkonViewAppUi->Exit();
+            }
+            iCoreLanguage = static_cast<CPtiCoreLanguage*>(iEngine->GetLanguage(iLanguage));
+        }
+    
+    RProperty::Get( KCRUidAvkon, KAknKeyBoardLayout, iKeyboardType );
+
+    if( iCoreLanguage )
+        {
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        if ( iKeyboardType == EPtiKeyboardHalfQwerty)
+           {
+           iHalfQwertyKeyMappings = static_cast<CPtiHalfQwertyKeyMappings*>(iCoreLanguage->GetHalfQwertyKeymappings());
+           }
+       else
+#endif
+          {
+          iQwertyKeyMappings = static_cast<CPtiQwertyKeyMappings*>(iCoreLanguage->GetQwertyKeymappings());
+          }
+        }
+    
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        
+    if ( iKeyboardType == EPtiKeyboardHalfQwerty )
+        { 
+        iEngine->ActivateLanguageL( iLanguage, EPtiEngineHalfQwerty );
+        }
+    else if ( IsQwertyKeypadActive())
+        { 
+        iEngine->ActivateLanguageL( iLanguage, EPtiEngineQwerty );
+        } 
+       
+  //      RProperty::Get( KCRUidAvkon, KAknKeyBoardLayout, iKeyboardType );
+        iEngine->SetKeyboardType( TPtiKeyboardType (iKeyboardType ));
+        
+#endif
+        
+    // UI language is used to determine the used number format.
+    iUiLanguage = User::Language();
+    iDecimalCounter = 0;
+    }
+    
+// ---------------------------------------------------------
+// CCalcEditorSubPane::IsQwertyActive
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::IsQwertyActive()
+    {
+    iIsQwertyActive = 1;
+    }
+    
+// ---------------------------------------------------------
+// CCalcEditorSubPane::IsQwertyNotActive
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::IsQwertyNotActive()
+    {
+    iIsQwertyActive = 0;
+    } 
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::ClearL
+// Clear 1 charactor from editor.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::ClearL()
+    {
+    iEditLine.ClearL();
+    }
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::SizeChanged
+// Size of control is set. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::SizeChanged()
+    {
+    TRect parentRect(iCalcContainer->Rect());
+    TRect EditorPaneRect(iCalcContainer->EditorPane()->Rect());
+    
+
+	if (!(AknLayoutUtils::ScalableLayoutInterfaceAvailable()))
+		{
+		iLayoutText[ECalcEditorOperandShadow].LayoutText(
+			parentRect,AppLayout::Calculator_texts_Line_1(),iCalcAppEnv->NumberShadowFont());
+		}
+
+
+                    
+     	if (AknLayoutUtils::ScalableLayoutInterfaceAvailable())
+			{
+                        if( iUiLanguage == ELangFarsi || iUiLanguage == ELangUrdu || iUiLanguage == ELangArabic
+                            || iUiLanguage == ELangHindi )
+				{
+				TAknTextLineLayout layout1; 
+			    if( AknLayoutUtils::PenEnabled() )
+    	        {
+    	            layout1	= AknLayoutScalable_Apps:: calc_display_pane_t1(enTouch_enabled).LayoutLine();
+    	        }
+    	        else
+    	        {
+    	            layout1	= AknLayoutScalable_Apps:: calc_display_pane_t1(enTouch_disabled).LayoutLine();    
+    	        }     
+				// Do this only in A&H etc. variants...
+				layout1.iFont &= 0xFFFFFFF0; // clear first 4 bits (font category)
+				layout1.iFont |= 0x00000001; // set first 4 bits to primary font category value (=1)					
+
+                // When the pen enable and the current screen is transverse,
+                // Enlarge the size of parent rect.
+                if ( AknLayoutUtils::PenEnabled() && Layout_Meta_Data::IsLandscapeOrientation() )
+                    {
+                    TRect enlargeEditorPaneRect;
+                    enlargeEditorPaneRect = EditorPaneRect;
+                    // Enlarging the parent rect, so that the editor could display a long number absolutely.
+                    enlargeEditorPaneRect.iBr.iX += EEnlargeFive;
+                    enlargeEditorPaneRect.iTl.iX -= EEnlargeTwenty;
+                    iLayoutText[ECalcEditorOperand].LayoutText( enlargeEditorPaneRect,
+					                                 layout1, iCalcAppEnv->NumberFont() );
+                    }
+                else
+                    {
+				iLayoutText[ECalcEditorOperand].LayoutText(EditorPaneRect,
+						layout1,iCalcAppEnv->NumberFont());
+                    }
+				}
+			else
+				{
+				 if( AknLayoutUtils::PenEnabled() )
+				 {
+                    // If the current screen is transverse,enlarge the size of parent rect.
+                    if ( Layout_Meta_Data::IsLandscapeOrientation() )
+                        {
+                        TRect enlargeEditorPaneRect;
+                        enlargeEditorPaneRect = EditorPaneRect;
+                        // Enlarging the parent rect, so that the editor could display a long number absolutely.
+                        enlargeEditorPaneRect.iBr.iX += EEnlargeFive;
+                        enlargeEditorPaneRect.iTl.iX -= EEnlargeTwenty;
+                        iLayoutText[ECalcEditorOperand].LayoutText( enlargeEditorPaneRect,
+                             AknLayoutScalable_Apps::calc_display_pane_t1( enTouch_enabled ).LayoutLine(), iCalcAppEnv->NumberFont() );
+                        }
+                    else
+                        {
+				    iLayoutText[ECalcEditorOperand].LayoutText(EditorPaneRect,
+					AknLayoutScalable_Apps::calc_display_pane_t1(enTouch_enabled).LayoutLine(),iCalcAppEnv->NumberFont());    
+                        }   
+				 }
+				 else
+				 {
+				    iLayoutText[ECalcEditorOperand].LayoutText(EditorPaneRect,
+					AknLayoutScalable_Apps::calc_display_pane_t1(enTouch_disabled).LayoutLine(),iCalcAppEnv->NumberFont());    
+				 }
+				}
+			}
+		else
+			{
+       		// Set layout for number
+    		iLayoutText[ECalcEditorOperand].LayoutText(
+            	parentRect,AppLayout::Calculator_texts_Line_2(),iCalcAppEnv->NumberFont());  
+       		}
+
+
+	if (!(AknLayoutUtils::ScalableLayoutInterfaceAvailable()))
+		{
+		iLayoutText[ECalcEditorOperatorShadow].LayoutText(
+			parentRect,AppLayout::Calculator_texts_Line_3(),iCalcAppEnv->OperatorShadowFont());   
+		}
+
+
+     if (AknLayoutUtils::ScalableLayoutInterfaceAvailable())
+		{
+    	    if( AknLayoutUtils::PenEnabled() )
+    	    {
+    	        iLayoutText[ECalcEditorOperator].LayoutText(EditorPaneRect,
+    			AknLayoutScalable_Apps::calc_display_pane_t2(enTouch_enabled).LayoutLine(),iCalcAppEnv->OperatorFont());
+    	    }
+    	    else
+    	    {
+    	        iLayoutText[ECalcEditorOperator].LayoutText(EditorPaneRect,
+    			AknLayoutScalable_Apps::calc_display_pane_t2(enTouch_disabled).LayoutLine(),iCalcAppEnv->OperatorFont());
+    	    }
+		}
+	
+	else
+       	{
+       		// Set layout for operator
+    	iLayoutText[ECalcEditorOperator].LayoutText(
+                parentRect,AppLayout::Calculator_texts_Line_4(),iCalcAppEnv->OperatorFont());   
+       	} 
+                        
+    if (AknLayoutUtils::ScalableLayoutInterfaceAvailable())
+		{
+		    if( AknLayoutUtils::PenEnabled() )
+		    {
+		        iLayoutText[ECalcEditorMemory].LayoutText(EditorPaneRect,
+				AknLayoutScalable_Apps::calc_display_pane_t3(enTouch_enabled).LayoutLine(),NULL);    
+		    }
+		    else
+		    {
+		        iLayoutText[ECalcEditorMemory].LayoutText(EditorPaneRect,
+				AknLayoutScalable_Apps::calc_display_pane_t3(enTouch_disabled).LayoutLine(),NULL);
+		    }
+		}
+	else
+		{
+		//	Set layout for memory indicator shadow
+		iLayoutText[ECalcEditorMemoryShadow].LayoutText(
+			parentRect,AppLayout::Calculator_texts_Line_5(),NULL);
+		// Set layout for memory indicator
+		iLayoutText[ECalcEditorMemory].LayoutText(
+			parentRect,AppLayout::Calculator_texts_Line_6(),NULL); 
+		}
+	
+	if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+		{               
+		TAknWindowLineLayout layoutOfDisplay;
+		if( AknLayoutUtils::PenEnabled() )
+		{
+		    layoutOfDisplay =  AknLayoutScalable_Apps:: bg_calc_display_pane(enTouch_enabled).LayoutLine();    
+		}
+		else
+		{
+		    layoutOfDisplay =  AknLayoutScalable_Apps:: bg_calc_display_pane(enTouch_enabled).LayoutLine();    
+		}
+		
+		TAknWindowLineLayout layoutOfSideLDisplay = AknLayoutScalable_Apps:: bg_calc_display_pane_g1().LayoutLine();              
+		TAknWindowLineLayout layoutOfCenterDisplay = AknLayoutScalable_Apps:: bg_calc_display_pane_g2().LayoutLine();             
+		TAknWindowLineLayout layoutOfSideRDisplay  = AknLayoutScalable_Apps:: bg_calc_display_pane_g3().LayoutLine();
+		TAknLayoutRect rectParent;
+		rectParent.LayoutRect(iCalcContainer->EditorPane()->Rect(),layoutOfDisplay) ;
+		iSideLDisplayLayout.LayoutRect(rectParent.Rect(),layoutOfSideLDisplay);
+		iCenterDisplayLayout.LayoutRect(rectParent.Rect(),layoutOfCenterDisplay);          
+		iSideRDisplayLayout.LayoutRect(rectParent.Rect(),layoutOfSideRDisplay);  
+		}
+    }
+
+
+// ---------------------------------------------------------
+// CCalcEditorSubPane::Draw
+// Drawing editor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcEditorSubPane::Draw
+              (const TRect& aRect) const   
+    {
+    // Get a graphics context
+     CWindowGc& gc = SystemGc();
+    gc.Clear(aRect);
+    gc.SetClippingRect(aRect);
+    // Draw calc_display outline
+    TRect rect(Rect()); 
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+	AknsDrawUtils::Background( skin, AknsDrawUtils::ControlContext(this), this, gc, rect );
+                                   
+    AknIconUtils::SetSize(iCalcSideLDisplay->Bitmap(),iSideLDisplayLayout.Rect().Size(),EAspectRatioNotPreserved);
+	AknIconUtils::SetSize(iCalcSideLDisplay->Mask(), iSideLDisplayLayout.Rect().Size(),EAspectRatioNotPreserved);  
+	
+	AknIconUtils::SetSize(iCalcCenterDisplay->Bitmap(),iCenterDisplayLayout.Rect().Size(),EAspectRatioNotPreserved);
+	AknIconUtils::SetSize(iCalcCenterDisplay->Mask(), iCenterDisplayLayout.Rect().Size(),EAspectRatioNotPreserved);        
+                    
+    AknIconUtils::SetSize(iCalcSideRDisplay->Bitmap(),iSideRDisplayLayout.Rect().Size(),EAspectRatioNotPreserved);
+	AknIconUtils::SetSize(iCalcSideRDisplay->Mask(), iSideRDisplayLayout.Rect().Size(),EAspectRatioNotPreserved);     
+
+	iSideLDisplayLayout.DrawImage(gc, iCalcSideLDisplay->Bitmap(),iCalcSideLDisplay->Mask());
+	iCenterDisplayLayout.DrawImage(gc,iCalcCenterDisplay->Bitmap(),iCalcCenterDisplay->Mask());
+	iSideRDisplayLayout.DrawImage(gc, iCalcSideRDisplay->Bitmap(),iCalcSideRDisplay->Mask());
+	
+	TRgb shadowcolor ;
+	AknsUtils::GetCachedColor( skin,shadowcolor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG31);
+	
+	TRgb color;
+    AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG30);
+    TBuf<256> keyvalue ;
+
+    if (iUiLanguage == ELangFarsi || iUiLanguage == ELangArabic 
+            || iUiLanguage == ELangHindi || iUiLanguage == ELangUrdu)
+	    {
+	    TPtrC number(iEditLine.NumberString());
+	    keyvalue.Append(number);
+	    AknTextUtils::LanguageSpecificNumberConversion  (keyvalue);
+	    }
+
+	if (!(AknLayoutUtils::ScalableLayoutInterfaceAvailable()))
+		{
+                    if ( iUiLanguage == ELangArabic || iUiLanguage == ELangUrdu )
+		    {
+		        TInt len = keyvalue.Length();
+			    TInt pos = KErrNotFound;
+			    TBuf<1> ch;
+			    ch.Append(iCalcAppEnv->MinusIndicator());
+			    if( (pos = keyvalue.Locate(iCalcAppEnv->MinusIndicator())) != KErrNotFound &&
+			         pos == keyvalue.LocateReverse(iCalcAppEnv->MinusIndicator()))
+			    {
+			     keyvalue.Delete( pos, 1 );
+			     keyvalue.Insert( 0, ch );	 
+			    }
+			iLayoutText[ECalcEditorOperandShadow].DrawText(gc, keyvalue,EFalse,shadowcolor);
+			}
+                    else if( iUiLanguage == ELangHindi || iUiLanguage == ELangFarsi )
+			{
+			 iLayoutText[ECalcEditorOperandShadow].DrawText(gc, keyvalue,EFalse,shadowcolor);	
+			}
+		else 
+			{
+			iLayoutText[ECalcEditorOperandShadow].DrawText(gc, iEditLine.NumberString(),EFalse,shadowcolor);	
+			}
+		}
+
+    if ( iUiLanguage == ELangArabic || iUiLanguage == ELangUrdu )
+	    {
+	        TInt len = keyvalue.Length();
+		    TInt pos = KErrNotFound;
+		    TBuf<1> ch;
+		    ch.Append(iCalcAppEnv->MinusIndicator());
+		    if( (pos = keyvalue.Locate(iCalcAppEnv->MinusIndicator())) != KErrNotFound &&
+		         pos == keyvalue.LocateReverse(iCalcAppEnv->MinusIndicator()))
+		    {
+		     keyvalue.Delete( pos, 1 );
+		     keyvalue.Insert( 0, ch );	 
+		    }
+	    iLayoutText[ECalcEditorOperand].DrawText(gc, keyvalue,EFalse,color);
+		}
+    else if( iUiLanguage == ELangHindi || iUiLanguage == ELangFarsi )
+		{
+	    iLayoutText[ECalcEditorOperand].DrawText(gc, keyvalue,EFalse,color);
+		}
+    else
+	    {
+		iLayoutText[ECalcEditorOperand].DrawText(gc, iEditLine.NumberString(),EFalse,color);
+		}
+
+	TCalcEditLine::TCalcOperatorType operatorType(
+		iEditLine.Operator());
+	TPtrC operatorString(
+		iCalcAppEnv->EditorOperator(operatorType));
+
+	if (!(AknLayoutUtils::ScalableLayoutInterfaceAvailable()))
+		{
+		iLayoutText[ECalcEditorOperatorShadow].DrawText(gc,operatorString,EFalse,shadowcolor);
+		}
+
+   	iLayoutText[ECalcEditorOperator].DrawText(gc, operatorString,EFalse,color);
+    CCalcDocument* calcDocument = 
+        STATIC_CAST(CCalcDocument*, iCalcAppEnv->AppUi()->Document());
+    if (calcDocument->HasMemory())
+        {
+        TPtrC mIndicatorShadow(
+            iCalcAppEnv->MemoryIndicatorShadow());
+        TPtrC mIndicator(iCalcAppEnv->MemoryIndicator());
+
+
+	if (!(AknLayoutUtils::ScalableLayoutInterfaceAvailable()))
+		{
+		iLayoutText[ECalcEditorMemoryShadow].DrawText(gc, mIndicatorShadow);
+		}
+
+
+        iLayoutText[ECalcEditorMemory].DrawText(gc, mIndicator);
+        }
+    }
+    
+// ---------------------------------------------------------
+// CCalcEditorSubPane::MapNumericChar
+// Redraw percent button, either normal or dimmed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//		
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+TBool CCalcEditorSubPane::MapDecimal( TKeyEvent aKeyEvent )
+    {
+    const TInt KMaxNumCharsPerCase = 50;
+    TBuf<KMaxNumCharsPerCase> keys;
+
+    TPtiKey aKey = ( TPtiKey )aKeyEvent.iScanCode;
+    if( !keys.Length() )
+            {
+            keys.Append( aKeyEvent.iCode );
+            }
+
+    if ( keys.Length() > 0 )
+        {
+        TUint16 firstChar = keys[0];
+        switch ( firstChar )		
+            {
+            case KPtiPinyinMarker:
+            case KPtiStrokeMarker:
+            case KPtiZhuyinMarker:
+            case KPtiCangjieMarker:
+            case KPtiGetAllMarker:
+            if ( keys.Length() > 1 )
+                {
+                firstChar = keys[1];
+                }
+            default:
+                break;
+            }
+        TInt loc = iAllowedDecimal.Locate( firstChar );
+
+                if ( ( loc != KErrNotFound ) )/*|| (HandleSpeciallyForChineseNubers(aKey, aCase)))*/
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+#else
+TBool CCalcEditorSubPane::MapDecimal( TPtiKey aKey, TPtiTextCase aCase )	
+    {
+    const TInt KMaxNumCharsPerCase = 50;
+    TBuf<KMaxNumCharsPerCase> keys;
+
+    iQwertyKeyMappings->GetDataForKey( aKey, keys, aCase );
+
+    if ( keys.Length() > 0 )
+        {
+        TUint16 firstChar = keys[0];
+        switch ( firstChar )
+            {
+            case KPtiPinyinMarker:
+            case KPtiStrokeMarker:
+            case KPtiZhuyinMarker:
+            case KPtiCangjieMarker:
+            case KPtiGetAllMarker:
+                if ( keys.Length() > 1 )
+                    {
+                    firstChar = keys[1];
+                    }
+            default:
+                break;
+            }
+        TInt loc = iAllowedDecimal.Locate( firstChar );
+
+                if ( ( loc != KErrNotFound ) )/*|| (HandleSpeciallyForChineseNubers(aKey, aCase)))*/
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+#endif
+	
+// ---------------------------------------------------------
+// CCalcEditorSubPane::EditPaneRect
+// This function gives the editor pane layout.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+
+TRect CCalcEditorSubPane::EditPaneRect()
+   {
+   TRect parentRect(Rect()); 
+   return 	parentRect;
+   }
+   
+// ---------------------------------------------------------
+// CCalcEditorSubPane::HandlePointerEventL
+// Handled when there is a pen input in EditorPane.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//   
+void CCalcEditorSubPane::HandlePointerEventL
+            ( const TPointerEvent& aPointerEvent )           
+    {
+    TRect memoryLayoutRect = iLayoutText[ECalcEditorMemory].TextRect();
+    CCalcDocument* calcDocument = 
+        STATIC_CAST( CCalcDocument*, iCalcAppEnv->AppUi()->Document() );
+    if( ( memoryLayoutRect.Contains( aPointerEvent.iPosition ) ) && ( calcDocument->HasMemory() ) )
+        {
+        // When we set the memory value to the editor, 
+        // We should change the menu item "Lase Result"'s flag to "EFalse".
+        iCalcContainer->View()->iLastResultSetected = EFalse;
+        iCalcContainer->View()->HandleMemoryRecallL();
+        }
+
+    }
+
+// End of file  CALCEDIT_CPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcEditline.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,376 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Helper class used by CalcDocument,CCalcContainer etc., 
+*                TCalcEditLine. 
+*                The numerical value and the character sequence of 
+*                the real number are held. Addition of a numerical character 
+*                sequence and which clear operation are performed.
+*
+*/
+
+
+
+// INCLUDE FILES  
+#include    "CalcDoc.h"
+#include    "CalcEditline.h"
+#include	"CalcEnv.h"
+
+
+//  LOCAL CONSTANTS AND MACROS  
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+TCalcEditLine::TCalcEditLine():
+                     iNumber(0), 
+                     iOperator(ECalcOperatorNone)
+    {
+    }
+
+TCalcEditLine::~TCalcEditLine()
+    {
+    }
+
+// Copy constructor
+TCalcEditLine::TCalcEditLine
+           (const TCalcEditLine& aEditLine) 
+    {
+    *this = aEditLine;
+    }
+
+// Assignment operator
+const TCalcEditLine& TCalcEditLine::operator=
+                       (const TCalcEditLine& aEditLine) 
+    {
+    iNumber = aEditLine.iNumber;
+    iOperator = aEditLine.iOperator;
+    return  *this;
+    }
+
+
+// ---------------------------------------------------------
+// TCalcEditLine::AllClear
+// This function exists because long-press clear-key event is executed. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::AllClear()
+    {
+    iNumber.Zero();
+    iOperator = ECalcOperatorNone;
+    }
+
+// ---------------------------------------------------------
+// TCalcEditLine::ClearL
+// This function exists because short-press clear-key event is executed. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::ClearL()
+    {
+    TInt length(iNumber.Length());
+    if (length > 1)
+        {
+        CCalcAppEnv* env = CCalcAppEnv::Static();
+        TChar minusIndicator(env->MinusIndicator());
+        if (iNumber[0] == (TUint) minusIndicator && // Casted for THUMB build
+            length == 2)
+            {
+            SetNumber(0);
+            }
+        else
+            {
+            iNumber.Delete(length - 1, 1);
+            length--;
+            if (length == 2 && iNumber[0] == (TUint) minusIndicator &&
+                                             // Casted for THUMB build
+                NumberL() == 0.0)
+                {
+                SetNumber(0);
+                }
+            }
+        }
+    else
+        {
+        SetNumber(0);
+        }
+    }
+
+
+// ---------------------------------------------------------
+// TCalcEditLine::ClearOperand
+// Set number of editor "0".  
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::ClearOperand()
+    {
+    SetNumber(0);
+    }
+
+// ---------------------------------------------------------
+// TCalcEditLine::NumberL
+// Convert from TBuf<> to number.    
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TReal64 TCalcEditLine::NumberL() const
+    {
+    TLex  lex(iNumber);
+    TReal64  data;
+    TInt errorCode(lex.Val(data));
+    // Converting is failed. 
+    if (errorCode)
+        {
+        User::Leave(errorCode);
+        }
+    return  data;
+    }
+
+// ---------------------------------------------------------
+// TCalcEditLine::SetNumber
+// Convert from number to TBuf<>.    
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::SetNumber
+                (TReal64 aNumber)
+    {
+    // Set data format. 
+    TRealFormat realFormat( KCalcMaxEditNumberWidth, KCalcMaxDigits );
+    if ( aNumber >= 0 )
+        {
+        realFormat.iWidth--;
+        }
+    realFormat.iType = KRealFormatNoExponent;
+    realFormat.iTriLen = 0;  //  Delimit character is nothing
+    CCalcAppEnv* env = CCalcAppEnv::Static();
+    TChar separator(env->DecimalSeparator());
+    realFormat.iPoint = separator;
+
+    TInt code = iNumber.Num(aNumber, realFormat);
+    
+    if(KErrOverflow == code || KErrUnderflow == code)
+	    {
+	    // Set data format 
+	    TRealFormat realFormat(KCalcMaxNumberWidth);  
+	    if ( aNumber >= 0 )
+	        {
+	        realFormat.iWidth--;
+	        }
+	    realFormat.iType = KRealFormatExponent;
+	    realFormat.iPlaces = 3;
+	    realFormat.iTriLen = 0;  //  Delimit character is nothing
+	    CCalcAppEnv* env = CCalcAppEnv::Static();
+	    TChar separator(env->DecimalSeparator());
+	    realFormat.iPoint = separator;
+        code = iNumber.Num(aNumber, realFormat);
+	    }
+	   
+	  switch (code)
+        {
+        case KErrOverflow:
+            {
+            TRAP_IGNORE( User::Leave( KErrOverflow ) );  
+            break;
+            }
+        case KErrUnderflow:
+            {
+            iNumber.Num(0,0);
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// TCalcEditLine::AppendL
+// This function exists to handle numeric or "#" key event.    
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::AppendL
+               (TChar aInput) // Input type is digit or decimal point only  
+    {
+    //  Check whether editline is not full
+    if ( iNumber.Length() < KCalcMaxNumberWidth )
+        {
+        if ( aInput.IsDigit() )
+            {
+            if ( NumberDigits() < KCalcMaxDigits )
+                {
+                if (CheckZeroL())  
+                    {
+                    iNumber.Zero();
+                    }
+                iNumber.Append(aInput);
+                }
+            else
+                {
+                // If editor space is full, error code returned.
+                User::Leave(KCalcErrEditorSpaceFull); 
+                }
+            }
+        // If decimal point do not exist, decimal point is added 
+        // But editor has 8 dights, decimal point is not added.
+        else 
+            {
+            CCalcAppEnv* env = CCalcAppEnv::Static();
+            TChar separator(env->DecimalSeparator());
+            if ( iNumber.Length() )
+                {
+                if ( iNumber.Locate(separator) == KErrNotFound )
+                    {
+                    if (NumberDigits() < KCalcMaxDigits)
+                        {
+                        iNumber.Append(separator);
+                        }
+                    }
+                }
+            else
+                {
+                SetNumber(0);  
+                iNumber.Append(separator);
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// TCalcEditLine::AppendNumberString
+// This function appends a character after the number.
+// Used for example in percent calculations.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::AppendNumberStringL
+				(TChar aChar)
+	{
+	//  This kind of a paranoid check as when this function
+	//  is called the amount of digits can never be more
+	//  than 8. Because the iNumber is going
+	//  to the output sheet we can display 10 characters
+	//  8 digits + operator + aChar
+    if ( NumberDigits() < KCalcMaxDigits + 1 )
+        { 
+			iNumber.Append(aChar);
+        }
+    else
+        {
+			// If editor space is full, error code returned.
+            User::Leave(KCalcErrEditorSpaceFull); 
+         }
+	}
+
+// ---------------------------------------------------------
+// TCalcEditLine::ChangeSignL
+// This function exists to handle "Change Sign" command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::ChangeSignL()
+    {
+    TInt length(iNumber.Length()); 
+
+    // If the number is zero or empty, this command is ignored
+    if ((length > 0) && (NumberL() != 0.0))
+        {
+        CCalcAppEnv* env = CCalcAppEnv::Static();
+        TChar minusIndicator(env->MinusIndicator());
+        // If the number is less than zero, '-' is deleted.
+        if ( iNumber[0] == (TUint) minusIndicator ) // Casted for THUMB build
+            {
+            iNumber.Delete(0, 1);
+            }
+        // Case number is more than zero.
+        else
+            {
+            TBuf<1> buf;
+            buf.Append(minusIndicator);
+            iNumber.Insert(0, buf);
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// TCalcEditLine::TrimZeroL
+// If number of editor is "iii.ddd000...", set number "iii.ddd".
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::TrimZeroL() 
+    {
+    TReal64 realValue(NumberL());
+    SetNumber(realValue);
+    }
+
+
+// ---------------------------------------------------------
+// TCalcEditLine::CheckZero
+// For checking that editline is cleared. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool TCalcEditLine::CheckZeroL() const
+    {
+    return ((iNumber.Length() == 1) && (NumberL() == 0.0));
+    }
+
+// ---------------------------------------------------------
+// TCalcEditLine::ChangeDecimal
+// Changing decimal separator.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TCalcEditLine::ChangeDecimal(TChar aOld, TChar aNew)
+    {
+    TInt pos(iNumber.Locate(aOld));
+
+    if (pos != KErrNotFound)
+        {
+        iNumber[pos] = (TUint16) aNew;
+        }
+    }
+        
+
+// ---------------------------------------------------------
+// TCalcEditLine::NumberDigits
+// To count of digits in a line
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt TCalcEditLine::NumberDigits() const
+    {
+    TInt len(iNumber.Length());
+    TInt num(0);
+    for (TInt i(0); i < len; ++i)
+        {
+        TChar onechar(iNumber[i]);
+        if (onechar.IsDigit())
+            {
+            ++num;
+            }
+        }
+    return num;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcEnv.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,572 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Global data class, CCalcAppEnv, derived from CBase
+*                This class maintain global data. e.g font, bitmap.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <barsread.h> // resource reader
+#include <eikapp.h>
+#include <eikenv.h>
+#include <eikrutil.h> 
+#include <fbs.h>    // Fonts
+#include <AknUtils.h>
+
+//Extended Icon Skin Implementation
+#include  <AknsConstants.h>
+#include <AknsUtils.h>
+#include <AknsItemID.h>
+
+#include <Calcsoft.rsg>
+#include <calcsoft.mbg>
+#include "CalcEnv.h"
+#include "CalcAppUi.h"
+
+//  LOCAL CONSTANTS AND MACROS  
+
+// ================= MEMBER FUNCTIONS =======================
+// Two-phased constructor.
+CCalcAppEnv* CCalcAppEnv::NewL
+(CCalcAppUi* aAppUi)    
+	{
+	CCalcAppEnv* self = new (ELeave) CCalcAppEnv(aAppUi);
+	CleanupStack::PushL(self);
+	self->ConstructAppEnvL();
+	CleanupStack::Pop(self);
+	// Set to TLS(Thread Local Storage).
+	UserSvr::DllSetTls(67338721, self); 
+
+	return self;     	
+	}
+
+void CCalcAppEnv::InitializeAppUI(CCalcAppUi* aAppUi)
+	{
+	iAppUi = aAppUi;
+	}
+
+
+// Destructor
+CCalcAppEnv::~CCalcAppEnv()
+	{
+	// Text
+	delete iEditorOperArray;
+	delete iOutSheetOperArray;
+#ifdef __SCALABLE_ICONS
+	delete  iResultsLineBitmap;
+#endif
+
+
+	// Bitmap
+    	delete iDisplaySideLBitmap;
+		delete iDisplayCenterBitmap;
+		delete iDisplaySideRBitmap;
+		
+	delete iPaperBitmap;
+	for(TInt Cnt=0;Cnt<9;Cnt++)
+		{
+	delete iScalablePaperBitmap[Cnt];
+		} 
+    
+	// font 
+	// free font for number and operator
+	CBitmapDevice* device = iEnv->ScreenDevice();
+	device->ReleaseFont(iNumberShadowFont);
+	device->ReleaseFont(iNumberFont);
+	device->ReleaseFont(iOperatorShadowFont);
+	device->ReleaseFont(iOperatorFont);
+	device->ReleaseFont(iOutSheetOperatorFont);
+
+   
+	//Extended Icon Skin Implementation
+		iAknsConstArray.Close();
+		iAknsConstArrayForPaper.Close();
+	}
+
+
+// ---------------------------------------------------------
+// CCalcAppEnv::Static
+// Return value of thread-local storage.
+// This value is set pointer of CCalcAppEnc class in CCalcAppEnv::NewL().  
+// (other items were commented in a header).  
+// ---------------------------------------------------------
+//
+CCalcAppEnv* CCalcAppEnv::Static()
+	{
+	return REINTERPRET_CAST(CCalcAppEnv*, UserSvr::DllTls(67338721)); 
+	}
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+
+CCalcAppEnv::CCalcAppEnv()
+	{
+	}
+	
+
+CCalcAppEnv::CCalcAppEnv
+(CCalcAppUi* aAppUi)  
+: iAppUi(aAppUi)
+	{
+	}
+
+// Second-phase constructor
+void CCalcAppEnv::ConstructAppEnvL()
+	{
+	iEnv = CEikonEnv::Static();
+
+	// Read char code for operator.
+	TResourceReader editOperRr;
+	iEnv ->CreateResourceReaderLC(
+		editOperRr, R_CALC_EDITOR_OPERATOR_ARRAY);
+	TResourceReader osheetOperRr;
+	iEnv->CreateResourceReaderLC(
+		osheetOperRr, R_CALC_OUTSHEET_OPERATOR_ARRAY);
+
+	editOperRr.ReadInt16(); // Read count of items
+	osheetOperRr.ReadInt16(); // Read count of items
+
+	iEditorOperArray = 
+		new (ELeave) CDesCArrayFlat(KCalcCountOfOperatorType);
+	iOutSheetOperArray = 
+		new (ELeave) CDesCArrayFlat(KCalcCountOfOperatorType);
+
+	TChar editorOper;
+	TChar outSheetOper;
+
+	for (TInt cnt(0); cnt < KCalcCountOfOperatorType; cnt++)
+		{
+		editorOper = editOperRr.ReadUint16();
+		outSheetOper = osheetOperRr.ReadUint16();
+		TBuf<1> editorOperBuf;
+		TBuf<1> outSheetOperBuf; 
+		editorOperBuf.Append(editorOper);
+		outSheetOperBuf.Append(outSheetOper);
+		iEditorOperArray->AppendL(editorOperBuf); 
+		iOutSheetOperArray->AppendL(outSheetOperBuf);
+		}
+
+	CleanupStack::PopAndDestroy(2); // editOperRr, osheetOperRr
+
+
+	// TLocale::DecimalSeparator() must be used when decimal separator is get.  
+	TLocale locale;
+	iDecimalSeparator = locale.DecimalSeparator();
+
+	TBuf<1> buf;
+	iEnv->ReadResourceL(buf, R_CALC_MINUS_INDICATOR);
+	iMinusIndicator = buf[0];
+	iEnv->ReadResourceL(iMemoryIndicator, R_CALC_STTUS_SAVED_TO_MEM);
+	iEnv->ReadResourceL(iMemoryIndicatorShadow, R_CALC_STTUS_SAVED_TO_MEM_SHA);
+
+	CEikApplication* app = iEnv->EikAppUi()->Application();
+	TFileName bmpPath(app->BitmapStoreName());
+
+	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+	CFbsBitmap* bitmap = NULL;
+	CFbsBitmap* mask	= NULL;
+
+	//Ext Icon Skinning implementation for Display
+	
+	AknsUtils::CreateIconL(skin,KAknsIIDQsnFrCalcDisplaySideL,bitmap,mask,bmpPath,
+		EMbmCalcsoftQsn_fr_calc_display_side_l, EMbmCalcsoftQsn_fr_calc_display_side_l_mask);
+		
+		iDisplaySideLBitmap = CGulIcon::NewL(bitmap, mask);
+			bitmap = NULL;
+			mask	= NULL;
+		
+		
+	AknsUtils::CreateIconL(skin,KAknsIIDQsnFrCalcDisplayCenter,bitmap,mask,bmpPath,
+		EMbmCalcsoftQsn_fr_calc_display_center, EMbmCalcsoftQsn_fr_calc_display_center_mask);
+			
+		iDisplayCenterBitmap = CGulIcon::NewL(bitmap, mask);
+			bitmap = NULL;
+			mask	= NULL;
+		
+	AknsUtils::CreateIconL(skin,KAknsIIDQsnFrCalcDisplaySideR,bitmap,mask,bmpPath,
+		EMbmCalcsoftQsn_fr_calc_display_side_r, EMbmCalcsoftQsn_fr_calc_display_side_r_mask);
+			
+		iDisplaySideRBitmap = CGulIcon::NewL(bitmap, mask);
+
+	//Ext Icon Skinning implementation for Paper
+	bitmap = NULL;
+	mask	= NULL;
+	AknsUtils::CreateIconL(skin,KAknsIIDQgnGrafCalcPaper,bitmap,mask,bmpPath,
+		EMbmCalcsoftQgn_graf_calc_paper,EMbmCalcsoftQgn_graf_calc_paper_mask);
+	iPaperBitmap = CGulIcon::NewL(bitmap, mask);
+
+	bitmap = NULL;
+	mask	= NULL;
+
+#ifdef __SCALABLE_ICONS
+	AknsUtils::CreateIconL(skin,KAknsIIDQgnGrafCalcResultsLine, bitmap,mask,bmpPath,
+		EMbmCalcsoftQgn_graf_calc_results_line,EMbmCalcsoftQgn_graf_calc_results_line_mask);
+	iResultsLineBitmap = CGulIcon::NewL(bitmap, mask);
+#endif
+	bitmap = NULL;
+	mask	= NULL; 
+	iIsSkinChanged = EFalse;
+	UpdateAknConstArrayforPaper();
+	LoadPaperBitmapsL();
+
+	UpdateAknConstArray();
+
+	LoadFuncMapBitmapL();
+
+
+	}
+
+
+// ---------------------------------------------------------
+// CCalcAppEnv::LoadPaperBitmapsL
+// Load bitmaps for Paper Pane.  
+// (other items were commented in a header).  
+// ---------------------------------------------------------
+//
+ void CCalcAppEnv::LoadPaperBitmapsL()
+	{
+	CEikApplication* app = iEnv->EikAppUi()->Application();
+	TFileName bmpPath(app->BitmapStoreName());
+	TInt startBitmapId = EMbmCalcsoftQsn_fr_calc_paper_center;
+	TInt startMaskId = EMbmCalcsoftQsn_fr_calc_paper_center_mask;
+	TInt startIndex=0;
+	TInt count = 9;
+	TInt bmpId(startBitmapId);
+	TInt maskId(startMaskId);
+
+	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+	CFbsBitmap* bitmap = NULL;
+	CFbsBitmap* mask	= NULL; 
+
+	for (TInt cnt(startIndex); cnt < (count + startIndex); cnt++)
+		{
+
+		AknsUtils::CreateIconL(skin, (iAknsConstArrayForPaper)[cnt],bitmap,mask,
+					bmpPath, bmpId, maskId);
+
+		if(!iIsSkinChanged)
+			{
+			iScalablePaperBitmap[cnt] = CGulIcon::NewL(bitmap, mask);
+			}
+		else
+			{
+			iScalablePaperBitmap[cnt]->SetBitmap(bitmap);
+			iScalablePaperBitmap[cnt]->SetMask(mask);
+			}
+		bmpId = bmpId + 2;
+		maskId = maskId + 2;
+		}
+	}
+
+// ---------------------------------------------------------
+// CCalcAppEnv::LoadFuncMapBitmapL
+// Load bitmaps for FunctionMap SubPane.  
+// (other items were commented in a header).  
+// ---------------------------------------------------------
+//
+void CCalcAppEnv::LoadFuncMapBitmapL()
+	{
+
+	CEikApplication* app = iEnv->EikAppUi()->Application();
+	TFileName bmpPath(app->BitmapStoreName());
+
+	if(iIsSkinChanged) //EISkin2.6
+		{
+		MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+		CFbsBitmap* bitmap = NULL;
+		CFbsBitmap* mask	= NULL;
+
+		//Ext Icon Skinning implementation for Display
+		
+	AknsUtils::CreateIconL(skin,KAknsIIDQsnFrCalcDisplaySideL,bitmap,mask,bmpPath,
+		EMbmCalcsoftQsn_fr_calc_display_side_l, EMbmCalcsoftQsn_fr_calc_display_side_l_mask);
+		
+		iDisplaySideLBitmap->SetBitmap(bitmap);
+		iDisplaySideLBitmap->SetMask(mask);
+		
+			bitmap = NULL;
+			mask	= NULL;
+		
+		
+	AknsUtils::CreateIconL(skin,KAknsIIDQsnFrCalcDisplayCenter,bitmap,mask,bmpPath,
+		EMbmCalcsoftQsn_fr_calc_display_center, EMbmCalcsoftQsn_fr_calc_display_center_mask);
+			
+		iDisplayCenterBitmap->SetBitmap(bitmap);
+		iDisplayCenterBitmap->SetMask(mask);
+		
+			bitmap = NULL;
+			mask	= NULL;
+		
+	AknsUtils::CreateIconL(skin,KAknsIIDQsnFrCalcDisplaySideR,bitmap,mask,bmpPath,
+		EMbmCalcsoftQsn_fr_calc_display_side_r, EMbmCalcsoftQsn_fr_calc_display_side_r_mask);
+			
+	iDisplaySideRBitmap->SetBitmap(bitmap);
+	iDisplaySideRBitmap->SetMask(mask);
+			
+		//Ext Icon Skinning implementation for Paper
+		bitmap = NULL;
+		mask	= NULL;
+		AknsUtils::CreateIconL(skin,KAknsIIDQgnGrafCalcPaper,bitmap,mask,bmpPath,
+			EMbmCalcsoftQgn_graf_calc_paper,EMbmCalcsoftQgn_graf_calc_paper_mask);
+	
+		iPaperBitmap->SetBitmap(bitmap);
+		iPaperBitmap->SetMask(mask);
+		bitmap = NULL;
+		mask	= NULL;
+#ifdef __SCALABLE_ICONS
+		AknsUtils::CreateIconL(skin,KAknsIIDQgnGrafCalcResultsLine, bitmap,mask,bmpPath,
+		EMbmCalcsoftQgn_graf_calc_results_line,EMbmCalcsoftQgn_graf_calc_results_line_mask);
+		
+		iResultsLineBitmap->SetBitmap(bitmap);
+		iResultsLineBitmap->SetMask(mask);
+#endif
+		bitmap = NULL;
+		mask	= NULL;
+		LoadPaperBitmapsL();
+		}
+
+	if(!iIsSkinChanged)
+	{
+		
+	
+		if( AknLayoutUtils::PenEnabled() )
+	    {
+	            
+	        
+	        LoadBitmapForFuncMapL(
+			EMbmCalcsoftQgn_indi_calc_cancel,
+	    	EMbmCalcsoftQgn_indi_calc_cancel_mask,
+		    0, 
+		    KCountOfButtonsTouch, iUnpressedButtonBmp, ENORMAL);
+	    }
+
+		else
+	    {
+	        LoadBitmapForFuncMapL(
+			EMbmCalcsoftQgn_indi_calc_button_plus,
+	    	EMbmCalcsoftQgn_indi_calc_button_plus_mask,
+		    0, 
+		    KCountOfButtons, iUnpressedButtonBmp, ENORMAL);
+		    
+		    LoadBitmapForFuncMapL(
+			EMbmCalcsoftQgn_indi_calc_button_plus_pressed,
+	    	EMbmCalcsoftQgn_indi_calc_button_plus_pressed_mask,
+		    0, 
+		    KCountOfButtons, iPressedButtonBmp, EPRESSED);
+		    
+	    }	
+	}
+
+	}
+
+// ---------------------------------------------------------
+// CCalcAppEnv::UpdateAknConstArrayForFuncmap
+// Update array for function map.  
+// (other items were commented in a header).  
+// ---------------------------------------------------------
+//
+void CCalcAppEnv::UpdateAknConstArrayForFuncMap()
+    {
+    UpdateAknConstArray();
+    }
+	    
+// ---------------------------------------------------------
+// CCalcAppEnv::LoadBitmapForFuncMapButtonL
+// Load bitmaps for FunctionMap button.  
+// (other items were commented in a header).  
+// ---------------------------------------------------------
+//
+
+void CCalcAppEnv::LoadBitmapForFuncMapL(TInt aStartBitmapId, TInt aStartMaskId, TInt aStartIndex,
+	TInt aCount, CGulIcon* aBitmapArray[], ButtonType aType)
+	{
+	CEikApplication* app = iEnv->EikAppUi()->Application();
+	TFileName bmpPath(app->BitmapStoreName());
+	TInt bmpId(aStartBitmapId);
+	TInt maskId(aStartMaskId);
+
+	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+	CFbsBitmap* bitmap = NULL;
+	CFbsBitmap* mask	= NULL;
+
+    // Get the text color of theme
+    TRgb iconColor;
+    AknsUtils::GetCachedColor( skin, iconColor, 
+        KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG29 );
+    
+	for (TInt cnt(aStartIndex); cnt < (aCount + aStartIndex); cnt++)
+		{
+		switch(aType)
+			{
+			case EPRESSED:
+				{
+    				if(!AknLayoutUtils::PenEnabled() )
+    				{
+    				    AknsUtils::CreateIconL(skin,(iAknsConstArray)[cnt + KCalcCountOfButtonPressed],bitmap,mask,
+    					bmpPath, bmpId, maskId);    
+    					
+    				}
+				}
+			break;
+			case ENORMAL:
+				{
+				    if(!AknLayoutUtils::PenEnabled() )
+				    {
+				        AknsUtils::CreateIconL(skin,(iAknsConstArray)[cnt],bitmap,mask,
+					    bmpPath, bmpId, maskId);        
+				    }
+                    else
+                    {
+                        AknsUtils::CreateIconL(skin,(iAknsConstArray)[cnt]/*KAknsIIDQgnIndiCalcAdd*/,bitmap,mask,
+                        bmpPath, bmpId, maskId);
+                        // Set the color of icons
+                        AknIconUtils::SetIconColor( bitmap, iconColor );
+                    }
+				
+				}
+			break;
+			case EACTIVE_INACTIVE:
+				{
+				AknsUtils::CreateIconL(skin,(iAknsConstArray)[cnt + KCalcCountOfButtonInactive],bitmap,mask,
+					bmpPath, bmpId, maskId);
+				}
+			break;
+			default:
+				break;
+
+			}
+
+		CGulIcon* icon = CGulIcon::NewL(bitmap, mask);
+		aBitmapArray[cnt] = icon;
+			
+		bmpId = bmpId + 2;
+		maskId = maskId + 2;
+		}
+
+	}
+
+//---------------------------------------------------------
+// CCalcAppEnv::UpdateAknConstArrayforPaper
+//Updates the array with avkon skin constant Ids for paper bitmaps.   
+// ---------------------------------------------------------
+//
+   void CCalcAppEnv::UpdateAknConstArrayforPaper()
+	{
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperCenter);
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperCornerTl);
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperCornerTr);
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperCornerBl);
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperCornerBr);
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperSideT);
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperSideB);
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperSideL);
+	iAknsConstArrayForPaper.Append(KAknsIIDQsnFrCalcPaperSideR); 
+	
+	}
+
+//---------------------------------------------------------
+// CCalcAppEnv::UpdateAknConstArray
+//Updates the array with avkon skin constant Ids for bitmaps.   
+// ---------------------------------------------------------
+//
+void CCalcAppEnv::UpdateAknConstArray()
+    {
+    iAknsConstArray.Reset();
+    if( AknLayoutUtils::PenEnabled() )
+    {
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcCancel );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcSeven );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcFour );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcOne );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcZero );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcSquareroot );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcEight );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcFive );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcTwo );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcSeparator );  
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcPercent );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcNine );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcSix );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcThree );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcSign );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcDivide );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcMultiply );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcSubtract );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcAdd );
+    iAknsConstArray.Append( KAknsIIDQgnIndiCalcEquals );
+    }
+    else
+    {
+    //Akn Const for +, -, *, /....etc 0-9
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonPlus);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonMinus);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonMultiply);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonDivide);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonSign);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonEquals);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonSquareroot);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonPercent);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonUp);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonDown);
+
+
+    //Akn Const for pressed +, -, *, /....etc  10-19
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonPlusPressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonMinusPressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonMultiplyPressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonDividePressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonSignPressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonEqualsPressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonSquarerootPressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonPercentPressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonUpPressed);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonDownPressed);
+
+    //Akn Const for Active/ Inactive icons 20-24
+    /*iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonSignInactive);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonSignInactive);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonSquarerootInactive);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonPercentInactive);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonUpInactive);
+    iAknsConstArray.Append(KAknsIIDQgnIndiCalcButtonDownInactive);*/
+    //}
+    }
+    }   
+//EISkin2.6
+//-----------------------------------------------------------
+//CCalcAppEnv::LoadFuncMapBitmapSkinChangeL
+//Loads the function map Icons when the skin changes
+//-----------------------------------------------------------
+//
+void CCalcAppEnv::LoadFuncMapBitmapSkinChangeL()
+	{
+	iIsSkinChanged = ETrue;
+	LoadFuncMapBitmapL();
+	}
+
+
+//-----------------------------------------------------------
+//CCalcAppEnv::SetSkinChangedValue
+//Sets if the skin is changed or not
+//-----------------------------------------------------------
+	
+void CCalcAppEnv::SetSkinChangedValue(TBool aValue)
+{
+	iIsSkinChanged = aValue;
+}
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcFunc.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,2048 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  The Function-Map subpane class, CCalcFuncmapSubPane
+*                Derived from CCoeControl.
+*                CCalcFuncmapSubPane is container class of CCalcCommandButton.
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include <AknUtils.h>
+#include <aknViewAppUi.h>
+
+#include <AknsSkinInstance.h> 
+#include <aknpopuplayout.h> 
+#include <Calcsoft.rsg>
+#include <layoutmetadata.cdl.h>
+#include "CalcFunc.h"
+//#include "CalcCmdBtn.h"
+#include "CalcEnv.h"
+#include "CalcCont.h"
+#include "CalcView.h"
+#include "CalcOutSheet.h"
+#include "calc.hrh"
+#include "CalcDrawingConst.laf"
+#include "CalcView.h"
+#include <applayout.cdl.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <AvkonInternalCRKeys.h>
+#include <PtiDefs.h>
+#include <PtiEngine.h>
+#include <PtiKeyMappings.h>
+#include <AknFepInternalCRKeys.h>
+#include <aknbutton.h>
+#include <AknsDrawUtils.h>
+#include <aknnotewrappers.h> 
+#include <featmgr.h>      // Feature Manager
+
+//enum to hold the values of button states
+enum
+{
+    EnNormal = 0,
+    EnPressed,
+    EnDimmed
+};
+//  LOCAL CONSTANTS AND MACROS  
+const TInt KButtonsInColumn(2);      // The number of column of a button
+const TInt KButtonsInRow(KCountOfButtons / KButtonsInColumn);
+const TInt KButtonsInColumnTouch(4);      // The number of column of a button in Touch layout
+const TInt KButtonsInRowTouch(KCountOfButtonsTouch / KButtonsInColumnTouch);
+                                     // The number of row of a button
+const TInt KButtonsIdTblTouch[] =         // The command ID of a button in Touch Layout
+               { 
+               ECalcCmdCancel,          // C
+               ECalcCmdSeven,          // 7
+               ECalcCmdFour,          // 4
+               ECalcCmdOne,          // 1
+               ECalcCmdZero,          // 0
+               ECalcCmdSqrt,          // Sqrt
+               ECalcCmdEight,          // 8
+               ECalcCmdFive,          // 5
+               ECalcCmdTwo,          // 2
+               ECalcCmdSeparator,          // .
+               ECalcCmdPercent,         // %    
+               ECalcCmdNine,          // 9
+               ECalcCmdSix,          // 6
+               ECalcCmdThree,          // 3
+               ECalcCmdChangeSign,   // +/- 
+               ECalcCmdDivide,       // /
+               ECalcCmdMultiply,     // *
+               ECalcCmdSubtract,     // -
+               ECalcCmdAdd,          // +
+               ECalcCmdResult       // =
+                };
+                
+const TInt KButtonsIdTbl[] =         // The command ID of a button in non Touch Layout
+               { 
+               ECalcCmdAdd,          // +
+               ECalcCmdSubtract,     // -
+               ECalcCmdMultiply,     // *
+               ECalcCmdDivide,       // /
+               ECalcCmdChangeSign,   // +/- 
+               ECalcCmdResult,       // =
+               ECalcCmdSqrt,          // Sqrt
+               ECalcCmdPercent,         // %
+               ECalcCmdScrollUp,     // Scroll-up
+               ECalcCmdScrollDown    // Scroll-down
+                };
+
+
+// If const TChar is used, complie error occurs in THUMB build.
+// To avoid this, #define is used.
+#define KCalcAsteriskBtn '*'
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Two-phased constructor.
+CCalcFuncmapSubPane* CCalcFuncmapSubPane::NewL(
+                     CCalcContainer* aContainer)
+    {
+    CCalcFuncmapSubPane* self = new (ELeave) CCalcFuncmapSubPane();
+    CleanupStack::PushL(self);
+    self->ConstructL(aContainer);
+    CleanupStack::Pop(self); 
+    return self;
+    }
+
+
+// Destructor
+CCalcFuncmapSubPane::~CCalcFuncmapSubPane()
+    {
+        for (TInt count(0); count < KCountOfButtonsTouch; count++)
+            {
+                if(iButtons[count])
+                {
+                     delete iButtons[count];    
+                }
+                
+            }
+   
+    // delete of button controls
+       iQwertyModeStatusProperty.Close();
+       delete iEngine;
+       delete iCRKey;
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetScrollupEnable
+// \ scroll up and down button on scrolling enable.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::RedrawScrollButtons()
+    {
+    CCalcOutputSheet* outputSheet = iContainer->OutputSheet();
+    SetScrollupEnable(outputSheet->CanUp());
+    SetScrolldownEnable(outputSheet->CanDown());
+    }
+
+
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetChangeSignEnable
+// Redraw ChangeSign button on ChangeSign enable.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetChangeSignEnable
+                            (TBool aEnable)
+    {
+
+                /*Get the selected pointer 
+                button -> different layouts, different values*/
+        CAknButton* button = NULL;
+        if( AknLayoutUtils::PenEnabled() )
+        {
+            button = iButtons[ECmdTChangeSign];
+        }
+        else
+        {
+            button = iButtons[EChangeSignButton];
+        }
+        
+        //Set to dimmed state
+        button->SetDimmed( !aEnable );
+        button->DrawNow();
+        iIsChangeSignDimmed = aEnable;
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetClearKeyEnable
+// Redraw ClearKey button on ClearKey enable.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetClearKeyEnable( TBool aEnable )
+    {
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        CAknButton* button = NULL;
+        button = iButtons[ECmdTCancel];
+
+        if ( button )
+            {
+            button->SetDimmed( !aEnable );   
+            button->DrawNow();
+            }      
+        }
+    iIsClearKeyEnabled = aEnable;
+   }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::NotifyTimeoutL
+// If no key is pressed until timeout of *-key,
+// this function is called.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::NotifyTimeoutL()
+    {
+
+      /*Get the selected pointer 
+        button -> different layouts, different values*/
+    CAknButton* button = iButtons[iSelected];    
+    if( !AknLayoutUtils::PenEnabled() )
+        {
+#ifdef RD_INTELLIGENT_TEXT_INPUT  
+        if ( iKeyboardType == EPtiKeyboardHalfQwerty )
+            {
+            if( ( iLastKeyCode == EStdKeyLeftShift && iDecimalPoint ) || ( iLastKeyCode == EStdKeyLeftFunc && iDecimalPoint ))
+                {
+                iContainer->SetSeparatorFromTouchL();
+                }
+            else
+                {
+                iContainer->View()->HandleCommandL( KButtonsIdTbl[iSelected] );
+                }
+            }
+        else
+#endif
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[iSelected] );
+            }
+        }
+    else
+        {
+        iContainer->View()->HandleCommandL( KButtonsIdTblTouch[iSelected] );
+        }   
+   
+#ifdef RD_INTELLIGENT_TEXT_INPUT  
+    if ( iKeyboardType == EPtiKeyboardHalfQwerty )
+        {
+        iLastKeyCode = 0;
+        }
+#endif
+    
+    //Set to dimmed state
+    button->SetDimmed( EFalse );
+    DrawDeferred();    
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::NotifyReleaseKeyL
+// Notify any key is released. If pressed button exists.
+// command which is releated is executed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::NotifyReleaseKeyL()
+    {
+                /*Get the selected pointer 
+                button -> different layouts, different values*/
+        CAknButton* button = iButtons[iSelected];
+        CAknButtonState* state = button->State(EnNormal);          
+        
+        if(state->Flags() == EnPressed)
+        {
+          TKeyEvent aKeyEvent;
+          aKeyEvent.iScanCode = EStdKeyEnter;
+          TEventCode aType = EEventKeyUp;
+          //trigger offerkeyeventl to this button
+          button->OfferKeyEventL(aKeyEvent,aType);
+          state->SetFlags(EnNormal);    
+          button->DrawNow();
+        }
+      if( !AknLayoutUtils::PenEnabled() )
+           {
+             if(iSelected == EScrollUp)
+            {
+                CCalcOutputSheet* outputSheet = iContainer->OutputSheet();
+                if(!outputSheet->CanUp())
+                {
+                    RedrawHighlight(EScrollUp,EScrollDown);
+                    iSelected = EScrollDown;
+                }
+            }
+            
+          if(iSelected == EScrollDown)
+            {
+                CCalcOutputSheet* outputSheet = iContainer->OutputSheet();
+                if(!outputSheet->CanDown())
+                {
+                    RedrawHighlight(EScrollDown,EScrollUp);
+                    iSelected = EScrollUp;
+                }
+            }
+            
+           }
+
+       }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::NotifyOtherThanOkKeyPressed
+// If key other than OK-key is pressed this function is called.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::NotifyOtherThanOkKeyPressed()
+    {
+    //for (TInt cnt(0); cnt < iCountOfButtons; cnt++)
+        {
+          //Get the pointer for the button
+         CAknButton* button = iButtons[iSelected];
+         CAknButtonState* state = button->State(EnNormal);
+         if(state->Flags() == EnPressed)
+            {
+          state->SetFlags(EnNormal);
+          button->DrawNow();
+            }
+        }
+
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::NotifyLangChange
+// Called if language is changed.
+// Change layout according to the language.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::NotifyLangChange()
+    {
+    // Write code here.
+    SetLayout();
+    DrawNow();
+    }
+
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::IsQwertyKeypadActive
+// Called to check qwerty keypad is active or not
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+ TInt CCalcFuncmapSubPane::IsQwertyKeypadActive()
+  {
+     TInt value = 0;
+    
+    iQwertyModeStatusProperty.Get(value);
+    
+    return value;
+ }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::HandleControlEventL
+// Observer event from avkon button change
+// (other items were commented in a header).
+// ---------------------------------------------------------
+void CCalcFuncmapSubPane::HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType)
+    {    
+    iIsKeyLongPress = EFalse;   
+    if ( aEventType != EEventStateChanged && aEventType != CAknButton::ELongPressEvent )
+        {
+        return;
+        }
+    else if ( aEventType == CAknButton::ELongPressEvent )
+        {
+        iIsKeyLongPress = ETrue;
+        }
+        
+    //Get the selected button
+    CAknButton* button = (CAknButton*)aControl;
+
+    for ( TInt i = 0; i < KCountOfButtons; ++i )
+        {
+        if ( button == iButtons[i] )
+            {
+            if(iSelected != i)
+            return;
+            
+            //break;
+            }
+        }    
+
+    // Check if the button has been pressed.
+    CAknButtonState* state = button->State(EnNormal);
+    if ( aEventType == EEventStateChanged && state->Flags() == EnNormal )
+        {
+        iInputData = ETrue;
+        }
+    
+    if ( !button->IsDimmed() )
+        {
+                //handles all the commands for the buttons
+            if( !AknLayoutUtils::PenEnabled() )
+            {
+            iContainer->View()->HandleCommandL(KButtonsIdTbl[iSelected]);
+            if(iSelected == EScrollUp)
+            {
+                CCalcOutputSheet* outputSheet = iContainer->OutputSheet();
+                if(!outputSheet->CanUp())
+                {
+                    RedrawHighlight(EScrollUp,EScrollDown);
+                    iSelected = EScrollDown;
+                }
+            }
+            else if(iSelected == EScrollDown)
+            {
+                CCalcOutputSheet* outputSheet = iContainer->OutputSheet();
+                if(!outputSheet->CanDown())
+                {
+                    RedrawHighlight(EScrollDown,EScrollUp);
+                    iSelected = EScrollUp;
+                }
+            }
+            }
+            else
+            {
+            // Input data if the button has been pressed or long pressed.
+            if ( iInputData || iIsKeyLongPress )
+                {
+                iContainer->View()->HandleCommandL(KButtonsIdTblTouch[iSelected]);
+                iInputData = EFalse;
+                }
+            }   
+
+        } 
+    if( iErrorCode != KErrNone )
+        {
+        ErrorMsgL( iErrorCode );
+        iErrorCode = KErrNone;
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::OfferKeyEventL
+// This function is called by CCalcContainer::OfferKeyEventL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TKeyResponse CCalcFuncmapSubPane::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+{
+    TKeyResponse exitCode(EKeyWasNotConsumed);
+       
+    TPtiKey keyQwertyValue = (TPtiKey)aKeyEvent.iScanCode;
+    
+    if(IsQwertyKeypadActive())  
+        {
+#ifdef RD_INTELLIGENT_TEXT_INPUT  
+        if ( iKeyboardType == EPtiKeyboardHalfQwerty )
+            {
+            TBuf<KMaxNumCharsPerCase> keys;
+            TInt firstoperator(-1);
+            TInt secondoperator(-1);
+                   
+            TInt oldSelect( iSelected );
+            
+            if ( ( aKeyEvent.iScanCode == EStdKeyLeftFunc && aType == EEventKeyDown ) || 
+                 ( aKeyEvent.iScanCode == EStdKeyLeftShift && aType == EEventKeyDown ) )
+                 {            
+                 iEngine->MappingDataForKey( keyQwertyValue, keys, EPtiCaseFnLower  );
+                 MapDataForChrShiftKey( keys, firstoperator, secondoperator);
+                 if ( (secondoperator == -1) && (firstoperator != -1))
+                     {
+                     if ( AknLayoutUtils::PenEnabled() )
+                         {
+                         iSelected = firstoperator;    
+                         }
+                     else
+                         {
+                         if ( firstoperator == ECmdTSeparator )
+                             {
+                             iDecimalPoint = ETrue;
+                             }
+                         else
+                             {
+                             iSelected = firstoperator;
+                             iDecimalPoint = EFalse;
+                             }
+                         }                     
+                     }
+                 else if ( (firstoperator == -1) && (secondoperator != -1) )
+                     {
+                     if ( AknLayoutUtils::PenEnabled() )
+                         {
+                         iSelected = secondoperator;    
+                         }
+                     else
+                         {
+                         if ( secondoperator == ECmdTSeparator )
+                             {
+                             iDecimalPoint = ETrue;
+                             }
+                         else
+                             {
+                             iSelected = secondoperator;
+                             iDecimalPoint = EFalse;
+                             }
+                         }                     
+                     }
+                 else if ( (firstoperator != -1) && (secondoperator != -1) )
+                     {
+                     if ( iLastKeyCode == aKeyEvent.iScanCode )
+                         {
+                         if ( AknLayoutUtils::PenEnabled() )
+                             {
+                             if ( iSelected == firstoperator )
+                                 {
+                                 iSelected = secondoperator;
+                                 }
+                             else
+                                 {
+                                 iSelected = firstoperator;
+                                 }
+                             }
+                         else
+                             {
+                              if ( firstoperator == ECmdTSeparator || secondoperator == ECmdTSeparator )
+                                  {
+                                  if ( iDecimalPoint )
+                                      {
+                                      iDecimalPoint = EFalse;
+                                      if ( firstoperator == ECmdTSeparator )
+                                          {
+                                          iSelected = secondoperator;
+                                          }
+                                      else
+                                          {
+                                          iSelected = firstoperator;
+                                          }                           
+                                      }
+                                  else
+                                      {
+                                      iDecimalPoint = ETrue;
+                                      }
+                                  }
+                              else
+                                  {
+                                  if ( iSelected == firstoperator )
+                                      {
+                                      iSelected = secondoperator;
+                                      }
+                                  else
+                                      {
+                                      iSelected = firstoperator;
+                                      }                      
+                                  }
+                             }
+                         }
+                     else
+                         {
+                         if ( AknLayoutUtils::PenEnabled() )
+                             {
+                             iSelected = firstoperator;    
+                             }
+                         else
+                             {
+                             if ( firstoperator == ECmdTSeparator )
+                                 {
+                                 iDecimalPoint = ETrue;
+                                 }
+                             else
+                                 {
+                                 iSelected = firstoperator;
+                                 iDecimalPoint = EFalse;
+                                 }
+                             }
+
+                         }
+                     }
+                     RedrawHighlight( oldSelect, iSelected );
+                     iLastKeyCode = aKeyEvent.iScanCode;
+                     exitCode = EKeyWasConsumed;
+                     
+                     iIsShiftKeyPressed = ETrue;
+                 }
+            }
+         else
+#endif
+            {
+            //For Multiplication operator in Qwerty keypad
+            if(((aKeyEvent.iScanCode == EStdKeyLeftShift) || (aKeyEvent.iScanCode == EStdKeyRightShift)) && aType == EEventKeyDown)
+                {
+                 if(iShiftKeyPressed == EPtiCaseLower )
+                     {
+                        iShiftKeyPressed = EPtiCaseUpper;
+                        iShiftKey = 0;
+                        iValue = ETrue;
+                     }
+                  
+                 else
+                     {
+                    iShiftKeyPressed = EPtiCaseLower;
+                     }
+                exitCode = EKeyWasConsumed;     
+                
+                iIsShiftKeyPressed = ETrue;
+                }
+            else if((aKeyEvent.iScanCode == EStdKeyLeftShift || aKeyEvent.iScanCode == EStdKeyRightShift)&& aType == EEventKeyUp)
+                {
+                        /*if(((iLanguage == ELangFrench) || (iLanguage == ELangTaiwanChinese) || 
+                            (iLanguage == ELangCzech) || (iLanguage == ELangSlovak))&& iShiftKey >= 1)*/
+                                if( iShiftKey >= 1 )
+                    {
+                    iShiftKeyPressed = EPtiCaseLower;
+                    }
+                iValue = EFalse;
+                exitCode = EKeyWasConsumed; 
+                
+                iIsShiftKeyPressed = ETrue;
+                }
+            }
+          //else
+     if ( !iIsShiftKeyPressed )
+        {
+        if (aType != EEventKey)
+        {
+            if (aType == EEventKeyDown)
+                {
+                    iIsOfferKeyEvent = ETrue;        
+                }
+                else if (aType == EEventKeyUp)
+                {
+                    iIsOfferKeyEvent = EFalse;        
+                }
+            // when users press send key, EKeyWasNotConsumed is returned to system
+            // to open dialer 
+            if ( aKeyEvent.iScanCode == EStdKeyYes )
+                {
+                return EKeyWasNotConsumed;
+                }
+        return EKeyWasConsumed;
+        }
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        if( MapNumericCharL( aKeyEvent ) )
+            {
+            exitCode = EKeyWasConsumed;
+            iShiftKeyPressed = EPtiCaseLower;
+            }
+#else
+        if(MapNumericCharL(keyQwertyValue,iShiftKeyPressed))
+            {
+            exitCode = EKeyWasConsumed;
+            iShiftKeyPressed = EPtiCaseLower;        
+            }
+#endif
+        else 
+            {
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+            if( MapNumerics( aKeyEvent ) || aKeyEvent.iCode == EKeyBackspace )
+                {
+                exitCode = EKeyWasNotConsumed;
+                iShiftKeyPressed = EPtiCaseLower;
+                
+                                /*if((iLanguage == ELangFrench) || (iLanguage == ELangTaiwanChinese) || 
+                                         (iLanguage == ELangCzech) || (iLanguage == ELangSlovak))*/
+                    {
+                    if( !iValue )
+                    iShiftKeyPressed = EPtiCaseLower;
+
+                    else
+                    iShiftKeyPressed = EPtiCaseUpper;
+                    iShiftKey++;
+                    }
+                }
+#else
+            if(MapNumerics(keyQwertyValue,iShiftKeyPressed) || aKeyEvent.iCode == EKeyBackspace)
+                {
+                exitCode = EKeyWasNotConsumed;
+                iShiftKeyPressed = EPtiCaseLower;
+
+                                /*if((iLanguage == ELangFrench) || (iLanguage == ELangTaiwanChinese) || 
+                                         (iLanguage == ELangCzech) || (iLanguage == ELangSlovak))*/
+                    {
+                    if(!iValue)
+                    iShiftKeyPressed = EPtiCaseLower;
+                    
+                    else
+                    iShiftKeyPressed = EPtiCaseUpper;
+                    iShiftKey++;    
+                    }
+                }
+#endif
+            else
+                {
+                exitCode = EKeyWasConsumed;    
+                iShiftKeyPressed = EPtiCaseLower;
+                }
+            
+            }
+
+        }        
+
+    // handle Enter key event    
+    if ( aKeyEvent.iCode == EKeyEnter )
+        {
+        exitCode = EKeyWasConsumed;
+        HandleMiddleSoftKeyOREKeyOKL();
+        iShiftKeyPressed = EPtiCaseLower;
+        return exitCode;
+        }
+    
+    iIsShiftKeyPressed = EFalse;
+        
+    }
+ 
+/*    if(aKeyEvent.iCode == EKeyOK)
+    {
+       
+        HandleMiddleSoftKeyOREKeyOKL();
+        exitCode = EKeyWasConsumed;
+    }   
+    else if (aType == EEventKey)*/
+    if (aType == EEventKey)
+    {
+        TInt oldSelect(iSelected);
+        TInt row(iSelected % iButtonsInRow);
+        TInt column(iSelected / iButtonsInRow);
+        iIsOfferKeyEvent = EFalse; 
+        switch(aKeyEvent.iCode)
+        {
+            case EKeyLeftArrow:
+            {
+                
+                do
+                {   
+                   
+                        column--;
+                        
+                        if(column < 0)
+                        {
+                            column = iButtonsInColumn -1;
+                            row--;
+
+                            if( row < 0 )
+                            {
+                                row = iButtonsInRow -1;
+                            }
+                        }
+                    
+                    iSelected = row + column * iButtonsInRow;
+
+                }while( iButtons[iSelected]->IsDimmed() );
+                
+                RedrawHighlight( oldSelect, iSelected, ETrue );
+
+                exitCode = EKeyWasConsumed;
+                break;
+            }
+            
+            case EKeyRightArrow:
+            {
+                               
+                do
+                {   
+                        column++;
+                        
+                        if(column == iButtonsInColumn)
+                        {
+                            column = 0;
+                            row++;
+                            
+                            if( row >= iButtonsInRow )
+                            {
+                                row = 0;
+                            }
+                        }
+                    
+                    iSelected = row + column * iButtonsInRow;
+
+                }while( iButtons[iSelected]->IsDimmed() );
+                
+                RedrawHighlight( oldSelect, iSelected, ETrue );
+                exitCode = EKeyWasConsumed;
+                break;
+            }
+            
+            case EKeyUpArrow:
+            {
+                
+                SetNextCursorPosForUpArrow(oldSelect);
+
+                RedrawHighlight( oldSelect, iSelected, ETrue );
+                exitCode = EKeyWasConsumed;
+                break;
+            }
+            
+            case EKeyDownArrow:
+            {
+                
+                SetNextCursorPosForDownArrow(oldSelect);
+ 
+                RedrawHighlight( oldSelect, iSelected, ETrue );
+                exitCode = EKeyWasConsumed;
+                break;
+            }
+
+            case EKeyOK:
+            {
+            if ( !AknLayoutUtils::PenEnabled() )
+                {
+                // get and judge the state of button
+                CAknButton* button = iButtons[iSelected];
+                CAknButtonState* state = button->State( EnNormal ); 
+                if ( ( iSelected == EScrollUp || iSelected == EScrollDown ) 
+                    && ( state->Flags() == EnPressed ) )
+                    {
+                    iContainer->View()->HandleCommandL( KButtonsIdTbl[iSelected] );
+                    // when the history arrives the top or bottom,the button should be set dimmed
+                    CCalcOutputSheet* outputSheet = iContainer->OutputSheet();
+                    if ( !( outputSheet->CanDown() ) && iSelected == EScrollDown )
+                        {
+                        button->SetDimmed( ETrue );
+                        DrawDeferred();  
+                        }
+                    if ( !( outputSheet->CanUp() ) && iSelected == EScrollUp )
+                        {
+                        button->SetDimmed( ETrue );
+                        DrawDeferred();  
+                        }   
+                    }
+                }
+                break;
+            }
+            default:
+            {
+               if(!IsQwertyKeypadActive())
+             {
+                if(aKeyEvent.iCode == KCalcAsteriskBtn)
+                {
+                    if(iLastKeyCode == aKeyEvent.iCode)
+                    {
+                        row++;
+                        
+                        if(row == iButtonsInRow - 1)  // Equal is not contained in a loop.
+                        {
+                            row = 0;
+                        }
+                        iSelected = row + column * iButtonsInRow;
+                    }
+                    else
+                    {
+                        if(AknLayoutUtils::PenEnabled())
+                            {
+                              iSelected = ECmdTAdd;    
+                            }
+                        else
+                            {
+                              iSelected = EPlusButton;    
+                            }    
+                        
+                    }
+                    RedrawHighlight( oldSelect, iSelected);
+                    exitCode = EKeyWasConsumed;
+                }
+             }
+            break;
+            }
+        }
+        iLastKeyCode = aKeyEvent.iCode;
+        
+    }
+    else if (aType == EEventKeyDown)
+    {
+    iIsOfferKeyEvent = ETrue; 
+    // If the enter key has been pressed, set the button and input data.
+    if ( aKeyEvent.iCode == EKeyEnter || aKeyEvent.iScanCode == EStdKeyEnter )
+        {
+        exitCode = EKeyWasConsumed;
+        HandleMiddleSoftKeyOREKeyOKL();
+        iShiftKeyPressed = EPtiCaseLower;
+        return exitCode;
+        }       
+    }
+    else if (aType == EEventKeyUp)
+    {
+    iIsOfferKeyEvent = EFalse;
+    // Release the button when enter key released.
+    if ( aKeyEvent.iCode == EKeyEnter || aKeyEvent.iScanCode == EStdKeyEnter )
+        {
+        NotifyReleaseKeyL();
+        }
+    }
+    
+   
+    return exitCode;
+}
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcFuncmapSubPane::CCalcFuncmapSubPane()
+    {
+    }
+
+
+// default constructor can leave.
+void CCalcFuncmapSubPane::ConstructL
+      (CCalcContainer* aContainer) 
+    {
+    iSelected = 0;    
+    iContainer = aContainer;
+    iIsOfferKeyEvent = EFalse;
+    iErrorCode = KErrNone;
+    iShowDrawHight = EFalse;
+    iInputData = EFalse;
+    SetContainerWindowL(*iContainer);
+    // Read character sequence tables, such as -, +.
+    iCalcAppEnv = CCalcAppEnv::Static();
+    iIsChangeSignDimmed = ETrue;
+    
+       if( AknLayoutUtils::PenEnabled() )
+    {
+        iCountOfButtons = KCountOfButtonsTouch;
+        iButtonsInRow = KButtonsInRowTouch;
+        iButtonsInColumn = KButtonsInColumnTouch;
+      
+    }
+    else
+    {
+        iCountOfButtons = KCountOfButtons;
+        iButtonsInRow = KButtonsInRow;
+        iButtonsInColumn = KButtonsInColumn;  
+        
+    }
+    
+
+    for (TInt count = 0; count < iCountOfButtons; count++)
+        {        
+        //Create the AknButtons
+        if(AknLayoutUtils::PenEnabled())
+            {
+                iButtons[count] = CAknButton::NewL(
+            iCalcAppEnv->UnpressedButtonBmp(count),
+            NULL,
+            NULL,
+            NULL,
+            _L(""),
+            _L(""),
+            // Report the observer when the button recieve the key down event.
+            KAknButtonReportOnKeyDown, 
+            0
+            );     
+            
+            }
+        else
+            {
+            
+                iButtons[count] = CAknButton::NewL(
+            iCalcAppEnv->UnpressedButtonBmp(count),
+            NULL,
+            iCalcAppEnv->PressedButtonBmp(count),
+            NULL,
+            _L(""),
+            _L(""),
+            // Report the observer when the button recieve the key down event.
+            KAknButtonReportOnKeyDown,
+            0
+            );     
+            /*if((count == ESqrtButton) && !iIsChangeSignDimmed)
+            {
+                iButtons[count]->SetDimmed(ETrue);
+            }*/
+            
+            }
+        
+        iButtons[count]->SetContainerWindowL( *this );
+        iButtons[count]->SetObserver( this );     
+        }
+
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        iButtons[ECmdTCancel]->SetButtonFlags( KAknButtonReportOnLongPress );
+        }
+    iSelected = 0;
+    RedrawHighlight( iSelected, iSelected );
+
+    User::LeaveIfError(iQwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive));
+   
+    iShiftKeyPressed = EPtiCaseLower;
+    iShiftKey         = 0;
+
+     // Try to get the English key mappings. If those are not available, use the 
+    // mappings of the current input language. The order is this because all mappings
+    // do not necessarily contain all characters neeeded by the Calculator.
+    iLanguage = ELangEnglish;
+    iEngine = CPtiEngine::NewL(ETrue);
+    iCoreLanguage = static_cast<CPtiCoreLanguage*>(iEngine->GetLanguage( iLanguage ));
+
+    if( !iCoreLanguage )
+        {
+        iCRKey = CRepository::NewL(KCRUidAknFep);
+        TInt ret = iCRKey->Get(KAknFepInputTxtLang,iLanguage);
+        if( ret!= KErrNone )
+            {
+            //Exit application if server is busy( Error Raised )
+            iAvkonViewAppUi->Exit();
+            }
+            iCoreLanguage = static_cast<CPtiCoreLanguage*>(iEngine->GetLanguage(iLanguage));
+         }
+
+    RProperty::Get( KCRUidAvkon, KAknKeyBoardLayout, iKeyboardType );
+    
+    if( iCoreLanguage )
+        {
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        if ( iKeyboardType == EPtiKeyboardHalfQwerty)
+           {
+           iHalfQwertyKeyMappings = static_cast<CPtiHalfQwertyKeyMappings*>(iCoreLanguage->GetHalfQwertyKeymappings());
+           }
+       else
+#endif
+          {
+          iQwertyKeyMappings = static_cast<CPtiQwertyKeyMappings*>(iCoreLanguage->GetQwertyKeymappings());
+          }
+        }
+
+        // UI language is used to determine the used number format.
+        iUiLanguage = User::Language();
+  
+        
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        
+        if ( iKeyboardType == EPtiKeyboardHalfQwerty )
+            { 
+            iEngine->ActivateLanguageL( iLanguage, EPtiEngineHalfQwerty );
+            }
+        else if ( IsQwertyKeypadActive())
+            { 
+            iEngine->ActivateLanguageL( iLanguage, EPtiEngineQwerty );
+            }  
+       
+  //      RProperty::Get( KCRUidAvkon, KAknKeyBoardLayout, iKeyboardType );
+        iEngine->SetKeyboardType( TPtiKeyboardType (iKeyboardType ));
+        
+#endif
+    
+    iIsShiftKeyPressed = EFalse;
+
+    }
+
+//    ---------------------------------------------------------
+// CCalcFuncmapSubPane::RefreshButtonIcons
+// This function is called by CCalcContainer::OfferKeyEventL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::RefreshButtonIcons()
+{
+    /*for (TInt count(0); count < iCountOfButtons; count++)
+        {
+        iButtons[count]->SetBitmapIcons(iCalcAppEnv->UnpressedButtonBmp(count),
+            iCalcAppEnv->PressedButtonBmp(count),
+            iCalcAppEnv->InactiveButtonBmp(count));
+        }*/
+}
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetScrollupEnable
+// Redraw scroll-up button on scrolling enable.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetScrollupEnable
+                     (TBool aEnable)  
+    {
+        //Enabling/Disabling of scroll up buttons only for Non-Touch   
+    if(!AknLayoutUtils::PenEnabled())
+    {
+        CAknButton* scrollUp = iButtons[EScrollUp];
+        scrollUp->SetDimmed( !aEnable );
+        scrollUp->DrawNow();         
+    }
+    
+    }
+
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetScrolldownEnable
+// Redraw scroll-down button on scrolling enable.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetScrolldownEnable
+                     (TBool aEnable) 
+    {
+    //Enabling/Disabling of scroll down buttons only for Non-Touch
+    if(!AknLayoutUtils::PenEnabled())
+    {       
+    CAknButton* scrollDown = iButtons[EScrollDown];
+    scrollDown->SetDimmed( !aEnable );
+    scrollDown->DrawNow();
+    }
+    }
+
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetNextCursorPosForUpArrow
+// Set next cursor position whwn pressing uparrow key.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetNextCursorPosForUpArrow(TInt aOldPos)
+{
+    
+    TInt row(aOldPos % iButtonsInRow);
+    TInt column(aOldPos / iButtonsInRow);
+
+    do
+    {   row--;
+
+        if(row < 0)
+        {
+            column--;
+        
+            if(column < 0)
+            {
+                column = iButtonsInColumn -1;
+            }
+            row = iButtonsInRow - 1;
+        }
+        iSelected = row + column * iButtonsInRow;
+    
+    }while( iButtons[iSelected]->IsDimmed() );
+}
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetNextCursorPosForDownArrow
+// Set next cursor position whwn pressing downarrow key.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetNextCursorPosForDownArrow(TInt aOldPos)
+{
+    TInt row(aOldPos % iButtonsInRow);
+    TInt column(aOldPos / iButtonsInRow);
+
+    do
+    {   row++;
+
+        if(row == iButtonsInRow)  // KButtonsInRow is equal to "number of rows in column"
+        {
+            row = 0;
+
+            //move focus from last item to first item, column should be added one
+            column++;     
+        
+            if( column == iButtonsInColumn )  
+            {
+                column = 0;
+            }
+        }
+        iSelected = row + column * iButtonsInRow;
+    
+    }while( iButtons[iSelected]->IsDimmed() );
+}
+
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::RedrawHighlight
+// An old highlight rectangle is erased and 
+// a new highlight rectangle is drawn.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::RedrawHighlight
+      (TUint aOldId,            // The button chosen before
+       TUint aNewId)            // The button chosen newly
+    {
+    // The State of each button is set.
+    CAknButton* button = iButtons[aOldId];
+    CAknButtonState* state = button->State(EnNormal);          
+        
+    if(state->Flags() == EnPressed)
+        {
+        TKeyEvent aKeyEvent;
+        aKeyEvent.iScanCode = EStdKeyEnter;
+        TEventCode aType = EEventKeyUp;
+        //trigger offerkeyeventl to this button
+        TRAP_IGNORE(button->OfferKeyEventL(aKeyEvent,aType));
+        state->SetFlags(EnNormal);
+         }
+
+    if( aOldId != aNewId )
+        {
+        button->SetFocus( EFalse, EDrawNow );
+        button = iButtons[aNewId];        
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::RedrawHighlight
+// An old highlight rectangle is erased and 
+// a new highlight rectangle is drawn.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::RedrawHighlight
+      (TUint aOldId,            // The button chosen before
+       TUint aNewId,
+       TBool aShowHightlight)       // The button chosen newly
+    {
+    // The State of each button is set.
+    CAknButton* button = iButtons[aOldId];
+    CAknButtonState* state = button->State(EnNormal);          
+    iShowDrawHight = ETrue;
+    if( state->Flags() == EnPressed )
+        {
+        TKeyEvent aKeyEvent;
+        aKeyEvent.iScanCode = EStdKeyEnter;
+        TEventCode aType = EEventKeyUp;
+        //trigger offerkeyeventl to this button
+        TRAP_IGNORE(button->OfferKeyEventL(aKeyEvent,aType));
+        state->SetFlags(EnNormal);
+         }
+        if( aOldId != aNewId )
+        {       
+        button->SetFocus( EFalse, EDrawNow );      
+        button = iButtons[aNewId];        
+        button->SetFocus( ETrue, EDrawNow );
+        }  
+    }
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetLayout
+// Set functionmap button layout.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+
+
+void CCalcFuncmapSubPane::SetLayout()
+    {
+    TRect parentRect(Rect());    
+    
+     TInt t = 0;
+     if( AknLayoutUtils::PenEnabled()  )
+        {
+            for (TInt count(0); count < KButtonsInColumnTouch; count++)
+            {
+            for (TInt row(0); row < 5; row++)   
+                  { 
+                  
+                   TAknWindowLineLayout area;
+                 TAknWindowLineLayout area1;
+
+                 TAknWindowLineLayout areaG2;
+                 TAknWindowLineLayout areaGraphics;
+                 
+                     area= AknLayoutScalable_Apps::toolbar_button_pane_cp01(1).LayoutLine();
+                   areaG2= AknLayoutScalable_Apps::cell_calc_pane_g2(1).LayoutLine();
+                     if (Layout_Meta_Data::IsLandscapeOrientation())
+                        {
+                            area1 = AknLayoutScalable_Apps::cell_calc_pane(count,row,enTouch_with_prt).LayoutLine();
+                        }
+                     else
+                        {
+                           area1 = AknLayoutScalable_Apps::cell_calc_pane(count,row,enTouch_enabled).LayoutLine();
+                        }   
+
+                    areaGraphics = area1;
+                    areaGraphics.iW = areaGraphics.iW - areaG2.il - areaG2.ir;
+                    areaGraphics.iH = areaG2.iH;
+                
+                    area1.il = area1.il + area.il;
+                    area1.ir = area1.ir - area.ir;
+                    area1.it = area1.it + area.it;
+                    area1.ib = area1.ib - area.ib;
+                    area1.iW = area1.iW - area.il - area.ir;
+                    area1.iH = area1.iH - area.it - area.ib;
+                
+                 
+                //A change in values here
+                if ( Layout_Meta_Data::IsLandscapeOrientation() )
+                {
+                AknLayoutUtils::LayoutControl(
+                iButtons[t], parentRect,/*AknLayoutScalable_Apps::cell_calc_pane(count,Row,enTouch_with_prt).LayoutLine()*/area1 );
+                }
+                else
+                {
+                AknLayoutUtils::LayoutControl(
+                iButtons[t], parentRect,/*AknLayoutScalable_Apps::cell_calc_pane(count,Row,enTouch_enabled).LayoutLine()*/area1 );
+                }
+
+                TSize iconSize( areaGraphics.iW, areaGraphics.iH );
+                iButtons[t]->SetIconSize( iconSize );
+                TRect rect = iButtons[t]->Rect();
+                rect.iBr.iX += 5;
+                rect.iBr.iY += 5; 
+                rect.iTl.iX -= 5;
+                rect.iTl.iY -= 5;
+
+                if ( FeatureManager::FeatureSupported( KFeatureIdRockerKey ) )
+                {
+                iButtons[t]->SetHighlightRect( rect );
+                }
+                t++;
+                  }
+            }
+            
+       }
+            
+        
+        else
+            {
+             for (TInt count(0); count < KButtonsInColumn; count++)
+                {
+                for (TInt row(0); row < 5; row++)   
+                       {               
+                           AknLayoutUtils::LayoutControl(
+                        iButtons[t], parentRect, AknLayoutScalable_Apps::cell_calc_pane( count, row ).LayoutLine());
+                        iButtons[t]->SetHighlightRect( iButtons[t]->Rect() );
+                        t++;
+                       }
+                       
+                }
+            }
+                
+        
+    }
+
+
+
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::CountComponentControls
+// The count of child control is returned.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CCalcFuncmapSubPane::CountComponentControls() const
+    {
+    return iCountOfButtons;
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::ComponentControl
+// Child control's pointer corresponding to the specified index is returned.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CCoeControl* CCalcFuncmapSubPane::ComponentControl
+              (TInt aIndex) const 
+    {
+    return iButtons[aIndex];
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::GetButtonBitmapControl
+// This function is called when the size changes.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+/*CCalcCommandButton*/CAknButton* CCalcFuncmapSubPane::GetButtonBitmapControl
+                                    (TInt aIndex)
+    {
+        return iButtons[aIndex];
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SizeChanged
+// This function is called when the size changes.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SizeChanged()
+    {
+    SetLayout();
+    }
+
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetSqrtEnable
+// Redraw square root button, either normal or dimmed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetSqrtEnable(TBool aEnable)
+{
+    //Get the sqrt button
+    CAknButton* button = NULL;
+     if( !AknLayoutUtils::PenEnabled()  )
+        {
+         button = iButtons[ESqrtButton];     
+        }
+      else
+        {
+         button = iButtons[ECmdTSqrt];    
+        }  
+    if( button )
+        {
+         button->SetDimmed(!aEnable);   
+         button->DrawNow();
+        }
+    iIsSqrtDimmed = aEnable;
+    }
+
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetPercentEnable
+// Redraw percent button, either normal or dimmed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetPercentEnable(TBool aEnable)
+{
+    //Get the percent button
+    CAknButton* button = NULL;
+     if( !AknLayoutUtils::PenEnabled()  )
+        {
+         button = iButtons[EPercentButton];     
+        }
+      else
+        {
+         button = iButtons[ECmdTPercent];    
+        }  
+    if( button )
+        {
+         button->SetDimmed(!aEnable);   
+         button->DrawNow();
+       }
+    iIsPercentDimmed = aEnable;
+}
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::MapNumericChar
+// Redraw percent button, either normal or dimmed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//        
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+TBool CCalcFuncmapSubPane::MapNumericCharL( TKeyEvent aKeyEvent )
+    {
+    TBuf<KMaxNumCharsPerCase> keys;
+
+    TPtiKey aKey = ( TPtiKey )aKeyEvent.iScanCode;
+
+
+    if( !keys.Length() )
+            {
+            keys.Append( aKeyEvent.iCode );
+            }
+
+    if ( keys.Length() > 0 )
+        {
+        TUint16 firstChar = keys[0];
+        switch ( firstChar )
+            {
+            case KPtiPinyinMarker:
+            case KPtiStrokeMarker:
+            case KPtiZhuyinMarker:
+            case KPtiCangjieMarker:
+            case KPtiGetAllMarker:
+                 if ( keys.Length() > 1 )
+                     {
+                     firstChar = keys[1];
+                     }
+            default:
+                break;
+            }
+
+        TInt loc1 = KAllowedOperatorPlus().Locate( firstChar );
+        if ( loc1 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[0] );
+            return ETrue;
+            }
+        TInt loc2 = KAllowedOperatorMinus().Locate( firstChar );
+        if ( loc2 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[1] );
+            return ETrue;
+            }
+        TInt loc3 = KAllowedOperatorStar().Locate( firstChar );
+        if ( loc3 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[2] );
+            return ETrue;
+            }
+        TInt loc4 = KAllowedOperatorDivide().Locate( firstChar );
+        if ( loc4 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[3] );
+            return ETrue;
+            }
+        TInt loc5 = KAllowedOperatorEquals().Locate( firstChar );
+        if ( loc5 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[5] );
+            return ETrue;
+            }
+        TInt loc6 = KAllowedOperatorPercent().Locate( firstChar );
+        if ( loc6 != KErrNotFound &&  GetPercentButtonState() )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[7] );
+            return ETrue;
+            }
+
+              }
+        
+    return EFalse;
+    }
+
+#else
+TBool CCalcFuncmapSubPane::MapNumericCharL( TPtiKey aKey, TPtiTextCase aCase )    
+    {
+    TBuf<KMaxNumCharsPerCase> keys;
+
+    iQwertyKeyMappings->GetDataForKey( aKey, keys, aCase );                
+
+    if ( keys.Length() > 0 )
+        {
+        TUint16 firstChar = keys[0];
+        switch ( firstChar )
+            {
+            case KPtiPinyinMarker:
+            case KPtiStrokeMarker:
+            case KPtiZhuyinMarker:
+            case KPtiCangjieMarker:
+            case KPtiGetAllMarker:
+                if ( keys.Length() > 1 )
+                    {
+                    firstChar = keys[1];
+                    }
+            default:
+                break;
+            }
+
+        TInt loc1 = KAllowedOperatorPlus().Locate( firstChar );
+        if ( loc1 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[0] );
+            return ETrue;
+            }
+        TInt loc2 = KAllowedOperatorMinus().Locate( firstChar );
+        if ( loc2 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[1] );
+            return ETrue;
+            }
+        TInt loc3 = KAllowedOperatorStar().Locate( firstChar );
+        if ( loc3 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[2] );
+            return ETrue;
+            }
+        TInt loc4 = KAllowedOperatorDivide().Locate( firstChar );
+        if ( loc4 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[3] );
+            return ETrue;
+            }
+        TInt loc5 = KAllowedOperatorEquals().Locate( firstChar );
+        if ( loc5 != KErrNotFound )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[5] );
+            return ETrue;
+            }
+        TInt loc6 = KAllowedOperatorPercent().Locate( firstChar );
+        if ( loc6 != KErrNotFound &&  GetPercentButtonState() )
+            {
+            iContainer->View()->HandleCommandL( KButtonsIdTbl[7] );
+            return ETrue;
+            }
+
+              }
+        
+    return EFalse;
+    }
+#endif       
+    
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::MapNumericChar
+// Redraw percent button, either normal or dimmed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//        
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+TBool CCalcFuncmapSubPane::MapNumerics( TKeyEvent aKeyEvent )
+    {
+    
+    TBuf<KMaxNumCharsPerCase> keys;
+
+    TPtiKey aKey = ( TPtiKey )aKeyEvent.iScanCode;
+
+    if ( !keys.Length() )
+            {
+            keys.Append( aKeyEvent.iCode );
+            }
+
+    if ( keys.Length() > 0 )
+        {
+        TUint16 firstChar = keys[0];
+        switch ( firstChar )
+            {
+            case KPtiPinyinMarker:
+            case KPtiStrokeMarker:
+            case KPtiZhuyinMarker:
+            case KPtiCangjieMarker:
+            case KPtiGetAllMarker:
+                 if ( keys.Length() > 1 )
+                     {
+                     firstChar = keys[1];
+                     }
+            default:
+                break;
+            }
+        TInt loc = KAllowedNumericChars().Locate( firstChar );
+        if ( loc != KErrNotFound )
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+#else
+TBool CCalcFuncmapSubPane::MapNumerics( TPtiKey aKey, TPtiTextCase aCase )    
+    {
+
+    TBuf<KMaxNumCharsPerCase> keys;
+
+    iQwertyKeyMappings->GetDataForKey( aKey, keys, aCase );                
+
+    if ( keys.Length() > 0 )
+        {
+        TUint16 firstChar = keys[0];
+        switch ( firstChar )
+            {
+            case KPtiPinyinMarker:
+            case KPtiStrokeMarker:
+            case KPtiZhuyinMarker:
+            case KPtiCangjieMarker:
+            case KPtiGetAllMarker:
+                 if ( keys.Length() > 1 )
+                     {
+                     firstChar = keys[1];
+                     }
+            default:
+                break;
+            }
+        TInt loc = KAllowedNumericChars().Locate( firstChar );
+        if ( loc != KErrNotFound )
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+#endif
+        
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::HandlePointerEventL
+// Handles apen input in Function Pane. .
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::HandlePointerEventL
+                ( const TPointerEvent& aPointerEvent )           
+    {
+    if ( !AknLayoutUtils::PenEnabled() )
+        {
+        return;
+        }
+    TInt oldSelect( iSelected );
+    TInt buttonValue = CalculatingCorrectButton( aPointerEvent );
+    if ( !iButtons[buttonValue]->IsDimmed() )
+        {
+        iSelected = buttonValue;
+        if ( iButtons[buttonValue]->Rect().Contains( aPointerEvent.iPosition ) )
+            {
+            RedrawHighlight( oldSelect, iSelected );
+            }
+        else
+            {
+            //when user drag outside of button,the Button Up event is missed always.
+            //Because the pointer is out of the button and it can't get the pointer
+            //event any more. We simulate the button up event to release the button
+            //when user drag out of button
+            if( aPointerEvent.iType == TPointerEvent::EDrag )
+                {
+                TPointerEvent event = aPointerEvent;
+                event.iType = TPointerEvent::EButton1Up;
+                iInputData = EFalse;
+                if( iErrorCode != KErrNone )
+                   {
+                   ErrorMsgL( iErrorCode );
+                   iErrorCode = KErrNone;
+                   }
+                CCoeControl::HandlePointerEventL( event );
+                return;
+                }
+            }
+
+
+        if( aPointerEvent.iType == TPointerEvent::EButton1Up )
+            {
+            iInputData = EFalse;
+            if( iErrorCode != KErrNone )
+                {
+                ErrorMsgL( iErrorCode );
+                iErrorCode = KErrNone;
+                }
+            }
+        }
+
+        CCoeControl::HandlePointerEventL( aPointerEvent );
+        
+    }
+    
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetErrorCode
+// Call from container  when an error code is display.
+// ---------------------------------------------------------
+//        
+void  CCalcFuncmapSubPane::SetErrorCode(TInt aError)
+    {
+    iErrorCode = aError;
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::ErrorMsgL
+// Call when there is an error release event.
+// ---------------------------------------------------------
+//    
+void CCalcFuncmapSubPane::ErrorMsgL(TInt aErrorCode) 
+    {
+    TInt resourceId(0);
+
+    switch (aErrorCode)
+        {
+        case KErrOverflow:
+            {
+            resourceId = R_CALC_ERROR_OUTOFRANGE;
+            break;
+            }
+        case KErrDivideByZero:
+            {
+            resourceId = R_CALC_ERROR_DIVISIONBYZERO;
+
+             // UpdateState( EOperator );
+            break;
+            }
+        case KErrNotSupported:
+            {
+            resourceId = R_CALC_ERROR_NEGATIVEVALUESQRT;
+            break;
+            }
+        default:
+            {
+            return;
+            }
+        }
+    
+    //Localisation of scalable UI.
+    HBufC* message = iCoeEnv->AllocReadResourceLC( resourceId ) ;
+    CAknErrorNote* note = new (ELeave) CAknErrorNote();
+    note->ExecuteLD( *message );
+    CleanupStack::PopAndDestroy( message );
+    
+    }
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::FunctionPaneRect
+// This function gives the layout of Function Pnae.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+
+TRect CCalcFuncmapSubPane::FunctionPaneRect()
+   {
+   TRect parentRect(Rect()); 
+   return     parentRect;
+   }
+   
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::CalculatingCorrectButton
+// Handled when there is Pen Input.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+
+TInt CCalcFuncmapSubPane::CalculatingCorrectButton
+                    (const TPointerEvent& aPointerEvent)
+   {
+    TInt selected = iSelected;
+    
+    //Function that calculates the correct button where the pointer event had occurred
+    for(TInt i = 0; i<iCountOfButtons; i++)
+    {
+           if(iButtons[i]->Rect().Contains(aPointerEvent.iPosition))
+           {
+               selected = i;
+           }
+    }
+    return selected;
+   }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::HandleMiddleSoftKeyOREKeyOK
+// Handled when MSK or EKeyOk is selected.
+// ---------------------------------------------------------
+//
+
+void CCalcFuncmapSubPane::HandleMiddleSoftKeyOREKeyOKL()
+   {
+     //get the selected button id
+    CAknButton* button = iButtons[iSelected];
+    //put the button in the pressed state
+    CAknButtonState* state = button->State(EnNormal);
+    //Put the button in pressed state
+    
+    TKeyEvent aKeyEvent;
+    aKeyEvent.iScanCode = EStdKeyEnter;
+    TEventCode aType = EEventKeyDown;
+    button->OfferKeyEventL(aKeyEvent,aType);
+
+    //put to pressed state
+    state->SetFlags(EnPressed);
+    button->DrawNow();
+
+   }
+   
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::GetChangeSignButtonState
+// Returns the state of change sign button
+// ---------------------------------------------------------
+//
+TBool CCalcFuncmapSubPane::GetChangeSignButtonState()
+{
+    return(iIsChangeSignDimmed);
+}
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::GetClearButtonState
+// Returns the state of Clear button
+// ---------------------------------------------------------
+//
+TBool CCalcFuncmapSubPane::GetClearButtonState()
+    {
+    return( iIsClearKeyEnabled );
+    } 
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::GetSqrtButtonState
+// Returns the state of square root button
+// ---------------------------------------------------------
+//
+TBool CCalcFuncmapSubPane::GetSqrtButtonState()
+{
+    return(iIsSqrtDimmed);
+}
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::GetPercentButtonState
+// returns the state of percent button
+// ---------------------------------------------------------
+//
+TBool CCalcFuncmapSubPane::GetPercentButtonState()
+{
+    return(iIsPercentDimmed);
+}
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::GetSelectedButtonId
+// returns the id of current button
+// ---------------------------------------------------------
+//
+TInt CCalcFuncmapSubPane::GetSelectedButtonId()
+    {
+    return iSelected;
+    }
+   
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::SetHighlightButton
+// set highlight button
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::SetHighlightButton( TUint aOldId, TUint aNewId )
+    {
+    iSelected = aNewId;
+    RedrawHighlight( aOldId, aNewId );
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::IsClearKeyLongPressed
+// Find Clear is long Pressed.
+// ---------------------------------------------------------
+//
+TBool CCalcFuncmapSubPane::IsKeyLongPressed()
+    {
+    return iIsKeyLongPress;
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::MapDataForChrShiftKey
+// Redraw percent button, either normal or dimmed.
+// ---------------------------------------------------------
+//
+void CCalcFuncmapSubPane::MapDataForChrShiftKey( TDes& aOperators, TInt& aFirstOperator, TInt& aSecondOperator)
+    { 
+    if( aOperators.Length() > 0 )
+        {
+        TUint16 firstChar = aOperators[0];
+        TUint16 secondChar = firstChar;
+        
+        if ( aOperators.Length() > 1 )
+            {
+            secondChar = aOperators[1];
+            }
+        
+        switch ( firstChar )
+            {
+            case KPtiPinyinMarker:
+            case KPtiStrokeMarker:
+            case KPtiZhuyinMarker:
+            case KPtiCangjieMarker:
+            case KPtiGetAllMarker:
+                if ( aOperators.Length() > 2 )
+                    {
+                    firstChar = aOperators[1];
+                    secondChar = aOperators[2];
+                    }
+                else
+                    {
+                    firstChar = aOperators[1];
+                    secondChar = firstChar;
+                    }
+                break;
+            default:
+                break;
+        
+        }
+        
+       MapOperators( firstChar, aFirstOperator );
+
+       MapOperators( secondChar, aSecondOperator );
+       
+       }
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::MapOperators
+// Redraw percent button, either normal or dimmed.
+// ---------------------------------------------------------
+//
+TBool CCalcFuncmapSubPane::MapOperators( TUint16 aOperator, TInt& aResult)
+    {
+    TInt loc1 = KAllowedOperatorPlus().Locate( aOperator );
+    if ( loc1 != KErrNotFound )
+        {
+        if ( AknLayoutUtils::PenEnabled() )
+            {
+            aResult = ECmdTAdd;
+            }
+        else
+            {
+            aResult = EPlusButton;
+            }
+        return ETrue;
+        }
+    TInt loc2 = KAllowedOperatorMinus().Locate( aOperator );
+    if ( loc2 != KErrNotFound )
+        {
+        if ( AknLayoutUtils::PenEnabled() )
+            {
+            aResult = ECmdTSubtract;
+            }
+        else
+            {
+            aResult = EMinusButton;
+            }
+        return ETrue;
+        }
+    TInt loc3 = KAllowedOperatorStar().Locate( aOperator );
+    if ( loc3 != KErrNotFound )
+        {
+        if ( AknLayoutUtils::PenEnabled() )
+            {
+            aResult = ECmdTMultiply;
+            }
+        else
+            {
+            aResult = EMultiplyButton;
+            }
+        return ETrue;
+        }
+    TInt loc4 = KAllowedOperatorDivide().Locate( aOperator );
+    if ( loc4 != KErrNotFound )
+        {
+        if ( AknLayoutUtils::PenEnabled() )
+            {
+            aResult = ECmdTDivide;
+            }
+        else
+            {
+            aResult = EDivideButton;
+            }
+        return ETrue;
+        }
+    TInt loc5 = KAllowedOperatorEquals().Locate( aOperator );
+    if ( loc5 != KErrNotFound )
+        {
+        if ( AknLayoutUtils::PenEnabled() )
+            {
+            aResult = ECmdTResult;
+            }
+        else
+            {
+            aResult = EEqualButton;
+            }
+        return ETrue;
+        }
+    TInt loc6 = KAllowedOperatorPercent().Locate( aOperator );
+    if ( loc6 != KErrNotFound )
+        {
+        if ( AknLayoutUtils::PenEnabled() )
+            {
+            aResult = ECmdTPercent;
+            }
+        else
+            { 
+            aResult = EPercentButton;
+            }
+        return ETrue;
+        }
+    TInt loc7 = KAllowedOperatorDecimal().Locate( aOperator );
+    if ( loc7 != KErrNotFound )
+        {
+        aResult = ECmdTSeparator;
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------
+// CCalcFuncmapSubPane::GetKeyboardType
+// Returns the type of keyboard
+// ---------------------------------------------------------
+//
+TBool CCalcFuncmapSubPane::GetKeyboardType()
+    {
+    return iKeyboardType;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcHistory.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  Define CCalcHistory class. This class is handled historical 
+*                line of the calculator. 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CalcEditline.h" 
+#include "CalcHistory.h" 
+
+//  LOCAL CONSTANTS AND MACROS  
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcHistory::CCalcHistory():
+              iNewestIndex(KCalcMaxHistoryLines - 1)
+    {
+    iHistory[iNewestIndex].AllClear();
+    }
+
+// Destructor
+CCalcHistory::~CCalcHistory()
+    {
+    }
+
+
+
+// Assignment operator
+// This inplementation depends on how to have history data. 
+// Refer to description of member data, CCalcHistory.h 
+// 
+const TCalcEditLine& CCalcHistory::operator[]
+                       (TInt aIndex) // Get (aIndex + 1)th latest history line 
+    {
+    TInt lineIndex(iNewestIndex - aIndex);
+    
+    if ( lineIndex < 0 )
+        {
+        lineIndex += KCalcMaxHistoryLines;
+        }
+        
+    return iHistory[lineIndex];      
+    }
+
+// ---------------------------------------------------------
+// CCalcHistory::Count
+// Return count of histoical lines.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CCalcHistory::Count() const     
+    {
+    return iCount;
+    }
+
+// ---------------------------------------------------------
+// CCalcHistory::Add
+// This inplementation depends on how to have history data. 
+// Refer to description of member data, CCalcHistory.h 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcHistory::Add
+                (const TCalcEditLine aLine) 
+    {
+    if ( iNewestIndex == (KCalcMaxHistoryLines - 1) )
+        {
+        iNewestIndex = 0;
+        }
+    else
+        {
+        iNewestIndex++;
+        }
+    
+    if ( iCount < KCalcMaxHistoryLines )
+        {
+        iCount++;
+        }
+    
+    iHistory[iNewestIndex] = aLine;
+    }
+
+// ---------------------------------------------------------
+// CCalcHistory::ClearHistory
+// Clear calculation history.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcHistory::ClearHistory()
+    {
+    iCount = 0;
+    iNewestIndex = KCalcMaxHistoryLines - 1;
+    for (TInt cnt(0); cnt < KCalcMaxHistoryLines; cnt++)
+        {
+        iHistory[cnt].AllClear();
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CCalcHistory::NotifyChangeDecimal
+// Call when decimal separator is changed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcHistory::NotifyChangeDecimal(TChar aOld, TChar aNew)
+    {
+    for (TInt cnt(0); cnt < iCount; cnt++)
+        {
+        iHistory[cnt].ChangeDecimal(aOld, aNew);
+        }
+    }
+        
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcOutSheet.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,821 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  The OutputSheet sub-pane class, CCalcOutputSheet.
+*                Derived from CCoeControl.
+*                The CCalcOutputSheet displays histroy data.
+*                History data is scroll up and down.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <AknUtils.h>
+#include    <Calcsoft.rsg>
+#include    <applayout.cdl.h>
+#include     <AknsDrawUtils.h>
+#include    <layoutmetadata.cdl.h>
+#include    "CalcEnv.h"
+#include    "CalcCont.h"    
+#include    "CalcOutSheet.h"
+#include    "CalcDoc.h"
+#include    "CalcEditline.h"
+#include    "CalcAppUi.h"
+#include    "CalcHistory.h"
+#include    "CalcDrawingConst.laf"
+#include "fbs.h"
+#include <AknIconUtils.h>
+#include <aknlayoutscalable_apps.cdl.h>
+#include <AknsBasicBackgroundControlContext.h>
+#include <AknFepInternalCRKeys.h>
+
+
+#include <eiksbfrm.h> 
+#include <eikscrlb.h>
+
+//  LOCAL CONSTANTS AND MACROS  
+
+// ================= MEMBER FUNCTIONS =======================
+
+// Two-phased constructor.
+CCalcOutputSheet* CCalcOutputSheet::NewL(
+                    CCalcContainer* aContainer)
+    {
+    CCalcOutputSheet* self = new (ELeave) CCalcOutputSheet();
+    CleanupStack::PushL(self);
+    self->ConstructL(aContainer);
+    CleanupStack::Pop(self); 
+    return self;
+    }
+
+// Destructor
+CCalcOutputSheet::~CCalcOutputSheet()
+    {
+    delete iOpSheetContext;
+    if(iOperatorLayout)
+        {
+        iOperatorLayout->Reset();
+        delete iOperatorLayout;    
+        }
+    if(iOperandLayout)
+        {
+        iOperandLayout->Reset();
+        delete iOperandLayout;    
+        }
+    if(iEqualLineLayout)
+        {
+        iEqualLineLayout->Reset();
+        delete iEqualLineLayout;    
+        }
+    if(iResultsLineLayout)
+        {
+        iResultsLineLayout->Reset();
+        delete iResultsLineLayout;    
+        }
+    if (iCRKey)
+        {
+        delete iCRKey;
+        iCRKey = NULL;
+        }
+        
+    //Delete the scrollbar frame
+    if(iSBFrame)
+        {
+        delete iSBFrame;
+        iSBFrame = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::ScrollToBottomL
+// Scroll to bottom line.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::ScrollToBottomL()
+    {
+    iScrollOffset = 0;
+    
+    //If scrollbar is present, update the scrollbar as well
+     if( AknLayoutUtils::PenEnabled()  )
+        {
+          UpdateScrollIndicatorL();
+        }
+    DrawNow();
+    }
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::NotifyClearHistory
+// Called after clearing calculation history.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::NotifyClearHistoryL()
+    {
+    iScrollOffset = 0;
+    if( AknLayoutUtils::PenEnabled()  )
+    {
+        UpdateScrollIndicatorL();    
+    }
+    DrawNow();
+    }
+        
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::CanUp
+// Check whether scroll-up can be done or not.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CCalcOutputSheet::CanUp() const
+    {
+    // The number of lines of the history which a document has is got.
+    TInt historyLine(iCalcHistory->Count());
+    if ( (iCalcOutputSheetLines + iScrollOffset) < historyLine )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::CanDown
+// Check whether scroll-down can be done or not.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TBool CCalcOutputSheet::CanDown() const
+    {
+    // The number of lines of the history which a document has is got.
+    return (iScrollOffset != 0);
+    }
+
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::ScrollUp
+// history is scrolled up.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::ScrollUp()
+    {
+   
+    if (CanUp())
+        {
+        iScrollOffset++;
+        DrawNow();
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::ScrollDown
+// history is scrolled down.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::ScrollDown()
+    {
+
+    if (CanDown())
+        {
+        iScrollOffset--;
+        DrawNow();
+        }
+    }
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcOutputSheet::CCalcOutputSheet() 
+    {
+    }
+
+// default constructor can leave.
+void CCalcOutputSheet::ConstructL
+        (CCalcContainer* aContainer) 
+                     
+    {
+    SetContainerWindowL(*aContainer);
+
+    iCalcContainer = aContainer;
+    
+    iCalcAppEnv = CCalcAppEnv::Static();
+    iCalcPaper = iCalcAppEnv->PaperBitmap();
+    iCalcAppEnv->ScalablePaperBitmaps(iCalcScalablePaper);
+#ifdef __SCALABLE_ICONS
+    iCalcResultsLine = iCalcAppEnv->ResultsLineBitmap();
+#endif
+
+    CCalcAppUi* appui = iCalcAppEnv->AppUi();
+    CCalcDocument* calcDocument = 
+                   STATIC_CAST(CCalcDocument*, appui->Document());
+    iCalcHistory = calcDocument->History(); 
+    TAknLayoutScalableParameterLimits listLimits;
+    listLimits = AknLayoutScalable_Apps::list_calc_item_pane_ParamLimits();
+    iCalcOutputSheetLines   = (listLimits.LastRow()-listLimits.FirstRow()) + 1;
+    iOpSheetContext = CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnFrCalcPaper , TRect(0,0,0,0), EFalse);
+    iOperatorLayout = new(ELeave)CArrayFixFlat<TAknLayoutText>(iCalcOutputSheetLines);
+    iOperandLayout = new(ELeave)CArrayFixFlat<TAknLayoutText>(iCalcOutputSheetLines);
+    iResultsLineLayout = new(ELeave)CArrayFixFlat<TAknLayoutRect>(iCalcOutputSheetLines-1);
+    iEqualLineLayout = new(ELeave)CArrayFixFlat<TAknLayoutRect>(iCalcOutputSheetLines-1);
+    iUiLanguage = User::Language();
+    }
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::SizeChanged
+// Set size of control.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::SizeChanged()
+    {
+    TRAP_IGNORE( SizeChangedOutSheetL() );
+    }
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::SizeChanged
+// Set size of control.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::SizeChangedOutSheetL()
+    {
+    TRect parentRect(iCalcContainer->Rect());
+    
+    TAknLayoutScalableParameterLimits listLimits;
+    if(AknLayoutUtils::PenEnabled())
+    {
+        listLimits = AknLayoutScalable_Apps::list_calc_item_pane_ParamLimits(enTouch_enabled);    
+    }
+    else
+    {
+        listLimits = AknLayoutScalable_Apps::list_calc_item_pane_ParamLimits(enTouch_disabled);    
+    }
+    iCalcOutputSheetLines   = (listLimits.LastRow()-listLimits.FirstRow()) + 1;
+    iOperatorLayout->ResizeL(iCalcOutputSheetLines);
+    iOperandLayout->ResizeL(iCalcOutputSheetLines);
+    iResultsLineLayout->ResizeL(iCalcOutputSheetLines-1);
+    iEqualLineLayout->ResizeL(iCalcOutputSheetLines-1);
+    
+    iOperatorLayout->Reset();
+    iOperandLayout->Reset();
+    iResultsLineLayout->Reset();
+    iEqualLineLayout->Reset();
+    
+    TAknLayoutRect rectParent;
+    TAknWindowLineLayout layoutOfParentResultsLine;
+    TAknLayoutRect rectListCalcPane;
+    
+ 
+    
+    if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+        {
+            TAknWindowLineLayout  calcPaperPane;
+            
+            //For Touch UI Layouts, different configuration
+            if( AknLayoutUtils::PenEnabled() )
+            {
+                if (Layout_Meta_Data::IsLandscapeOrientation())
+                {
+                    calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_lsc).LayoutLine();
+                }
+                else
+                {
+                    calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_prt).LayoutLine();
+                }
+            }
+            else
+            {
+                calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_disabled).LayoutLine();
+            }
+            TAknLayoutRect rectcalcPaperPane;    
+            rectcalcPaperPane.LayoutRect(parentRect,calcPaperPane);
+            iSBBrPoint = rectcalcPaperPane.Rect().iBr;
+            TAknWindowLineLayout layoutListCalcPane;
+            if( AknLayoutUtils::PenEnabled() )
+            {
+                layoutListCalcPane = AknLayoutScalable_Apps::list_calc_pane(enTouch_enabled).LayoutLine();
+            }
+            else
+            {
+                layoutListCalcPane = AknLayoutScalable_Apps::list_calc_pane(enTouch_disabled).LayoutLine();
+            }
+            
+            rectListCalcPane.LayoutRect(rectcalcPaperPane.Rect(),layoutListCalcPane);
+        }
+    
+    TInt nTimes=(iCalcOutputSheetLines-1);
+    for (TInt cnt(0); cnt < iCalcOutputSheetLines; cnt++)
+        {
+        if (AknLayoutUtils::ScalableLayoutInterfaceAvailable())
+        {
+        if(AknLayoutUtils::PenEnabled())
+        {
+            if (Layout_Meta_Data::IsLandscapeOrientation())
+            {
+                layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_enabled).LayoutLine();    
+            }
+            else
+            {
+                layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_enabled).LayoutLine();
+            }
+    
+        }
+        else
+        {
+            layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_disabled).LayoutLine();    
+        }
+        
+        
+        rectParent.LayoutRect(rectListCalcPane.Rect(),layoutOfParentResultsLine) ;
+            
+        TAknLayoutText operatorLayout;
+        TAknLayoutText operendLayout;
+        if(AknLayoutUtils::PenEnabled())
+        {
+            operatorLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t2(enTouch_with_prt).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
+            iOperatorLayout->AppendL(operatorLayout);
+        
+            operendLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t1(enTouch_with_lsc).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
+            iOperandLayout->AppendL(operendLayout);
+        }
+        else
+        {
+            operatorLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t2(enTouch_disabled).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
+            iOperatorLayout->AppendL(operatorLayout);
+        
+            operendLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t1(enTouch_disabled).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
+            iOperandLayout->AppendL(operendLayout);    
+        }
+        
+      // aCustomFont
+     --nTimes;
+        
+        }
+      
+      else
+      {
+            
+        
+      //Scalable UI.
+
+          TAknLayoutText operatorLayout;
+        TAknLayoutText operendLayout;
+          operatorLayout.LayoutText(parentRect,AppLayout::Calculator_texts_Line_8(nTimes),iCalcAppEnv->OutSheetOperatorFont()); // aCustomFont
+        iOperatorLayout->AppendL(operatorLayout);        
+
+        operendLayout.LayoutText(parentRect,AppLayout::Calculator_texts_Line_7(nTimes), NULL);
+        iOperandLayout->AppendL(operendLayout);            
+     --nTimes;
+      }
+    }
+    
+    //Scalable UI.
+    nTimes = iCalcOutputSheetLines - 2;      
+    for (TInt ii(0); ii < (iCalcOutputSheetLines - 1); ii++)
+        {
+
+
+        if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+            {
+#ifdef __SCALABLE_ICONS        
+            layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes).LayoutLine();
+
+            rectParent.LayoutRect(rectListCalcPane.Rect(),layoutOfParentResultsLine) ;
+            TAknWindowLineLayout   layoutOfResultsLine = AknLayoutScalable_Apps::list_calc_item_pane_g1().LayoutLine(); 
+            TAknLayoutRect lineLayout;
+            lineLayout.LayoutRect(rectParent.Rect(),layoutOfResultsLine);
+            iResultsLineLayout->AppendL(lineLayout);
+#else
+            TAknLayoutRect lineLayout;
+            lineLayout.LayoutRect(parentRect,AppLayout::Calculator_elements_Line_3(nTimes)); 
+            iEqualLineLayout->AppendL(lineLayout);
+#endif
+            }
+            else
+            {
+            TAknLayoutRect lineLayout;
+            lineLayout.LayoutRect(parentRect,AppLayout::Calculator_elements_Line_3(nTimes)); 
+            iEqualLineLayout->AppendL(lineLayout);
+            }
+            
+        --nTimes;
+        }
+
+    TAknLayoutRect  paperRect;
+    if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+            {
+            TAknLayoutRect rectCalcPaperPane;    
+            TAknLayoutRect rectbgCalcPaperPane;
+            //Different configuration for Touch Layouts
+            if( AknLayoutUtils::PenEnabled() )
+            {
+                    //In landscape mode different configuration is needed
+                 if (Layout_Meta_Data::IsLandscapeOrientation())
+                 {
+                    rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_lsc).LayoutLine());  
+                 }
+                 else
+                 {
+                    rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_prt).LayoutLine());      
+                 }
+                 rectbgCalcPaperPane.LayoutRect(rectCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane(enTouch_enabled).LayoutLine());
+            }
+            else
+            {
+                rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_disabled).LayoutLine());    
+                rectbgCalcPaperPane.LayoutRect(rectCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane().LayoutLine());
+            }
+            
+            iPaperPaneRect  = rectCalcPaperPane;
+            
+            
+            iCalcPaperLayout[0].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g1().LayoutLine());
+            iCalcPaperLayout[1].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g2().LayoutLine());
+            iCalcPaperLayout[2].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g3().LayoutLine());
+            iCalcPaperLayout[3].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g4().LayoutLine());
+            iCalcPaperLayout[4].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g5().LayoutLine());
+            iCalcPaperLayout[5].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g6().LayoutLine());
+            iCalcPaperLayout[6].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g7().LayoutLine());
+            iCalcPaperLayout[7].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g8().LayoutLine());
+            iCalcPaperLayout[8].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::calc_bg_paper_pane_g9().LayoutLine());
+            }
+            
+       iOpSheetContext->SetRect(Rect());
+        
+        //Only for touch UI, scrollbars are present
+       if( AknLayoutUtils::PenEnabled()  )
+        {
+          UpdateScrollIndicatorL();
+        }
+        else
+        {
+        if(iSBFrame)
+        {
+            delete(iSBFrame);
+            iSBFrame = NULL;
+        }
+        
+        }
+        
+        }
+
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::UpdateScrollIndicatorL
+// Creates and updates the scrollbar
+// (other items were commented in a header).
+// ---------------------------------------------------------
+void CCalcOutputSheet::UpdateScrollIndicatorL()
+    {
+        
+        if( !AknLayoutUtils::PenEnabled()  )
+        {
+            return;
+        }
+        
+        TAknLayoutRect rectCalcScrollPane;    
+
+        //Get the layout information for the scrollbar
+        if( AknLayoutUtils::PenEnabled() )
+        {
+         if (Layout_Meta_Data::IsLandscapeOrientation())
+         {
+            rectCalcScrollPane.LayoutRect(iPaperPaneRect.Rect(),AknLayoutScalable_Apps::scroll_pane_cp024().LayoutLine());  
+         }
+         else
+         {
+            rectCalcScrollPane.LayoutRect(iPaperPaneRect.Rect(),AknLayoutScalable_Apps::scroll_pane_cp024().LayoutLine());      
+         }
+
+        }
+                //Create scrollbar if not created already
+        if ( !iSBFrame )
+        {
+        //Make this class as the observer class as well
+        iSBFrame = new( ELeave ) CEikScrollBarFrame( this,this, ETrue );
+
+        // Decide which type of scrollbar is to be shown
+        CAknAppUi* appUi = iAvkonAppUi;
+        if (AknLayoutUtils::DefaultScrollBarType(appUi) == CEikScrollBarFrame::EDoubleSpan)
+        {
+            // For EDoubleSpan type scrollbar
+            iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse); // non-window owning scrollbar            
+            iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
+        }
+        else
+        {
+            // For EArrowHead type scrollbar
+            iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead);
+        }  
+        iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EOff);
+        }
+
+        TEikScrollBarModel hSbarModel;
+        TEikScrollBarModel vSbarModel;
+        
+        //By default span is one if only one page is present
+        if(iCalcHistory->Count() < iCalcOutputSheetLines)
+        {
+            vSbarModel.iScrollSpan = 1;    
+            vSbarModel.iThumbPosition = 0;    
+            
+        }
+        else
+        {
+                //span calculator if no of lines exceeds one page
+            vSbarModel.iScrollSpan = 1 + iCalcHistory->Count() - iCalcOutputSheetLines;  
+        }
+
+        iPrevThumbPosition = vSbarModel.iThumbPosition = vSbarModel.iScrollSpan - 1;
+        vSbarModel.iThumbSpan = 1;
+
+        TRect clientRect( iAvkonAppUi->ClientRect() );
+        TRect rec(rectCalcScrollPane.Rect()); 
+        TPoint point = rectCalcScrollPane.Rect().iBr;
+        TInt width = rectCalcScrollPane.Rect().Width();
+        TInt rightPointRectX = iSBBrPoint.iX;
+        TInt pointRectX = point.iX;
+        TInt pointRectY = point.iY;
+        pointRectX = rightPointRectX;
+        TPoint newPoint;
+        newPoint.SetXY( pointRectX, pointRectY );
+        TRect rect;
+        rect.SetRect( rec.iTl, newPoint );
+
+        TEikScrollBarFrameLayout layout;
+        layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
+
+        if (iSBFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan)
+        {    
+        // For EDoubleSpan type scrollbar
+        if (vSbarModel.iThumbPosition + vSbarModel.iThumbSpan > vSbarModel.iScrollSpan)
+        {
+            // Not let scrollbar values overflow
+            vSbarModel.iThumbPosition = vSbarModel.iScrollSpan - vSbarModel.iThumbSpan;
+        }
+
+        TAknDoubleSpanScrollBarModel hDsSbarModel(hSbarModel);
+        TAknDoubleSpanScrollBarModel vDsSbarModel(vSbarModel);
+        
+        if (iCalcHistory->Count() <= iCalcOutputSheetLines )
+        {
+        iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
+                CEikScrollBarFrame::EOff);
+        }
+        else
+        {
+        iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
+                CEikScrollBarFrame::EOn);
+        }
+
+        iSBFrame->TileL(&hDsSbarModel, &vDsSbarModel, clientRect, rect, layout);               
+        iSBFrame->SetVFocusPosToThumbPos(vDsSbarModel.FocusPosition());
+        }  
+        else
+        {
+        iSBFrame->TileL( &hSbarModel, &vSbarModel, clientRect, rect, layout );
+        iSBFrame->SetVFocusPosToThumbPos( vSbarModel.iThumbPosition );
+        }
+        }
+        
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::Draw
+// Drawing frame and history.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::Draw
+        (const TRect& aRect) const
+    {
+    
+    CWindowGc& gc = SystemGc();
+    gc.Clear(aRect);
+    gc.SetClippingRect(aRect);
+    TRect rect(Rect());
+    
+
+    
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    
+    AknsDrawUtils::Background( AknsUtils:: SkinInstance(), AknsDrawUtils::ControlContext(this), this, gc, rect );
+        
+           
+    gc.SetBrushStyle(CGraphicsContext::ENullBrush);
+    gc.SetPenStyle(CGraphicsContext::ENullPen);
+    //set the size of the bitmap. SVG-T upgrade.
+    CAknsItemData* idata = NULL;                    
+    if (skin)
+        {
+        idata = skin->GetCachedItemData( KAknsIIDQsnFrCalcPaper);
+        }
+        
+    if ( idata && idata->Type() == EAknsITImageTable )
+        {
+            if ( AknLayoutUtils::PenEnabled() ) 
+            {//when touch input,the paper become bigger,so it needs only one paper 
+                AknIconUtils::SetSize(iCalcScalablePaper[0]->Bitmap(),iCalcPaperLayout[0].Rect().Size(),EAspectRatioNotPreserved); 
+                AknIconUtils::SetSize(iCalcScalablePaper[0]->Mask(),iCalcPaperLayout[0].Rect().Size(),EAspectRatioNotPreserved);
+                iCalcPaperLayout[0].DrawImage(gc, iCalcScalablePaper[0]->Bitmap(),iCalcScalablePaper[0]->Mask());    
+            }
+            else
+            {
+                for(TInt Cnt=0;Cnt < 9; Cnt++)
+                {
+                AknIconUtils::SetSize(iCalcScalablePaper[Cnt]->Bitmap(),iCalcPaperLayout[Cnt].Rect().Size(),EAspectRatioNotPreserved); 
+                AknIconUtils::SetSize(iCalcScalablePaper[Cnt]->Mask(),iCalcPaperLayout[Cnt].Rect().Size(),EAspectRatioNotPreserved);
+                iCalcPaperLayout[Cnt].DrawImage(gc, iCalcScalablePaper[Cnt]->Bitmap(),iCalcScalablePaper[Cnt]->Mask());
+                }
+            }
+          }
+    else
+        {
+            // Make outsheet displayed in Jingmask is the same size as in other themes
+            // when there is a scrollbar on outsheet.
+            if ( AknLayoutUtils::PenEnabled() )
+                {
+                AknsDrawUtils::Background( AknsUtils:: SkinInstance(), iOpSheetContext, this, gc, iCalcPaperLayout[0].Rect() );
+                }
+            else
+                {
+                AknsDrawUtils::Background( AknsUtils:: SkinInstance(), iOpSheetContext, this, gc, rect );
+                }    
+        }
+          
+    
+    for (TInt loop(iCalcOutputSheetLines - 1); loop >= 0; loop--)
+        {
+        const TCalcEditLine& history = (*iCalcHistory)[loop + iScrollOffset];
+        TCalcEditLine::TCalcOperatorType operatorType(
+            history.Operator());
+        
+        if (loop < iCalcOutputSheetLines - 1)
+            {
+            // When an operator is Equal, a line is drawn at an upper end.
+            if (TCalcEditLine::ECalcEqual == operatorType)
+                {
+                    TRgb ResultsLineolor;
+                    TInt error1 = AknsUtils::GetCachedColor( skin, ResultsLineolor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG29);
+                    if(error1 == KErrNone)
+                    {
+                        AknIconUtils::SetIconColor(iCalcResultsLine->Bitmap(),ResultsLineolor);
+                    }
+                if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
+                    {
+#ifdef __SCALABLE_ICONS
+                    TAknLayoutRect& lineLayout = iResultsLineLayout->At(loop);
+                    AknIconUtils::SetSize(iCalcResultsLine->Bitmap(),lineLayout.Rect().Size(),EAspectRatioNotPreserved);
+                    AknIconUtils::SetSize(iCalcResultsLine->Mask(),lineLayout.Rect().Size(),EAspectRatioNotPreserved);
+                    lineLayout.DrawImage(gc, iCalcResultsLine->Bitmap(),iCalcResultsLine->Mask()); 
+#else
+                    TAknLayoutRect& equalLineLayout= iEqualLineLayout->At(loop);
+                    TRect rectLine = equalLineLayout.Rect();
+                    equalLineLayout.DrawRect(gc);
+#endif
+                    }
+                else 
+                    { 
+                    TAknLayoutRect& equalLineLayout= iEqualLineLayout->At(loop);
+                    TRect rectLine = equalLineLayout.Rect();
+                    equalLineLayout.DrawRect(gc);
+                    }
+                }
+            }
+            TRgb color;
+            TInt error = AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG29);
+            if(error == KErrNone)
+            {
+                gc.SetPenColor(color);
+            }
+            
+        //change TBuf<10> to TBuf<KCalcMaxNumberWidth>
+       TBuf<KCalcMaxNumberWidth> keyvalue;
+       
+       keyvalue.Append(history.NumberString());
+       AknTextUtils::LanguageSpecificNumberConversion  (keyvalue);
+        // An operand's drawing
+        TAknLayoutText& operendLayout = iOperandLayout->At(loop);
+
+                    if ( iUiLanguage == ELangFarsi || iUiLanguage == ELangHindi || 
+                        iUiLanguage == ELangUrdu || iUiLanguage == ELangArabic )
+                        {
+                         if( iUiLanguage == ELangUrdu || iUiLanguage == ELangArabic )
+                 {
+                    TInt len = keyvalue.Length();
+                    TInt pos = KErrNotFound;
+                    TBuf<1> ch;
+                    ch.Append(iCalcAppEnv->MinusIndicator());
+                    if( (pos = keyvalue.Locate(iCalcAppEnv->MinusIndicator())) != KErrNotFound &&
+                         pos == keyvalue.LocateReverse(iCalcAppEnv->MinusIndicator()))
+                    {
+                     keyvalue.Delete( pos, 1 );
+                     keyvalue.Insert( 0, ch );     
+                    }
+                 }
+            operendLayout.DrawText(gc,keyvalue,EFalse,color);
+            }
+        else
+            {
+            operendLayout.DrawText(gc,history.NumberString(),EFalse,color);    
+            }
+        // An operator's drawing
+        TPtrC operatorString(
+            iCalcAppEnv->OutSheetOperator(operatorType));
+        TAknLayoutText& operatorLayout = iOperatorLayout->At(loop);
+        operatorLayout.DrawText(gc, operatorString , EFalse, color);
+        }
+        
+        
+    }
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::HandleScrollEventL
+// Handles the events from the scrollbar
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType)
+    {
+          //Only on page up/down,scroll up/down and drag events
+    if((aEventType == EEikScrollPageDown) || (aEventType == EEikScrollPageUp) || 
+       (aEventType == EEikScrollThumbDragVert) || (aEventType == EEikScrollUp) ||
+       (aEventType == EEikScrollDown))
+       
+        {
+           //Get the current position from the scroll bar
+           
+           if(iPrevThumbPosition >aScrollBar->ThumbPosition() )
+           {
+                     //Move the scroll bar n times up
+                while(iPrevThumbPosition != aScrollBar->ThumbPosition())
+                {
+                    ScrollUp();
+                    iPrevThumbPosition--;
+                }
+           }
+           else
+           {
+                //Move the scroll bar n times down
+                while( iPrevThumbPosition != aScrollBar->ThumbPosition() )
+                {
+                    ScrollDown();
+                    iPrevThumbPosition++;
+                }
+           }
+
+           DrawNow();
+        }
+    }
+    
+// ---------------------------------------------------------
+// CCalcOutputSheet::HandleResourceChange
+// Handles the events that needs to be taken care after resource change
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::HandleResourceChange(TInt aType)
+{
+    TRAP_IGNORE(HandleResourceChangeOutSheetL(aType) );
+    }
+
+// ---------------------------------------------------------
+// CCalcOutputSheet::HandleResourceChangeOutSheetL
+// Handles the events that needs to be taken care after resource change
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcOutputSheet::HandleResourceChangeOutSheetL(TInt aType)
+
+{
+  
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        if (AknLayoutUtils::PenEnabled())
+            {
+            ScrollToBottomL();
+            }
+        }
+    if ( aType == KAknsMessageSkinChange )
+        {
+        if (AknLayoutUtils::PenEnabled())
+            {
+            delete (iSBFrame);
+            iSBFrame = NULL;
+
+            UpdateScrollIndicatorL();
+            }
+        }
+}
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/calcsoft/src/CalcView.cpp	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,1188 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:  CCalcView is a view class of Calculator application.
+*                Base class of CCalcView is CAknView. 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <avkon.hrh>
+#include <eikon.hrh>
+#include <eikmenup.h>
+#include <aknnotewrappers.h> 
+#include <AiwServiceHandler.h>
+
+#include <aknbutton.h>
+
+#include <hlplch.h>   // For HlpLauncher 
+#include <featmgr.h>      // Feature Manager
+
+#include <Calcsoft.rsg>
+
+#include "CalcView.h"
+#include "CalcCont.h" 
+#include "CalcEdit.h"
+#include "CalcAppUi.h"
+#include "CalcDoc.h"
+#include "CalcHistory.h"
+#include "CalcOutSheet.h"
+#include "CalcFunc.h"
+#include "CalcEnv.h"
+#include "calc.hrh" 
+#include "CalcEditline.h"
+
+//#include    "CalcCmdBtn.h"
+
+#include <layoutmetadata.cdl.h>
+#include <AiwMenu.h>
+#include <AiwCommon.h>
+
+
+//  LOCAL CONSTANTS AND MACROS  
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// Two-phased constructor.
+CCalcView* CCalcView::NewLC()
+    {
+    CCalcView* self = new (ELeave) CCalcView();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+  
+  // default constructor can leave.
+void CCalcView::ConstructL()
+    {
+    
+    BaseConstructL(R_CALC_VIEW_INFO);
+    
+    iCalcDocument = STATIC_CAST(CCalcDocument*, AppUi()->Document());
+
+    iCalcDocument->SetCalcView( this );
+
+    iCalcDocument->LoadStateL();
+   
+    /******** Initialize the ServiceHandler in the ConstructL *****/
+    
+    iServiceHandler = CAiwServiceHandler::NewL();
+    
+    /***** Attach the Menu Items of the Calculator and also the Interest *****/
+    
+    iServiceHandler->AttachMenuL(R_CALC_POPUPMENU, R_AIWHELPAPP_INTEREST);
+    
+    this->iLastResultSetected = EFalse;
+    }
+
+// Destructor
+CCalcView::~CCalcView()
+    {
+    if ( iContainer )
+        {
+        delete iContainer;
+        iContainer = NULL;
+        }
+
+    if( iServiceHandler )
+        {
+        delete iServiceHandler;
+        iServiceHandler = NULL;
+        }
+     
+     }
+
+// ---------------------------------------------------------
+// CCalcView::State
+// Return current state
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CCalcView::TStateNo CCalcView::State() const
+    {
+    return iState;
+    }
+
+// ----------------------------------------------------
+// CCalcView::LatestInput
+// Return type of latest input
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+CCalcView::TKindOfInput CCalcView::LatestInput() const
+    {
+    return iLatestInput;
+    }
+
+// ----------------------------------------------------
+// CCalcView::UpdateState
+// Update state by using kind of input
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+void CCalcView::UpdateState
+        (const TKindOfInput& aKind)   
+    {
+    iLatestInput = aKind;
+    
+    switch (aKind)
+       {
+        case EOperand:
+        case EMemoryRecall:
+            {
+            switch (iState)
+                {
+                case EInitialMode: 
+                case ESelectResult:
+                    iState = EOperandOnly;
+                    break;
+                case EOperandAndOperator:
+                    iState = EOperandAndOperatorAndOperand;
+                    break;
+                default:
+                    break;
+                }
+            break;
+            }
+        case EOperatorResult:
+            {
+            iState = EOperatorOnlyResult;
+            break;
+            }
+        case EOperator:
+            {
+            iState = EOperandAndOperator;
+            break;
+            }
+        case EEqual:
+            {
+            iState = ESelectResult;
+            break;
+            }
+        case EMemorySave:
+            {
+            switch (iState)
+                {
+                case EOperandAndOperatorAndOperand:
+                    iState = ESelectResult;
+                    break;
+                case ESelectResult:
+                    iState = EOperandOnly;
+                    break;
+                default:
+                    break;
+                }
+            break;
+            }
+        case EAllClear:
+            {
+            iState = EOperandOnly;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+
+// ----------------------------------------------------
+// CCalcView::ErrorMsgL
+// Display error message
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+void CCalcView::ErrorMsgL
+        (TInt aErrorCode) 
+    {
+    TInt resourceId(0);
+
+    switch (aErrorCode)
+        {
+        case KErrOverflow:
+            {
+            resourceId = R_CALC_ERROR_OUTOFRANGE;
+            break;
+            }
+        case KErrDivideByZero:
+            {
+            resourceId = R_CALC_ERROR_DIVISIONBYZERO;
+
+             // UpdateState( EOperator );
+            break;
+            }
+        case KErrNotSupported:
+            {
+            resourceId = R_CALC_ERROR_NEGATIVEVALUESQRT;
+            break;
+            }
+        default:
+            {
+            return;
+            }
+        }
+    
+    //Localisation of scalable UI.
+    HBufC* message = iCoeEnv->AllocReadResourceLC(resourceId) ;
+    CAknErrorNote* note = new (ELeave) CAknErrorNote();
+    note->ExecuteLD(*message);
+    CleanupStack::PopAndDestroy(message);
+    
+    }
+
+
+// ----------------------------------------------------
+// CCalcView::DynInitMainMenuPane
+// Delete meaningless items from main menu.
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+void CCalcView::DynInitMainMenuPane    
+              (CEikMenuPane* aMenuPane) 
+    {
+    
+            
+
+    switch (iState)
+        {
+        case ESelectResult:
+            {
+            aMenuPane->DeleteMenuItem(ECalcCmdLastResult);
+            break;
+            }
+        case EInitialMode:
+            {
+            aMenuPane->DeleteMenuItem(ECalcCmdClearCalcAndHistory);
+            break;
+            }
+        case EOperandOnly:
+            {
+            if (iCalcDocument->History()->Count() == 0)
+                {
+                aMenuPane->DeleteMenuItem(ECalcCmdClearCalcAndHistory);
+                }
+             if(iLastResultSetected)
+                 {
+                aMenuPane->DeleteMenuItem(ECalcCmdLastResult);     
+                 }
+            break;
+            }
+        case EOperandAndOperator:
+        case EOperandAndOperatorAndOperand:
+             if(iLastResultSetected)
+                 {
+                aMenuPane->DeleteMenuItem(ECalcCmdLastResult);     
+                 }
+            break;      
+        default:
+            {
+            break;
+            }
+        }
+    }                        
+
+
+// ----------------------------------------------------
+// CCalcView::DynInitMemoryMenuPane
+// Delete meaningless items from menu of memory 
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+void CCalcView::DynInitMemoryMenuPane
+        (CEikMenuPane* aMenuPane)
+    {
+    if (!iCalcDocument->HasMemory())
+        {
+        aMenuPane->DeleteMenuItem(ECalcCmdMemoryClear);
+        }    
+    }
+    
+// ---------------------------------------------------------
+// CCalcView::NotifyChangeDecimal
+// Call when decimal separator is changed.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::NotifyChangeDecimal(TChar aOld, TChar aNew)
+    {
+    iContainer->NotifyChangeDecimal(aOld, aNew);
+    }
+    
+
+
+// ---------------------------------------------------------
+// CCalcView::HandleCommandL
+// Handling command.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleCommandL
+        ( TInt aCommand ) 
+    {
+    // Handle the command generated by:
+    //   1. menu item selection
+    //   2. short-cut key press
+   
+    switch ( aCommand )
+        {
+        case ECalcCmdResult:
+            {
+            HandleResultL();
+            break;
+            }
+        case ECalcCmdAdd:
+            {
+            HandleOperatorL(TCalcEditLine::ECalcAdd);
+            break;
+            }
+        case ECalcCmdSubtract:
+            {
+            HandleOperatorL(TCalcEditLine::ECalcSubtract);
+            break;
+            }
+        case ECalcCmdMultiply:
+            {
+            HandleOperatorL(TCalcEditLine::ECalcMultiply);
+            break;
+            }
+        case ECalcCmdDivide:
+            {
+            HandleOperatorL(TCalcEditLine::ECalcDivide);
+            break;
+            }
+        case ECalcCmdChangeSign:
+            {
+            this->iLastResultSetected = EFalse;
+            HandleChangeSignL();
+            break;
+            }
+        case ECalcCmdLastResult:
+            {
+            HandleLastResultL();
+            break;
+            }
+        case ECalcCmdPercent:
+            {
+            HandleOperatorL(TCalcEditLine::ECalcPercent);
+            // The result is always is displayed
+            // after the percent button is pressed.
+            // But if there was a error in the calculation
+            // this if will enable us to not call the
+            // HandleResultL and thus making sure that
+            // the state of the buttons is identical to the
+            // situation before the calculation.
+            if (iState == EOperatorOnlyResult)
+                HandleResultL();
+            break;
+            }
+        case ECalcCmdSqrt:
+            {
+//            TRequestStatus trs;
+//            RTimer timer;
+//            timer.CreateLocal();
+//            timer.After(trs, 1000*2);
+//            while ( trs == KRequestPending) {
+//                  User::WaitForAnyRequest();
+//            }
+//            timer.Cancel();
+//            timer.Close();
+            HandleOperatorL(TCalcEditLine::ECalcSqrt);
+            // HandleResultL only if sqrt was pressed after single operand.
+            if (iState == EOperatorOnlyResult)
+                HandleResultL();
+
+            break;
+            }
+        case ECalcCmdMemorySave:
+            {
+            HandleMemorySaveL();
+            break;
+            }
+        case ECalcCmdMemoryRecall:
+            {
+            this->iLastResultSetected = EFalse;
+            HandleMemoryRecallL();
+            break;
+            }
+        case ECalcCmdMemoryClear:
+            {
+            HandleMemoryClearL();
+            break;
+            }
+        case ECalcCmdScrollUp:
+            {
+            HandleScrollUp();
+            break;
+            }
+        case ECalcCmdScrollDown:
+            {
+            HandleScrollDown();
+            break;
+            }
+        case ECalcCmdClearCalcAndHistory:
+            {
+            DoClearCalcAndHistoryL();
+            break;
+            }
+        case EAknSoftkeyExit:
+        case EEikCmdExit:
+            {
+            STATIC_CAST(CCalcAppUi*, AppUi())->ExitCalculator();
+            break;
+            }
+        case ECalcCmdHelp: 
+            {
+            if (FeatureManager::FeatureSupported( KFeatureIdHelp ))
+                {
+                HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), AppUi()->AppHelpContextL());
+                }
+            break;
+            }
+        case EAknSoftkeySelect:
+            {
+            iContainer->HandleMiddleSoftKey();
+            break;
+            }
+            
+        //Below cases are possible only for Touch UI Layouts
+        case ECalcCmdOne:
+            {
+            iContainer->SetOperatorFromTouchL(1);
+            }
+            break;
+        case ECalcCmdTwo:
+            {
+            iContainer->SetOperatorFromTouchL(2);
+            }
+            break;
+        case ECalcCmdThree:
+            {
+            iContainer->SetOperatorFromTouchL(3);
+            }
+            break;
+        case ECalcCmdFour:
+            {
+            iContainer->SetOperatorFromTouchL(4);
+            }
+            break;
+        case ECalcCmdFive:
+            {
+            iContainer->SetOperatorFromTouchL(5);
+            }
+            break;
+        case ECalcCmdSix:
+            {
+            iContainer->SetOperatorFromTouchL(6);
+            }
+            break;
+        case ECalcCmdSeven:
+            {
+            iContainer->SetOperatorFromTouchL(7);
+            }
+            break;
+        
+        case ECalcCmdEight:
+            {
+            iContainer->SetOperatorFromTouchL(8);
+            }
+            break;
+        
+        case ECalcCmdNine:
+            {
+            iContainer->SetOperatorFromTouchL(9);
+            }
+            break;
+        
+        case ECalcCmdZero:
+            {
+            iContainer->SetOperatorFromTouchL(0);
+            }
+            break;
+            
+        case ECalcCmdSeparator:
+            {
+            iContainer->SetSeparatorFromTouchL();
+            }
+            break;
+        case ECalcCmdCancel:
+            {
+            TInt repeat( iContainer->FuncmapSubPane()->IsKeyLongPressed() );           
+            iContainer->ClearInputKeyL( repeat );
+            }
+            break; 
+            
+    /****** If none of the cases handle the Aiw Help then it will come to the default case ****/
+        default:
+            {
+                 CArrayFix<TCoeHelpContext>* buf = AppUi()->AppHelpContextL();
+                 TCoeHelpContext& helpContext = buf->At(0);         
+                   TAiwVariant uidVariant;
+                 TAiwVariant contextVariant;         
+                 uidVariant.Set(helpContext.iMajor);         
+                 TAiwGenericParam uidParam(EGenericParamHelpItem, uidVariant);                          contextVariant.Set(helpContext.iContext);         
+                 contextVariant.Set(helpContext.iContext);         
+                 TAiwGenericParam contextParam(EGenericParamHelpItem, contextVariant);     
+                 CAiwGenericParamList* list = CAiwGenericParamList::NewLC();         
+                 list->AppendL(uidParam);
+                 list->AppendL(contextParam); 
+                 iServiceHandler->ExecuteMenuCmdL(aCommand,*list,iServiceHandler->OutParamListL());     
+                 CleanupStack::PopAndDestroy(list);
+                 delete buf;
+                 buf= NULL;
+            break;
+            }
+        }
+    }
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CCalcView::CCalcView():
+           iState(EInitialMode),
+           iLatestInput(EOperand)
+    {
+    }
+
+
+// ---------------------------------------------------------
+// CCalcView::CreateContainerL
+// Create CCalcContainer class
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::CreateContainerL()
+    {
+    iContainer = CCalcContainer::NewL(this);
+    
+    iContainer->SetMopParent(this);
+        
+    TRect mainPaneRect ;
+    TRect statusPaneRect;
+    
+    if (Layout_Meta_Data::IsLandscapeOrientation())
+      
+      {
+      
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane,mainPaneRect);
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane,statusPaneRect);
+        mainPaneRect.iTl= statusPaneRect.iTl;
+          
+      }
+      
+      else
+      
+      {
+      
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane,mainPaneRect);
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane,statusPaneRect);
+       
+       mainPaneRect.iTl= statusPaneRect.iTl;
+                                                
+      } 
+    
+    
+    iContainer->SetRect(mainPaneRect);    
+    iEditorSubPane = iContainer->EditorPane();
+    iOutputSheet = iContainer->OutputSheet();
+    }
+
+
+// ---------------------------------------------------------
+// CCalcView::HandleResultL
+// Handle result command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleResultL()
+    {
+    if (!HandleEqualSubRoutineL())
+        {
+        iEditorSubPane->DrawNow();
+        UpdateState(EEqual);
+
+        iContainer->SetSqrtEnableL();
+        iContainer->ShowPercentButton(EFalse);
+        iContainer->SetClearKeyEnable();             
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CCalcView::HandleChangeSignL
+// Handle ChangeSign command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleChangeSignL()
+    {
+    iEditorSubPane->DoChangeSignL(iState);        
+    
+    if (iState == CCalcView::EOperandAndOperator)
+        {
+        UpdateState(EMemoryRecall);
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcView::HandleLastResultL
+// Handle LastResult command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleLastResultL()
+    {
+    iLastResultSetected = ETrue;
+    //  Recall "LastResult", which is the answer based on latest "=" input.
+    iEditorSubPane->DoMemoryRecallOrLastResult(
+        iCalcDocument->LastResult(), iState);
+
+    UpdateState(EMemoryRecall);
+    if ( iState == EOperandOnly && 
+         iEditorSubPane->EditLine().CheckZeroL() )
+        {
+        UpdateState(EAllClear);
+        }
+    iContainer->SetChangeSignEnableL();
+    iContainer->SetSqrtEnableL();
+    iContainer->SetClearKeyEnable(); 
+
+    //highlighting the sign "%".
+    if ( iState == EOperandAndOperatorAndOperand )
+        {
+        iContainer->SetPercentEnableL();
+        }        
+    }
+
+// ---------------------------------------------------------
+// CCalcView::HandleMemorySaveL
+// Handle MemorySave command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleMemorySaveL()
+    {
+    CCalcView::TKindOfInput kindOfInput(CCalcView::EMemorySave);
+    
+    if (iState == EOperandAndOperatorAndOperand)
+        {
+        if (HandleEqualSubRoutineL()) // Calculate result
+            {
+            return;
+            }
+        }
+    else
+        {
+        if (iState == ESelectResult)
+            {
+            iCalcDocument->AddEmptyLine();
+            iOutputSheet->ScrollToBottomL();
+            iContainer->ScrollArrowUpdate();
+            iEditorSubPane->SetOperator(TCalcEditLine::ECalcOperatorNone);
+            
+            if (iEditorSubPane->EditLine().CheckZeroL())
+                {
+                kindOfInput = CCalcView::EAllClear;
+                }
+            }
+        }
+    iCalcDocument->MemorySaveL(iEditorSubPane->EditorNumber());
+    iEditorSubPane->DrawNow();
+    UpdateState(kindOfInput);
+    iContainer->SetChangeSignEnableL();
+    iContainer->SetSqrtEnableL();
+    }
+
+// ---------------------------------------------------------
+// CCalcView::HandleMemoryRecallL
+// Handle MemoryRecall command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleMemoryRecallL()
+    {
+    iEditorSubPane->DoMemoryRecallOrLastResult(
+        iCalcDocument->Memory(), iState );
+
+    if ( iState == ESelectResult )
+        {
+        iCalcDocument->AddEmptyLine();
+        iOutputSheet->ScrollToBottomL();
+        iContainer->ScrollArrowUpdate();
+        }
+        
+    UpdateState( EMemoryRecall );
+    if ( iState == EOperandOnly && 
+         iEditorSubPane->EditLine().CheckZeroL() )
+        {
+        UpdateState( EAllClear );
+        }
+
+    iContainer->SetChangeSignEnableL();
+    iContainer->SetSqrtEnableL();
+
+    iContainer->SetClearKeyEnable();
+
+    // highlighting the sign "%".
+    if ( iState == EOperandAndOperatorAndOperand )
+        {
+        iContainer->SetPercentEnableL();
+        }        
+    }
+
+// ---------------------------------------------------------
+// CCalcView::HandleMemoryClear
+// Handle MemoryClear command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+// 
+
+void CCalcView::HandleMemoryClearL()
+    {
+    iCalcDocument->MemoryClearL();
+    iEditorSubPane->DrawNow();
+    }
+
+// ---------------------------------------------------------
+// CCalcView::HandleScrollUp
+// Handle Scroll up button command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleScrollUp()
+    {
+    iOutputSheet->ScrollUp();
+    iContainer->ScrollArrowUpdate();
+    }
+
+// ---------------------------------------------------------
+// CCalcView::HandleScrollDown
+// Handle Scroll down button command
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleScrollDown()
+    {
+    iOutputSheet->ScrollDown();
+    iContainer->ScrollArrowUpdate();
+    }
+
+// ---------------------------------------------------------
+// CCalcView::DoClearCalcAndHistoryL
+// Clear calculation history and clear calculation.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::DoClearCalcAndHistoryL()
+    {
+    iCalcDocument->History()->ClearHistory();
+    iOutputSheet->NotifyClearHistoryL();
+    iContainer->ScrollArrowUpdate();
+    // Clear calculation
+    TKeyEvent keyEvent;
+    keyEvent.iCode = EKeyBackspace;
+    keyEvent.iRepeats = 1; 
+    iEditorSubPane->OfferKeyEventL(keyEvent, EEventKey);
+    iContainer->ShowPercentButton(EFalse);
+    }
+        
+
+// ---------------------------------------------------------
+// CCalcView::HandleOperatorL
+// Operator Handler common routin.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::HandleOperatorL
+        (TCalcEditLine::TCalcOperatorType aOperator) 
+    {
+    TCalcEditLine editLine(iEditorSubPane->EditLine());
+    TReal64 editorNumber(iEditorSubPane->EditorNumber());
+    TReal64 result(editorNumber);
+
+    this->iLastResultSetected = EFalse;
+    // User has pressed %
+    if (aOperator == TCalcEditLine::ECalcPercent)
+        {    
+        if (iState == EOperandAndOperatorAndOperand)
+            {
+            editLine.TrimZeroL();
+            // Save the previous operator
+            TCalcEditLine::TCalcOperatorType previousOperator = editLine.Operator();
+            // Set the operator to percent
+            editLine.SetOperator(TCalcEditLine::ECalcPercent);
+            
+            
+            // Calculate
+            TRAPD(errorCode3, 
+                result = iCalcDocument->CalculateAndModifyHistoryL(
+                editorNumber, editLine, previousOperator));
+            
+            if (errorCode3)
+                {
+                iContainer->SetErrorCode(errorCode3);
+                return;
+                }
+
+            iOutputSheet->ScrollToBottomL();
+            // Show the correct operand in the output sheet
+            aOperator = previousOperator;
+            // Set the state to EOperatorResult so that the HandleResult knows what to do
+            UpdateState(EOperatorResult);
+            }    
+        }
+
+    // User has pressed sqrt
+    else if (aOperator == TCalcEditLine::ECalcSqrt)
+        {
+        // We are in a middle of calculation chain
+        if (iState == EOperandAndOperatorAndOperand)
+            {
+            editLine.TrimZeroL();
+            // Save the previous operator
+            TCalcEditLine::TCalcOperatorType previousOperator = editLine.Operator();
+            // Set the operator to sqrt
+            editLine.SetOperator(TCalcEditLine::ECalcSqrt);
+            
+            // First calculate the sqrt
+            TRAPD(errorCode, 
+                result = iCalcDocument->CalculateAndNoHistoryL(
+                editorNumber, editLine));
+                                                 
+            if (errorCode)
+                {
+                iContainer->SetErrorCode(errorCode);
+                return;
+                }
+            
+            // Set the operator to previous one
+            editLine.SetOperator(previousOperator);
+            // Result goes to the outputsheet
+            editLine.SetNumber(result);
+
+            // Calculate again
+            TRAPD(errorCode2, 
+                result = iCalcDocument->CalculateAndAddHistoryL(
+                result, editLine));
+                                                 
+            if (errorCode2)
+                {
+                iContainer->SetErrorCode(errorCode2);
+                return;
+                }
+            // Set this so that we will display correct operator in the output sheet
+            aOperator = previousOperator;
+            iOutputSheet->ScrollToBottomL();
+            UpdateState(EOperator);
+            // Dimm the square root and percent
+            iContainer->ShowSqrtButton(EFalse);
+            iContainer->ShowPercentButton(EFalse);
+            }
+        // Only operand and sqrt
+        else
+            {
+            editLine.SetOperator(aOperator);
+                    
+            // Trap harness, because the CalculateAndHistoryL leaves in case of negative operand
+            TRAPD(errorCode,
+                result = iCalcDocument->CalculateAndAddHistoryL(
+                editorNumber, editLine));
+            
+            if (errorCode)
+                {
+                iContainer->SetErrorCode(errorCode);
+                return;
+                }
+
+            iOutputSheet->ScrollToBottomL();
+            //Set the state to EOperatorResult so that we know to call HandleResult later
+            UpdateState(EOperatorResult);
+            }
+        }
+    //  Current state is state4 and previous input is MS,
+    // provisional result is get and show this the editor.
+    // And a line is not added to OutputSheet because a line
+    // is already added.
+    
+    else if (iState == ESelectResult)
+        {
+        iCalcDocument->AddEmptyLine();
+        editLine.SetOperator(TCalcEditLine::ECalcOperatorNone);
+        //  Because the state is "User has selected result",
+        // this function does not occur leave.
+        result = iCalcDocument->CalculateAndAddHistoryL(
+                 editorNumber, editLine);
+        iOutputSheet->ScrollToBottomL();
+        UpdateState(EOperator);    
+        iContainer->SetSqrtEnableL();
+        }
+        
+    //  If a input is a operator and state is updated,
+    // calculate and update history.
+    else if (iState != EOperandAndOperator)  
+        {
+        editLine.TrimZeroL();
+
+        // If the number in the EditLine is not a operand
+        // we need to dim square root and percent buttons
+        if (iState == EOperandAndOperatorAndOperand)
+            {
+            iContainer->ShowSqrtButton(EFalse);
+            iContainer->ShowPercentButton(EFalse);
+            }
+        // Calculate by user's input
+        TRAPD(errorCode, 
+              result = iCalcDocument->CalculateAndAddHistoryL(
+              editorNumber, editLine));
+                                                 
+        if (errorCode)
+            {
+            iContainer->SetErrorCode(errorCode);
+            return;
+            }
+        iOutputSheet->ScrollToBottomL();
+        UpdateState(EOperator);
+        }
+    
+    iEditorSubPane->SetEditorNumber(result);
+    iEditorSubPane->SetOperator(aOperator);
+    
+    if ( aOperator != TCalcEditLine::ECalcSqrt )
+        {
+        iEditorSubPane->DrawNow();  
+        }
+    iContainer->ScrollArrowUpdate();
+ 
+    iContainer->SetClearKeyEnable(); 
+    if (aOperator == TCalcEditLine::ECalcAdd ||aOperator == TCalcEditLine::ECalcSubtract ||
+         aOperator == TCalcEditLine::ECalcMultiply ||aOperator == TCalcEditLine::ECalcDivide )
+        {
+        iContainer->SetChangeSignDisable();
+        }  
+    
+    }
+
+
+// ---------------------------------------------------------
+// CCalcView::HandleEqualSubRoutineL
+// Common routine for select result and MemorySave on two operands
+// and operator or State4.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt CCalcView::HandleEqualSubRoutineL()
+    {
+    TCalcEditLine editLine(iEditorSubPane->EditLine());
+    TInt calculationError(KErrNone);
+    TReal64 result(0);
+
+    if (iState == EOperandAndOperator || iState == EOperatorOnlyResult)
+        {
+        // User has selected equal or operand and sqrt, or percent
+        result = iCalcDocument->ProvisionalResult();
+        }
+    else 
+        {
+        editLine.TrimZeroL();
+        // We are calculating the intermediate result. 
+        // So we need to dim the sqrt and percent buttons.
+        iContainer->ShowSqrtButton(EFalse); 
+        iContainer->ShowPercentButton(EFalse);
+        
+        if (iState == ESelectResult)
+            {
+            iCalcDocument->AddEmptyLine();
+            editLine.SetOperator(TCalcEditLine::ECalcOperatorNone);
+            }
+        TRAP(calculationError,
+             result = iCalcDocument->CalculateAndAddHistoryL(
+             iEditorSubPane->EditorNumber(), editLine));
+        }
+    
+    //  If overflow or division by zero occurs,
+    // error message is displayed.
+    if (calculationError)
+        {
+        iContainer->SetErrorCode(calculationError);
+        }
+    else
+        {
+        iCalcDocument->AddEqualLineAndUpdateLastResultL();
+        iEditorSubPane->SetEditorNumber(result);
+        iEditorSubPane->SetOperator(TCalcEditLine::ECalcEqual);
+        // Show result on the sheet
+        CCalcOutputSheet* sheet = iContainer->OutputSheet();
+        sheet->ScrollToBottomL();
+        iContainer->ScrollArrowUpdate();
+        }
+    return calculationError;
+    }
+
+// ----------------------------------------------------
+// CCalcView::DoActivateL
+// This is called when CCalcView becomes active.
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+void CCalcView::DoActivateL
+                (const TVwsViewId& /* aPrevViewId */,
+                 TUid /* aCustomMessageId */,
+                 const TDesC8& /* aCustomMessage */)
+    {
+    if ( iContainer == NULL )
+        {
+        CreateContainerL();
+        AppUi()->AddToStackL( *this, iContainer );
+        iContainer->ActivateL();
+        } 
+    
+    }
+
+// ----------------------------------------------------
+// CCalcView::DoDeactivate
+// This is called when CCalcView becomes deactive.
+// (other items were commented in a header).
+// ----------------------------------------------------
+//
+void CCalcView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromStack( iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CCalcView::Id
+// Return UID of CCalcView
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TUid CCalcView::Id() const
+    {
+    return TUid::Uid(KCalcViewId);
+    }
+
+// ---------------------------------------------------------
+// CCalcView::DynInitMenuPaneL
+// This app can have only one menu.
+// But menu of Calculator application is changed on State, memory etc.
+// Therefore to delete meaningless items from menu, this function is defined. 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalcView::DynInitMenuPaneL
+        (TInt aResourceId,        
+         CEikMenuPane* aMenuPane) 
+    {
+    if(iServiceHandler->HandleSubmenuL(*aMenuPane))
+        {
+            return;
+        }
+    switch (aResourceId)
+        {
+        case (R_CALC_POPUPMENU):
+            {
+                
+                       DynInitMainMenuPane(aMenuPane);
+                    
+                /***** Get the context of the Help topic from here *****/
+                  CArrayFix<TCoeHelpContext>* buf= AppUi()->AppHelpContextL();
+                   TInt i= buf->Count();
+                   if(i!=0)
+                       {
+                       /***** Check whether our flag is defined or not *****/
+                       #ifdef RD_HELP_AIW_INTEGRATION
+                       
+                       /***** Call the AiwProvider's AddItemsL  to attach the mnu items********/
+                           
+                            iServiceHandler->InitializeMenuPaneL(*aMenuPane,aResourceId,
+                                        ECmdLast,iServiceHandler->InParamListL()); 
+                    /**** Set the old embedded help as dimmed one ****/ 
+                        aMenuPane->SetItemDimmed(ECalcCmdHelp, ETrue);                     
+                    #else
+                    /**** Set the Aiw Help as dimmed one as our feature flag is not defined ****/ 
+                        aMenuPane->SetItemDimmed(ECmdAiwPlaceHolder,ETrue);    
+                    #endif
+                       }
+                else 
+                    {
+                 /**** If the Feature flag is not defined dont show the Aiw Help ****/
+                    aMenuPane->SetItemDimmed(ECmdAiwPlaceHolder,ETrue);
+                    }
+                    
+                /******* Delete the buffer and make it to NULL *****/
+                   delete buf;
+                buf = NULL;   
+                if (!FeatureManager::FeatureSupported( KFeatureIdHelp ))
+                    {
+                    aMenuPane->DeleteMenuItem(ECalcCmdHelp);
+                    aMenuPane->DeleteMenuItem(ECmdAiwPlaceHolder);
+                    }  
+            break;
+            }
+
+        case (R_CALC_MEMORY_MENU):
+            {
+            DynInitMemoryMenuPane(aMenuPane);
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }   
+// ---------------------------------------------------------
+// CCalcView::HandleForegroundEventL
+//Refresh and draw display ,paper and function map Icons.
+// ---------------------------------------------------------
+//
+void CCalcView::HandleForegroundEventL(TBool aForeground)
+    {
+    if( (aForeground) && (STATIC_CAST(CCalcAppUi*, AppUi())->IsSkinChanged()) )
+        {
+        iEditorSubPane->RefreshDisplaySideLBitmap();
+        iEditorSubPane->RefreshDisplayCenterBitmap();
+        iEditorSubPane->RefreshDisplaySideRBitmap();    
+        
+        iEditorSubPane->DrawNow();
+
+        iOutputSheet->RefreshPaperBitmap();
+        iOutputSheet->RefreshScalablePaperBitmap();
+#ifdef __SCALABLE_ICONS
+        iOutputSheet->RefreshResultsLineBitmap();
+#endif
+        iOutputSheet->DrawNow();
+
+        iContainer->FunctionSubPane()->RefreshButtonIcons();        
+        for(TInt i =0; i< 10; i++)
+            {
+            iContainer->FunctionSubPane()->GetButtonBitmapControl(i)->DrawNow();
+            }
+        }
+    else
+        {
+        CAknView::HandleForegroundEventL(aForeground);
+        }
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/group/bld.inf	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:   Build info file for Ado domain extrapimui extras subsystem components.
+*
+*/
+
+PRJ_PLATFORMS
+DEFAULT
+
+// extras subsystem
+#include "../about/group/bld.inf"
+#include "../calcsoft/group/bld.inf"
+
+
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+*
+* Description:   Build info file for Ado domain extrapimui extras subsystem components.
+*
+*/
+
+PRJ_PLATFORMS
+DEFAULT
+
+// extras subsystem
+#include "../extras/group/bld.inf"
+
+
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "sf/app/utils" >
+]>
+
+<SystemDefinition name="utils" schema="1.4.0">
+  <systemModel>
+    <layer name="app_layer">
+      <module name="utils">
+        <unit unitID="orgdo.utils" mrp="" bldFile="&layer_real_source_path;/group" name="utils" />
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Wed Sep 01 12:29:54 2010 +0100
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>