# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1263838236 -7200 # Node ID 08c6ee43b3965699ad6b97026a07e618a823fadf # Parent 5315654608de41e64a63da9ff0b852212dfe560f Revision: 201001 Kit: 201003 diff -r 5315654608de -r 08c6ee43b396 group/bld.inf --- a/group/bld.inf Thu Jan 07 12:39:41 2010 +0200 +++ b/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -20,6 +20,7 @@ #include "../homescreen_plat/group/bld.inf" #include "../idlehomescreen/group/bld.inf" #include "../menufw/group/bld.inf" +#include "../taskswitcher/group/bld.inf" PRJ_PLATFORMS diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/group/bld.inf --- a/idlehomescreen/data/qhd_tch/group/bld.inf Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -15,8 +15,6 @@ * */ -//#include "../shortcut_2001f483/group/bld.inf" -//#include "../shortcut2_2001f484/group/bld.inf" #include "../desktop_20026f4f/group/bld.inf" #include "../empty_2001f47f/group/bld.inf" #include "../onerow_2001f480/group/bld.inf" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css Mon Jan 18 20:10:36 2010 +0200 @@ -81,7 +81,7 @@ image#SatIdleModeIcon { - display: block; + display: none; width: 18px; height: 20px; position: static; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css Mon Jan 18 20:10:36 2010 +0200 @@ -80,7 +80,7 @@ image#SatIdleModeIcon { - display: block; + display: none; width: 18px; height: 20px; position: static; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css Mon Jan 18 20:10:36 2010 +0200 @@ -80,7 +80,7 @@ image#SatIdleModeIcon { - display: block; + display: none; width: 18px; height: 20px; position: static; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css Mon Jan 18 20:10:36 2010 +0200 @@ -80,7 +80,7 @@ image#SatIdleModeIcon { - display: block; + display: none; width: 18px; height: 20px; position: static; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css Mon Jan 18 20:10:36 2010 +0200 @@ -80,7 +80,7 @@ image#SatIdleModeIcon { - display: block; + display: none; width: 18px; height: 20px; position: static; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/gfx/shortcut2logo.svg --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/gfx/shortcut2logo.svg Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/group/bld.inf --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/group/bld.inf Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -* Copyright (c) 2002-2008 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 information required for building -* -*/ - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// Support for productization and Carbide.Ui customization -//******************************************************** -../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/hsps/manifest.dat -../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/hsps/widgetconfiguration.xml -../hsps/00/shortcut2configuration.dtd /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/hsps/shortcut2configuration.dtd - -../xuikon/00/shortcut2.dat /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/shortcut2_2001f484.dat -../xuikon/00/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/shortcut2.css -../xuikon/00/shortcut2.xml /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/shortcut2.xml - -// logo icon -../gfx/shortcut2logo.svg /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/hsps/shortcut2logo.svg - -// Arabic languages -//***************** -../xuikon/37/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/37/shortcut2.css -../xuikon/50/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/50/shortcut2.css -../xuikon/57/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/57/shortcut2.css -../xuikon/94/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001f484/xuikon/94/shortcut2.css - - -// Support for S60 localization -//***************************** -#ifndef __SHORTCUT2CONFIGURATION_LOC__ -#define __SHORTCUT2CONFIGURATION_LOC__ - ../loc/shortcut2configuration.loc APP_LAYER_LOC_EXPORT_PATH(shortcut2configuration.loc) -#endif // __SHORTCUT2CONFIGURATION_LOC__ - -// Support for S60 builds -//*********************** -../rom/shortcut2_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001f484_resources.iby) -../rom/shortcut2_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001f484_customer.iby) -../rom/shortcut2_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001f484_variant.iby) -../rom/shortcut2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001f484.iby) - - -// Dtd-localization -//***************** -PRJ_EXTENSIONS -START EXTENSION tools/dtd -OPTION SWITCH_LOC_FILE_NAME shortcut2_2001f484 -OPTION DTD_TYPE widget -OPTION LOC_FOLDERS yes -END - - -PRJ_MMPFILES - -PRJ_TESTMMPFILES - -// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/manifest.dat Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ - - - - - - - qhd_tch - - - - widget - - - - - - 0x2001f48a - - - - - - 0x101fb657 - - - - - - 0x2001f484 - - - - - - &qtn_shortcut2_configuration_name; - - sc2 - - 1.0 - - - - - - widgetconfiguration.xml - - - - - - shortcut2configuration.dtd - - - - - - - &qtn_shortcut2_configuration_desc; - shortcut2logo.svg - - - - - - - shortcut2.o0000 - - - - - \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/shortcut2configuration.dtd --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/shortcut2configuration.dtd Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - - - - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/widgetconfiguration.xml --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/hsps/00/widgetconfiguration.xml Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/loc/shortcut2configuration.loc --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/loc/shortcut2configuration.loc Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2005-2006 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 Shortcuts 2 plugin configuration (HSPS) -* -*/ - -// d: Shortcuts -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -#define qtn_shortcut2_configuration_name "Shortcut 2" -#define qtn_shortcut2_configuration_desc "localized RnD shortcut 2 description." diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2.iby --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-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: -* Shortcut2 widget HSPS-plugin IBY file. -* -*/ - -#ifndef __SHORTCUT2_2001F484_IBY__ -#define __SHORTCUT2_2001F484_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\manifest.dat \private\200159c0\install\shortcut2_2001f484\hsps\00\manifest.dat - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __SHORTCUT2_2001F484_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_customer.iby --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_customer.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2005-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: -* Shortcut2 widget HSPS-plugin language specific IBY file. -* -*/ - -#ifndef __SHORTCUT2_2001F484_CUSTOMER_IBY__ -#define __SHORTCUT2_2001F484_CUSTOMER_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools, language specific -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\00\shortcut2.o0000 \private\200159c0\install\shortcut2_2001f484\xuikon\00\shortcut2.o0000 -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2configuration.dtd \private\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2configuration.dtd - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __SHORTCUT2_2001F484_CUSTOMER_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_resources.iby --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_resources.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2005-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: -* Shortcut2 widget HSPS-plugin language specific IBY file. -* -*/ - -#ifndef __SHORTCUT2_2001F484_RESOURCES_IBY__ -#define __SHORTCUT2_2001F484_RESOURCES_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools, language specific -#if defined (__LOCALES_37_IBY__) -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\37\shortcut2.o0037 \private\200159c0\install\shortcut2_2001f484\xuikon\37\shortcut2.o0037 -#endif -#if defined (__LOCALES_50_IBY__) -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\50\shortcut2.o0050 \private\200159c0\install\shortcut2_2001f484\xuikon\50\shortcut2.o0050 -#endif -#if defined (__LOCALES_57_IBY__) -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\57\shortcut2.o0057 \private\200159c0\install\shortcut2_2001f484\xuikon\57\shortcut2.o0057 -#endif -#if defined (__LOCALES_94_IBY__) -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\xuikon\94\shortcut2.o0094 \private\200159c0\install\shortcut2_2001f484\xuikon\94\shortcut2.o0094 -#endif - -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2configuration.dtd \private\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2configuration.dtd -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2logo.svg \private\200159c0\install\shortcut2_2001f484\hsps\00\shortcut2logo.svg - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __SHORTCUT2_2001F484_RESOURCES_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_variant.iby --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/rom/shortcut2_variant.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-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: -* Shortcut2 widget HSPS-plugin variant specific IBY file. -* -*/ - -#ifndef __SHORTCUT2_2001F484_VARIANT_IBY__ -#define __SHORTCUT2_2001F484_VARIANT_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by variation tools, variant specific -data=ZPRIVATE\200159c0\install\shortcut2_2001f484\hsps\00\widgetconfiguration.xml \private\200159c0\install\shortcut2_2001f484\hsps\00\widgetconfiguration.xml - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __SHORTCUT2_2001F484_VARIANT_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.css --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: ltr; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.dat --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.dat Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - - 2001CB4F - 101FB657 - 11001552 - Shortcut2 - Shortcut2 - 1.0 - shortcut2.xml - shortcut2.css - \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.xml --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/00/shortcut2.xml Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/37/shortcut2.css --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/37/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: rtl; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/50/shortcut2.css --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/50/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: rtl; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/57/shortcut2.css --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/57/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: rtl; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/94/shortcut2.css --- a/idlehomescreen/data/qhd_tch/shortcut2_2001f484/xuikon/94/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: rtl; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/gfx/shortcut1logo.png Binary file idlehomescreen/data/qhd_tch/shortcut_2001f483/gfx/shortcut1logo.png has changed diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/group/bld.inf --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/group/bld.inf Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2002-2008 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 information required for building -* -*/ - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// Support for productization and Carbide.Ui customization -//******************************************************** -../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/shortcut_2001f483/hsps/manifest.dat -../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/shortcut_2001f483/hsps/widgetconfiguration.xml -../hsps/00/shortcutconfiguration.dtd /epoc32/data/Z/resource/homescreen/shortcut_2001f483/hsps/shortcutconfiguration.dtd - -../xuikon/00/shortcut.dat /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/shortcut_2001f483.dat -../xuikon/00/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/shortcut.css -../xuikon/00/shortcut.xml /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/shortcut.xml - -// logo icon -../gfx/shortcut1logo.png /epoc32/data/Z/resource/homescreen/shortcut_2001f483/hsps/shortcut1logo.png - -// Arabic languages -//***************** -../xuikon/37/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/37/shortcut.css -../xuikon/50/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/50/shortcut.css -../xuikon/57/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/57/shortcut.css -../xuikon/94/shortcut.css /epoc32/data/Z/resource/homescreen/shortcut_2001f483/xuikon/94/shortcut.css - - -// Support for S60 localization -//***************************** -#ifndef __SHORTCUTCONFIGURATION_LOC__ -#define __SHORTCUTCONFIGURATION_LOC__ -../loc/shortcutconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(shortcutconfiguration.loc) -#endif // __SHORTCUTCONFIGURATION_LOC__ - -// Support for S60 builds -//*********************** -../rom/shortcut_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f483_resources.iby) -../rom/shortcut_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f483_customer.iby) -../rom/shortcut_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f483_variant.iby) -../rom/shortcut.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f483.iby) - - -// Dtd-localization -//***************** -PRJ_EXTENSIONS -START EXTENSION tools/dtd -OPTION SWITCH_LOC_FILE_NAME shortcut_2001f483 -OPTION DTD_TYPE widget -OPTION LOC_FOLDERS yes -END - - -PRJ_MMPFILES - -PRJ_TESTMMPFILES - -// End of File - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/manifest.dat Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ - - - - qhd_tch - - widget - - - 0x2001f48a - - - 0x101fb657 - - - 0x2001f483 - - - &qtn_shortcut1_configuration_name; - sc - 1.0 - - - widgetconfiguration.xml - - - shortcutconfiguration.dtd - - - - &qtn_shortcut1_configuration_desc; - shortcut1logo.png - - - - - shortcut.o0000 - - - \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/shortcutconfiguration.dtd --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/shortcutconfiguration.dtd Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/widgetconfiguration.xml --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/hsps/00/widgetconfiguration.xml Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/loc/shortcutconfiguration.loc --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/loc/shortcutconfiguration.loc Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2005-2006 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 Shortcut1 plugin configuration (HSPS) -* -*/ - - -// d: Shortcuts -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -#define qtn_shortcut1_configuration_name "Shortcut 1" -#define qtn_shortcut1_configuration_desc "localized RnD shortcut 1 description." - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut.iby --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-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: -* Shortcut widget HSPS-plugin IBY file. -* -*/ - -#ifndef __SHORTCUT_2001F483_IBY__ -#define __SHORTCUT_2001F483_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools -data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\manifest.dat \private\200159c0\install\shortcut_2001f483\hsps\00\manifest.dat - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __SHORTCUT_2001F483_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_customer.iby --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_customer.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2005-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: -* Shortcut widget HSPS-plugin language specific IBY file. -* -*/ - -#ifndef __SHORTCUT_2001F483_CUSTOMER_IBY__ -#define __SHORTCUT_2001F483_CUSTOMER_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools, language specific -data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\00\shortcut.o0000 \private\200159c0\install\shortcut_2001f483\xuikon\00\shortcut.o0000 -data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\shortcutconfiguration.dtd \private\200159c0\install\shortcut_2001f483\hsps\00\shortcutconfiguration.dtd - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __SHORTCUT_2001F483_CUSTOMER_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_resources.iby --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_resources.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2005-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: -* Shortcut widget HSPS-plugin language specific IBY file. -* -*/ - -#ifndef __SHORTCUT_2001F483_RESOURCES_IBY__ -#define __SHORTCUT_2001F483_RESOURCES_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools, language specific -#if defined (__LOCALES_37_IBY__) -data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\37\shortcut.o0037 \private\200159c0\install\shortcut_2001f483\xuikon\37\shortcut.o0037 -#endif -#if defined (__LOCALES_50_IBY__) -data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\50\shortcut.o0050 \private\200159c0\install\shortcut_2001f483\xuikon\50\shortcut.o0050 -#endif -#if defined (__LOCALES_57_IBY__) -data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\57\shortcut.o0057 \private\200159c0\install\shortcut_2001f483\xuikon\57\shortcut.o0057 -#endif -#if defined (__LOCALES_94_IBY__) -data=ZPRIVATE\200159c0\install\shortcut_2001f483\xuikon\94\shortcut.o0094 \private\200159c0\install\shortcut_2001f483\xuikon\94\shortcut.o0094 -#endif - -data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\shortcutconfiguration.dtd \private\200159c0\install\shortcut_2001f483\hsps\00\shortcutconfiguration.dtd -data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\shortcut1logo.png \private\200159c0\install\shortcut_2001f483\hsps\00\shortcut1logo.png - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __SHORTCUT_2001F483_RESOURCES_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_variant.iby --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/rom/shortcut_variant.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-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: -* Shortcut widget HSPS-plugin variant specific IBY file. -* -*/ - -#ifndef __SHORTCUT_2001F483_VARIANT_IBY__ -#define __SHORTCUT_2001F483_VARIANT_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by variation tools, variant specific -data=ZPRIVATE\200159c0\install\shortcut_2001f483\hsps\00\widgetconfiguration.xml \private\200159c0\install\shortcut_2001f483\hsps\00\widgetconfiguration.xml - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH - -#endif // __SHORTCUT_2001F483_VARIANT_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/Shortcut.css --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: ltr; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/Shortcut.xml --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/Shortcut.xml Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/shortcut.dat --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/00/shortcut.dat Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - - 2001CB4F - 101FB657 - 11001551 - Shortcut - Shortcut - 1.0 - Shortcut.xml - Shortcut.css - \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/37/Shortcut.css --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/37/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: rtl; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/50/Shortcut.css --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/50/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: rtl; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/57/Shortcut.css --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/57/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: rtl; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/94/Shortcut.css --- a/idlehomescreen/data/qhd_tch/shortcut_2001f483/xuikon/94/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -widget#shortcutPluginContainer -{ - block-progression: rl; - direction: rtl; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - background-color: none; -} - -button.shortcutButton -{ - width: 74px; - margin-right: 3px; - nav-index: appearance; -} - -button.shortcutButton:focus -{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - focus-background:"SKIN(268458534 9896)"; -} - -button.shortcutButton:hold -{ - background-color: "SKIN(268458534 9956)"; -} - -image.shortcutIcon -{ - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 350px; - height: 33px; - border-style: solid; - border-width: 5px; - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 6px; - padding-top: 3px; - padding-bottom: 3px; - padding-right: 6px; -} - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/templateview_20026f50/loc/templateview.loc --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/loc/templateview.loc Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/loc/templateview.loc Mon Jan 18 20:10:36 2010 +0200 @@ -260,3 +260,9 @@ // w: // r: TB9.2 #define qtn_hs_edit_widget_catalog "Widget Catalog" + +// d: Deletes the current Home screen page and focus goes to the next available Home screen page in Edit mode +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_edit_options_delete "Delete page" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.css Mon Jan 18 20:10:36 2010 +0200 @@ -26,9 +26,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.xml --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.xml Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/templateview.xml Mon Jan 18 20:10:36 2010 +0200 @@ -276,8 +276,7 @@ - - + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/view.dtd --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/view.dtd Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/00/view.dtd Mon Jan 18 20:10:36 2010 +0200 @@ -299,22 +299,22 @@ @@ -373,20 +373,20 @@ @@ -409,11 +409,20 @@ + + + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/37/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/37/templateview.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/37/templateview.css Mon Jan 18 20:10:36 2010 +0200 @@ -27,9 +27,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/50/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/50/templateview.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/50/templateview.css Mon Jan 18 20:10:36 2010 +0200 @@ -27,9 +27,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/57/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/57/templateview.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/57/templateview.css Mon Jan 18 20:10:36 2010 +0200 @@ -27,9 +27,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/94/templateview.css --- a/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/94/templateview.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/templateview_20026f50/xuikon/94/templateview.css Mon Jan 18 20:10:36 2010 +0200 @@ -27,9 +27,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/view_2001f48b/loc/View.loc --- a/idlehomescreen/data/qhd_tch/view_2001f48b/loc/View.loc Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/loc/View.loc Mon Jan 18 20:10:36 2010 +0200 @@ -260,3 +260,9 @@ // w: // r: TB9.2 #define qtn_hs_edit_widget_catalog "Widget Catalog" + +// d: Deletes the current Home screen page and focus goes to the next available Home screen page in Edit mode +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_edit_options_delete "Delete page" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.css Mon Jan 18 20:10:36 2010 +0200 @@ -26,9 +26,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.dtd --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.dtd Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.dtd Mon Jan 18 20:10:36 2010 +0200 @@ -299,22 +299,22 @@ @@ -373,20 +373,20 @@ @@ -409,11 +409,20 @@ + + + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.xml --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.xml Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/00/View.xml Mon Jan 18 20:10:36 2010 +0200 @@ -276,8 +276,7 @@ - - + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/37/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/37/View.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/37/View.css Mon Jan 18 20:10:36 2010 +0200 @@ -27,9 +27,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/50/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/50/View.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/50/View.css Mon Jan 18 20:10:36 2010 +0200 @@ -27,9 +27,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/57/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/57/View.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/57/View.css Mon Jan 18 20:10:36 2010 +0200 @@ -27,9 +27,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/94/View.css --- a/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/94/View.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/xuikon/94/View.css Mon Jan 18 20:10:36 2010 +0200 @@ -27,9 +27,6 @@ _s60-longtap: true; - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; - nav-index: appearance; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/00/double_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#double_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/37/double_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/37/double_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/37/double_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#double_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/50/double_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/50/double_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/50/double_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#double_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/57/double_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/57/double_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/57/double_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#double_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/94/double_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/94/double_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_icon_widget_2001fdbd/xuikon/94/double_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#double_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.css --- a/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/00/double_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -9,8 +9,6 @@ } box#double_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/37/double_row_widget.css --- a/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/37/double_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/37/double_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -10,8 +10,6 @@ } box#double_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/50/double_row_widget.css --- a/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/50/double_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/50/double_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -10,8 +10,6 @@ } box#double_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/57/double_row_widget.css --- a/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/57/double_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/57/double_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -10,8 +10,6 @@ } box#double_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/94/double_row_widget.css --- a/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/94/double_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/double_row_widget_2001fdc2/xuikon/94/double_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -10,8 +10,6 @@ } box#double_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/group/bld.inf --- a/idlehomescreen/data/vga_tch/group/bld.inf Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -19,8 +19,6 @@ #include "../double_row_icon_widget_2001fdbd/group/bld.inf" #include "../double_row_widget_2001fdc2/group/bld.inf" #include "../root_2001f48f/group/bld.inf" -//#include "../shortcut2_2001fdbb/group/bld.inf" -//#include "../shortcut_2001f490/group/bld.inf" #include "../single_row_icon_widget_2001fdc0/group/bld.inf" #include "../single_row_widget_2001fdc1/group/bld.inf" #include "../triple_row_icon_widget_2001fdbe/group/bld.inf" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/group/bld.inf --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/group/bld.inf Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2002-2008 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 information required for building -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// Support for productization and Carbide.Ui customization -//******************************************************** -../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/hsps/manifest.dat -../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/hsps/widgetconfiguration.xml -../hsps/00/shortcut2configuration.dtd /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/hsps/shortcut2configuration.dtd - -../xuikon/00/shortcut2.dat /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/shortcut2_2001fdbb.dat -../xuikon/00/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/shortcut2.css -../xuikon/00/shortcut2.xml /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/shortcut2.xml - -// Arabic languages -//***************** -../xuikon/37/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/37/shortcut2.css -../xuikon/50/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/50/shortcut2.css -../xuikon/57/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/57/shortcut2.css -../xuikon/94/shortcut2.css /epoc32/data/Z/resource/homescreen/shortcut2_2001fdbb/xuikon/94/shortcut2.css - - -// Support for S60 localization -//***************************** -#ifndef __SHORTCUT2CONFIGURATION_LOC__ -#define __SHORTCUT2CONFIGURATION_LOC__ -../loc/shortcut2configuration.loc APP_LAYER_LOC_EXPORT_PATH(shortcut2configuration.loc) -#endif // __SHORTCUT2CONFIGURATION_LOC__ - -// Support for S60 builds -//*********************** -../rom/shortcut2_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001fdbb_resources.iby) -../rom/shortcut2_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001fdbb_customer.iby) -../rom/shortcut2_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001fdbb_variant.iby) -../rom/shortcut2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shortcut2_2001fdbb.iby) - - -// Dtd-localization -//***************** -PRJ_EXTENSIONS -START EXTENSION tools/dtd -OPTION SWITCH_LOC_FILE_NAME shortcut2_2001fdbb -OPTION DTD_TYPE widget -OPTION LOC_FOLDERS yes -END - - -PRJ_MMPFILES - -PRJ_TESTMMPFILES - -// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/manifest.dat Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ - - - - vga_tch - - widget - - - 0x2001f48a - - - 0x101fb657 - - - 0x2001fdbb - - - &qtn_hs_sc2_widget; - sc2 - 1.0 - - - widgetconfiguration.xml - - - shortcut2configuration.dtd - - - - - - - shortcut2.o0000 - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/shortcut2configuration.dtd --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/shortcut2configuration.dtd Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/widgetconfiguration.xml --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/hsps/00/widgetconfiguration.xml Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/loc/shortcut2configuration.loc --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/loc/shortcut2configuration.loc Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2005-2006 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 Shortcuts 2 plugin configuration (HSPS) -* -*/ - -// d: Shortcuts -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -#define qtn_shortcut2_configuration_name "Shortcut 2" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2.iby --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2005-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: Shortcut2 widget HSPS-plugin IBY file. -* -*/ - -#ifndef __SHORTCUT2_2001FDBB_IBY__ -#define __SHORTCUT2_2001FDBB_IBY__ - -#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -// Enabled by DTD-localization tools -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\hsps\00\manifest.dat \private\200159c0\install\shortcut2_2001fdbb\hsps\00\manifest.dat - -#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -#endif // __SHORTCUT2_2001FDBB_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_customer.iby --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_customer.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2005-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: Shortcut2 widget HSPS-plugin language specific IBY file. -* -*/ - - -#ifndef __SHORTCUT2_2001FDBB_CUSTOMER_IBY__ -#define __SHORTCUT2_2001FDBB_CUSTOMER_IBY__ - -#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -// Enabled by DTD-localization tools, language specific -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\00\shortcut2.o0000 \private\200159c0\install\shortcut2_2001fdbb\xuikon\00\shortcut2.o0000 -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\hsps\00\shortcut2configuration.dtd \private\200159c0\install\shortcut2_2001fdbb\hsps\00\shortcut2configuration.dtd - -#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -#endif // __SHORTCUT2_2001FDBB_CUSTOMER_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_resources.iby --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_resources.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2005-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: Shortcut2 widget HSPS-plugin language specific IBY file. -* -*/ - - -#ifndef __SHORTCUT2_2001FDBB_RESOURCES_IBY__ -#define __SHORTCUT2_2001FDBB_RESOURCES_IBY__ - -#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -// Enabled by DTD-localization tools, language specific -#if defined (__LOCALES_37_IBY__) -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\37\shortcut2.o0037 \private\200159c0\install\shortcut2_2001fdbb\xuikon\37\shortcut2.o0037 -#endif -#if defined (__LOCALES_50_IBY__) -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\50\shortcut2.o0050 \private\200159c0\install\shortcut2_2001fdbb\xuikon\50\shortcut2.o0050 -#endif -#if defined (__LOCALES_57_IBY__) -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\57\shortcut2.o0057 \private\200159c0\install\shortcut2_2001fdbb\xuikon\57\shortcut2.o0057 -#endif -#if defined (__LOCALES_94_IBY__) -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\xuikon\94\shortcut2.o0094 \private\200159c0\install\shortcut2_2001fdbb\xuikon\94\shortcut2.o0094 -#endif - -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\hsps\00\shortcut2configuration.dtd \private\200159c0\install\shortcut2_2001fdbb\hsps\00\shortcut2configuration.dtd - -#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -#endif // __SHORTCUT2_2001FDBB_RESOURCES_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_variant.iby --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/rom/shortcut2_variant.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-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: Shortcut2 widget HSPS-plugin variant specific IBY file. -* -*/ - - -#ifndef __SHORTCUT2_2001FDBB_VARIANT_IBY__ -#define __SHORTCUT2_2001FDBB_VARIANT_IBY__ - -#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -// Enabled by variation tools, variant specific -data=ZPRIVATE\200159c0\install\shortcut2_2001fdbb\hsps\00\widgetconfiguration.xml \private\200159c0\install\shortcut2_2001fdbb\hsps\00\widgetconfiguration.xml - -#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -#endif // __SHORTCUT2_2001FDBB_VARIANT_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.css --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -widget#shortcutPlugin2 -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: ltr; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton7 -{ - margin-left: 0px; -} - -button#shortcutButton12 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; - _s60-position-hint: aboveleft; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.dat --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.dat Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - - 2001CB4F - 101FB657 - 11001552 - Shortcut2 - shortcut2 - 1.0 - shortcut2.xml - shortcut2.css - \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.xml --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/00/shortcut2.xml Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,349 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/37/shortcut2.css --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/37/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#shortcutPlugin2 -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: rtl; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton7 -{ - margin-left: 0px; -} - -button#shortcutButton12 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/50/shortcut2.css --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/50/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#shortcutPlugin2 -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: rtl; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton7 -{ - margin-left: 0px; -} - -button#shortcutButton12 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/57/shortcut2.css --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/57/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#shortcutPlugin2 -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: rtl; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton7 -{ - margin-left: 0px; -} - -button#shortcutButton12 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/94/shortcut2.css --- a/idlehomescreen/data/vga_tch/shortcut2_2001fdbb/xuikon/94/shortcut2.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#shortcutPlugin2 -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: rtl; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton7 -{ - margin-left: 0px; -} - -button#shortcutButton12 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/group/bld.inf --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/group/bld.inf Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2002-2008 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 information required for building -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// Support for productization and Carbide.Ui customization -//******************************************************** -../hsps/00/manifest.dat /epoc32/data/z/resource/homescreen/shortcut_2001f490/hsps/manifest.dat -../hsps/00/widgetconfiguration.xml /epoc32/data/z/resource/homescreen/shortcut_2001f490/hsps/widgetconfiguration.xml -../hsps/00/shortcutconfiguration.dtd /epoc32/data/z/resource/homescreen/shortcut_2001f490/hsps/shortcutconfiguration.dtd - -../xuikon/00/shortcut.dtd /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/shortcut.dtd -../xuikon/00/shortcut.dat /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/shortcut_2001f490.dat -../xuikon/00/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/shortcut.css -../xuikon/00/shortcut.xml /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/shortcut.xml - -// Arabic languages -//***************** -../xuikon/37/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/37/shortcut.css -../xuikon/50/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/50/shortcut.css -../xuikon/57/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/57/shortcut.css -../xuikon/94/shortcut.css /epoc32/data/z/resource/homescreen/shortcut_2001f490/xuikon/94/shortcut.css - - -// Support for S60 localization -//***************************** -#ifndef __SHORTCUTCONFIGURATION_LOC__ -#define __SHORTCUTCONFIGURATION_LOC__ -../loc/shortcutconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(shortcutconfiguration.loc) -#endif // __SHORTCUTCONFIGURATION_LOC__ - -// Support for S60 builds -//*********************** -../rom/shortcut_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f490_resources.iby) -../rom/shortcut_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f490_customer.iby) -../rom/shortcut_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f490_variant.iby) -../rom/shortcut.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shortcut_2001f490.iby) - - -// Dtd-localization -//***************** -PRJ_EXTENSIONS -START EXTENSION tools/dtd -OPTION SWITCH_LOC_FILE_NAME shortcut_2001f490 -OPTION DTD_TYPE widget -END - - -PRJ_MMPFILES - -PRJ_TESTMMPFILES - -// End of File - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/manifest.dat --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/manifest.dat Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ - - - - vga_tch - - widget - - - 0x2001f48a - - - 0x101fb657 - - - 0x2001f490 - - - &qtn_hs_sc1_widget; - sc - 1.0 - - - widgetconfiguration.xml - - - shortcutconfiguration.dtd - - - - shortcut.o0000 - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/shortcutconfiguration.dtd --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/shortcutconfiguration.dtd Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ - - - - - - - \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/widgetconfiguration.xml --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/hsps/00/widgetconfiguration.xml Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/loc/Shortcut.loc --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/loc/Shortcut.loc Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-2006 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 Shortcut1 widget (Xuikon) -* -*/ - - -// d: Shortcuts -// l: ai_gene_pane_1_t1 -// w: -// r: TB9.1 -#define qtn_hs_sc2_widget "Shortcuts 2" - -// d: Open -// l: control_pane_t1/opt7 -// w: -// r: TB9.1 -#define qtn_msk_open "Open" \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/loc/shortcutconfiguration.loc --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/loc/shortcutconfiguration.loc Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2005-2006 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 Shortcut1 plugin configuration (HSPS) -* -*/ - - -// d: Shortcuts -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -#define qtn_shortcut1_configuration_name "Shortcut 1" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut.iby --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-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: Shortcut widget HSPS-plugin IBY file. -* -*/ - - -#ifndef __SHORTCUT_2001F490_IBY__ -#define __SHORTCUT_2001F490_IBY__ - -#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -// Enabled by DTD-localization tools -data=ZPRIVATE\200159c0\install\shortcut_2001f490\hsps\00\manifest.dat \private\200159c0\install\shortcut_2001f490\hsps\00\manifest.dat - -#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -#endif // __SHORTCUT_2001F490_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_customer.iby --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_customer.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2005-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: Shortcut widget HSPS-plugin language specific IBY file. -* -*/ - - -#ifndef __SHORTCUT_2001F490_CUSTOMER_IBY__ -#define __SHORTCUT_2001F490_CUSTOMER_IBY__ - -#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -// Enabled by DTD-localization tools, language specific -data=ZPRIVATE\200159c0\install\shortcut_2001f490\xuikon\00\shortcut.o0000 \private\200159c0\install\shortcut_2001f490\xuikon\00\shortcut.o0000 -data=ZPRIVATE\200159c0\install\shortcut_2001f490\hsps\00\shortcutconfiguration.dtd \private\200159c0\install\shortcut_2001f490\hsps\00\shortcutconfiguration.dtd - -#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -#endif // __SHORTCUT_2001F490_CUSTOMER_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_resources.iby --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_resources.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2005-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: Shortcut widget HSPS-plugin language specific IBY file. -* -*/ - - -#ifndef __SHORTCUT_2001F490_RESOURCES_IBY__ -#define __SHORTCUT_2001F490_RESOURCES_IBY__ - -#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -// Enabled by DTD-localization tools, language specific -data=ZPRIVATE\200159c0\install\shortcut_2001f490\xuikon\00\shortcut.o0000 \private\200159c0\install\shortcut_2001f490\xuikon\00\shortcut.o0000 -data=ZPRIVATE\200159c0\install\shortcut_2001f490\hsps\00\shortcutconfiguration.dtd \private\200159c0\install\shortcut_2001f490\hsps\00\shortcutconfiguration.dtd - -#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -#endif // __SHORTCUT_2001F490_RESOURCES_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_variant.iby --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/rom/shortcut_variant.iby Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-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: Shortcut widget HSPS-plugin variant specific IBY file. -* -*/ - - -#ifndef __SHORTCUT_2001F490_VARIANT_IBY__ -#define __SHORTCUT_2001F490_VARIANT_IBY__ - -#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -// Enabled by variation tools, variant specific -data=ZPRIVATE\200159c0\install\shortcut_2001f490\hsps\00\widgetconfiguration.xml \private\200159c0\install\shortcut_2001f490\hsps\00\widgetconfiguration.xml - -#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3) || defined (FF_LAYOUT_480_640_TOUCH_VGA4) || defined (FF_LAYOUT_640_480_TOUCH_VGA4) - -#endif // __SHORTCUT_2001F490_VARIANT_IBY__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.css --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -widget#shortcutPlugin -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: ltr; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton1 -{ - margin-left: 0px; -} - -button#shortcutButton6 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; - _s60-position-hint: aboveleft; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.dat --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.dat Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - 2001CB4F - 101FB657 - 11001551 - Shortcut - shortcut - 1.0 - shortcut.xml - shortcut.css - shortcut.dtd - \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.dtd --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.dtd Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ - - - - - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.xml --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/00/Shortcut.xml Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,353 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/37/Shortcut.css --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/37/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#shortcutPlugin -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: rtl; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton1 -{ - margin-left: 0px; -} - -button#shortcutButton6 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/50/Shortcut.css --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/50/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#shortcutPlugin -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: rtl; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton1 -{ - margin-left: 0px; -} - -button#shortcutButton6 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/57/Shortcut.css --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/57/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#shortcutPlugin -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: rtl; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton1 -{ - margin-left: 0px; -} - -button#shortcutButton6 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/94/Shortcut.css --- a/idlehomescreen/data/vga_tch/shortcut_2001f490/xuikon/94/Shortcut.css Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#shortcutPlugin -{ - width: auto; - height: 70px; - - block-progression: rl; - direction: rtl; -} - -button.shortcutButton -{ - width: 70px; - height: auto; - - nav-index: appearance; - - margin-left: 4px; - margin-right: 4px; - - background-color: "SKIN(268458534 9906)"; -} - -button#shortcutButton1 -{ - margin-left: 0px; -} - -button#shortcutButton6 -{ - margin-right: 0px; -} - -button.shortcutButton:focus -{ - focus-background: "SKIN(268458534 5120 9)"; -} - -image.shortcutIcon -{ - width: auto; - height: auto; - - _s60-aspect-ratio: preserve; -} - -tooltip.shortcutTooltip -{ - width: adaptive; - max-width: 430px; - height: 5.5u; - - border-style: solid; - border-width: 5px; - - _s60-start-delay: 1000000; - _s60-display-time: 1000000; - - background-color:"SKIN(268458534 8480)"; - display: block; - padding-left: 8px; - padding-right: 8px; -} - - -text.shortcutTooltipText -{ - font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; - width: adaptive; - color: "SKIN(268458534 13056 19)"; -} - -/********************* - xSP -**********************/ -tooltip.shortcutTooltipXsp -{ - width: 15.0u; - height: adaptive; - border-style: solid; - border-width: 5px; - /* delay comes from the xSP server */ - _s60-start-delay: 0; - _s60-display-time: 60000000; /* 6 sec */ - background-color:"SKIN(268458534 8480)"; - overflow: visible; - display: none; - block-progression: tb; - padding-bottom: 1u; - padding-right: 2u; - padding-left: 2u; - padding-top: 1u; -} - -text.shortcutTextCaptionXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - font-weight: bold; - text-align: center; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} - -text.shortcutTextXsp -{ - position: static; - font-family: EAknLogicalFontSecondaryFont; - font-size: 3.5u; - text-align: left; - width: 30u; - height: 5u; - color: "SKIN(268458534 13056 19)"; - overflow: visible; - display: block; - visibility:visible; -} diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/00/single_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/37/single_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/37/single_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/37/single_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/50/single_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/50/single_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/50/single_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/57/single_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/57/single_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/57/single_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/94/single_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/94/single_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_icon_widget_2001fdc0/xuikon/94/single_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.css --- a/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/00/single_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/37/single_row_widget.css --- a/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/37/single_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/37/single_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/50/single_row_widget.css --- a/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/50/single_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/50/single_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/57/single_row_widget.css --- a/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/57/single_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/57/single_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/94/single_row_widget.css --- a/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/94/single_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/single_row_widget_2001fdc1/xuikon/94/single_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#single_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/00/triple_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#triple_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/37/triple_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/37/triple_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/37/triple_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#triple_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/50/triple_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/50/triple_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/50/triple_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#triple_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/57/triple_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/57/triple_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/57/triple_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#triple_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/94/triple_row_icon_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/94/triple_row_icon_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_icon_widget_2001fdbe/xuikon/94/triple_row_icon_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index:appearance; } box#triple_row_icon_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/00/triple_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index: appearance; } box#triple_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/37/triple_row_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/37/triple_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/37/triple_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index: appearance; } box#triple_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/50/triple_row_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/50/triple_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/50/triple_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index: appearance; } box#triple_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/57/triple_row_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/57/triple_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/57/triple_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index: appearance; } box#triple_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/94/triple_row_widget.css --- a/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/94/triple_row_widget.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/triple_row_widget_2001fdbf/xuikon/94/triple_row_widget.css Mon Jan 18 20:10:36 2010 +0200 @@ -8,8 +8,6 @@ nav-index: appearance; } box#triple_row_widget:focus{ - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/view1_2001fdb9/loc/view.loc --- a/idlehomescreen/data/vga_tch/view1_2001fdb9/loc/view.loc Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/loc/view.loc Mon Jan 18 20:10:36 2010 +0200 @@ -260,3 +260,9 @@ // w: // r: TB9.2 #define qtn_hs_edit_widget_catalog "Widget Catalog" + +// d: Deletes the current Home screen page and focus goes to the next available Home screen page in Edit mode +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +#define qtn_hs_page_edit_options_delete "Delete page" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.dtd --- a/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.dtd Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/00/view.dtd Mon Jan 18 20:10:36 2010 +0200 @@ -299,22 +299,22 @@ @@ -373,20 +373,20 @@ @@ -409,11 +409,20 @@ + + + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/37/view.css --- a/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/37/view.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/37/view.css Mon Jan 18 20:10:36 2010 +0200 @@ -106,8 +106,6 @@ box.profile_date:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-color: "SKIN(268458534 5120 9)"; } @@ -353,8 +351,6 @@ box#profile_softindicator:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; focus-background:"SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/50/view.css --- a/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/50/view.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/50/view.css Mon Jan 18 20:10:36 2010 +0200 @@ -106,8 +106,6 @@ box.profile_date:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-color: "SKIN(268458534 5120 9)"; } @@ -353,8 +351,6 @@ box#profile_softindicator:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; focus-background:"SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/57/view.css --- a/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/57/view.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/57/view.css Mon Jan 18 20:10:36 2010 +0200 @@ -106,8 +106,6 @@ box.profile_date:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-color: "SKIN(268458534 5120 9)"; } @@ -353,8 +351,6 @@ box#profile_softindicator:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; focus-background:"SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/94/view.css --- a/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/94/view.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/view1_2001fdb9/xuikon/94/view.css Mon Jan 18 20:10:36 2010 +0200 @@ -106,8 +106,6 @@ box.profile_date:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-color: "SKIN(268458534 5120 9)"; } @@ -353,8 +351,6 @@ box#profile_softindicator:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; focus-background:"SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.css --- a/idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.css Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/data/vga_tch/wideimage_10009dff/xuikon/00/wideimage.css Mon Jan 18 20:10:36 2010 +0200 @@ -4,8 +4,6 @@ } box#image_container:focus { - touchfeedbackdown: basic; - touchfeedbackdrag: sensitive; background-image: "SKIN(268458534 24576)"; background-color: "SKIN(268458534 5120 9)"; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/hscontentcontrol/group/hscontentcontrol.mmp --- a/idlehomescreen/hscontentcontrol/group/hscontentcontrol.mmp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/hscontentcontrol/group/hscontentcontrol.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -32,6 +32,7 @@ SOURCE hscontentcontrolfactory.cpp SOURCE hscontentcontrolui.cpp SOURCE hscontentcontrolecomlistener.cpp +SOURCE hscontentcontroluninstallmonitor.cpp //By default, the build tools look for the WINSCW def file in a BWINS directory //(at the same level as the directory containing the mmp file), diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/hscontentcontrol/inc/hscontentcontrolfactory.h --- a/idlehomescreen/hscontentcontrol/inc/hscontentcontrolfactory.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/hscontentcontrol/inc/hscontentcontrolfactory.h Mon Jan 18 20:10:36 2010 +0200 @@ -24,9 +24,11 @@ // User includes #include "hscontentcontrolecomobserver.h" +#include "hscontentcontroluninstallobserver.h" // Forward declarations class CHsContentControlEComListener; +class CHsContentControlUninstallMonitor; /** * Content control UI base class @@ -40,7 +42,8 @@ * @since S60 v5.0 */ NONSHARABLE_CLASS( CHsContentControlFactory ) : public CBase, - public MHsContentControlEComObserver + public MHsContentControlEComObserver, + public MHsContentControlUninstallObserver { public: // Constructor and destructor /** @@ -53,12 +56,20 @@ */ IMPORT_C ~CHsContentControlFactory(); -public: // from MHsContentControlEComObserver +private: // from MHsContentControlEComObserver /** * Notification of Ecom registry change. */ void HandleEComChangeEvent(); + +private: // from MHsContentControlUninstallObserver + + /** + * Notification of Uninstall event from SWI. + * @param aPkgUid The package UID which is being uninstalled. + */ + void HandleUninstallEvent( const TUid& aPkgUid ); private: // Constructors /** @@ -93,7 +104,7 @@ * Finds plugin implementation info in the ECOM registry. * @param aUid The plugin UID which is to be checked. * @param aPluginArray The array of plugins which have been implemented. - * @return ImplementationInfo of plugin. + * @return ImplementationInfo of plugin. */ CImplementationInformation* FindPluginImplInfo( const TUid& aUid, const RImplInfoPtrArray& aPlugInArray ); @@ -120,7 +131,12 @@ /** * An object of type CHsContentControlEComListener ( Owned ). */ - CHsContentControlEComListener* iHsContentControlEComListener; + CHsContentControlEComListener* iHsContentControlEComListener; + + /** + * An object of type CHsContentControlUninstallMonitor ( Owned ). + */ + CHsContentControlUninstallMonitor* iHsContentControlUninstallMonitor; }; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/hscontentcontrol/inc/hscontentcontroluninstallmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/inc/hscontentcontroluninstallmonitor.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,61 @@ +/* +* 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: Class to listen SWI uninstall operation. +* +*/ + +#ifndef HSCONTENTCONTROLUNINSTALLMONITOR_H +#define HSCONTENTCONTROLUNINSTALLMONITOR_H + +// System includes +#include +#include + +// User includes +#include "hscontentcontroluninstallobserver.h" + +// Forward declarations + +// Class declaration +/** +* @class CHsContentControlUninstallMonitor +* +* @brief An instance of class CHsContentControlUninstallMonitor which listens for +* uninstall event from SWI. +* +* @lib hscontentcontrol.lib +*/ +NONSHARABLE_CLASS( CHsContentControlUninstallMonitor ) : public CActive + { +public: // constructors and destructor + static CHsContentControlUninstallMonitor* NewL( + MHsContentControlUninstallObserver& aObs ); + ~CHsContentControlUninstallMonitor(); + +protected: // from CActive + void DoCancel(); + void RunL(); + +private: // new functions + CHsContentControlUninstallMonitor( + MHsContentControlUninstallObserver& aObs ); + void ConstructL(); + +private: // data + MHsContentControlUninstallObserver& iObs; + RProperty iSwUninstallKey; + }; + +#endif // HSCONTENTCONTROLUNINSTALLMONITOR_H + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/hscontentcontrol/inc/hscontentcontroluninstallobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/inc/hscontentcontroluninstallobserver.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2008 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: Interface for getting notified for SWI uninstall event. +* +*/ + + +#ifndef HSCONTENTCONTROLUNINSTALLOBSERVER_H +#define HSCONTENTCONTROLUNINSTALLOBSERVER_H + +/** +* MHsContentControlUninstallObserver +* +* @brief The observer of uninstall operations. The derived class needs to implement +* the functions below and will be notified by CHsContentControlUninstallMonitor. +* +* @see CHsContentControlUninstallMonitor +*/ +class MHsContentControlUninstallObserver + { +public: + /** + * Notification of Uninstall event from SWI. + * @param aPkgUid The package UID which is being uninstalled. + */ + virtual void HandleUninstallEvent( const TUid& aPkgUid ) = 0; + }; + +#endif // HSCONTENTCONTROLUNINSTALLOBSERVER_H + +// End of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/hscontentcontrol/src/hscontentcontrolfactory.cpp --- a/idlehomescreen/hscontentcontrol/src/hscontentcontrolfactory.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/hscontentcontrol/src/hscontentcontrolfactory.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -22,6 +22,7 @@ // User include files #include "hscontentcontrolfactory.h" #include "hscontentcontrolecomlistener.h" +#include "hscontentcontroluninstallmonitor.h" // Local constants @@ -78,6 +79,9 @@ CHsContentControlEComListener::NewL( *this ); REComSession::ListImplementationsL( KInterfaceUidContentController, iImplArray ); + + iHsContentControlUninstallMonitor = + CHsContentControlUninstallMonitor::NewL( *this ); } // ---------------------------------------------------------------------------- @@ -97,7 +101,9 @@ iImplArray.ResetAndDestroy(); iImplArray.Close(); iHsContentControlUis.ResetAndDestroy(); + delete iHsContentControlEComListener; + delete iHsContentControlUninstallMonitor; } // --------------------------------------------------------------------------------- @@ -157,7 +163,7 @@ { CHsContentControlUi* cc( iHsContentControlUis[ i ] ); - if ( cc->ContentControlType().CompareF( aControlType ) == 0 ) + if ( cc->ContentControlType().CompareF( aControlType ) == 0 ) { return cc; } @@ -180,6 +186,30 @@ } // ---------------------------------------------------------------------------- +// CHsContentControlFactory::HandleUninstallEvent() +// ---------------------------------------------------------------------------- +// +void CHsContentControlFactory::HandleUninstallEvent( const TUid& aPkgUid ) + { + // ignore event if no plugin loaded. + if ( iHsContentControlUis.Count() > 0 ) + { + for( TInt index( iHsContentControlUis.Count() - 1 ); index >= 0; --index ) + { + CHsContentControlUi* cc( iHsContentControlUis[ index ] ); + // ImplUid of plugin must match Sis pkg uid + if ( cc && cc->ImplUid() == aPkgUid ) + { + iHsContentControlUis.Remove( index ); + delete cc; + cc = NULL; + break; + } + } + } + } + +// ---------------------------------------------------------------------------- // CHsContentControlFactory::CheckPluginChangesL // ---------------------------------------------------------------------------- // diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/hscontentcontrol/src/hscontentcontroluninstallmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/hscontentcontrol/src/hscontentcontroluninstallmonitor.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,104 @@ +/* +* 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: Class to listen SWI uninstall operation. +* +*/ + +#include "hscontentcontroluninstallmonitor.h" +#include + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CHsContentControlUninstallMonitor::NewL() +// --------------------------------------------------------------------------- +// +CHsContentControlUninstallMonitor* CHsContentControlUninstallMonitor::NewL( + MHsContentControlUninstallObserver& aObs ) + { + CHsContentControlUninstallMonitor* self = + new ( ELeave ) CHsContentControlUninstallMonitor( aObs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CHsContentControlUninstallMonitor::~CHsContentControlUninstallMonitor() +// --------------------------------------------------------------------------- +// +CHsContentControlUninstallMonitor::~CHsContentControlUninstallMonitor() + { + Cancel(); + iSwUninstallKey.Close(); + } + +// --------------------------------------------------------------------------- +// CHsContentControlUninstallMonitor::DoCancel() +// --------------------------------------------------------------------------- +// +void CHsContentControlUninstallMonitor::DoCancel() + { + if ( IsActive() ) + { + iSwUninstallKey.Cancel(); + } + } + +// --------------------------------------------------------------------------- +// CHsContentControlUninstallMonitor::RunL() +// --------------------------------------------------------------------------- +// +void CHsContentControlUninstallMonitor::RunL() + { + iSwUninstallKey.Subscribe( iStatus ); + SetActive(); + + TInt value = 0; + if( iSwUninstallKey.Get( value ) == KErrNone ) + { + TUid uid( KNullUid ); + uid.iUid = value; + iObs.HandleUninstallEvent( uid ); + } + } + +// --------------------------------------------------------------------------- +// CHsContentControlUninstallMonitor::CHsContentControlUninstallMonitor() +// --------------------------------------------------------------------------- +// +CHsContentControlUninstallMonitor::CHsContentControlUninstallMonitor( + MHsContentControlUninstallObserver& aObs ) + : CActive( CActive::EPriorityStandard ), + iObs( aObs ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// CHsContentControlUninstallMonitor::ConstructL() +// --------------------------------------------------------------------------- +// +void CHsContentControlUninstallMonitor::ConstructL() + { + if ( KErrNone == iSwUninstallKey.Attach( + KPSUidSWInstallerUiNotification, KSWInstallerUninstallation ) ) + { + iSwUninstallKey.Subscribe( iStatus ); + SetActive(); + } + } + +// End of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xndomattribute.h --- a/idlehomescreen/inc/xndomattribute.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xndomattribute.h Mon Jan 18 20:10:36 2010 +0200 @@ -47,14 +47,14 @@ */ IMPORT_C static CXnDomAttribute* NewL( const TDesC8& aName, - CXnDomStringPool& aStringPool ); + CXnDomStringPool* aStringPool ); /** * Two-phased stream constructor. */ static CXnDomAttribute* NewL( RReadStream& aStream, - CXnDomStringPool& aStringPool ); + CXnDomStringPool* aStringPool ); /** * Destructor. */ @@ -103,6 +103,14 @@ * @return String pool index. */ IMPORT_C TInt16 ValueStringPoolIndex()const; + + /** + * Swap used string pool. + * + * @param aStringPool New string pool to be used. + * Ownership not transferred! + */ + IMPORT_C void SwapStringPoolL( CXnDomStringPool* aStringPool ); public: //From CXnDomListItem @@ -133,7 +141,7 @@ /** * C++ default constructor. */ - CXnDomAttribute( CXnDomStringPool& aStringPool ); + CXnDomAttribute( CXnDomStringPool* aStringPool ); /** * By default Symbian 2nd phase constructor is private. @@ -143,7 +151,7 @@ private: // Data //String pool to get string for references, not owned - CXnDomStringPool& iStringPool; + CXnDomStringPool* iStringPool; //Attribute name reference TInt16 iNameRef; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xndomdocument.h --- a/idlehomescreen/inc/xndomdocument.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xndomdocument.h Mon Jan 18 20:10:36 2010 +0200 @@ -136,10 +136,10 @@ IMPORT_C HBufC8* MarshallL(); /** - * Get reference to string pool + * Get pointer to string pool * @return Reference to string pool implementation */ - IMPORT_C CXnDomStringPool& StringPool() const; + IMPORT_C CXnDomStringPool* StringPool() const; /** * Read contents from a stream. diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xndomlist.h --- a/idlehomescreen/inc/xndomlist.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xndomlist.h Mon Jan 18 20:10:36 2010 +0200 @@ -54,7 +54,7 @@ * Two-phased constructor. */ static CXnDomList* NewL( TListType aListType, - CXnDomStringPool& aStringPool, + CXnDomStringPool* aStringPool, TInt aGranularity=4); /** @@ -62,7 +62,7 @@ */ static CXnDomList* NewL( RReadStream& aStream, - CXnDomStringPool& aStringPool ); + CXnDomStringPool* aStringPool ); /** * Destructor. @@ -168,11 +168,19 @@ IMPORT_C TInt ItemIndex( const MXnDomListItem& aItem )const; /** - * Get reference to the dom's string pool. + * Get pointer to the dom's string pool. * @since Series 60 3.1 * @return Reference to string pool */ - IMPORT_C CXnDomStringPool& StringPool() const; + IMPORT_C CXnDomStringPool* StringPool() const; + + /** + * Swap used string pool. + * + * @param aStringPool New string pool to be used. + * Ownership not transferred! + */ + IMPORT_C void SwapStringPoolL( CXnDomStringPool* aStringPool ); /** * Count items in a list. @@ -220,7 +228,7 @@ * C++ default constructor. */ CXnDomList( TListType aListType, - CXnDomStringPool& aStringPool, + CXnDomStringPool* aStringPool, TInt aGranularity=4 ); /** @@ -237,7 +245,7 @@ private: // Data // StringPool, not owned - CXnDomStringPool& iStringPool; + CXnDomStringPool* iStringPool; }; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xndomnode.h --- a/idlehomescreen/inc/xndomnode.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xndomnode.h Mon Jan 18 20:10:36 2010 +0200 @@ -57,19 +57,19 @@ static CXnDomNode* NewL( const TDesC8& aName, const TDesC8& aNS, - CXnDomStringPool& aStringPool ); + CXnDomStringPool* aStringPool ); /** * Two-phased stream constructor. */ - static CXnDomNode* NewL( RReadStream& aStream, CXnDomStringPool& aStringPool ); + static CXnDomNode* NewL( RReadStream& aStream, CXnDomStringPool* aStringPool ); /** * Destructor. */ virtual ~CXnDomNode(); - public: // New functions + public: // New functions /** * Makes a clone from this node and it's child nodes. * @since Series 60 3.1 @@ -79,21 +79,6 @@ IMPORT_C CXnDomNode* CloneL( CXnDomStringPool& aStringPool ); /** - * Makes a clone only from this node. - * @since Series 60 3.1 - * @param aStringPool. A new string pool. - * @return Pointer to a clone node. Caller has the ownership. - */ - IMPORT_C CXnDomNode* CloneWithoutKidsL( CXnDomStringPool& aStringPool ); - - /** - * Contructs a ref node from this node and its child's. - * @since Series 60 3.1 - * @return Pointer to a ref node. Caller has the ownership. - */ - IMPORT_C CXnDomNode* CreateRefNodeL(); - - /** * Get the namespace of this node. * @since Series 60 3.1 * @return Pointer to the namespace buffer @@ -235,25 +220,11 @@ IMPORT_C TInt DescendantCount() const; /** - * Get reference to the dom's string pool. + * Get pointer to the dom's string pool. * @since Series 60 3.1 * @return Reference to string pool */ - IMPORT_C CXnDomStringPool& StringPool() const; - - /** - * Mark this node as a reference node. - * @since Series 60 3.1 - * @param aRefNode ETrue if node is a reference node - */ - IMPORT_C void SetRefNode( TBool aRefNode=ETrue ); - - /** - * Check if this node is referring to some global node. - * @since Series 60 3.1 - * @return ETrue if this is a reference node. - */ - IMPORT_C TBool IsRefNode() const; + IMPORT_C CXnDomStringPool* StringPool() const; /** * Deletes attributes when they are not needed anymore. @@ -290,16 +261,9 @@ void InternalizeL( RReadStream& aStream ); /** - * Similar to InternalizeL, but does not expect dedicated odt document - */ - void ReadL( RReadStream& aStream ); - - - /** * Documented in CXnDomListItem::Name */ - IMPORT_C const TDesC8& Name(); - + IMPORT_C const TDesC8& Name(); public: @@ -323,15 +287,6 @@ * @param aNS New namespace */ IMPORT_C void SetNamespaceL(const TDesC8& aNS); - - /** - * Makes a clone from this node and it's child nodes. Sets new namespace. - * @since Series 60 3.1 - * @param aStringPool. A new string pool. - * @param aNS. A new namespace. - * @return Pointer to a clone node. Caller has the ownership. - */ - IMPORT_C CXnDomNode* CloneL( CXnDomStringPool& aStringPool, const TDesC8& aNS ); /** * Set ownership of node and its children @@ -339,13 +294,21 @@ * @param aNS. A new namespace. * @return void */ - IMPORT_C void SetOwnershipL( const TDesC8& aNS ); + IMPORT_C void SetOwnershipL( const TDesC8& aNS ); + + /** + * Swap used string pool. + * + * @param aStringPool New string pool to be used. + * Ownership not transferred! + */ + IMPORT_C void SwapStringPoolL( CXnDomStringPool* aStringPool ); private: /** * C++ default constructor. */ - CXnDomNode( CXnDomStringPool& aStringPool ); + CXnDomNode( CXnDomStringPool* aStringPool ); /** * By default Symbian 2nd phase constructor is private. @@ -361,7 +324,7 @@ TInt iNSRef; //iStringPool is used to resolve strings based on references - CXnDomStringPool& iStringPool; + CXnDomStringPool* iStringPool; //Type of the elements content TContentType iContentType; @@ -384,9 +347,6 @@ //Node is the owner of the properties CXnDomList* iPropertyList; - //Flag is set if this node is reference node - TBool iRefNode; - // Not owned CXnNode* iLayoutNode; }; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xndomproperty.h --- a/idlehomescreen/inc/xndomproperty.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xndomproperty.h Mon Jan 18 20:10:36 2010 +0200 @@ -67,20 +67,20 @@ */ IMPORT_C static CXnDomProperty* NewL( const TDesC8& aName, - CXnDomStringPool& aStringPool ); + CXnDomStringPool* aStringPool ); /** * Two-phased stream constructor. */ static CXnDomProperty* NewL( RReadStream& aStream, - CXnDomStringPool& aStringPool ); + CXnDomStringPool* aStringPool ); /** * Two-phased constructor. */ IMPORT_C static CXnDomProperty* NewL( TInt16 aStringPoolIndex, - CXnDomStringPool& aStringPool ); + CXnDomStringPool* aStringPool ); /** * Destructor. */ @@ -131,11 +131,11 @@ IMPORT_C void SetInherited( TBool aInherited ); /** - * Get reference to the dom's string pool. + * Get pointer to the dom's string pool. * @since Series 60 3.1 * @return Reference to string pool */ - IMPORT_C CXnDomStringPool& StringPool() const; + IMPORT_C CXnDomStringPool* StringPool() const; /** * Get the property's string pool index. @@ -144,6 +144,14 @@ */ IMPORT_C TInt16 StringPoolIndex()const; + /** + * Swap used string pool. + * + * @param aStringPool New string pool to be used. + * Ownership not transferred! + */ + IMPORT_C void SwapStringPoolL( CXnDomStringPool* aStringPool ); + public: //Pseudo class utility /** * Get value's pseudo class @@ -186,12 +194,12 @@ /** * C++ default constructor. */ - CXnDomProperty( CXnDomStringPool& aStringPool); + CXnDomProperty( CXnDomStringPool* aStringPool); /** * C++ constructor with string pool index. */ - CXnDomProperty( TInt16 aStringPoolIndex, CXnDomStringPool& aStringPool); + CXnDomProperty( TInt16 aStringPoolIndex, CXnDomStringPool* aStringPool); /** * By default Symbian 2nd phase constructor is private. @@ -205,7 +213,7 @@ private: // Data //String pool to get string for references, not owned - CXnDomStringPool& iStringPool; + CXnDomStringPool* iStringPool; // Pseudo class type for value TPseudoClass iPseudoClass; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xndompropertyvalue.h --- a/idlehomescreen/inc/xndompropertyvalue.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xndompropertyvalue.h Mon Jan 18 20:10:36 2010 +0200 @@ -94,14 +94,14 @@ /** * Two-phased constructor. */ - IMPORT_C static CXnDomPropertyValue* NewL( CXnDomStringPool& aStringPool ); + IMPORT_C static CXnDomPropertyValue* NewL( CXnDomStringPool* aStringPool ); /** * Two-phased stream constructor. */ static CXnDomPropertyValue* NewL( RReadStream& aStream, - CXnDomStringPool& aStringPool ); + CXnDomStringPool* aStringPool ); /** * Destructor. @@ -225,6 +225,7 @@ IMPORT_C void SetStringPoolIndexL( TPrimitiveValueType aValueType, TInt16 aStringPoolIndex ); + /** * Get the property's string pool index. If type is not string, * function will leave with KErrNotSupported. @@ -232,6 +233,14 @@ * @return String pool index. */ IMPORT_C TInt16 StringPoolIndexL()const; + + /** + * Swap used string pool. + * + * @param aStringPool New string pool to be used. + * Ownership not transferred! + */ + IMPORT_C void SwapStringPoolL( CXnDomStringPool* aStringPool ); public: //From MXnDomListItem /** @@ -260,7 +269,7 @@ /** * C++ default constructor. */ - CXnDomPropertyValue( CXnDomStringPool& aStringPool ); + CXnDomPropertyValue( CXnDomStringPool* aStringPool ); /** * By default Symbian 2nd phase constructor is private. @@ -289,7 +298,7 @@ } iData; //String pool - CXnDomStringPool& iStringPool; + CXnDomStringPool* iStringPool; // primitive value type TPrimitiveValueType iPrimitiveValueType; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xndomstringpool.h --- a/idlehomescreen/inc/xndomstringpool.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xndomstringpool.h Mon Jan 18 20:10:36 2010 +0200 @@ -15,14 +15,13 @@ * */ - - #ifndef XN_DOM_STRING_POOL_H #define XN_DOM_STRING_POOL_H // INCLUDES #include #include +#include "xndomstringpooloptimizer.h" // CLASS DECLARATION @@ -40,17 +39,27 @@ /** * Two-phased constructor. + * + * @param aAllowDuplicates ETrue if duplicates are to be allowed. + * Supported for legacy reasons. */ - static CXnDomStringPool* NewL(); + static CXnDomStringPool* NewL( const TBool aAllowDuplicates = EFalse ); + /** * Two-phased stream constructor. + * + * @param aStream Stream where string pool is internalized. + * @param aAllowDuplicates ETrue if duplicates are to be allowed. + * Supported for legacy reasons. */ - static CXnDomStringPool* NewL( RReadStream& aStream ); + static CXnDomStringPool* NewL( RReadStream& aStream, + const TBool aAllowDuplicates = EFalse ); + /** * Destructor. */ virtual ~CXnDomStringPool(); - + public: /** * Make a copy from original StringPool. @@ -58,18 +67,36 @@ * @return Pointer to a string pool. Ownership is transferred to a caller. */ CXnDomStringPool* CloneL(); + public: //Adding /** * Set dom string into string pool. + * * @param aString String to add to string pool * @return Index (reference) to string pool */ - IMPORT_C TInt AddStringL( const TDesC8& aString ); - + TInt AddStringL( const TDesC8& aString ); + + /** + * Set dom string into string pool. + * + * @param aString String to add to string pool. OWNERSHIP TRANSFERRED! + * @return Index (reference) to string pool + */ + TInt AddStringL( HBufC8* aString ); + + /** + * Add all string from another string pool. + * + * @param aStringPool Source string pool. + */ + void AddAllL( CXnDomStringPool& aStringPool ); + public: //Accessing /** - * Get pointer to the node element name. + * Get reference to string. + * * @param aMap Map object which has index to name string * @return Pointer to the name */ @@ -77,46 +104,67 @@ /** * Get object's data size in bytes. + * * @return Data size in bytes */ TInt Size() const; + + /** + * Get amount of strings. + */ + TInt Count() const; /** - * Externalize object + * Externalize object. + * * @param aStream Output stream */ void ExternalizeL( RWriteStream& aStream ) const; /** - * Internalize object + * Internalize object. + * * @param aStream Input stream */ void InternalizeL( RReadStream& aStream ); - /** - * Get index offset to string array for shared resources - * @return An offset that caller must add to its indexes - */ - TUint Offset() const; - private: /** * C++ default constructor. + * + * @param aAllowDuplicates ETrue if duplicates are to be allowed. + * Supported for legacy reasons. */ - CXnDomStringPool(); + CXnDomStringPool( const TBool aAllowDuplicates ); /** - * By default Symbian 2nd phase constructor is private. + * By default Symbian 2nd phase constructor is private. */ - void ConstructL(); - - private: + void ConstructL(); + + /** + * Add string to string pool and to optimizer also. + * + * @param aNewString String to be added. OWNERSHIP TRANSFERRED. + * @param TInt Index to added string. + */ + TInt DoAddStringL( HBufC8* aNewString ) ; + + private: //String pool RPointerArray iStringPool; - - TUint iStringPoolOffsetCurrent; // Internalize uses - TUint iStringPoolOffsetNext; + + /** + * String pool optimizer. + */ + TXnDomStringPoolOptimizer iStringPoolOptimizer; + + /** + * ETrue if string pool can contain duplicate entries. Must + * be supported for legacy reasons while loading xuikon odts. + */ + TBool iAllowDuplicates; }; #endif // XN_DOM_STRING_POOL_H diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xndomstringpooloptimizer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xndomstringpooloptimizer.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2005,2006 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: Optimizer module for CXnDomStringPool. +* +*/ + +#ifndef XN_DOM_STRING_POOL_OPTIMIZER_H +#define XN_DOM_STRING_POOL_OPTIMIZER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* @ingroup group_domdocument +* Optimizer module entry for CXnDomStringPool. +* +* @lib xndomdocument.lib +* @since Series 60 5.2 +*/ +class TXnDomStringPoolOptimizerEntry + { + public: // Construction. + /** + * Constructor. + * + * @param aIndex Index. + * @param aString String. + */ + TXnDomStringPoolOptimizerEntry( TInt aIndex, const TDesC8& aString ); + + public: // Data. + /** + * Index of string in actual string pool. + */ + TInt iIndex; + + /** + * Reference to string in string pool. + */ + const TDesC8& iString; + }; + +/** +* @ingroup group_domdocument +* Optimizer module for CXnDomStringPool. +* +* @lib xndomdocument.lib +* @since Series 60 5.2 +*/ +class TXnDomStringPoolOptimizer + { + public: + /** + * Add entry to optimizer list. + * + * @param aEntry Entry to be added. + */ + void AddEntryL( TXnDomStringPoolOptimizerEntry& aEntry ); + + /** + * Get index for string. + * + * @param aString Reference to given string. + * @return TInt Index to actual string pool for string if found. + * If string is not found will return KErrNotFound. + */ + TInt GetIndex( const TDesC8& aString ); + + /** + * Reset. + */ + void Reset(); + + /** + * Close allocated resources. + */ + void Close(); + + /** + * Get item count. + */ + TInt Count(); + + /** + * Get entry. + * + * @param aIndex Index to Entry. + */ + TXnDomStringPoolOptimizerEntry& Entry( const TInt aIndex ); + + private: + /** + * Find entry from alphabetic list. + * Uses binary search. + * + * @param aString Reference to string to be searched for. + * @param aLeft Left limit for binary search + * @param aRight Right limit for binary search. + * + * @return Index to OPTIMIZER ARRAY. KErrNotFound if + * given string is not found. + */ + TInt FindEntry( const TDesC8& aString, + const TInt aLeft, + const TInt aRight ); + + /** + * Find a position clue for given string. + * + * Will return index that can be used to initiate linear + * search. Uses binary search to limit required comparisons + * when string pools starts to fill. + * + * Note: Returned index is not absolute! it must be + * only used as a start index for linear searching. + * + * Returned index will be quite close to actual insertion position. + * it will be 0 - 2 steps backward from actual position. + * + * @param aString Reference to string. + * @param aLeft Left limit for binary search + * @param aRight Right limit for binary search. + * + * @return Index to start searching for position + * for given string. + */ + TInt FindInsertionIndexEstimate( const TDesC8& aString, + const TInt aLeft, + const TInt aRight ); + + private: // Data. + /** + * Array of optimizer entries. + */ + RArray iEntries; + }; + +#endif // XN_DOM_STRING_POOL_OPTIMIZER_H + +// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xnnewsticker.h --- a/idlehomescreen/inc/xnnewsticker.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xnnewsticker.h Mon Jan 18 20:10:36 2010 +0200 @@ -96,31 +96,12 @@ */ virtual const TDesC& Title(TInt aIndex) = 0; - /** - * Set the separator image for all titles. - * @param aIcon The separator image. This must be mif icon. - * @return KErrNone if successful, KErrArgument if the icon is not mif. - */ - virtual TInt SetSeparatorImageL(CGulIcon* aIcon) = 0; - /** * Delete all titles. */ virtual void ClearTitles() = 0; /** - * Append the SVG title to be shown. - * @param aByteData The SVG data. - */ - virtual void AppendSvgTitleL(const TDesC8& aByteData) = 0; - - /** - * Insert the SVG title to be shown. - * @param aByteData The SVG data. - */ - virtual void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) = 0; - - /** * Set callback interface. * @param aCallback The callback interface pointer. */ @@ -191,13 +172,6 @@ */ const TDesC& Title(TInt aIndex); - /** - * Set the separator image for all titles. - * @param aIcon The separator image. This must be mif icon. - * @return KErrNone if successful, KErrArgument if the icon is not mif. - */ - TInt SetSeparatorImageL(CGulIcon* aIcon); - /** * Delete all titles. */ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xnproperty.h --- a/idlehomescreen/inc/xnproperty.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xnproperty.h Mon Jan 18 20:10:36 2010 +0200 @@ -46,28 +46,29 @@ _LIT8(KPCData, "pcdata"); _LIT8(KFocusable, "focusable"); _LIT8(KInitialFocus, "_s60-initial-focus"); + _LIT8(KFocusAppearance, "_s60-focus-appearance"); _LIT8(KDisabled, "disabled"); // _LIT8(KLocked, "locked"); // _LIT8(KStyleLocked, "stylelocked"); _LIT8(KLongTap, "_s60-longtap"); _LIT8(KSwipe, "swipe"); - _LIT8(KSwipeDestination, "swipe_destination"); + _LIT8(KSwipeDestination, "_s60-swipe-destination"); _LIT8(KBackgroundMask, "backgroundmask" ); _LIT8(KStylusStates, "stylusstates"); - _LIT8(KTouchFeedbackDown, "touchfeedbackdown"); + /*_LIT8(KTouchFeedbackDown, "touchfeedbackdown"); _LIT8(KTouchFeedbackUp, "touchfeedbackup"); _LIT8(KTouchFeedbackDrag, "touchfeedbackdrag"); - _LIT8(KTouchFeedbackLongTap, "touchfeedbacklongtap"); - _LIT8(KEventFilter, "eventfilter"); + _LIT8(KTouchFeedbackLongTap, "touchfeedbacklongtap");*/ + _LIT8(KEventFilter, "eventfilter"); _LIT8(KEffectId, "effectid"); _LIT8(KKeyMoveMode, "keymovemode"); _LIT8(KSizeAware, "sizeaware"); _LIT8(KVisualisationAware, "visualisationaware"); - namespace touchfeedback + /*namespace touchfeedback { _LIT8(KFeedbackBasic, "basic"); _LIT8(KFeedbackSensitive, "sensitive"); - } + }*/ } namespace tooltip { diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/inc/xnviewmanager.h --- a/idlehomescreen/inc/xnviewmanager.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/inc/xnviewmanager.h Mon Jan 18 20:10:36 2010 +0200 @@ -237,7 +237,9 @@ private: TInt ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const; - + + void UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew ); + private: // data diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/data/20026F53.rss --- a/idlehomescreen/widgetmanager/data/20026F53.rss Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/data/20026F53.rss Mon Jan 18 20:10:36 2010 +0200 @@ -31,7 +31,10 @@ implementations = { IMPLEMENTATION_INFO - { + { + // implementation_uid MUST match sis pkg UID, hscontentcontrol uses to monitor + // uninstallation and releasing dll + implementation_uid = 0x20026F53; version_no = 1; display_name = "Widget Manager"; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/data/widgetmanagerview.loc --- a/idlehomescreen/widgetmanager/data/widgetmanagerview.loc Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/data/widgetmanagerview.loc Mon Jan 18 20:10:36 2010 +0200 @@ -159,5 +159,5 @@ // w: // r: TB9.2 // -#define qtn_wm_widget_details_wrt "This widget uses web content. Only one instance of this widget can be in the Home screen at a time." +#define qtn_wm_widget_details_wrt "HomeScreen application that uses internet connection to show dynamic updates from web" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/group/widgetmanager.mmp --- a/idlehomescreen/widgetmanager/group/widgetmanager.mmp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/group/widgetmanager.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -48,6 +48,7 @@ SOURCE wmdetailsdlg.cpp SOURCE wmportalbutton.cpp SOURCE wmwidgetloaderao.cpp +SOURCE wmconfiguration.cpp SOURCEPATH ../data START RESOURCE 20026F53.rss @@ -111,5 +112,5 @@ LIBRARY featmgr.lib // FeatureManager LIBRARY etext.lib LIBRARY centralrepository.lib - +LIBRARY bmpanim.lib // AknBitmap animation // End of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmcommon.h --- a/idlehomescreen/widgetmanager/inc/wmcommon.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmcommon.h Mon Jan 18 20:10:36 2010 +0200 @@ -35,7 +35,8 @@ // UI component ID's enum TWmUiControlIds { - EOviPortal = 0x1, + EPortalOne = 0x1, + EPortalTwo, ELastPortal, EWidgetsList, EFindBox, diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmconfiguration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/inc/wmconfiguration.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,175 @@ +/* +* 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: +* WidgetManager configuration class +* +*/ + +#ifndef WMCONFIGURATION_H +#define WMCONFIGURATION_H + +// INCLUDE FILES +#include + +// FORWARD DECLARATIONS +class CRepository; +class CWmResourceLoader; + +/** + * Configuration class for Widget Manager + * + * @class CWmConfiguration + */ +NONSHARABLE_CLASS( CWmConfiguration ) : public CBase + { + +public: // constructors and destructor + + /** Two-phased constructor. */ + static CWmConfiguration* NewL( + CWmResourceLoader& aResourceLoader ); + + /** Destructor */ + virtual ~CWmConfiguration(); + +private: + /** constructor */ + CWmConfiguration( + CWmResourceLoader& aResourceLoader ); + + /** 2nd phase constructor */ + void ConstructL(); + +public: // API + + /** + * portal button methods + */ + enum TMethod + { + ENone = 0, // no method + EHttp, // open browser to a certain page + EWidget // open given widget with params + }; + + /** + * Number of portal buttons (1 or more) + */ + TInt PortalButtonCount(); + + /** + * Label text to be displayed on a portal button + * @param aIndex index of the button, starting at 0 + */ + const TDesC& PortalButtonText( TInt aIndex ); + + /** + * Icon to be displayed on a portal button + * Logo syntax follows the widget icon syntax in MHsContentInfo + * @param aIndex index of the button, starting at 0 + */ + const TDesC& PortalButtonIcon( TInt aIndex ); + + /** + * Bundle ID related to this button + * parameter is valid if this button launches an application + * @param aIndex index of the button, starting at 0 + */ + const TDesC& PortalButtonBundleId( TInt aIndex ); + + /** + * Portal button action method. + * Defines what happens when the portal button is pressed. + * @param aIndex index of the button, starting at 0 + */ + TMethod PortalButtonPrimaryMethod( TInt aIndex ); + + /** + * parameters related to the method. + * For EHttp this is the HTTP address + * for EWidget the parameters passed to the widget + * @param aIndex index of the button, starting at 0 + */ + const TDesC& PortalButtonPrimaryParams( TInt aIndex ); + + /** + * Secondary method, which is excuted if + * primary method fails. + * Works like Primary method. + * @param aIndex index of the button, starting at 0 + */ + TMethod PortalButtonSecondaryMethod( TInt aIndex ); + + /** + * Parameters for Secondary method. Like Primary method + * Works like Primary params. + * @param aIndex index of the button, starting at 0 + */ + const TDesC& PortalButtonSecondaryParams( TInt aIndex ); + + +private: // New functions + + TInt FindCorrectLanguageId(); + HBufC* ReadParameterL( TInt aKey ); + HBufC* ReadLocalisedParameterL( TInt aOffset ); + +private: + + /** + * the central repository + */ + CRepository* iRepository; + + /** + * the resource loader + */ + CWmResourceLoader& iResourceLoader; + + /** + * The index in cenrep that matches current + * system language + */ + TInt iLanguageIndex; + + /** + * OviStore widget bundle ID + */ + HBufC* iOviStoreBundleId; + + /** + * OviStore widget client param + */ + HBufC* iOviStoreClientParam; + + /** + * Localized Url to start browser + */ + HBufC* iOviStoreUrl; + + /** + * Localised OVI store text + */ + HBufC* iOviStoreText; + + /** + * OVI store icon + */ + HBufC* iOviStoreIcon; + + }; + +#endif // WMCONFIGURATION_H + +// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmcrkeys.h --- a/idlehomescreen/widgetmanager/inc/wmcrkeys.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmcrkeys.h Mon Jan 18 20:10:36 2010 +0200 @@ -35,6 +35,7 @@ * OperatorButtonText_9 0x28 */ +const TUint32 KLangGroupSize = 4; const TUint32 KOviStoreBrowserUrlOffset = 1; const TUint32 OperatorUrlOffset = 2; const TUint32 KperatorButtonTextOffset = 3; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmdetailsdlg.h --- a/idlehomescreen/widgetmanager/inc/wmdetailsdlg.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmdetailsdlg.h Mon Jan 18 20:10:36 2010 +0200 @@ -139,7 +139,6 @@ * ETrue if widget can be added to HS */ TBool iCanBeAdded; - }; #endif ___WMDETAILSDLG_H__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmimageconverter.h --- a/idlehomescreen/widgetmanager/inc/wmimageconverter.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmimageconverter.h Mon Jan 18 20:10:36 2010 +0200 @@ -58,7 +58,8 @@ EIdle = 0, EDecoding, EScalingBitmap, - EScalingMask + EScalingMask, + EFailed }; public: //contructors/destructors @@ -84,8 +85,10 @@ * - mif( ) * - uid() * - . + * + * @return Error code */ - void HandleIconStringL( TInt aWidth, TInt aHeight, const TDesC& aIconStr ); + TInt HandleIconString( TInt aWidth, TInt aHeight, const TDesC& aIconStr ); /** * Returns converted bitmap. Caller takes ownership @@ -126,6 +129,13 @@ */ TConversionMethod ConversionMethod(); + /** + * Image convertion status + * + * @return ETrue if processing image, false otherwise. + */ + TBool IsProcessing(); + protected: // implementation of CActive /** * Implements cancellation of an outstanding request. @@ -152,9 +162,10 @@ CWmImageConverter(); void ConstructL( MConverterObserver* aObserver ); void CheckSvgErrorL( MSvgError* aError ); - + void HandleIconStringL( TInt aWidth, TInt aHeight, + const TDesC& aIconStr ); + private: - void ScaleBitmap( TInt aWidth, TInt aHeight ); void ScaleMask( TInt aWidth, TInt aHeight ); void CreateIconFromUidL( const TUid& aUid ); @@ -172,6 +183,9 @@ TInt& aBitmapId, TInt& aMaskId, TDes& aFileName ); TBool EndsWith( const TDesC& aString, const TDesC& aPattern ); + // helpers + TInt ParseNextUint( TLex& aLex, TUint& aValue ); + private: // from MAknIconFileProvider /** Returns an open file handle to the icon file. */ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmlistbox.h --- a/idlehomescreen/widgetmanager/inc/wmlistbox.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmlistbox.h Mon Jan 18 20:10:36 2010 +0200 @@ -244,8 +244,9 @@ * adding all widget datas to update the listbox correctly! * * @param aWidget Data data to add + * @param aRedraw listbox update flag */ - void AddWidgetDataL( CWmWidgetData* aWidgetData ); + void AddWidgetDataL( CWmWidgetData* aWidgetData, TBool aRedraw = ETrue ); /** * removes widget data from given index in the model @@ -378,6 +379,11 @@ RWidgetDataValues iWidgetDatas; /** + * array of trashed widget data objects, not visible in list. + */ + RPointerArray iTrashedData; + + /** * the currently active item ADD button's rectangle, for push recognition */ TRect iButtonRect; @@ -392,6 +398,8 @@ */ TBool iPressedDown; + /** size of logo rect in list item */ + TSize iLogoSize; }; #include "wmlistbox.inl" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmmaincontainer.h --- a/idlehomescreen/widgetmanager/inc/wmmaincontainer.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmmaincontainer.h Mon Jan 18 20:10:36 2010 +0200 @@ -39,6 +39,7 @@ class CWmPortalButton; class CWmWidgetLoaderAo; class CWmMainContainerView; +class CWmConfiguration; /** * Container class for WmMainContainer @@ -170,9 +171,9 @@ void UninstallWidgetL(); /** - * opens OVI portal + * opens currently selected portal */ - void OpenOviPortalL(); + void OpenPortalL(); /** * Selection key (middle soft key) @@ -218,8 +219,9 @@ /** * Moves focus to the OVI button + * @param aIndex 0=first button, 1=second (if it exists) */ - void SetFocusToOviButton(); + void SetFocusToPortalButton( TInt aIndex ); /** * Moves focus to the widgets list, alternatively also setting the currently @@ -240,6 +242,11 @@ * To set iClosingDown. See above. */ void SetClosingDown( TBool aClosingDown ); + + /** + * access to WM configuration + */ + CWmConfiguration& Configuration(); protected: // from base class CCoeControl @@ -283,14 +290,21 @@ void LayoutControls(); void StartLoadingWidgetsL(); void RemoveCtrlsFromStack(); + void UpdateFocusMode(); + CCoeControl* FindChildControlByPoint( const TPoint& aPoint ); + void HandleFindSizeChanged(); TKeyResponse MoveFocusByKeys( const TKeyEvent& aKeyEvent, TEventCode aType ); - void UpdateFocusMode(); - CCoeControl* FindChildControlByPoint( const TPoint& aPoint ); - void HandleFindSizeChanged(); - void FetchRepositoryDataL(); - + TKeyResponse HandleButtonKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + TKeyResponse HandleListKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + TKeyResponse HandleSearchKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); private: /** @@ -319,9 +333,16 @@ CAknsBasicBackgroundControlContext* iBgContext; /** - * Ovi portal + * portal button + * (if there is only one button, this is it) */ - CWmPortalButton* iOviPortal; + CWmPortalButton* iPortalButtonOne; + + /** + * portal button + * (if there is only one button, this is NULL) + */ + CWmPortalButton* iPortalButtonTwo; /** GUI layout modes */ enum TWmLayout @@ -340,7 +361,7 @@ enum TWmFocusMode { ENowhere, - EOvi, + EPortal, EList, EFind }; @@ -362,19 +383,9 @@ TBool iClosingDown; /** - * Localized Url to start browser - */ - HBufC* iOviStoreUrl; - - /** - * OviStore bundleId + * The configuration */ - HBufC* iOviStoreClientBundleId; - - /** - * OviStore client param - */ - HBufC* iOviStoreClientParam; + CWmConfiguration* iConfiguration; }; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmplugin.h --- a/idlehomescreen/widgetmanager/inc/wmplugin.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmplugin.h Mon Jan 18 20:10:36 2010 +0200 @@ -137,14 +137,22 @@ * the shared file server reference */ RFs& FileServer(); + + /** prestored action to be executed. */ + void ExecuteCommandL(); private: /** constructor */ CWmPlugin(); /** 2nd phase constructor */ void ConstructL(); - /** actions that are done when widget manager is closed */ - void ExecutePostponedCommandL(); + + /** + * Sets forwarding numeric keys to phone. + * + * @param aEnabled ETrue if numeric keys are forwarded to phone + */ + void ForwardNumericKeysToPhone( TBool aEnabled ); private: // data members @@ -157,7 +165,12 @@ * main container (not owned) */ CWmMainContainer* iWmMainContainer; - + + /** + * main view (not owned) + */ + CWmMainContainerView* iWmMainView; + /** * resource loader */ @@ -189,6 +202,11 @@ */ CHsContentInfo* iPostponedContent; + /** + * ActiveSchedulerWait used to wait while previous view is + * being activated upon deletion. + */ + CActiveSchedulerWait* iWait; }; #endif // __WMPLUGIN_ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmportalbutton.h --- a/idlehomescreen/widgetmanager/inc/wmportalbutton.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmportalbutton.h Mon Jan 18 20:10:36 2010 +0200 @@ -25,6 +25,7 @@ // FORWARD DECLARATIONS class CWmMainContainer; +class CFbsBitmap; /** * Portal button ( ovi, operator ) class for Wm @@ -32,43 +33,25 @@ * @class CWmPortalButton wmportalbutton.h */ NONSHARABLE_CLASS( CWmPortalButton ) : public CAknButton, - public MConverterObserver + public MConverterObserver, + public MCoeControlObserver { public: /* * Two-phased constructor. * * @param aParent button title text - * @param aText button title text - * @param aUrl Url to open in browser when clicked. - * @param aButtonCtrlId type of button + * @param aPortalButtonIndex index of this button (0 or 1) */ static CWmPortalButton* NewL( const CCoeControl* aParent, - const TDesC& aText = KNullDesC, - const TDesC& aUrl = KNullDesC, - TWmUiControlIds aButtonCtrlId = EOviPortal ); + TInt aPortalButtonIndex = 0 ); /** Destructor */ virtual ~CWmPortalButton(); public: // Functions from base class - - /** - * Handles key events. - * - * @see CCoeControl::OfferKeyEventL - */ - TKeyResponse OfferKeyEventL( - const TKeyEvent& aKeyEvent, TEventCode aType ); - - /** - * Handles pointer events. - * - * @see CCoeControl::HandlePointerEventL - */ - void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - + /* * Draws the control. * @@ -83,43 +66,45 @@ */ void SizeChanged(); + /** + * Executes action for button pressed + */ + void ExecuteL(); + protected: // from MConverterObserver /** image conversin completed */ void NotifyCompletion( TInt aError ); - + +protected: // from MCoeControlObserver + + /** Observes the button's own activity */ + void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); + protected: // Constructors /** Constructor for performing 1st stage construction */ CWmPortalButton( const TInt aFlags, - TWmUiControlIds aButtonCtrlId = EOviPortal ); + TInt aPortalButtonIndex ); /** 2nd phase constructor */ void ConstructL( - const CCoeControl* aParent, + CWmMainContainer* aParent, const TDesC& aText = KNullDesC, - const TDesC& aUrl = KNullDesC ); + const TDesC& aIcon = KNullDesC ); private: - /** - * Draws text over button - */ + /** size of button icon, defined in the layout */ + TSize LayoutIconSize() const; + + /** Draws text over button */ void DrawText( CWindowGc& aGc, const TDesC& aText, TAknTextComponentLayout& aLayout, TInt aMargin ) const; private: //data members - /** - * Button text - */ - HBufC* iText; - - /** - * Url assigned to button - */ - HBufC* iUrl; /** * the image converter utility @@ -132,9 +117,15 @@ CWmMainContainer* iWmMainContainer; /** - * Button ctrl id + * Button index */ - TWmUiControlIds iButtonCtrlId; + TInt iPortalButtonIndex; + + /** icon */ + CFbsBitmap* iButtonIcon; + + /** icon mask */ + CFbsBitmap* iButtonIconMask; }; #endif //___WMPORTALBUTTON_H__ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmresourceloader.h --- a/idlehomescreen/widgetmanager/inc/wmresourceloader.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmresourceloader.h Mon Jan 18 20:10:36 2010 +0200 @@ -77,7 +77,10 @@ const TDesC& IconFilePath(); /** default no description text */ - const TDesC& NoDescriptionText(); + const TDesC& NoDescription(); + + /** wrt specific description text */ + const TDesC& WrtDescription(); private: // internal methods @@ -125,9 +128,15 @@ CAknInformationNote *iNote; /** - * Default description text + * Default no description text */ - HBufC* iDescription; + HBufC* iNoDescription; + + /** + * Wrt specific description text + */ + HBufC* iWrtDescription; + }; #endif // WMRESOURCELOADER_H_ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmwidgetdata.h --- a/idlehomescreen/widgetmanager/inc/wmwidgetdata.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmwidgetdata.h Mon Jan 18 20:10:36 2010 +0200 @@ -26,6 +26,7 @@ #include #include #include +#include //installer #include "wmimageconverter.h" @@ -36,6 +37,7 @@ class CHsContentInfo; class CWmPersistentWidgetOrder; class RWidgetRegistryClientSession; +class CWmResourceLoader; // CLASS DECLARATION /** @@ -44,7 +46,7 @@ * handling the list item. */ NONSHARABLE_CLASS( CWmWidgetData ) - : public CBase + : public CActive , public MConverterObserver { @@ -61,28 +63,57 @@ public: // construction /** * static constructor + * @param aLogoSize size of logo image. * @param aHsContentInfo (takes ownership) * @param aRegistryClientSession (does not take ownership) */ - static CWmWidgetData* NewL( + static CWmWidgetData* NewL( + const TSize& aLogoSize, + CWmResourceLoader& aWmResourceLoader, CHsContentInfo* aHsContentInfo, RWidgetRegistryClientSession* aRegistryClientSession ); /** * static constructor, leaves object in cleanup stack + * @param aLogoSize size of logo image. * @param aHsContentInfo (takes ownership) * @param aRegistryClientSession (does not take ownership) */ - static CWmWidgetData* NewLC( + static CWmWidgetData* NewLC( + const TSize& aLogoSize, + CWmResourceLoader& aWmResourceLoader, CHsContentInfo* aHsContentInfo, RWidgetRegistryClientSession* aRegistryClientSession ); /** Destructor. */ ~CWmWidgetData(); +protected: // implementation of CActive + /** + * Implements cancellation of an outstanding request. + * + * @see CActive::DoCancel + */ + void DoCancel(); + + /** + * Handles an active object's request completion event. + * + * @see CActive::RunL + */ + void RunL(); + + /** + * RunError + * + * @see CActive::RunError + */ + TInt RunError(TInt aError); + private: // private construction /** Constructor for performing 1st stage construction */ - CWmWidgetData(); + CWmWidgetData( const TSize& aLogoSize, + CWmResourceLoader& aWmResourceLoader ); /** 2nd phase constructor */ void ConstructL( @@ -99,6 +130,27 @@ public: // external handles + /** + * Init uninstallation of widget. + */ + void UnInstallL(); + + /** current uninstall animation bitmap */ + const CFbsBitmap* AnimationBitmap( const TSize& aSize ); + + /** current uninstall animation mask */ + const CFbsBitmap* AnimationMask( const TSize& aSize ); + + /** + * @return ETrue if widget is being uninstalled. + */ + TBool IsUninstalling(); + + /** + * @return ETrue if logo is being created,false otherwise. + */ + TBool IsPrepairingLogo(); + /** * sets an observer for callbacks * @@ -113,16 +165,16 @@ const CWmPersistentWidgetOrder* aPersistentWidgetOrder ); /** - * set logo rect size - */ - void SetLogoSize( const TSize& aSize ); - - /** * Init logo re-creation */ void ReCreateLogo( const TSize& aSize ); /** + * returns widget description + */ + const TDesC& Description() const; + + /** * Replaces the content of this widget data. The method is called * during widget update. If widget values change, a change event is * fired for the observer. @@ -160,9 +212,6 @@ /** widget name */ inline const TDesC& Name() const; - /** widget description */ - inline const TDesC& Description() const; - /** widget uid */ inline TUid Uid() const; @@ -196,7 +245,14 @@ void NotifyCompletion( TInt aError ); private: // new functions - + + /** uninstall animation related*/ + void VisualizeUninstall(); + void PrepairAnimL(); + void DestroyAnimData(); + static TInt Tick( TAny* aPtr ); + static TInt CloseSwiSession( TAny* aPtr ); + /** fetches publisher uid from widget registry*/ void FetchPublisherUidL( RWidgetRegistryClientSession* aRegistryClientSession ); @@ -205,12 +261,14 @@ TUid UidFromString( const TDesC8& aUidString ) const; /** Logo icon string handling */ - static TInt HandleAsyncIconString( TAny* aPtr ); - void HandleIconStringL( const TDesC& aIconStr ); + void HandleIconString( const TDesC& aIconStr ); void FireDataChanged(); private: // data members + /* reference to resource loader */ + CWmResourceLoader& iWmResourceLoader; + /* instance of the CIdle class for async iconStr handling*/ CIdle* iIdle; @@ -220,15 +278,12 @@ /* observes this widget representation (NOT OWNED) */ MWmWidgetDataObserver* iObserver; - /* rotating animation index */ - TInt iInstallAnimationIndex; - /** the widget logo bitmap */ CFbsBitmap* iLogoImage; /** the widget logo mask */ CFbsBitmap* iLogoImageMask; - + /** The CHsContentInfo that corresponds to this list row */ CHsContentInfo* iHsContentInfo; @@ -246,7 +301,32 @@ /** validity of the widget - used during list refresh */ TBool iValid; + + /* Array of uninstall animation bitmaps*/ + RArray iUninstallAnimIcons; + /** periodic timer for updating animation */ + CPeriodic* iPeriodic; + + /* uninstall animation index */ + TInt iAnimationIndex; + + /** uninstallation switch */ + TBool iAsyncUninstalling; + + /** logo changed switch */ + TBool iFireLogoChanged; + + /** + * silent install launcher. + */ + SwiUI::RSWInstSilentLauncher iInstaller; + + /** + * ActiveSchedulerWait used to wait while logo image + * is being prepaired. + */ + CActiveSchedulerWait* iWait; }; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/inc/wmwidgetdata.inl --- a/idlehomescreen/widgetmanager/inc/wmwidgetdata.inl Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmwidgetdata.inl Mon Jan 18 20:10:36 2010 +0200 @@ -31,10 +31,6 @@ inline const TDesC& CWmWidgetData::Name() const { return iHsContentInfo->Name(); } - /** widget description */ - inline const TDesC& CWmWidgetData::Description() const - { return iHsContentInfo->Description(); } - /** widget uid */ inline TUid CWmWidgetData::Uid() const { return UidFromString( iHsContentInfo->Uid() ); }; @@ -47,10 +43,6 @@ inline CWmWidgetData::TWidgetType CWmWidgetData::WidgetType() const { return iWidgetType; } - /** running install animation index */ - inline TInt CWmWidgetData::InstallAnimationIndex() const - { return iInstallAnimationIndex; } - /** the logo bitmap */ inline const CFbsBitmap* CWmWidgetData::LogoImage() { return iLogoImage; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/sis/Create_update_sisx.bat --- a/idlehomescreen/widgetmanager/sis/Create_update_sisx.bat Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/sis/Create_update_sisx.bat Mon Jan 18 20:10:36 2010 +0200 @@ -18,6 +18,9 @@ call elftran.exe -version 1.1 \epoc32\release\armv5\urel\widgetmanager.dll call elftran.exe -version 1.1 \epoc32\release\armv5\udeb\widgetmanager.dll +rem make sure cenrep file exists +call \ext\tools\toolsextensions\ConfigurationTool\cli_build.cmd -master_conf s60 -impl ..\conf -confml ..\conf -no_iby + rem Create wm sis&sisx files makesis widgetmanager_udeb.pkg signsis widgetmanager_udeb.SIS widgetmanager_udeb.SISX Nokia_RnDCert_02.der Nokia_RnDCert_02.key @@ -25,4 +28,5 @@ signsis widgetmanager_urel.SIS widgetmanager_urel.SISX Nokia_RnDCert_02.der Nokia_RnDCert_02.key rem Create wm stubsis file -makesis -s widgetmanager_stub.pkg \ No newline at end of file +makesis -s widgetmanager_stub.pkg + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/sis/widgetmanager_urel.pkg --- a/idlehomescreen/widgetmanager/sis/widgetmanager_urel.pkg Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/sis/widgetmanager_urel.pkg Mon Jan 18 20:10:36 2010 +0200 @@ -44,4 +44,5 @@ "\epoc32\data\z\resource\apps\widgetmanager.mif" -"C:\resource\apps\widgetmanager.mif" ; cenrep -"\epoc32\data\z\private\10202be9\20026F53.txt" -"C:\private\10202be9\20026F53.txt" \ No newline at end of file +"\epoc32\data\z\private\10202be9\20026F53.txt" -"C:\private\10202be9\20026F53.txt" + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmconfiguration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/src/wmconfiguration.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,279 @@ +/* +* 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: +* WidgetManager configuration class +* +*/ + +// INCLUDE FILES +#include +#include +#include + +#include +#include +#include "wmconfiguration.h" +#include "wmresourceloader.h" +#include "wmcrkeys.h" + +// CONSTANTS +const TInt KMaxIconDescriptorLength = 256; + +// --------------------------------------------------------- +// CWmConfiguration::NewL +// --------------------------------------------------------- +// +CWmConfiguration* CWmConfiguration::NewL( + CWmResourceLoader& aResourceLoader ) + { + CWmConfiguration* self = new (ELeave) CWmConfiguration( aResourceLoader ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CWmConfiguration::CWmConfiguration() +// --------------------------------------------------------- +// +CWmConfiguration::CWmConfiguration( + CWmResourceLoader& aResourceLoader ) + : iResourceLoader( aResourceLoader ) + { + iOviStoreText = NULL; + iOviStoreIcon = NULL; + iRepository = NULL; + iOviStoreBundleId = NULL; + iOviStoreClientParam = NULL; + iOviStoreUrl = NULL; + } + +// --------------------------------------------------------- +// CWmConfiguration::~CWmConfiguration() +// --------------------------------------------------------- +// +CWmConfiguration::~CWmConfiguration() + { + delete iOviStoreText; + delete iOviStoreIcon; + delete iRepository; + delete iOviStoreBundleId; + delete iOviStoreClientParam; + delete iOviStoreUrl; + } + +// --------------------------------------------------------- +// CWmConfiguration::ConstructL +// --------------------------------------------------------- +// +void CWmConfiguration::ConstructL() + { + // localised ovistore button text + iOviStoreText = StringLoader::LoadL( R_QTN_WM_GO_TO_OVI_STORE ); + + // ovistore icon descriptor. It will look something like this: + // skin( 0x101f86e3 0x23f6 ):mif( z:\resource\apps\widgetmanager.mif 16388 16389 ) + TBuf buf; + _LIT( KSkinMifIconFormat, "skin( 0x%x 0x%x ):mif( %S %d %d )"); + buf.Format( KSkinMifIconFormat(), + EAknsMajorGeneric, EAknsMinorGenericQgnMenuOviStore, + &iResourceLoader.IconFilePath(), + EMbmWidgetmanagerQgn_menu_ovistore, + EMbmWidgetmanagerQgn_menu_ovistore_mask ); + iOviStoreIcon = buf.AllocL(); + + // read data from repository + TRAP_IGNORE( + iRepository = CRepository::NewL( + TUid::Uid( KCrWidgetManagerm ) ); + + iLanguageIndex = FindCorrectLanguageId(); + iOviStoreBundleId = ReadParameterL( KOviStoreBunbleId ); + iOviStoreClientParam = ReadParameterL( KOviStoreClientParam ); + iOviStoreUrl = ReadLocalisedParameterL( KOviStoreBrowserUrlOffset ); + ); + } + +// --------------------------------------------------------- +// CWmConfiguration::FindCorrectLanguageId +// --------------------------------------------------------- +// +TInt CWmConfiguration::FindCorrectLanguageId() + { + TInt languageIndex = KErrNotFound; // the correct language + TInt englishIndex = KErrNotFound; // english + TInt anyIndex = KErrNotFound; // backup - any existing + TLanguage sysLang = User::Language(); + + //read language id's from cenrep, find a match + for( TUint32 i=KLangId0; i<=KLangId9 && languageIndex<0; i+=KLangGroupSize ) + { + TInt crLang = 0; + if ( iRepository->Get( i, crLang ) == KErrNone ) + { + if ( crLang == sysLang && languageIndex < 0 ) + { languageIndex = i; } + if ( crLang == ELangEnglish && englishIndex < 0 ) + { englishIndex = i; } + if ( crLang > 0 && anyIndex < 0 ) + { anyIndex = i; } + } + } + + // if correct language was not found, use english + if ( languageIndex < 0 ) languageIndex = englishIndex; + // if english was not found, use any configured language + if ( languageIndex < 0 ) languageIndex = anyIndex; + // if there are no languages configured, we're in trouble... + if ( languageIndex < 0 ) languageIndex = 0; + + return languageIndex; + } + +// --------------------------------------------------------- +// CWmConfiguration::ReadParameterL +// --------------------------------------------------------- +// +HBufC* CWmConfiguration::ReadParameterL( TInt aKey ) + { + TBuf buf; + TInt err = iRepository->Get( aKey, buf ); + + HBufC* heapBuffer = NULL; + if ( err == KErrNone ) + { + heapBuffer = HBufC::NewL( buf.Length() ); + heapBuffer->Des().Copy( buf ); + } + return heapBuffer; + } + +// --------------------------------------------------------- +// CWmConfiguration::ReadLocalisedParameterL +// --------------------------------------------------------- +// +HBufC* CWmConfiguration::ReadLocalisedParameterL( + TInt aOffset ) + { + TBuf buf; + TInt err = KErrNone; + + err = iRepository->Get( iLanguageIndex + aOffset, buf ); + if ( err != KErrNone || buf.Length() == 0 ) + { + // This language is empty. Try default language (index 0) + err = iRepository->Get( KLangId0 + aOffset, buf ); + } + + // construct string in heap + HBufC* heapBuffer = NULL; + if ( err == KErrNone ) + { + heapBuffer = buf.AllocL(); + } + return heapBuffer; + } + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonCount +// --------------------------------------------------------- +// +TInt CWmConfiguration::PortalButtonCount() + { + return 1; + } + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonText +// --------------------------------------------------------- +// +const TDesC& CWmConfiguration::PortalButtonText( TInt aIndex ) + { + if ( aIndex == 0 && iOviStoreText ) return *iOviStoreText; + return KNullDesC; + } + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonIcon +// --------------------------------------------------------- +// +const TDesC& CWmConfiguration::PortalButtonIcon( TInt aIndex ) + { + if ( aIndex == 0 && iOviStoreIcon ) return *iOviStoreIcon; + return KNullDesC; + } + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonBundleId +// --------------------------------------------------------- +// +const TDesC& + CWmConfiguration::PortalButtonBundleId( TInt aIndex ) + { + if ( aIndex == 0 && iOviStoreBundleId ) return *iOviStoreBundleId; + return KNullDesC; + } + + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonPrimaryMethod +// --------------------------------------------------------- +// +CWmConfiguration::TMethod + CWmConfiguration::PortalButtonPrimaryMethod( TInt aIndex ) + { + if ( aIndex == 0 && iOviStoreClientParam ) return EWidget; + return ENone; + } + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonPrimaryParams +// --------------------------------------------------------- +// +const TDesC& + CWmConfiguration::PortalButtonPrimaryParams( TInt aIndex ) + { + if ( aIndex == 0 && iOviStoreClientParam ) return *iOviStoreClientParam; + return KNullDesC; + } + + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonSecondaryMethod +// --------------------------------------------------------- +// +CWmConfiguration::TMethod + CWmConfiguration::PortalButtonSecondaryMethod( TInt aIndex ) + { + if ( aIndex == 0 && iOviStoreUrl ) return EHttp; + return ENone; + } + +// --------------------------------------------------------- +// CWmConfiguration::PortalButtonSecondaryParams +// --------------------------------------------------------- +// +const TDesC& + CWmConfiguration::PortalButtonSecondaryParams( TInt aIndex ) + { + if ( aIndex == 0 && iOviStoreUrl ) return *iOviStoreUrl; + return KNullDesC; + } + + + + +// End of File + diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp --- a/idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -239,7 +239,14 @@ TCharFormatMask charFormatMask; CParaFormat paraFormat; TParaFormatMask paraFormatMask; - paraFormat.iHorizontalAlignment = CParaFormat::EJustifiedAlign; + if ( Layout_Meta_Data::IsMirrored() ) + { + paraFormat.iHorizontalAlignment = CParaFormat::ERightAlign; + } + else + { + paraFormat.iHorizontalAlignment = CParaFormat::ELeftAlign; + } charFormat.iFontPresentation.iTextColor = color; paraFormatMask.SetAttrib(EAttAlignment); charFormatMask.SetAttrib(EAttFontTypeface); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmimageconverter.cpp --- a/idlehomescreen/widgetmanager/src/wmimageconverter.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmimageconverter.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -90,20 +90,47 @@ Cancel(); delete iImageDecoder; iFs.Close(); - if (iBitmap) + if ( iBitmap ) { delete iBitmap; iBitmap = NULL; - } - if (iMask) + } + if ( iMask ) { delete iMask; iMask = NULL; - } + } delete iScaler; } // --------------------------------------------------------- +// CWmImageConverter::HandleIconString +// --------------------------------------------------------- +// +TInt CWmImageConverter::HandleIconString( + TInt aWidth, TInt aHeight, + const TDesC& aIconStr ) + { + TInt err( KErrNone ); + TRAP( err, HandleIconStringL( aWidth, aHeight, aIconStr ); ); + if ( KErrNone != err ) + { + iState = EFailed; + if ( iBitmap ) + { + delete iBitmap; + iBitmap = NULL; + } + if ( iMask ) + { + delete iMask; + iMask = NULL; + } + } + return err; + } + +// --------------------------------------------------------- // CWmImageConverter::HandleIconStringL // --------------------------------------------------------- // @@ -111,6 +138,8 @@ TInt aWidth, TInt aHeight, const TDesC& aIconStr ) { + iConversionMethod = EUnrecognized; + iState = EDecoding; if ( aIconStr.Length() ) { TAknsItemID skinItemId; @@ -120,7 +149,7 @@ TInt maskId( KErrNotFound ); TUid appUid; iFilename = KNullDesC; - iScaleNeeded = EFalse; + iScaleNeeded = EFalse; iSize.SetSize( aWidth, aHeight ); if ( ResolveSkinIdAndMifId( @@ -154,10 +183,13 @@ } else { - iConversionMethod = EUnrecognized; User::Leave( KErrArgument ); } } + else + { + User::Leave( KErrArgument ); + } } // --------------------------------------------------------- @@ -193,7 +225,7 @@ break; } } - } + } CApaMaskedBitmap* maskedBmp = CApaMaskedBitmap::NewLC(); User::LeaveIfError( lsSession.GetAppIcon( aUid, size, *maskedBmp ) ); iBitmap = static_cast( maskedBmp ); // ownership transfered @@ -212,6 +244,7 @@ // scale or notify if ( size == iSize ) { + iState = EIdle; iObserver->NotifyCompletion( KErrNone ); } else @@ -253,10 +286,12 @@ } // notify observer + iState = EIdle; iObserver->NotifyCompletion( err ); } else { + iState = EIdle; User::Leave( KErrArgument ); } } @@ -315,6 +350,7 @@ iBitmap = bitmap; iMask = mask; + iState = EIdle; iObserver->NotifyCompletion( KErrNone ); } @@ -336,7 +372,7 @@ // void CWmImageConverter::CreateIconFromOtherL( const TDesC& aFileName ) { - if ( IsActive() || iState != EIdle ) + if ( IsActive() ) { User::Leave( KErrNotReady ); } @@ -364,8 +400,8 @@ { iScaleNeeded = ETrue; } + // start conversion to bitmap - iState = EDecoding; iImageDecoder->Convert( &iStatus, *iBitmap, *iMask ); SetActive(); } @@ -376,11 +412,13 @@ // void CWmImageConverter::DoCancel() { - if( iState == EDecoding ) + if( iState == EDecoding && + iConversionMethod == EImageIcon ) { - iImageDecoder->Cancel(); + iImageDecoder->Cancel(); + iState = EIdle; if ( iObserver ) - { + { iObserver->NotifyCompletion( KErrCancel ); } } @@ -388,16 +426,16 @@ iState == EScalingMask ) { iScaler->Cancel(); + iState = EIdle; if ( iObserver ) - { + { iObserver->NotifyCompletion( KErrCancel ); } } else { // State is EIdle, do nothing - } - iState = EIdle; + } iScaleNeeded = EFalse; } @@ -529,9 +567,9 @@ iBitmap && ( iState == EDecoding || iState == EIdle ) ) { + iState = EScalingBitmap; // the maintain aspect ratio is by default set to true - iScaler->Scale( &iStatus, *iBitmap, TSize( aWidth,aHeight ), EFalse ); - iState = EScalingBitmap; + iScaler->Scale( &iStatus, *iBitmap, TSize( aWidth,aHeight ), EFalse ); SetActive(); } } @@ -546,9 +584,9 @@ iState == EScalingBitmap && iMask ) { + iState = EScalingMask; // the maintain aspect ratio is by default set to true - iScaler->Scale( &iStatus, *iMask, TSize(aWidth,aHeight), EFalse ); - iState = EScalingMask; + iScaler->Scale( &iStatus, *iMask, TSize(aWidth,aHeight), EFalse ); SetActive(); } } @@ -607,33 +645,17 @@ TInt pos = aPath.FindF( KUid ); if( pos == 0 ) { - // Skip skin token + // Skip uid token pos += KUid().Length(); // Initialize lexer TLex lex( aPath.Mid( pos ) ); - + lex.SkipSpaceAndMark(); + // Check left parenthesis if ( lex.Get() == KLeftParenthesis ) { - lex.SkipSpaceAndMark(); - lex.SkipCharacters(); - - TPtrC mtoken = lex.MarkedToken(); - pos = mtoken.FindF( KHexPrefix ); - if ( pos == 0 ) - { - TLex lex( mtoken.Mid( KHexPrefix().Length() ) ); - TUint id = 0; - error = lex.Val( id, EHex ); - aUid = TUid::Uid( (TInt)id ); - } - else - { - TInt id( 0 ); - error = lex.Val( id ); - aUid.iUid = id; - } + error = ParseNextUint( lex, (TUint&)aUid.iUid ); } } @@ -657,37 +679,16 @@ // Initialize lexer TLex lex( aPath.Mid( pos ) ); + lex.SkipSpaceAndMark(); - lex.SkipSpaceAndMark(); // Check left parenthesis if ( lex.Get() == KLeftParenthesis ) { - pos++; - TLex lex( aPath.Mid( pos ) ); - lex.SkipSpaceAndMark(); - - TPtrC mtoken = lex.MarkedToken(); - pos = mtoken.FindF( KHexPrefix ); - if ( pos == 0 ) - { - TUint majorId( 0 ); - TUint minorId( 0 ); - lex.Assign( mtoken.Mid( KHexPrefix().Length() ) ); - error = lex.Val( majorId, EHex ); - lex.SkipSpace(); - lex.SkipAndMark( KHexPrefix().Length() ); - error |= lex.Val( minorId, EHex ); - aItemId.Set( majorId, minorId ); - } - else - { - TInt majorId(0); - TInt minorId(0); - error = lex.Val( majorId ); - lex.SkipSpace(); - error |= lex.Val( minorId ); - aItemId.Set( majorId, minorId ); - } + TUint majorId = 0; + TUint minorId = 0; + error = ParseNextUint( lex, majorId ); + error |= ParseNextUint( lex, minorId ); + aItemId.Set( majorId, minorId ); } } @@ -711,7 +712,8 @@ pos += KMif().Length(); // Initialize lexer TLex lex( aPath.Mid( pos ) ); - + lex.SkipSpaceAndMark(); + // Check left parenthesis if ( lex.Get() == KLeftParenthesis ) { @@ -721,22 +723,15 @@ aFileName.Copy(lex.MarkedToken()); if( aFileName.Length()!= 0) { - // Resolve bitmap id - lex.SkipSpace(); - error = lex.Val( aBitmapId ); - - // Resolve mask id - // dont return error if it is not found, that is ok - lex.SkipSpace(); - lex.Val( aMaskId ); - } - else - { - error = KErrNotFound; + TUint bitmap, mask; + error = ParseNextUint( lex, bitmap ); + ParseNextUint( lex, mask ); // mask is not mandatory + aBitmapId = bitmap; + aMaskId = mask; } } } - return (error == KErrNone ); + return ( error == KErrNone ); } // --------------------------------------------------------------------------- @@ -796,7 +791,7 @@ itemData->SetMask( NULL ); CleanupStack::PopAndDestroy( itemData ); } - else + else { // look in imagetable CAknsImageTableItemData* iconData = NULL; @@ -827,7 +822,8 @@ } iBitmap = bitmap; iMask = mask; - // notify observer + iState = EIdle; + // notify observer iObserver->NotifyCompletion( KErrNone ); return; } @@ -855,23 +851,51 @@ } else { + iState = EIdle; User::Leave( KErrArgument ); } iBitmap = bitmap; iMask = mask; - + TInt err = AknIconUtils::SetSize( iBitmap , iSize, EAspectRatioNotPreserved ); if ( KErrNone == err ) { err = AknIconUtils::SetSize( iMask , iSize, EAspectRatioNotPreserved ); } - + + iState = EIdle; // notify observer iObserver->NotifyCompletion( err ); } // --------------------------------------------------------------------------- +// CWmImageConverter::ParseNextUint() +// --------------------------------------------------------------------------- +// +TInt CWmImageConverter::ParseNextUint( TLex& aLex, TUint& aValue ) + { + TInt error = KErrNone; + aLex.SkipSpaceAndMark(); + aLex.SkipCharacters(); + + TPtrC mtoken = aLex.MarkedToken(); + TInt pos = mtoken.FindF( KHexPrefix ); + if ( pos == 0 ) + { + TLex innerLex( mtoken.Mid( KHexPrefix().Length() ) ); + error = innerLex.Val( aValue, EHex ); + } + else + { + TLex innerLex( mtoken ); + error = innerLex.Val( aValue, EDecimal ); + } + + return error; + } + +// --------------------------------------------------------------------------- // CWmImageConverter::SetLogoSize() // --------------------------------------------------------------------------- // @@ -896,7 +920,13 @@ void CWmImageConverter::RetrieveIconFileHandleL( RFile& aFile, const TIconFileType /*aType*/ ) { - User::LeaveIfError( aFile.Open( iFs, iFilename, EFileShareAny ) ); + TInt err = aFile.Open( iFs, iFilename, + EFileRead | EFileShareReadersOnly ); + if ( KErrNone != err ) + { + iState = EIdle; + User::Leave( err ); + } } // --------------------------------------------------------------------------- @@ -908,6 +938,15 @@ // finishes using the icon file. No actions needed here. } +// --------------------------------------------------------------------------- +// CWmImageConverter::IsProcessing +// --------------------------------------------------------------------------- +// +TBool CWmImageConverter::IsProcessing() + { + return ( ( ( iState != EIdle && iState != EFailed ) || + IsActive() ) ? ETrue : EFalse ); + } // End of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmlistbox.cpp --- a/idlehomescreen/widgetmanager/src/wmlistbox.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmlistbox.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -99,7 +99,7 @@ EMbmWidgetmanagerQgn_menu_hswidget, EMbmWidgetmanagerQgn_menu_hswidget_mask ); - + AknsUtils::CreateColorIconL( skin, KAknsIIDQgnIndiWmAdd, @@ -232,11 +232,11 @@ logoLayout.LayoutRect( itemRect, AknLayoutScalable_Apps::listrow_wgtman_pane_g1().LayoutLine() ); - if ( !bitmap ) + if ( !bitmap && !wData.IsPrepairingLogo() ) { logoLayout.DrawImage( gc, iDefaultLogoImage, iDefaultLogoImageMask ); } - else + else if( bitmap && mask ) { logoLayout.DrawImage( gc, bitmap, mask ); } @@ -255,14 +255,13 @@ TAknTextLineLayout titleTextLayout = AknLayoutScalable_Apps::listrow_wgtman_pane_t1().LayoutLine(); - TAknTextLineLayout descTextLayout = - AknLayoutScalable_Apps::listrow_wgtman_pane_t2().LayoutLine(); TAknLayoutText textLayout; textLayout.LayoutText( itemRect, titleTextLayout ); textLayout.DrawText( gc, wData.Name(), ETrue, textColor ); - if ( wData.HsContentInfo().CanBeAdded() ) + if ( !wData.IsUninstalling() && + wData.HsContentInfo().CanBeAdded() ) { // DRAW ADD BUTTON TAknLayoutRect addButtonLayout; @@ -280,11 +279,31 @@ } } - gc.SetPenSize(TSize(1,1)); - - // DRAW DESCRIPTION TEXT - textLayout.LayoutText( itemRect, descTextLayout ); - textLayout.DrawText( gc, wData.Description(), ETrue, textColor ); + if ( !wData.IsUninstalling() ) + { + TAknTextLineLayout descTextLayout = + AknLayoutScalable_Apps::listrow_wgtman_pane_t2().LayoutLine(); + gc.SetPenSize(TSize(1,1)); + // DRAW DESCRIPTION TEXT + textLayout.LayoutText( itemRect, descTextLayout ); + textLayout.DrawText( gc, wData.Description(), ETrue, textColor ); + } + else + { + // draw animation + TAknLayoutRect animationLayout; + animationLayout.LayoutRect( itemRect, + AknLayoutScalable_Apps::wait_bar_pane_cp09().LayoutLine() ); + TSize size = animationLayout.Rect().Size(); + CFbsBitmap* animBitmap = + const_cast(wData.AnimationBitmap( size )); + CFbsBitmap* animMask = + const_cast(wData.AnimationMask( size )); + if ( animBitmap && animMask ) + { + animationLayout.DrawImage( gc, animBitmap, animMask ); + } + } gc.DiscardFont(); } @@ -400,6 +419,7 @@ { iFindPaneIsVisible = EFalse; iPressedDown = EFalse; + iLogoSize = TSize( 0, 0); } // --------------------------------------------------------- @@ -409,6 +429,7 @@ CWmListBox::~CWmListBox() { iWidgetDatas.ResetAndDestroy(); + iTrashedData.ResetAndDestroy(); } // --------------------------------------------------------- @@ -456,13 +477,13 @@ // CWmListBox::AddWidgetDataL // --------------------------------------------------------- // -void CWmListBox::AddWidgetDataL( CWmWidgetData* aWidgetData ) +void CWmListBox::AddWidgetDataL( CWmWidgetData* aWidgetData, + TBool aRedraw ) { aWidgetData->SetObserver( this ); - aWidgetData->SetLogoSize( LogoSize() ); iWidgetDatas.InsertInOrderAllowRepeatsL( aWidgetData, SortOrder(EStoredOrder) ); - HandleItemAdditionL(); + if ( aRedraw ) { HandleItemAdditionL(); } } // --------------------------------------------------------- @@ -476,12 +497,24 @@ // remove widget data CWmWidgetData* data = iWidgetDatas[realIndex]; iWidgetDatas.Remove( realIndex ); - delete data; - // reorganise TRAP_IGNORE( AknListBoxUtils::HandleItemRemovalAndPositionHighlightL( this, realIndex, current ) ); + + // widgetlist changed notification comes too early before even + // uninstall is completed. in wk04_2010 there is going to be fix + // available for this issue. add data object to trashed array so + // that its not visible in list and is destroyed later. + if ( data->IsUninstalling() && data->IsActive() ) + { + iTrashedData.Append( data ); + } + else + { + // delete now + delete data; + } } // --------------------------------------------------------- @@ -519,6 +552,9 @@ cellData, this ); CleanupStack::Pop(); // cellData + + // enable extended drawing + EnableExtendedDrawingL(); } // --------------------------------------------------------- @@ -527,10 +563,11 @@ // void CWmListBox::HandleLayoutChanged() { - TSize ls = LogoSize(); + iLogoSize = TSize( 0, 0); + iLogoSize = LogoSize(); for ( TInt i=0; iReCreateLogo( ls ); + iWidgetDatas[i]->ReCreateLogo( iLogoSize ); } } @@ -561,7 +598,7 @@ if ( index >= 0 ) { // redraw item. - RedrawItem( RealIndex( index ) ); + RedrawItem( RealIndex( index ) ); } } else @@ -677,15 +714,22 @@ // TSize CWmListBox::LogoSize() { - TAknLayoutRect rowLayoutRect; - rowLayoutRect.LayoutRect( Rect(), - AknLayoutScalable_Apps::listrow_wgtman_pane().LayoutLine() ); - TAknLayoutRect logoLayoutRect; - logoLayoutRect.LayoutRect( rowLayoutRect.Rect(), - AknLayoutScalable_Apps::listrow_wgtman_pane_g1().LayoutLine() ); - return logoLayoutRect.Rect().Size(); + TSize size( iLogoSize ); + if ( size.iWidth == 0 || size.iHeight == 0 ) + { + TAknLayoutRect rowLayoutRect; + rowLayoutRect.LayoutRect( Rect(), + AknLayoutScalable_Apps::listrow_wgtman_pane().LayoutLine() ); + TAknLayoutRect logoLayoutRect; + logoLayoutRect.LayoutRect( rowLayoutRect.Rect(), + AknLayoutScalable_Apps::listrow_wgtman_pane_g1().LayoutLine() ); + size = logoLayoutRect.Rect().Size(); + iLogoSize = size; + } + return size; } + // --------------------------------------------------------- // CWmListBox::DefaultLogo // --------------------------------------------------------- diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmmaincontainer.cpp --- a/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -49,16 +48,11 @@ #include #include #include -#include //installer -#include // widgetreqistry -#include // for starting the OVI client #include // FeatureManager #include // HlpLauncher #include #include -#include -#include "wmcrkeys.h" #include "wmcommon.h" #include "wmplugin.h" #include "wmmaincontainer.h" @@ -70,12 +64,11 @@ #include "wmdetailsdlg.h" #include "wmportalbutton.h" #include "wmwidgetloaderao.h" +#include "wmconfiguration.h" // CONSTANTS const TInt KTextLimit = 40; // Text-limit for find-field const TInt KMinWidgets = 1; // minimum number of widgets to show findpane -_LIT8( KWrtMime, "application/x-nokia-widget"); -_LIT( KBrowserPrefix, "4 "); // --------------------------------------------------------- // CWmMainContainer::CWmMainContainer() @@ -98,17 +91,15 @@ // CWmMainContainer::~CWmMainContainer() { - delete iOviStoreUrl; - delete iOviStoreClientBundleId; - delete iOviStoreClientParam; - RemoveCtrlsFromStack(); Components().ResetAndDestroy(); delete iWidgetLoader; iWidgetsList = NULL; - iOviPortal = NULL; + iPortalButtonOne = NULL; + iPortalButtonTwo = NULL; iFindbox = NULL; delete iBgContext; + delete iConfiguration; } // --------------------------------------------------------- @@ -176,9 +167,9 @@ iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgScreen, ScreenRect() , ETrue); - // Read needed values from cenrep - TRAP_IGNORE( FetchRepositoryDataL(); ); - + // load configuration + iConfiguration = CWmConfiguration::NewL( iWmPlugin.ResourceLoader() ); + // set up controls InitializeControlsL( aRect ); @@ -189,68 +180,6 @@ } // --------------------------------------------------------- -// CWmMainContainer::FetchRepositoryDataL -// --------------------------------------------------------- -// -void CWmMainContainer::FetchRepositoryDataL() - { - iOviStoreUrl = NULL; - iOviStoreClientBundleId = NULL; - iOviStoreClientParam = NULL; - - CRepository *repository = CRepository::NewLC( - TUid::Uid( KCrWidgetManagerm ) ); - TInt err = KErrNone; - - //read localized data from cenrep - TLanguage sysLang = User::Language(); - for( TUint32 i = KLangId0; i <= KLangId9; i+=4 ) - { - TInt crLang = 0; - err = repository->Get( i, crLang ); - - if ( sysLang == crLang && err == KErrNone ) - { - // system langauge matches langauge in cenrep - iOviStoreUrl = HBufC::NewL( - NCentralRepositoryConstants::KMaxUnicodeStringLength ); - TPtr ptr( iOviStoreUrl->Des() ); - - // get localized ovi store url - err = repository->Get( i + KOviStoreBrowserUrlOffset, ptr ); - if ( err != KErrNone ) - { - delete iOviStoreUrl; - iOviStoreUrl = NULL; - } - } - } - - //read other data from cenrep - iOviStoreClientBundleId = HBufC::NewL( - NCentralRepositoryConstants::KMaxUnicodeStringLength ); - TPtr ptr( iOviStoreClientBundleId->Des() ); - err = repository->Get( KOviStoreBunbleId, ptr ); - if ( err != KErrNone ) - { - delete iOviStoreClientBundleId; - iOviStoreClientBundleId = NULL; - } - - iOviStoreClientParam = HBufC::NewL( - NCentralRepositoryConstants::KMaxUnicodeStringLength ); - ptr.Set( iOviStoreClientParam->Des() ); - err = repository->Get( KOviStoreClientParam, ptr ); - if ( err != KErrNone ) - { - delete iOviStoreClientParam; - iOviStoreClientParam = NULL; - } - - CleanupStack::PopAndDestroy( repository ); - } - -// --------------------------------------------------------- // CWmMainContainer::SizeChanged // --------------------------------------------------------- // @@ -293,8 +222,9 @@ iLayout = EPortrait; } - // layout Ovi button - AknLayoutUtils::LayoutControl( iOviPortal, rect, btnPane ); + // portal button layout + // todo: 2-button layout + AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, btnPane ); if( iFindbox && iFindPaneIsVisible ) { @@ -316,80 +246,117 @@ // --------------------------------------------------------- // TKeyResponse CWmMainContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse keyResponse( EKeyWasNotConsumed ); + + // This is a bug fix for ou1cimx1#217716 & ou1cimx1#217667. + // For some weird reason homescreen is genarating one extra EEventKey + // when using Nokia SU-8W bluetooth keyboard & backspace key. This if is to + // ignore that event. Extra event allways has iModifiers set to + // EModifierAutorepeatable. + if ( aType == EEventKey && + aKeyEvent.iScanCode == EStdKeyBackspace && + aKeyEvent.iModifiers == EModifierAutorepeatable ) + { + return EKeyWasNotConsumed; + } + + // Handle search keyevent + keyResponse = HandleSearchKeyEventL( aKeyEvent, aType ); + + // Move focus between controls + if ( keyResponse == EKeyWasNotConsumed ) + { + keyResponse = MoveFocusByKeys( aKeyEvent, aType ); + } + + // Handle list keyevent + if ( keyResponse == EKeyWasNotConsumed ) + { + keyResponse = HandleListKeyEventL( aKeyEvent, aType ); + } + + // Handle buttons keyevent + if ( keyResponse == EKeyWasNotConsumed ) + { + keyResponse = HandleButtonKeyEventL( aKeyEvent, aType ); + } + + // Update ui if needed + if ( keyResponse == EKeyWasConsumed ) + { + DrawDeferred(); + } + + // Do not let UI framework forward the keys to child controls as + // we have already done that. + return EKeyWasConsumed; + } + +TKeyResponse CWmMainContainer::HandleSearchKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { TKeyResponse keyResponse( EKeyWasNotConsumed ); - if ( iFindbox ) + // open search field with alpha digit numbers + if ( aType == EEventKeyDown && !iFindPaneIsVisible && + aKeyEvent.iScanCode < EStdKeyF1 && + TChar( aKeyEvent.iScanCode ).IsAlphaDigit() ) { - // open search field with alpha digit numbers - if ( aType == EEventKeyDown && !iFindPaneIsVisible && - aKeyEvent.iScanCode < EStdKeyF1 && - TChar(aKeyEvent.iScanCode).IsAlphaDigit() ) - { - ActivateFindPaneL(); - - if ( iFindPaneIsVisible ) - { - return EKeyWasConsumed; - } - } + ActivateFindPaneL(); if ( iFindPaneIsVisible ) { - // deactive the FindPane when Back has been pressed - if ( aType == EEventKeyDown && - aKeyEvent.iScanCode == EStdKeyBackspace ) - { - TBuf searchText; - iFindbox->GetSearchText( searchText ); - if ( searchText == KNullDesC ) - { - DeactivateFindPaneL(); - return EKeyWasConsumed; - } - } - - // Cancel-selected need to unfocus findbox - // to receive event in ProcessCommand - if ( aType == EEventKeyDown - && aKeyEvent.iScanCode == EStdKeyDevice1 ) - { - iFindbox->SetFocus( EFalse ); - UpdateFocusMode(); - return EKeyWasConsumed; - } - - if ( aKeyEvent.iScanCode == EStdKeyNo || - aKeyEvent.iCode == EKeyNo ) - { - DeactivateFindPaneL(); - return EKeyWasConsumed; - } - - // find items with all event codes (that's the reason why there is EEventKey instead of aType) - TBool needsRefresh( EFalse ); + return EKeyWasConsumed; + } + } + + if ( iFindPaneIsVisible && aType == EEventKey ) + { + if ( aKeyEvent.iScanCode == EStdKeyNo || aKeyEvent.iCode == EKeyNo ) + { + DeactivateFindPaneL(); + return EKeyWasConsumed; + } + + TBool needsRefresh( EFalse ); + + if ( iFindbox->TextLength() == 0 + && aKeyEvent.iScanCode == EStdKeyBackspace ) + { + // if lenght is 0 and backspace is pressed AknFind will deactivate + // searchbox so we don't want to pass this event to AknFind + keyResponse = EKeyWasConsumed; + } + else + { keyResponse = AknFind::HandleFindOfferKeyEventL( - aKeyEvent, EEventKey, this, - iWidgetsList, iFindbox, ETrue, needsRefresh ); - if ( needsRefresh ) - { - DrawNow(); - } + aKeyEvent, aType, this, + iWidgetsList, iFindbox, ETrue, needsRefresh ); + } + if ( needsRefresh ) + { + DrawNow(); } } - // check special cases for movement between controls - if ( keyResponse == EKeyWasNotConsumed && !iFindPaneIsVisible ) - { - keyResponse = MoveFocusByKeys( aKeyEvent, aType ); - } + return keyResponse; + } +TKeyResponse CWmMainContainer::HandleListKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse keyResponse( EKeyWasNotConsumed ); + // pass key event except backpace or delete key event to widgets list if focused - if ( keyResponse == EKeyWasNotConsumed && iWidgetsList->IsFocused() ) + if ( iWidgetsList->IsFocused() ) { - if ( (aType == EEventKey) && (aKeyEvent.iCode == EKeyBackspace || aKeyEvent.iCode == EKeyDelete)) + if ( ( aType == EEventKey ) && ( aKeyEvent.iCode == EKeyBackspace + || aKeyEvent.iCode == EKeyDelete ) ) { if( CanDoUninstall() ) { @@ -402,30 +369,41 @@ iWmPlugin.ResourceLoader().InfoPopupL( R_QTN_WM_UNINST_NOT_ALLOWED, data->Name() ); } + keyResponse = EKeyWasConsumed; } else { - //passing to listbox handler + //passing to listbox handler keyResponse = iWidgetsList->OfferKeyEventL( aKeyEvent, aType ); } } + + return keyResponse; + } - // pass key event to OVI portal if focused - if ( keyResponse == EKeyWasNotConsumed && iOviPortal->IsFocused() ) +TKeyResponse CWmMainContainer::HandleButtonKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse keyResponse( EKeyWasNotConsumed ); + + // pass key event to portal button if focused + if ( iPortalButtonOne->IsFocused() ) { - keyResponse = iOviPortal->OfferKeyEventL( + keyResponse = iPortalButtonOne->OfferKeyEventL( aKeyEvent, aType ); } - if ( keyResponse == EKeyWasConsumed ) - DrawDeferred(); - - // Do not let UI framework forward the keys to child controls as - // we have already done that. - return EKeyWasConsumed; - } - + // pass key event to the other portal button if exists and focused + if ( iPortalButtonTwo && iPortalButtonTwo->IsFocused() ) + { + keyResponse = iPortalButtonTwo->OfferKeyEventL( + aKeyEvent, aType ); + } + + return keyResponse; + } // --------------------------------------------------------- // CWmMainContainer::MoveFocusByKeys @@ -448,7 +426,7 @@ { // widget list top -> up -> ovi button (portrait) if ( aType == EEventKey ) - SetFocusToOviButton(); + SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; } else if ( iLayout == EPortrait && @@ -458,7 +436,7 @@ { // widget list bottom -> down -> ovi button (portrait) if ( aType == EEventKey ) - SetFocusToOviButton(); + SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; } else if ( iLayout == ELandscape && @@ -466,7 +444,7 @@ { // widget list -> right -> ovi button (landscape) if ( aType == EEventKey ) - SetFocusToOviButton(); + SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; } else if ( iLayout == ELandscapeMirrored && @@ -474,19 +452,19 @@ { // widget list -> left -> ovi button (landscape mirrored) if ( aType == EEventKey ) - SetFocusToOviButton(); + SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; } } - else if ( iOviPortal->IsFocused() ) + else if ( iPortalButtonOne->IsFocused() ) { // ------------------------------------ - // focus is in the OVI PORTAL BUTTON + // focus is in the FIRST PORTAL BUTTON // ------------------------------------ if ( iLayout == EPortrait && aKeyEvent.iScanCode == EStdKeyDownArrow ) { - // ovi button -> down -> widget list top (portrait) + // left portal -> down -> widget list top if ( aType == EEventKey ) SetFocusToWidgetList( 0 ); keyResponse = EKeyWasConsumed; @@ -494,15 +472,24 @@ else if ( iLayout == EPortrait && aKeyEvent.iScanCode == EStdKeyUpArrow ) { - // obi button -> up -> widget list bottom (portrait) + // left portal -> up -> widget list bottom if ( aType == EEventKey ) SetFocusToWidgetList( iWidgetsList->Model()->NumberOfItems()-1 ); keyResponse = EKeyWasConsumed; } + else if ( iLayout == EPortrait && + aKeyEvent.iScanCode == EStdKeyRightArrow && + iConfiguration->PortalButtonCount() > 1 ) + { + // left portal -> right -> right portal + if ( aType == EEventKey ) + SetFocusToPortalButton( 1 ); + keyResponse = EKeyWasConsumed; + } else if ( iLayout == ELandscape && aKeyEvent.iScanCode == EStdKeyLeftArrow ) { - // ovi button -> left -> widget list (landscape) + // upper portal -> left -> widget list if ( aType == EEventKey ) SetFocusToWidgetList(); keyResponse = EKeyWasConsumed; @@ -510,11 +497,77 @@ else if ( iLayout == ELandscapeMirrored && aKeyEvent.iScanCode == EStdKeyRightArrow ) { - // ovi button -> right -> widget list (landscape mirrored) + // upper portal -> right -> widget list (mirrored) if ( aType == EEventKey ) SetFocusToWidgetList(); keyResponse = EKeyWasConsumed; } + else if ( ( iLayout == ELandscape || + iLayout == ELandscapeMirrored ) && + aKeyEvent.iScanCode == EStdKeyDownArrow && + iConfiguration->PortalButtonCount() > 1 ) + { + // upper portal -> down -> lower portal + if ( aType == EEventKey ) + SetFocusToPortalButton( 1 ); + keyResponse = EKeyWasConsumed; + } + } + else if ( iPortalButtonTwo && iPortalButtonTwo->IsFocused() ) + { + // ------------------------------------ + // focus is in the SECOND PORTAL BUTTON + // ------------------------------------ + if ( iLayout == EPortrait && + aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + // right portal -> down -> widget list top + if ( aType == EEventKey ) + SetFocusToWidgetList( 0 ); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == EPortrait && + aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + // right portal -> up -> widget list bottom + if ( aType == EEventKey ) + SetFocusToWidgetList( iWidgetsList->Model()->NumberOfItems()-1 ); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == EPortrait && + aKeyEvent.iScanCode == EStdKeyRightArrow && + iConfiguration->PortalButtonCount() > 1 ) + { + // right portal -> right -> left portal + if ( aType == EEventKey ) + SetFocusToPortalButton( 0 ); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == ELandscape && + aKeyEvent.iScanCode == EStdKeyLeftArrow ) + { + // lower portal -> left -> widget list + if ( aType == EEventKey ) + SetFocusToWidgetList(); + keyResponse = EKeyWasConsumed; + } + else if ( iLayout == ELandscapeMirrored && + aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + // lower portal -> right -> widget list (mirrored) + if ( aType == EEventKey ) + SetFocusToWidgetList(); + keyResponse = EKeyWasConsumed; + } + else if ( ( iLayout == ELandscape || + iLayout == ELandscapeMirrored ) && + aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + // lower portal -> up -> upper portal + if ( aType == EEventKey ) + SetFocusToPortalButton( 0 ); + keyResponse = EKeyWasConsumed; + } } else { @@ -537,13 +590,24 @@ } // --------------------------------------------------------- -// CWmMainContainer::SetFocusToOviButton +// CWmMainContainer::SetFocusToPortalButton // --------------------------------------------------------- // -void CWmMainContainer::SetFocusToOviButton() +void CWmMainContainer::SetFocusToPortalButton( TInt aIndex ) { - iWidgetsList->SetFocus(EFalse); - iOviPortal->SetFocus(ETrue); + if ( aIndex != 0 && iPortalButtonTwo ) + { + iWidgetsList->SetFocus(EFalse); + iPortalButtonOne->SetFocus(EFalse); + iPortalButtonTwo->SetFocus(ETrue); + } + else + { + iWidgetsList->SetFocus(EFalse); + if ( iPortalButtonTwo ) + iPortalButtonTwo->SetFocus(EFalse); + iPortalButtonOne->SetFocus(ETrue); + } DrawDeferred(); UpdateFocusMode(); } @@ -554,12 +618,14 @@ // void CWmMainContainer::SetFocusToWidgetList( TInt aIndex ) { - iOviPortal->SetFocus(EFalse); - iWidgetsList->SetFocus(ETrue); + iPortalButtonOne->SetFocus(EFalse); + if ( iPortalButtonTwo ) + iPortalButtonTwo->SetFocus(EFalse); if ( aIndex >= 0 && aIndex < iWidgetsList->Model()->NumberOfItems() ) { iWidgetsList->SetCurrentItemIndex( aIndex ); } + iWidgetsList->SetFocus(ETrue); DrawDeferred(); UpdateFocusMode(); } @@ -570,10 +636,15 @@ // void CWmMainContainer::UpdateFocusMode() { - if ( iOviPortal->IsFocused() ) + if ( iPortalButtonOne->IsFocused() ) { - // OVI BUTTON is focused - iFocusMode = EOvi; + // PORTAL BUTTON is focused + iFocusMode = EPortal; + } + else if ( iPortalButtonTwo && iPortalButtonTwo->IsFocused() ) + { + // SECOND PORTAL BUTTON is focused + iFocusMode = EPortal; } else if( ( iFindPaneIsVisible ) && ( iFindbox->IsFocused() || iWidgetsList->IsFocused() ) ) @@ -669,13 +740,16 @@ // void CWmMainContainer::InitializeControlsL( const TRect& /*aRect*/ ) { - // Create OVI STORE button - HBufC* oviText = StringLoader::LoadLC( R_QTN_WM_GO_TO_OVI_STORE ); - iOviPortal = CWmPortalButton::NewL( this, *oviText ); - CleanupStack::PopAndDestroy( oviText ); - - iOviPortal->SetMopParent( this ); - AddControlL( iOviPortal, EOviPortal ); + // Create portal buttons + iPortalButtonOne = CWmPortalButton::NewL( this, 0 ); + iPortalButtonOne->SetMopParent( this ); + AddControlL( iPortalButtonOne, EPortalOne ); + if ( iConfiguration->PortalButtonCount() > 1 ) + { + iPortalButtonTwo = CWmPortalButton::NewL( this, 1 ); + iPortalButtonTwo->SetMopParent( this ); + AddControlL( iPortalButtonTwo, EPortalTwo ); + } // Create widget list box iWidgetsList = CWmListBox::NewL( @@ -807,7 +881,7 @@ // TBool CWmMainContainer::PortalSelected() { - return ( iFocusMode == EOvi ); + return ( iFocusMode == EPortal ); } // --------------------------------------------------------- @@ -864,7 +938,7 @@ if ( WidgetSelected() ) { CWmWidgetData* data = iWidgetsList->WidgetData(); - if ( data->WidgetType() == CWmWidgetData::ECps && + if ( data && data->WidgetType() == CWmWidgetData::ECps && data->PublisherUid() != KNullUid ) { retVal = ETrue; @@ -930,12 +1004,36 @@ // set add to homescreen to be executed later iWmPlugin.SetPostponedCommandL( - CWmPlugin::EAddToHomescreen, data->HsContentInfo() ); + CWmPlugin::EAddToHomescreen, + data->HsContentInfo() ); - iWmPlugin.Deactivate(); + // check if we can add any widgets to hs. + TBool hsContentFull = ETrue; + for ( TInt i=0; iWidgetDataCount(); i++ ) + { + CHsContentInfo& info = iWidgetsList->WidgetData(i).HsContentInfo(); + if ( info.CanBeAdded() ) + { + hsContentFull = EFalse; + break; + } + } + + // do not deactivate wm if wrt widget already exists on hs, + // instead of that show popup info note. + if ( CWmWidgetData::ECps == data->WidgetType() && + !data->HsContentInfo().CanBeAdded() && + !hsContentFull ) + { + iWmPlugin.ExecuteCommandL(); + } + else + { + iWmPlugin.Deactivate(); + } } } - + // --------------------------------------------------------------------------- // CWmMainContainer::LaunchWidgetL // --------------------------------------------------------------------------- @@ -1076,90 +1174,25 @@ { if ( CanDoUninstall() ) { - CWmWidgetData* data = iWidgetsList->WidgetData(); - - SwiUI::RSWInstLauncher installer; - User::LeaveIfError( installer.Connect() ); - - installer.Uninstall( data->PublisherUid(), KWrtMime ); - installer.Close(); + iWidgetsList->WidgetData()->UnInstallL(); } } // --------------------------------------------------------------------------- -// CWmMainContainer::OpenOviPortalL +// CWmMainContainer::OpenPortalL // --------------------------------------------------------------------------- // -void CWmMainContainer::OpenOviPortalL() +void CWmMainContainer::OpenPortalL() { if ( !iClosingDown ) { - RApaLsSession session; - User::LeaveIfError( session.Connect() ); - CleanupClosePushL( session ); - TApaAppInfo appInfo; - TUid launchUid; - - // Get ovi store uid - RWidgetRegistryClientSession widgetSession; - User::LeaveIfError( widgetSession.Connect() ); - CleanupClosePushL( widgetSession ); - - launchUid.iUid = widgetSession.GetWidgetUidL( *iOviStoreClientBundleId ); - CleanupStack::PopAndDestroy( &widgetSession ); - - TInt err = session.GetAppInfo( appInfo, launchUid ); - if ( err == KErrNone ) - { - CApaCommandLine* commandLine = CApaCommandLine::NewLC(); - commandLine->SetExecutableNameL(appInfo.iFullName); - HBufC8* buf8 = HBufC8::NewLC( iOviStoreClientParam->Des().Length() ); - buf8->Des().Copy( *iOviStoreClientParam ); - - //cmdLine->SetOpaqueDataL( *buf8 ); - commandLine->SetTailEndL( *buf8 ); - err = session.StartApp( *commandLine ); - CleanupStack::PopAndDestroy( buf8 ); - CleanupStack::PopAndDestroy( commandLine ); - } - else - { - if( iOviStoreUrl ) - { - // Ovi store not found start browser - const TUid KOSSBrowserUidValue = { 0x10008D39 }; - HBufC* param = HBufC::NewLC( iOviStoreUrl->Length() + - KBrowserPrefix().Length() ); - - param->Des().Copy( KBrowserPrefix ); - param->Des().Append( *iOviStoreUrl ); - - TUid id( KOSSBrowserUidValue ); - - TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); - TApaTask task = taskList.FindApp(id); - if( task.Exists() ) - { - task.BringToForeground(); - HBufC8* param8 = HBufC8::NewLC(param->Length()); - param8->Des().Append(*param); - task.SendMessage(TUid::Uid(0), *param8); // UID not used - CleanupStack::PopAndDestroy(param8); - } - else - { - if( !session.Handle() ) - { - User::LeaveIfError( session.Connect() ); - } - TThreadId thread; - User::LeaveIfError(session.StartDocument(*param, KOSSBrowserUidValue, thread)); - - } - CleanupStack::PopAndDestroy( param ); - } - } - CleanupStack::PopAndDestroy( &session ); + // execute whichever of the portal buttons happens to be active + if ( iPortalButtonOne->IsFocused() ) + iPortalButtonOne->ExecuteL(); + else if ( iPortalButtonTwo && iPortalButtonTwo->IsFocused() ) + iPortalButtonTwo->ExecuteL(); + else if ( !iPortalButtonTwo ) + iPortalButtonOne->ExecuteL(); } } @@ -1172,7 +1205,7 @@ if ( WidgetSelected() ) AddWidgetToHomeScreenL(); else if ( PortalSelected() ) - OpenOviPortalL(); + OpenPortalL(); else SetFocusToWidgetList(); } @@ -1245,10 +1278,8 @@ const CFbsBitmap* mask = ( data->LogoImageMask() ) ? data->LogoImageMask() : iWidgetsList->DefaultMask(); - TPtrC description = ( data->Description().Length() > 0 ) ? - data->Description() : iWmPlugin.ResourceLoader().NoDescriptionText(); CWmDetailsDlg* dlg = CWmDetailsDlg::NewL( - data->Name(), description, + data->Name(), data->Description(), data->HsContentInfo().CanBeAdded(), logo, mask, iBgContext ); @@ -1278,6 +1309,15 @@ } // ---------------------------------------------------- +// CWmMainContainer::Configuration +// ---------------------------------------------------- +// +CWmConfiguration& CWmMainContainer::Configuration() + { + return *iConfiguration; + } + +// ---------------------------------------------------- // CWmMainContainer::HandleFindSizeChanged // ---------------------------------------------------- // diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp --- a/idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -306,7 +306,7 @@ { if ( iWmMainContainer && iWmMainContainer->PortalSelected() ) { - iWmMainContainer->OpenOviPortalL(); + iWmMainContainer->OpenPortalL(); } return ETrue; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmplugin.cpp --- a/idlehomescreen/widgetmanager/src/wmplugin.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmplugin.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include "wmcommon.h" #include "widgetmanager.hrh" @@ -49,15 +51,35 @@ // CWmPlugin::~CWmPlugin() { + iPostponedCommand = ENone; if ( iViewAppUi ) { - Deactivate(); - iViewAppUi->RemoveView( TUid::Uid( EWmMainContainerViewId ) ); - } - iWmMainContainer = NULL; + if ( iWmMainContainer && IsActive() ) + { + iWmMainContainer->SetClosingDown( ETrue ); + TRAPD( err, iViewAppUi->ActivateLocalViewL( + iPreviousViewUid.iViewUid ); ); + if ( KErrNone == err ) + { + iWait->Start(); + // remove view from appui + iViewAppUi->RemoveView( + TUid::Uid( EWmMainContainerViewId ) ); + } + else + { + TRAP_IGNORE( iViewAppUi->DeactivateActiveViewL(); ); + iViewAppUi->RemoveFromViewStack( + *iWmMainView, iWmMainContainer ); + delete iWmMainContainer; + iWmMainContainer = NULL; + } + } + } delete iResourceLoader; delete iEffectManager; delete iPostponedContent; + delete iWait; } // --------------------------------------------------------- @@ -76,6 +98,7 @@ void CWmPlugin::ConstructL() { iWmMainContainer = NULL; + iWmMainView = NULL; // store static view app ui CEikonEnv* eikonEnv = CEikonEnv::Static(); @@ -88,12 +111,16 @@ iResourceLoader = CWmResourceLoader::NewL( *eikonEnv ); iEffectManager = CWmEffectManager::NewL( *eikonEnv ); + // wait object + iWait = new (ELeave) CActiveSchedulerWait(); + // main view CWmMainContainerView* mainView = CWmMainContainerView::NewL( *this ); CleanupStack::PushL( mainView ); iViewAppUi->AddViewL( mainView ); CleanupStack::Pop( mainView ); + iWmMainView = mainView; } // --------------------------------------------------------- @@ -152,6 +179,9 @@ iWmMainContainer = aWmMainContainer; iEffectManager->UiRendered(); iWmMainContainer->SetClosingDown( EFalse ); + + // Don't forward numeric keys to phone + ForwardNumericKeysToPhone( EFalse ); } // --------------------------------------------------------- @@ -160,11 +190,35 @@ // void CWmPlugin::MainViewDeactivated() { + // Forward numeric keys to phone + ForwardNumericKeysToPhone( ETrue ); + iPreviousViewUid.iViewUid = KNullUid; iWmMainContainer = NULL; - iEffectManager->UiRendered(); + if ( iEffectManager && !iWait->IsStarted() ) + { + iEffectManager->UiRendered(); + } + + TRAP_IGNORE( ExecuteCommandL(); ); + + if ( iWait->IsStarted() ) { iWait->AsyncStop(); } + } - TRAP_IGNORE( ExecutePostponedCommandL(); ); +// --------------------------------------------------------- +// CWmPlugin::ForwardNumericKeysToPhone +// --------------------------------------------------------- +// +void CWmPlugin::ForwardNumericKeysToPhone( TBool aEnabled ) + { + TInt value = aEnabled ? + EPSAiForwardNumericKeysToPhone : + EPSAiDontForwardNumericKeysToPhone; + + RProperty::Set( + KPSUidAiInformation, + KActiveIdleForwardNumericKeysToPhone, + value ); } // --------------------------------------------------------- @@ -181,10 +235,10 @@ } // --------------------------------------------------------- -// CWmPlugin::ExecutePostponedCommandL +// CWmPlugin::ExecuteCommandL // --------------------------------------------------------- // -void CWmPlugin::ExecutePostponedCommandL() +void CWmPlugin::ExecuteCommandL() { if ( iPostponedCommand == EAddToHomescreen ) { @@ -257,7 +311,7 @@ // void CWmPlugin::NotifyWidgetListChanged() { - if ( iWmMainContainer ) + if ( iWmMainContainer && !iWmMainContainer->ClosingDown() ) { iWmMainContainer->HandleWidgetListChanged(); } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmportalbutton.cpp --- a/idlehomescreen/widgetmanager/src/wmportalbutton.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmportalbutton.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -27,12 +27,20 @@ #include #include #include +#include +#include +#include // widgetreqistry + #include "wmportalbutton.h" #include "wmcommon.h" #include "wmplugin.h" #include "wmresourceloader.h" #include "wmmaincontainer.h" +#include "wmconfiguration.h" + +// CONSTANTS +_LIT( KBrowserPrefix, "4 "); // MEMBER FUNCTIONS @@ -42,14 +50,21 @@ // CWmPortalButton* CWmPortalButton::NewL( const CCoeControl* aParent, - const TDesC& aText, - const TDesC& aUrl, - TWmUiControlIds aButtonCtrlId ) + TInt aPortalButtonIndex ) { CWmPortalButton* self = new (ELeave) CWmPortalButton( - KAknButtonTextInsideFrame, aButtonCtrlId ); - CleanupStack::PushL( self ); - self->ConstructL( aParent,aText, aUrl ); + KAknButtonTextInsideFrame, aPortalButtonIndex ); + + CleanupStack::PushL( self ); + + CWmMainContainer* mainContainer = + static_cast ( + const_cast ( aParent ) ); + + self->ConstructL( mainContainer, + mainContainer->Configuration().PortalButtonText( aPortalButtonIndex ), + mainContainer->Configuration().PortalButtonIcon( aPortalButtonIndex ) ); + CleanupStack::Pop( self ); return self; } @@ -59,9 +74,13 @@ // --------------------------------------------------------- // CWmPortalButton::~CWmPortalButton() - { - delete iText; - delete iUrl; + { + delete iButtonIcon; + delete iButtonIconMask; + + // if MAknIconFileProvider was used to create image from icon string + // then it'll try accessing imageconverter after bitmap deletion + // for de-reference open file count, so it should be deleted last. delete iImageConverter; } @@ -71,10 +90,12 @@ // CWmPortalButton::CWmPortalButton( const TInt aFlags, - TWmUiControlIds aButtonCtrlId ) + TInt aPortalButtonIndex ) :CAknButton( aFlags ), - iButtonCtrlId( aButtonCtrlId ) + iPortalButtonIndex( aPortalButtonIndex ) { + iButtonIcon = NULL; + iButtonIconMask = NULL; } // --------------------------------------------------------- @@ -82,14 +103,15 @@ // --------------------------------------------------------- // void CWmPortalButton::ConstructL( - const CCoeControl* aParent, - const TDesC& aText, const TDesC& aUrl ) + CWmMainContainer* aParent, + const TDesC& aText, + const TDesC& aIcon ) { if ( !aParent ) { User::Leave( KErrArgument ); } - else if ( iButtonCtrlId != EOviPortal ) + else if ( iPortalButtonIndex != 0 ) { // operator button not supported until layout available. User::Leave( KErrNotSupported ); @@ -98,32 +120,15 @@ SetContainerWindowL( *aParent ); // Obtain pointer to main container. - iWmMainContainer = - static_cast ( - const_cast ( aParent ) ); - - CGulIcon* icon = AknsUtils::CreateGulIconL( - AknsUtils::SkinInstance(), KAknsIIDQgnMenuOviStore, - iWmMainContainer->WmPlugin().ResourceLoader().IconFilePath(), - EMbmWidgetmanagerQgn_menu_ovistore, - EMbmWidgetmanagerQgn_menu_ovistore_mask ); + iWmMainContainer = aParent; - CleanupStack::PushL( icon ); - CAknButton::ConstructL( icon, NULL, NULL, NULL, - aText, KNullDesC, 0 ); - CleanupStack::Pop( icon ); // ownership taken - - TAknsItemID frameId = ((iButtonCtrlId == EOviPortal) ? - KAknsIIDQgnHomeWmButton : KAknsIIDQsnFrButtonNormal); - TAknsItemID frameCenterId = ((iButtonCtrlId == EOviPortal) ? - KAknsIIDQgnHomeWmButtonCenter : KAknsIIDQsnFrButtonCenterNormal ); - TAknsItemID framePressedId = ((iButtonCtrlId == EOviPortal) ? - KAknsIIDQgnHomeWmButtonPressed : KAknsIIDQsnFrButtonPressed ); - TAknsItemID framePressedCenterId = ((iButtonCtrlId == EOviPortal) ? - KAknsIIDQgnHomeWmButtonPressedCenter : KAknsIIDQsnFrButtonCenterPressed ); + // construct the button + CAknButton::ConstructL( NULL, NULL, NULL, NULL, aText, KNullDesC, 0 ); - iText = aText.AllocL(); - iUrl = aUrl.AllocL(); + TAknsItemID frameId = KAknsIIDQgnHomeWmButton; + TAknsItemID frameCenterId = KAknsIIDQgnHomeWmButtonCenter; + TAknsItemID framePressedId = KAknsIIDQgnHomeWmButtonPressed; + TAknsItemID framePressedCenterId = KAknsIIDQgnHomeWmButtonPressedCenter; SetFocusing( ETrue ); SetBackgroundIds( frameId, @@ -143,67 +148,176 @@ KAknsIIDDefault, KAknsIIDDefault ); + // start image converter for the icon + iImageConverter = CWmImageConverter::NewL( this ); + TSize iconsize( LayoutIconSize() ); + iImageConverter->HandleIconString( + iconsize.iWidth, iconsize.iHeight, aIcon ); + // observe our own press events + SetObserver( this ); + // ready to be drawn ActivateL(); } +// --------------------------------------------------------------------------- +// Runs HTTP method: (starts browser or brongs browser to foreground) +// --------------------------------------------------------------------------- +// +void TryRunHttpL( const TDesC& aParam ) + { + RApaLsSession session; + User::LeaveIfError( session.Connect() ); + CleanupClosePushL( session ); + + // browser start parameters + const TUid KOSSBrowserUidValue = { 0x10008D39 }; + HBufC* param = HBufC::NewLC( aParam.Length() + + KBrowserPrefix().Length() ); + + param->Des().Copy( KBrowserPrefix ); + param->Des().Append( aParam ); + + TUid id( KOSSBrowserUidValue ); + + TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); + TApaTask task = taskList.FindApp( id ); + if( task.Exists() ) + { + task.BringToForeground(); + HBufC8* param8 = HBufC8::NewLC(param->Length()); + param8->Des().Append(*param); + task.SendMessage(TUid::Uid(0), *param8); // UID not used + CleanupStack::PopAndDestroy(param8); + } + else + { + if( !session.Handle() ) + { + User::LeaveIfError( session.Connect() ); + } + TThreadId thread; + User::LeaveIfError(session.StartDocument(*param, KOSSBrowserUidValue, thread)); + } + + CleanupStack::PopAndDestroy( param ); + CleanupStack::PopAndDestroy( &session ); + } + +// --------------------------------------------------------------------------- +// Runs WIDGET method: (launches given widget with parameters) +// --------------------------------------------------------------------------- +// +void TryRunWidgetL( const TDesC& aParam, const TDesC& aBundleId ) + { + RApaLsSession session; + User::LeaveIfError( session.Connect() ); + CleanupClosePushL( session ); + TApaAppInfo appInfo; + TUid launchUid; + + // Get widget uid + RWidgetRegistryClientSession widgetSession; + User::LeaveIfError( widgetSession.Connect() ); + CleanupClosePushL( widgetSession ); + launchUid.iUid = widgetSession.GetWidgetUidL( aBundleId ); + CleanupStack::PopAndDestroy( &widgetSession ); + + // prepare widget start params + User::LeaveIfError( session.GetAppInfo( appInfo, launchUid ) ); + CApaCommandLine* commandLine = CApaCommandLine::NewLC(); + commandLine->SetExecutableNameL( appInfo.iFullName ); + HBufC8* buf8 = HBufC8::NewLC( aParam.Length() ); + buf8->Des().Copy( aParam ); + + // do the launch + commandLine->SetTailEndL( *buf8 ); + User::LeaveIfError( session.StartApp( *commandLine ) ); + + CleanupStack::PopAndDestroy( buf8 ); + CleanupStack::PopAndDestroy( commandLine ); + CleanupStack::PopAndDestroy( &session ); + } + +// --------------------------------------------------------------------------- +// Tries to open a portal with given method and parameters. +// this method may be called twice on a portal button, if a primary +// method fails. +// --------------------------------------------------------------------------- +// +void TryOpenPortalL( + CWmConfiguration::TMethod aMethod, const TDesC& aParam, + const TDesC& aBundleId ) + { + // open portal according to the method. + if ( aMethod == CWmConfiguration::EHttp ) + { TryRunHttpL( aParam ); } + else if ( aMethod == CWmConfiguration::EWidget ) + { TryRunWidgetL( aParam, aBundleId ); } + else + { /* do nothing */ } + } + +// --------------------------------------------------------------------------- +// Opens a portal. Called when user presses a portal button. tries the +// primary method, and if if fails, tries the secondary. If it fails, +// gives up. +// --------------------------------------------------------------------------- +// +void OpenPortalL( + CWmConfiguration& aConfiguration, TInt aPortalIndex ) + { + TRAPD( err, + TryOpenPortalL( + aConfiguration.PortalButtonPrimaryMethod( aPortalIndex ), + aConfiguration.PortalButtonPrimaryParams( aPortalIndex ), + aConfiguration.PortalButtonBundleId( aPortalIndex ) ); ); + if ( err != KErrNone ) + { + // if secondary method fails, leave will be propagated. + TryOpenPortalL( + aConfiguration.PortalButtonSecondaryMethod( aPortalIndex ), + aConfiguration.PortalButtonSecondaryParams( aPortalIndex ), + aConfiguration.PortalButtonBundleId( aPortalIndex ) ); + } + } + // --------------------------------------------------------- -// CWmPortalButton::HandlePointerEventL +// CWmPortalButton::ExecuteL // --------------------------------------------------------- // -void CWmPortalButton::HandlePointerEventL( - const TPointerEvent& aPointerEvent ) - { - CAknButton::HandlePointerEventL( aPointerEvent); - - if ( AknLayoutUtils::PenEnabled() ) - { - switch ( aPointerEvent.iType ) - { - case TPointerEvent::EButton1Down: - { - break; - } - case TPointerEvent::EButton1Up: - { - if ( iWmMainContainer && - iButtonCtrlId == EOviPortal ) - { - iWmMainContainer->OpenOviPortalL(); - } - break; - } - default: - break; - } - } - } - +void CWmPortalButton::ExecuteL() + { + OpenPortalL( iWmMainContainer->Configuration(), iPortalButtonIndex ); + } + // --------------------------------------------------------- -// CWmPortalButton::OfferKeyEventL +// CWmPortalButton::HandleControlEventL // --------------------------------------------------------- // -TKeyResponse CWmPortalButton::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) +void CWmPortalButton::HandleControlEventL( CCoeControl* /*aControl*/, + TCoeEvent aEventType ) { - TKeyResponse keyResponse( EKeyWasNotConsumed ); - keyResponse = CAknButton::OfferKeyEventL( aKeyEvent, aType ); - - if ( ( aType == EEventKey ) && - ( aKeyEvent.iScanCode == EStdKeyDevice3 || - aKeyEvent.iScanCode == EStdKeyEnter ) ) + // execute portal action when button pressed (short or long press) + if ( aEventType == EEventStateChanged || + aEventType == ELongPressEndedEvent ) { - if ( iWmMainContainer && - iButtonCtrlId == EOviPortal ) - { - iWmMainContainer->OpenOviPortalL(); - } + ExecuteL(); + } + } - keyResponse = EKeyWasConsumed; - } - - return keyResponse; +// --------------------------------------------------------- +// CWmPortalButton::LayoutIconSize +// --------------------------------------------------------- +// +TSize CWmPortalButton::LayoutIconSize() const + { + TBool landscape = Layout_Meta_Data::IsLandscapeOrientation(); + TAknLayoutRect imageLayout; + imageLayout.LayoutRect( Rect(), + AknLayoutScalable_Apps::wgtman_btn_pane_g1( + landscape ? 1 : 0).LayoutLine() ); + return imageLayout.Rect().Size(); } // --------------------------------------------------------- @@ -214,17 +328,19 @@ { CAknButton::SizeChanged(); - TBool landscape = Layout_Meta_Data::IsLandscapeOrientation(); - TRect rect = Rect(); - TAknLayoutRect imageLayout; - if ( iButtonCtrlId == EOviPortal ) + SetTextVerticalAlignment( CAknButton::ECenter ); + + // resize icon + if ( iButtonIcon && iButtonIconMask ) { - imageLayout.LayoutRect( rect, - AknLayoutScalable_Apps::wgtman_btn_pane_g1( - landscape ? 1 : 0).LayoutLine() ); + TSize size = LayoutIconSize(); + AknIconUtils::SetSize( + iButtonIcon, size, EAspectRatioPreserved ); + AknIconUtils::SetSize( + iButtonIconMask, size, EAspectRatioPreserved ); } - SetTextVerticalAlignment( CAknButton::ECenter ); - SetIconSize( imageLayout.Rect().Size() ); + + TBool landscape = Layout_Meta_Data::IsLandscapeOrientation(); SetTextAndIconAlignment( landscape ? CAknButton::EIconOverText : CAknButton::EIconBeforeText ); } @@ -235,21 +351,28 @@ // void CWmPortalButton::NotifyCompletion( TInt aError ) { - if ( KErrNone != aError ) + if ( KErrNone == aError ) { - // no image available. Do nothing. + // take ownership of icon + delete iButtonIcon; + iButtonIcon = NULL; + iButtonIcon = iImageConverter->Bitmap(); + delete iButtonIconMask; + iButtonIconMask = NULL; + iButtonIconMask = iImageConverter->Mask(); + if ( iButtonIcon && iButtonIconMask ) + { + TSize size = LayoutIconSize(); + AknIconUtils::SetSize( + iButtonIcon, size, EAspectRatioPreserved ); + AknIconUtils::SetSize( + iButtonIconMask, size, EAspectRatioPreserved ); + DrawDeferred(); + } } else - { - CGulIcon* icon = NULL; - TRAPD( err, icon = CGulIcon::NewL( - iImageConverter->Bitmap(), iImageConverter->Mask() ) ); - if ( KErrNone == err && icon ) - { - // Ownership transfered - State()->SetIcon( icon ); - DrawDeferred(); - } + { + // no image available. Do nothing. } } @@ -269,17 +392,13 @@ CWindowGc& gc = SystemGc(); MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TAknsItemID frameId = ( ( iButtonCtrlId == EOviPortal) ? - KAknsIIDQgnHomeWmButton : KAknsIIDQsnFrButtonNormal ); - TAknsItemID frameCenterId = ( ( iButtonCtrlId == EOviPortal) ? - KAknsIIDQgnHomeWmButtonCenter : KAknsIIDQsnFrButtonCenterNormal ); + TAknsItemID frameId = ( KAknsIIDQgnHomeWmButton ); + TAknsItemID frameCenterId = ( KAknsIIDQgnHomeWmButtonCenter ); if ( iButtonPressed ) { - frameId = ( ( iButtonCtrlId == EOviPortal) ? - KAknsIIDQgnHomeWmButtonPressed : KAknsIIDQsnFrButtonPressed ); - frameCenterId = ( ( iButtonCtrlId == EOviPortal) ? - KAknsIIDQgnHomeWmButtonPressedCenter : KAknsIIDQsnFrButtonCenterPressed ); + frameId = ( KAknsIIDQgnHomeWmButtonPressed ); + frameCenterId = ( KAknsIIDQgnHomeWmButtonPressedCenter ); } else if ( IsDimmed() ) { @@ -310,27 +429,27 @@ { TBool landscape = Layout_Meta_Data::IsLandscapeOrientation(); - const CGulIcon* icon = state->Icon(); - CFbsBitmap* bitmap = const_cast(icon->Bitmap()); - CFbsBitmap* mask = const_cast(icon->Mask()); - // draw image - if ( state->Icon() && bitmap && mask ) + + // draw image if one exists + if ( iButtonIcon && iButtonIconMask ) { TAknLayoutRect imageLayout; - if ( iButtonCtrlId == EOviPortal ) + // todo: 2-button layout + if ( iWmMainContainer->Configuration().PortalButtonCount() == 1 ) { imageLayout.LayoutRect( rect, AknLayoutScalable_Apps::wgtman_btn_pane_g1( landscape ? 1 : 0).LayoutLine() ); } - imageLayout.DrawImage( gc, bitmap, mask ); + imageLayout.DrawImage( gc, iButtonIcon, iButtonIconMask ); } // draw text if portrait if ( !landscape ) { TAknTextComponentLayout leftLayout; - if ( iButtonCtrlId == EOviPortal ) + // todo: 2-button layout + if ( iWmMainContainer->Configuration().PortalButtonCount() == 1 ) { leftLayout = AknLayoutScalable_Apps::wgtman_btn_pane_t1( landscape ? 1 : 0 ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmresourceloader.cpp --- a/idlehomescreen/widgetmanager/src/wmresourceloader.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmresourceloader.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -67,7 +67,8 @@ { UnloadResources(); delete iNote; - delete iDescription; + delete iNoDescription; + delete iWrtDescription; } // --------------------------------------------------------- @@ -81,8 +82,11 @@ LoadResourcesL(); DetermineIconFilePath(); - iDescription = StringLoader::LoadL( + iNoDescription = StringLoader::LoadL( R_QTN_WM_DETAILS_NO_DESCRIPTION, &iEnv ); + + iWrtDescription = StringLoader::LoadL( + R_QTN_WM_WIDGET_DETAILS_WRT, &iEnv ); } // --------------------------------------------------------- @@ -209,13 +213,22 @@ } // --------------------------------------------------------- -// CWmResourceLoader::NoDescriptionText +// CWmResourceLoader::NoDescription // --------------------------------------------------------- // -const TDesC& CWmResourceLoader::NoDescriptionText() +const TDesC& CWmResourceLoader::NoDescription() { - return *iDescription; + return *iNoDescription; } - + +// --------------------------------------------------------- +// CWmResourceLoader::WrtDescription +// --------------------------------------------------------- +// +const TDesC& CWmResourceLoader::WrtDescription() + { + return *iWrtDescription; + } + // end of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmwidgetdata.cpp --- a/idlehomescreen/widgetmanager/src/wmwidgetdata.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmwidgetdata.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -23,24 +23,34 @@ #include #include #include // widgetreqistry -#include #include +#include +#include +#include +#include +#include #include "wmwidgetdata.h" #include "wmwidgetdataobserver.h" #include "wmpersistentwidgetorder.h" +#include "wmresourceloader.h" #include "wmcommon.h" -#include + +// CONSTANTS +_LIT8( KWrtMime, "application/x-nokia-widget"); // --------------------------------------------------------- // CWmWidgetData::NewL // --------------------------------------------------------- // -CWmWidgetData* CWmWidgetData::NewL( +CWmWidgetData* CWmWidgetData::NewL( + const TSize& aLogoSize, + CWmResourceLoader& aWmResourceLoader, CHsContentInfo* aHsContentInfo, RWidgetRegistryClientSession* aRegistryClientSession ) { CWmWidgetData* self = CWmWidgetData::NewLC( + aLogoSize, aWmResourceLoader, aHsContentInfo, aRegistryClientSession ); CleanupStack::Pop(); // self; return self; @@ -50,11 +60,14 @@ // CWmWidgetData::NewLC // --------------------------------------------------------- // -CWmWidgetData* CWmWidgetData::NewLC( +CWmWidgetData* CWmWidgetData::NewLC( + const TSize& aLogoSize, + CWmResourceLoader& aWmResourceLoader, CHsContentInfo* aHsContentInfo, RWidgetRegistryClientSession* aRegistryClientSession ) { - CWmWidgetData* self = new ( ELeave ) CWmWidgetData(); + CWmWidgetData* self = new ( ELeave ) CWmWidgetData( + aLogoSize, aWmResourceLoader ); CleanupStack::PushL(self); self->ConstructL( aHsContentInfo, aRegistryClientSession ); return self; @@ -64,16 +77,23 @@ // CWmWidgetData::CWmWidgetData // --------------------------------------------------------- // -CWmWidgetData::CWmWidgetData() +CWmWidgetData::CWmWidgetData( const TSize& aLogoSize, + CWmResourceLoader& aWmResourceLoader ) + : CActive( EPriorityStandard ), + iWmResourceLoader( aWmResourceLoader ) { iIdle = NULL; iLogoImage = NULL; iLogoImageMask = NULL; iHsContentInfo = NULL; iWidgetType = CWmWidgetData::EUnknown; - iInstallAnimationIndex = KErrNotFound; iPublisherUid = KNullUid; - iLogoSize = TSize( 0, 0 ); + iLogoSize = aLogoSize; + iPeriodic = NULL; + iAnimationIndex = 0; + iAsyncUninstalling = EFalse; + iFireLogoChanged = EFalse; + CActiveScheduler::Add( this ); } // --------------------------------------------------------- @@ -88,8 +108,13 @@ // start decoding the icon iImageConverter = CWmImageConverter::NewL( this ); - iIdle = CIdle::NewL( CActive::EPriorityLow ); - iIdle->Start( TCallBack( HandleAsyncIconString, this ) ); + iIdle = CIdle::NewL( CActive::EPriorityStandard ); + iWait = new (ELeave) CActiveSchedulerWait(); + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + + // start logo handling + iImageConverter->SetLogoSize( iLogoSize ); + HandleIconString( HsContentInfo().IconPath() ); } // --------------------------------------------------------- @@ -124,12 +149,20 @@ // CWmWidgetData::~CWmWidgetData() { + Cancel(); if ( iIdle && iIdle->IsActive() ) { iIdle->Cancel(); } delete iIdle; + if ( iWait && iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + delete iWait; SetObserver( NULL ); + DestroyAnimData(); + delete iPeriodic; delete iLogoImage; delete iLogoImageMask; delete iImageConverter; @@ -219,15 +252,24 @@ { iLogoImage = iImageConverter->Bitmap(); iLogoImageMask = iImageConverter->Mask(); - FireDataChanged(); + + if ( iWait && iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + if ( iFireLogoChanged ) + { + iFireLogoChanged = EFalse; + FireDataChanged(); + } } } // --------------------------------------------------------- -// CWmWidgetData::HandleIconStringL +// CWmWidgetData::HandleIconString // --------------------------------------------------------- // -void CWmWidgetData::HandleIconStringL( const TDesC& aIconStr ) +void CWmWidgetData::HandleIconString( const TDesC& aIconStr ) { HBufC* iconStr = NULL; if ( aIconStr.Length() == 0 && @@ -236,12 +278,13 @@ // workaround for wrt widgets icon _LIT( KUidTag, "uid(0x%x)" ); const TInt KLength = 32; - iconStr = HBufC::NewLC( KLength ); - iconStr->Des().Format( KUidTag, iPublisherUid.iUid ); + TBuf uidBuf; + uidBuf.Format( KUidTag, iPublisherUid.iUid ); + iconStr = uidBuf.Alloc(); } else { - iconStr = aIconStr.AllocLC(); + iconStr = aIconStr.Alloc(); } TSize size( iLogoSize ); @@ -251,10 +294,21 @@ { size = iLogoSize; } - iImageConverter->HandleIconStringL( + TInt err = iImageConverter->HandleIconString( size.iWidth, size.iHeight, *iconStr ); - CleanupStack::PopAndDestroy( iconStr ); + delete iconStr; + iconStr = NULL; + + // handle result + if ( KErrNone == err && IsPrepairingLogo() ) + { + iWait->Start(); + } + else if ( KErrNone != err && iFireLogoChanged ) + { + FireDataChanged(); // draw default icon + } } // --------------------------------------------------------- @@ -314,12 +368,7 @@ if ( widgetUid != 0 ) { // WRT widget - iPublisherUid = TUid::Uid( widgetUid ); - - HBufC* desc = StringLoader::LoadLC( R_QTN_WM_WIDGET_DETAILS_WRT, - CEikonEnv::Static() ); - iHsContentInfo->SetDescriptionL( *desc ); - CleanupStack::PopAndDestroy( desc ); + iPublisherUid = TUid::Uid( widgetUid ); } else { @@ -327,33 +376,21 @@ } } } -// ---------------------------------------------------- -// CWmWidgetData::SetLogoSize -// ---------------------------------------------------- -// -void CWmWidgetData::SetLogoSize( const TSize& aSize ) - { - iLogoSize = aSize; - if ( iImageConverter ) - { - iImageConverter->SetLogoSize( aSize ); - } - } // --------------------------------------------------------- -// CWmWidgetData::HandleAsyncIconString +// CWmWidgetData::Description // --------------------------------------------------------- // -TInt CWmWidgetData::HandleAsyncIconString( TAny* aPtr ) +const TDesC& CWmWidgetData::Description() const { - CWmWidgetData* self = static_cast< CWmWidgetData* >( aPtr ); - if ( self->iIdle->IsActive() ) - { - self->iIdle->Cancel(); - } - TRAP_IGNORE( self->HandleIconStringL( - self->HsContentInfo().IconPath() ); ); - return KErrNone; + if ( iHsContentInfo->Description().Length() <= 0 && + &iWmResourceLoader ) + { + return ( ( iPublisherUid != KNullUid ) ? + iWmResourceLoader.WrtDescription() : + iWmResourceLoader.NoDescription() ); + } + return iHsContentInfo->Description(); } // --------------------------------------------------------- @@ -361,19 +398,20 @@ // --------------------------------------------------------- // void CWmWidgetData::ReCreateLogo( const TSize& aSize ) - { - iLogoSize = aSize; - + { delete iLogoImage; iLogoImage = NULL; delete iLogoImageMask; iLogoImageMask = NULL; - - if ( iIdle && !iIdle->IsActive() ) + + if ( iWait && iWait->IsStarted() ) { - // start decoding the icon - iIdle->Start( TCallBack( HandleAsyncIconString, this ) ); + iWait->AsyncStop(); } + + iFireLogoChanged = ETrue; + iLogoSize = aSize; + HandleIconString( HsContentInfo().IconPath() ); } // --------------------------------------------------------- @@ -412,5 +450,274 @@ return !( sameAppearance && sameLogo ); } + +// --------------------------------------------------------- +// CWmWidgetData::IsPrepairingLogo +// --------------------------------------------------------- +// +TBool CWmWidgetData::IsPrepairingLogo() + { + TBool prepairing( EFalse ); + if ( !iLogoImage ) + { + prepairing = iImageConverter->IsProcessing(); + } + return prepairing; + } + +// --------------------------------------------------------- +// CWmWidgetData::UnInstallL +// --------------------------------------------------------- +// +void CWmWidgetData::UnInstallL() + { + if ( IsUninstalling() || IsActive() ) + { + User::Leave( KErrInUse ); + } + + DestroyAnimData(); + + TInt err = iInstaller.Connect(); + if ( KErrNone == err ) + { + CleanupClosePushL( iInstaller ); + PrepairAnimL(); + CleanupStack::Pop( &iInstaller ); + SwiUI::TUninstallOptions optionsUninstall; + optionsUninstall.iBreakDependency = SwiUI::EPolicyAllowed; + optionsUninstall.iKillApp = SwiUI::EPolicyAllowed; + SwiUI::TUninstallOptionsPckg uninstallOptionsPkg( optionsUninstall ); + iInstaller.SilentUninstall( iStatus, iPublisherUid, + uninstallOptionsPkg, KWrtMime ); + VisualizeUninstall(); + SetActive(); + } + else + { + // do normal uninstall + iAsyncUninstalling = EFalse; + SwiUI::RSWInstLauncher installer; + User::LeaveIfError( installer.Connect() ); + CleanupClosePushL( installer ); + User::LeaveIfError( installer.Uninstall( iPublisherUid, KWrtMime ) ); + CleanupStack::PopAndDestroy( &installer ); + } + } + +// --------------------------------------------------------- +// CWmWidgetData::VisualizeUninstall +// --------------------------------------------------------- +// +void CWmWidgetData::VisualizeUninstall() + { + iAsyncUninstalling = ETrue; + iAnimationIndex = 0; + const TInt tickInterval = 400000; + iPeriodic->Start( + tickInterval,tickInterval,TCallBack(Tick, this)); + } + +// --------------------------------------------------------- +// CWmWidgetData::PrepairAnimL +// --------------------------------------------------------- +// +void CWmWidgetData::PrepairAnimL() + { + TInt resourceId = R_QGN_GRAF_WAIT_BAR_ANIM; + CAknBitmapAnimation* aknAnimation = CAknBitmapAnimation::NewL(); + CleanupStack::PushL( aknAnimation ); + aknAnimation->SetScaleModeForAnimationFrames(EAspectRatioNotPreserved); + TAknsItemID iid; + iid.Set(EAknsMajorAvkon, resourceId ); + if ( !aknAnimation ->ConstructFromSkinL( iid ) ) + { + TResourceReader readerForAnimation; + CCoeEnv::Static()->CreateResourceReaderLC( readerForAnimation,resourceId ); + aknAnimation->ConstructFromResourceL( readerForAnimation ); + CleanupStack::PopAndDestroy(); + } + TInt endFrame = aknAnimation ->BitmapAnimData()->FrameArray().Count()-1; + for ( TInt i=0; i<=endFrame; i++ ) + { + aknAnimation ->BitmapAnimData()->FrameArray().At(i)->SetBitmapsOwnedExternally( ETrue ); + CFbsBitmap* bitmap = aknAnimation ->BitmapAnimData()->FrameArray().At(i)->Bitmap(); + CFbsBitmap* bitmapMask = aknAnimation ->BitmapAnimData()->FrameArray().At(i)->Mask(); + if ( bitmap && bitmapMask ) + { + iUninstallAnimIcons.AppendL( bitmap ); + iUninstallAnimIcons.AppendL( bitmapMask ); + } + } + CleanupStack::PopAndDestroy( aknAnimation ); + } + +// --------------------------------------------------------- +// CWmWidgetData::DestroyAnimData +// --------------------------------------------------------- +// +void CWmWidgetData::DestroyAnimData() + { + if ( iPeriodic && iPeriodic->IsActive() ) + { + iPeriodic->Cancel(); + } + + for( TInt i=0; i < iUninstallAnimIcons.Count(); i++ ) + { + CFbsBitmap* bitmap = iUninstallAnimIcons[i]; + delete bitmap; bitmap = NULL; + } + iUninstallAnimIcons.Close(); + } + +// --------------------------------------------------------- +// CWmWidgetData::Tick +// --------------------------------------------------------- +// +TInt CWmWidgetData::Tick( TAny* aPtr ) + { + CWmWidgetData* self = static_cast< CWmWidgetData* >( aPtr ); + self->iAnimationIndex += 2; + if ( self->iAnimationIndex >= self->iUninstallAnimIcons.Count() -1 ) + { + self->iAnimationIndex = 0; // restart from beginging + } + self->FireDataChanged(); + return 1; + } + +// --------------------------------------------------------- +// CWmWidgetData::CloseSwiSession +// --------------------------------------------------------- +// +TInt CWmWidgetData::CloseSwiSession( TAny* aPtr ) + { + CWmWidgetData* self = static_cast< CWmWidgetData* >( aPtr ); + if ( self->iIdle->IsActive() ) + { + self->iIdle->Cancel(); + } + + self->iInstaller.Close(); + return KErrNone; + } + +// --------------------------------------------------------- +// CWmWidgetData::AnimationBitmap +// --------------------------------------------------------- +// +const CFbsBitmap* CWmWidgetData::AnimationBitmap( const TSize& aSize ) + { + CFbsBitmap* bitmap = NULL; + if ( iUninstallAnimIcons.Count() ) + { + TInt index = iAnimationIndex; + if ( index >= iUninstallAnimIcons.Count() - 1 ) + { + index = 0; + } + bitmap = iUninstallAnimIcons[index]; + if ( bitmap->SizeInPixels() != aSize ) + { + AknIconUtils::SetSize( bitmap, aSize, + EAspectRatioNotPreserved ); + } + } + return bitmap; + } + +// --------------------------------------------------------- +// CWmWidgetData::AnimationMask +// --------------------------------------------------------- +// +const CFbsBitmap* CWmWidgetData::AnimationMask( const TSize& aSize ) + { + CFbsBitmap* mask = NULL; + if ( iUninstallAnimIcons.Count() ) + { + TInt index = iAnimationIndex+1; + if ( index >= iUninstallAnimIcons.Count() ) + { + index = 1; + } + mask = iUninstallAnimIcons[index]; + if ( mask && mask->SizeInPixels() != aSize ) + { + AknIconUtils::SetSize( mask, aSize, + EAspectRatioNotPreserved ); + } + } + return mask; + } + +// --------------------------------------------------------- +// CWmWidgetData::IsUninstalling +// --------------------------------------------------------- +// +TBool CWmWidgetData::IsUninstalling() + { + return iAsyncUninstalling; + } + +// --------------------------------------------------------- +// CWmWidgetData::DoCancel +// --------------------------------------------------------- +// +void CWmWidgetData::DoCancel() + { + if ( IsActive() && iAsyncUninstalling ) + { + iInstaller.CancelAsyncRequest( + SwiUI::ERequestSilentUninstall ); + + // close session + iInstaller.Close(); + } + iAsyncUninstalling = EFalse; + iAnimationIndex = 0; + } + +// --------------------------------------------------------- +// CWmWidgetData::RunL +// --------------------------------------------------------- +// +void CWmWidgetData::RunL() + { + iAsyncUninstalling = EFalse; + iAnimationIndex = 0; + + DestroyAnimData(); + FireDataChanged(); + + // close SWI session + if ( iIdle && iIdle->IsActive() ) + { + iIdle->Cancel(); + } + iIdle->Start( TCallBack( CloseSwiSession, this ) ); + } + +// --------------------------------------------------------- +// CWmWidgetData::RunError +// --------------------------------------------------------- +// +TInt CWmWidgetData::RunError(TInt /*aError*/) + { + iAsyncUninstalling = EFalse; + iAnimationIndex = 0; + DestroyAnimData(); + FireDataChanged(); + + // close SWI session + if ( iIdle && iIdle->IsActive() ) + { + iIdle->Cancel(); + } + iIdle->Start( TCallBack( CloseSwiSession, this ) ); + + return KErrNone; + } + // End of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp --- a/idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -123,20 +123,23 @@ // void CWmWidgetLoaderAo::DoLoadWidgetsL() { - // 1. mark all the existing widgets initially non-valid - for( TInt i=0; iLoadL() ); + // 3. prepare the widget data list + for( TInt i=0; i 0 ) + + // update listbox + if ( widgetsAdded > 0 ) + { + iWidgetsList.HandleItemAdditionL(); + } + + if ( widgetsRemoved > 0 || widgetsAdded > 0 || + widgetsChanged > 0 ) { iWidgetsList.DrawDeferred(); } @@ -203,7 +214,7 @@ { iWidgetOrder->StoreL( iWidgetsList.WidgetDataArray() ); } - + } // --------------------------------------------------------- @@ -240,10 +251,12 @@ CleanupStack::Pop( aContentInfo ); CWmWidgetData* widgetData = CWmWidgetData::NewLC( + iWidgetsList.LogoSize(), + iWmPlugin.ResourceLoader(), aContentInfo, iWidgetRegistry ); widgetData->SetPersistentWidgetOrder( iWidgetOrder ); widgetData->SetValid( ETrue ); - iWidgetsList.AddWidgetDataL( widgetData ); + iWidgetsList.AddWidgetDataL( widgetData, EFalse ); CleanupStack::Pop( widgetData ); } @@ -262,7 +275,11 @@ iWidgetRegistry = NULL; } - // delete widget order + // delete widget order and references to it + for( TInt i=0; iHandleIconStringL( 40, 40, inputStr ) ); + TInt err = iImageConverter->HandleIconString( 40, 40, inputStr ); if ( err != KErrNone ) { - _LOG("ImageConverterConvertL:HandleIconStringL returns with leave"); + _LOG("ImageConverterConvertL:HandleIconString returns Error!!!"); iConversionReady = ETrue; iConversionError = err; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -163,6 +163,15 @@ return KErrNone; } +TInt CWmUnitTest::ActiveViewL( CHsContentInfo& /*aInfo*/ ) + { + return 0; + } + +TInt CWmUnitTest::ActiveAppL( CHsContentInfo& /*aInfo*/ ) + { + return 0; + } // ----------------------------------------------------------------------------- @@ -201,9 +210,10 @@ name.Format( _L("Widget_%d"), i ); info->SetNameL( name ); TBuf8<20> id; - id.Num( i ); + id.Format( _L8("0x%x"), i ); info->SetUidL( id ); info->SetTypeL( _L8("template") ); + info->SetPublisherIdL( _L("teron.pub") ); info->SetIconPathL( _L("uid(0x2000DAD2)") ); info->SetCanBeAdded( ETrue ); info->SetDescriptionL(_L("Default plaa plaa plaa plaa plaa plaa plaa")); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_sortorder.cpp --- a/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_sortorder.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_sortorder.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -155,11 +155,15 @@ RWidgetRegistryClientSession registryClient; User::LeaveIfError( registryClient.Connect() ); CleanupClosePushL( registryClient ); - + TSize dummySize(40,40); + CWmResourceLoader* resLoader = NULL; // not used in this case while( contentArray->Array().Count() > 0 ) - { + { CWmWidgetData* data = CWmWidgetData::NewL( - contentArray->Array()[0], ®istryClient); + dummySize, *resLoader, + contentArray->Array()[0], + ®istryClient); + contentArray->Array().Remove( 0 ); CleanupStack::PushL( data ); aArray.AppendL( data ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluicontroller/conf/activeidle2.confml Binary file idlehomescreen/xmluicontroller/conf/activeidle2.confml has changed diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluicontroller/conf/activeidle2_10275102.crml Binary file idlehomescreen/xmluicontroller/conf/activeidle2_10275102.crml has changed diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluicontroller/src/aieventhandler.cpp --- a/idlehomescreen/xmluicontroller/src/aieventhandler.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/aieventhandler.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -269,9 +269,9 @@ TLiwGenericParam data( KData, TLiwVariant( &aMap )); inparam.AppendL( data ); - TRAPD(err, msgInterface ->ExecuteCmdL(KExecute, inparam, outparam)); + msgInterface ->ExecuteCmdL(KExecute, inparam, outparam); msgInterface->Close(); - + outparam.Reset(); inparam.Reset(); } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluicontroller/src/aixmluiutils.cpp --- a/idlehomescreen/xmluicontroller/src/aixmluiutils.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/aixmluiutils.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -439,7 +439,7 @@ { // Create new property value and property CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( - aUiElement.UiEngineL()->StringPool() ); + &aUiElement.UiEngineL()->StringPool() ); CleanupStack::PushL( value ); CXnProperty* property = CXnProperty::NewL( @@ -1066,7 +1066,7 @@ const TDesC8& aNewValueString ) { // Set defined property to defined node. - CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL(aNode.UiEngineL()->StringPool()); + CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( &aNode.UiEngineL()->StringPool() ); CleanupStack::PushL(newValue); newValue->SetStringValueL(CXnDomPropertyValue::EString, aNewValueString); CXnProperty* prop = CXnProperty::NewL(aPropertyName, newValue, aNode.UiEngineL()->StringPool()); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluicontroller/src/databuffertransactionelement.cpp --- a/idlehomescreen/xmluicontroller/src/databuffertransactionelement.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/databuffertransactionelement.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -145,7 +145,7 @@ // Create new new label attribute value CXnDomPropertyValue* propertyValue = - CXnDomPropertyValue::NewL( target.UiEngineL()->StringPool() ); + CXnDomPropertyValue::NewL( &target.UiEngineL()->StringPool() ); CleanupStack::PushL( propertyValue ); @@ -178,16 +178,6 @@ User::LeaveIfError( AiUtility::ParseInt( volume, iNewData ) ); volumeControl->SetValue( volume ); } - else if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) - { - // Get newsticker interface - XnNewstickerInterface::MXnNewstickerInterface* newsTicker = NULL; - XnComponentInterface::MakeInterfaceL( newsTicker, Target() ); - LeaveIfNull( newsTicker, KErrNotSupported ); - - // Append new SVG title - newsTicker->AppendSvgTitleL( iNewData ); - } else { User::Leave( KErrNotSupported ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluicontroller/src/imagetransactionelement.cpp --- a/idlehomescreen/xmluicontroller/src/imagetransactionelement.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/imagetransactionelement.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -225,16 +225,6 @@ imageIntr->SetContentBitmaps( iIcon->Bitmap(), iIcon->Mask() ); } - else if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) - { - XnNewstickerInterface::MXnNewstickerInterface* newsTicker = NULL; - XnComponentInterface::MakeInterfaceL( newsTicker, *node ); - LeaveIfNull( newsTicker, KErrNotSupported ); - - User::LeaveIfError( newsTicker->SetSeparatorImageL( iIcon ) ); - // Ownership of icon transferred to newsticker - iIcon = NULL; - } // Menu softkey icons else if ( ( ( type == KXnMenuItem || type == KXnMenu ) && IsNodeVisible( *node ) ) || @@ -375,18 +365,6 @@ iNewIcon->SetBitmapsOwnedExternally( ETrue ); imageIntr->SetContentBitmaps( iNewIcon->Bitmap(), iNewIcon->Mask() ); } - else if ( type == XnNewstickerInterface::MXnNewstickerInterface::Type() ) - { - XnNewstickerInterface::MXnNewstickerInterface* newsTicker = NULL; - XnComponentInterface::MakeInterfaceL( newsTicker, Target() ); - LeaveIfNull( newsTicker, KErrNotSupported ); - - User::LeaveIfError( newsTicker->SetSeparatorImageL( iNewIcon ) ); - - // Ownership of icon transferred to newsticker - - iNewIcon = NULL; - } // Menu softkey icons else if ( ( ( type == KXnMenuItem || type == KXnMenu ) && IsNodeVisible( Target() ) ) || diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluicontroller/src/texttransactionelement.cpp --- a/idlehomescreen/xmluicontroller/src/texttransactionelement.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/texttransactionelement.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -145,7 +145,7 @@ CXnNodeAppIf& target = Target(); // Set the label of the softkey CXnDomPropertyValue* propertyValue = - CXnDomPropertyValue::NewL( target.UiEngineL()->StringPool() ); + CXnDomPropertyValue::NewL( &target.UiEngineL()->StringPool() ); CleanupStack::PushL( propertyValue ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/bwins/xn3domdocumentu.def --- a/idlehomescreen/xmluirendering/dom/bwins/xn3domdocumentu.def Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/bwins/xn3domdocumentu.def Mon Jan 18 20:10:36 2010 +0200 @@ -1,11 +1,11 @@ EXPORTS - ?IsRefNode@CXnDomNode@@QBEHXZ @ 1 NONAME ; int CXnDomNode::IsRefNode(void) const - ??1CXnDomAttribute@@UAE@XZ @ 2 NONAME ; CXnDomAttribute::~CXnDomAttribute(void) - ?Value@CXnDomAttribute@@QAEABVTDesC8@@XZ @ 3 NONAME ; class TDesC8 const & CXnDomAttribute::Value(void) - ?NewL@CXnDomDocument@@SAPAV1@AAVRReadStream@@@Z @ 4 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(class RReadStream &) - ?InternalizeL@CXnDomDocument@@QAEXAAVRReadStream@@@Z @ 5 NONAME ; void CXnDomDocument::InternalizeL(class RReadStream &) - ?SetContentType@CXnDomNode@@QAEXABW4TContentType@@@Z @ 6 NONAME ; void CXnDomNode::SetContentType(enum TContentType const &) - ?RemoveItem@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 7 NONAME ; void CXnDomList::RemoveItem(class MXnDomListItem *) + ??1CXnDomAttribute@@UAE@XZ @ 1 NONAME ; CXnDomAttribute::~CXnDomAttribute(void) + ?Value@CXnDomAttribute@@QAEABVTDesC8@@XZ @ 2 NONAME ; class TDesC8 const & CXnDomAttribute::Value(void) + ?NewL@CXnDomDocument@@SAPAV1@AAVRReadStream@@@Z @ 3 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(class RReadStream &) + ?InternalizeL@CXnDomDocument@@QAEXAAVRReadStream@@@Z @ 4 NONAME ; void CXnDomDocument::InternalizeL(class RReadStream &) + ?SetContentType@CXnDomNode@@QAEXABW4TContentType@@@Z @ 5 NONAME ; void CXnDomNode::SetContentType(enum TContentType const &) + ?RemoveItem@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 6 NONAME ; void CXnDomList::RemoveItem(class MXnDomListItem *) + ?SwapStringPoolL@CXnDomList@@QAEXPAVCXnDomStringPool@@@Z @ 7 NONAME ; void CXnDomList::SwapStringPoolL(class CXnDomStringPool *) ?MarshallL@CXnDomDocument@@QAEPAVHBufC8@@XZ @ 8 NONAME ; class HBufC8 * CXnDomDocument::MarshallL(void) ??1CXnDomDepthIterator@@UAE@XZ @ 9 NONAME ; CXnDomDepthIterator::~CXnDomDepthIterator(void) ?IsValueSet@CXnDomProperty@@QAEHXZ @ 10 NONAME ; int CXnDomProperty::IsValueSet(void) @@ -14,77 +14,77 @@ ?IsAutoIdent@CXnDomPropertyValue@@QAEHXZ @ 13 NONAME ; int CXnDomPropertyValue::IsAutoIdent(void) ?AttributeList@CXnDomNode@@QBEAAVCXnDomList@@XZ @ 14 NONAME ; class CXnDomList & CXnDomNode::AttributeList(void) const ?StringValue@CXnDomPropertyValue@@QAEABVTDesC8@@XZ @ 15 NONAME ; class TDesC8 const & CXnDomPropertyValue::StringValue(void) - ?SetRefNode@CXnDomNode@@QAEXH@Z @ 16 NONAME ; void CXnDomNode::SetRefNode(int) - ?AddItemL@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 17 NONAME ; void CXnDomList::AddItemL(class MXnDomListItem *) - ?AddChildL@CXnDomNode@@QAEXPAV1@H@Z @ 18 NONAME ; void CXnDomNode::AddChildL(class CXnDomNode *, int) - ?IsInheritIdent@CXnDomPropertyValue@@QAEHXZ @ 19 NONAME ; int CXnDomPropertyValue::IsInheritIdent(void) - ?StringPool@CXnDomDocument@@QBEAAVCXnDomStringPool@@XZ @ 20 NONAME ; class CXnDomStringPool & CXnDomDocument::StringPool(void) const - ?Parent@CXnDomNode@@QBEPAV1@XZ @ 21 NONAME ; class CXnDomNode * CXnDomNode::Parent(void) const - ?Name@CXnDomAttribute@@UAEABVTDesC8@@XZ @ 22 NONAME ; class TDesC8 const & CXnDomAttribute::Name(void) - ?CloneL@CXnDomProperty@@QAEPAV1@XZ @ 23 NONAME ; class CXnDomProperty * CXnDomProperty::CloneL(void) - ?Last@CXnDomList@@QAEPAVMXnDomListItem@@XZ @ 24 NONAME ; class MXnDomListItem * CXnDomList::Last(void) - ?AddStringL@CXnDomStringPool@@QAEHABVTDesC8@@@Z @ 25 NONAME ; int CXnDomStringPool::AddStringL(class TDesC8 const &) - ?StringValueL@CXnDomPropertyValue@@QAEABVTDesC8@@XZ @ 26 NONAME ; class TDesC8 const & CXnDomPropertyValue::StringValueL(void) - ?SetPseudoClass@CXnDomProperty@@QAEXW4TPseudoClass@1@@Z @ 27 NONAME ; void CXnDomProperty::SetPseudoClass(enum CXnDomProperty::TPseudoClass) - ?ReplaceChildL@CXnDomNode@@QAEXPAV1@0@Z @ 28 NONAME ; void CXnDomNode::ReplaceChildL(class CXnDomNode *, class CXnDomNode *) - ?CreateRefNodeL@CXnDomNode@@QAEPAV1@XZ @ 29 NONAME ; class CXnDomNode * CXnDomNode::CreateRefNodeL(void) - ?Length@CXnDomList@@QBEHXZ @ 30 NONAME ; int CXnDomList::Length(void) const - ?AppendPCDataL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 31 NONAME ; void CXnDomNode::AppendPCDataL(class TDesC8 const &) - ?ReleaseData@CXnDomPropertyValue@@QAEXXZ @ 32 NONAME ; void CXnDomPropertyValue::ReleaseData(void) - ?ItemIndex@CXnDomList@@QBEHABVMXnDomListItem@@@Z @ 33 NONAME ; int CXnDomList::ItemIndex(class MXnDomListItem const &) const - ?FloatValueL@CXnDomPropertyValue@@QBENXZ @ 34 NONAME ; double CXnDomPropertyValue::FloatValueL(void) const - ?LayoutNode@CXnDomNode@@QAEPAVCXnNode@@XZ @ 35 NONAME ; class CXnNode * CXnDomNode::LayoutNode(void) - ?StringPoolIndexL@CXnDomPropertyValue@@QBEFXZ @ 36 NONAME ; short CXnDomPropertyValue::StringPoolIndexL(void) const - ?FindByName@CXnDomList@@QAEPAVMXnDomListItem@@ABVTDesC8@@@Z @ 37 NONAME ; class MXnDomListItem * CXnDomList::FindByName(class TDesC8 const &) - ?StringPool@CXnDomNode@@QBEAAVCXnDomStringPool@@XZ @ 38 NONAME ; class CXnDomStringPool & CXnDomNode::StringPool(void) const - ?First@CXnDomList@@QAEPAVMXnDomListItem@@XZ @ 39 NONAME ; class MXnDomListItem * CXnDomList::First(void) - ?ValueStringPoolIndex@CXnDomAttribute@@QBEFXZ @ 40 NONAME ; short CXnDomAttribute::ValueStringPoolIndex(void) const - ?NewL@CXnDomDocument@@SAPAV1@PBVHBufC8@@@Z @ 41 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(class HBufC8 const *) - ?DeleteChild@CXnDomNode@@QAEXPAV1@@Z @ 42 NONAME ; void CXnDomNode::DeleteChild(class CXnDomNode *) - ?AddChildL@CXnDomNode@@QAEXPAV1@@Z @ 43 NONAME ; void CXnDomNode::AddChildL(class CXnDomNode *) - ?NewL@CXnDomProperty@@SAPAV1@FAAVCXnDomStringPool@@@Z @ 44 NONAME ; class CXnDomProperty * CXnDomProperty::NewL(short, class CXnDomStringPool &) - ?NewL@CXnDomAttribute@@SAPAV1@ABVTDesC8@@AAVCXnDomStringPool@@@Z @ 45 NONAME ; class CXnDomAttribute * CXnDomAttribute::NewL(class TDesC8 const &, class CXnDomStringPool &) - ?ChildNodes@CXnDomNode@@QAEAAVCXnDomList@@XZ @ 46 NONAME ; class CXnDomList & CXnDomNode::ChildNodes(void) - ?NodeId@CXnDomNode@@QBEHXZ @ 47 NONAME ; int CXnDomNode::NodeId(void) const - ?IsNoneIdent@CXnDomPropertyValue@@QAEHXZ @ 48 NONAME ; int CXnDomPropertyValue::IsNoneIdent(void) - ?ItemIndex@CXnDomNode@@QBEHABVMXnDomListItem@@@Z @ 49 NONAME ; int CXnDomNode::ItemIndex(class MXnDomListItem const &) const - ?Item@CXnDomList@@QBEPAVMXnDomListItem@@H@Z @ 50 NONAME ; class MXnDomListItem * CXnDomList::Item(int) const - ?ExternalizeL@CXnDomDocument@@QBEXAAVRWriteStream@@@Z @ 51 NONAME ; void CXnDomDocument::ExternalizeL(class RWriteStream &) const - ?StringPool@CXnDomProperty@@QBEAAVCXnDomStringPool@@XZ @ 52 NONAME ; class CXnDomStringPool & CXnDomProperty::StringPool(void) const - ?SetNamespaceL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 53 NONAME ; void CXnDomNode::SetNamespaceL(class TDesC8 const &) - ?CloneL@CXnDomPropertyValue@@QAEPAV1@XZ @ 54 NONAME ; class CXnDomPropertyValue * CXnDomPropertyValue::CloneL(void) - ?PCData@CXnDomNode@@QAEABVTDesC8@@XZ @ 55 NONAME ; class TDesC8 const & CXnDomNode::PCData(void) - ?ContentType@CXnDomNode@@QAEABW4TContentType@@XZ @ 56 NONAME ; enum TContentType const & CXnDomNode::ContentType(void) - ?DeleteItem@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 57 NONAME ; void CXnDomList::DeleteItem(class MXnDomListItem *) - ?StringPool@CXnDomList@@QBEAAVCXnDomStringPool@@XZ @ 58 NONAME ; class CXnDomStringPool & CXnDomList::StringPool(void) const - ?Reset@CXnDomList@@QAEXXZ @ 59 NONAME ; void CXnDomList::Reset(void) - ?PropertyList@CXnDomNode@@QAEAAVCXnDomList@@XZ @ 60 NONAME ; class CXnDomList & CXnDomNode::PropertyList(void) - ?CloneL@CXnDomAttribute@@QAEPAV1@XZ @ 61 NONAME ; class CXnDomAttribute * CXnDomAttribute::CloneL(void) - ?RootNode@CXnDomDocument@@QBEPAVCXnDomNode@@XZ @ 62 NONAME ; class CXnDomNode * CXnDomDocument::RootNode(void) const - ??1CXnDomPropertyValue@@UAE@XZ @ 63 NONAME ; CXnDomPropertyValue::~CXnDomPropertyValue(void) - ?SetLayoutNode@CXnDomNode@@QAEXPAVCXnNode@@@Z @ 64 NONAME ; void CXnDomNode::SetLayoutNode(class CXnNode *) - ?PropertyValueList@CXnDomProperty@@QAEAAVCXnDomList@@XZ @ 65 NONAME ; class CXnDomList & CXnDomProperty::PropertyValueList(void) - ??1CXnDomDocument@@UAE@XZ @ 66 NONAME ; CXnDomDocument::~CXnDomDocument(void) - ?DeleteItem@CXnDomList@@QAEXH@Z @ 67 NONAME ; void CXnDomList::DeleteItem(int) - ?NewL@CXnDomDepthIterator@@SAPAV1@AAVCXnDomNode@@@Z @ 68 NONAME ; class CXnDomDepthIterator * CXnDomDepthIterator::NewL(class CXnDomNode &) - ?CloneWithoutKidsL@CXnDomNode@@QAEPAV1@AAVCXnDomStringPool@@@Z @ 69 NONAME ; class CXnDomNode * CXnDomNode::CloneWithoutKidsL(class CXnDomStringPool &) - ?RemoveItem@CXnDomList@@QAEXH@Z @ 70 NONAME ; void CXnDomList::RemoveItem(int) - ?CloneL@CXnDomDocument@@QAEPAV1@XZ @ 71 NONAME ; class CXnDomDocument * CXnDomDocument::CloneL(void) - ?NameStringPoolIndex@CXnDomAttribute@@QBEFXZ @ 72 NONAME ; short CXnDomAttribute::NameStringPoolIndex(void) const - ?PrimitiveValueType@CXnDomPropertyValue@@QBE?AW4TPrimitiveValueType@1@XZ @ 73 NONAME ; enum CXnDomPropertyValue::TPrimitiveValueType CXnDomPropertyValue::PrimitiveValueType(void) const - ?SetInherited@CXnDomProperty@@QAEXH@Z @ 74 NONAME ; void CXnDomProperty::SetInherited(int) - ?SetRgbColorL@CXnDomPropertyValue@@QAEXABVTRgb@@@Z @ 75 NONAME ; void CXnDomPropertyValue::SetRgbColorL(class TRgb const &) - ?AttributeValue@CXnDomNode@@QBEABVTDesC8@@ABV2@@Z @ 76 NONAME ; class TDesC8 const & CXnDomNode::AttributeValue(class TDesC8 const &) const - ?SetRootNode@CXnDomDocument@@QAEXPAVCXnDomNode@@@Z @ 77 NONAME ; void CXnDomDocument::SetRootNode(class CXnDomNode *) - ?DeleteAttributeList@CXnDomNode@@QAEXXZ @ 78 NONAME ; void CXnDomNode::DeleteAttributeList(void) - ?Inherited@CXnDomProperty@@QAEHXZ @ 79 NONAME ; int CXnDomProperty::Inherited(void) - ?NewL@CXnDomDocument@@SAPAV1@XZ @ 80 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(void) - ?SetValueL@CXnDomAttribute@@QAEXABVTDesC8@@@Z @ 81 NONAME ; void CXnDomAttribute::SetValueL(class TDesC8 const &) - ?AddItemL@CXnDomList@@QAEXPAVMXnDomListItem@@H@Z @ 82 NONAME ; void CXnDomList::AddItemL(class MXnDomListItem *, int) - ?Namespace@CXnDomNode@@QAEABVTDesC8@@XZ @ 83 NONAME ; class TDesC8 const & CXnDomNode::Namespace(void) - ?SetNodeId@CXnDomNode@@QAEXH@Z @ 84 NONAME ; void CXnDomNode::SetNodeId(int) - ?PseudoClass@CXnDomProperty@@QBE?AW4TPseudoClass@1@XZ @ 85 NONAME ; enum CXnDomProperty::TPseudoClass CXnDomProperty::PseudoClass(void) const - ?CloneL@CXnDomNode@@QAEPAV1@AAVCXnDomStringPool@@ABVTDesC8@@@Z @ 86 NONAME ; class CXnDomNode * CXnDomNode::CloneL(class CXnDomStringPool &, class TDesC8 const &) + ?AddItemL@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 16 NONAME ; void CXnDomList::AddItemL(class MXnDomListItem *) + ?AddChildL@CXnDomNode@@QAEXPAV1@H@Z @ 17 NONAME ; void CXnDomNode::AddChildL(class CXnDomNode *, int) + ?IsInheritIdent@CXnDomPropertyValue@@QAEHXZ @ 18 NONAME ; int CXnDomPropertyValue::IsInheritIdent(void) + ?Parent@CXnDomNode@@QBEPAV1@XZ @ 19 NONAME ; class CXnDomNode * CXnDomNode::Parent(void) const + ?Name@CXnDomAttribute@@UAEABVTDesC8@@XZ @ 20 NONAME ; class TDesC8 const & CXnDomAttribute::Name(void) + ?CloneL@CXnDomProperty@@QAEPAV1@XZ @ 21 NONAME ; class CXnDomProperty * CXnDomProperty::CloneL(void) + ?Last@CXnDomList@@QAEPAVMXnDomListItem@@XZ @ 22 NONAME ; class MXnDomListItem * CXnDomList::Last(void) + ?StringValueL@CXnDomPropertyValue@@QAEABVTDesC8@@XZ @ 23 NONAME ; class TDesC8 const & CXnDomPropertyValue::StringValueL(void) + ?SetPseudoClass@CXnDomProperty@@QAEXW4TPseudoClass@1@@Z @ 24 NONAME ; void CXnDomProperty::SetPseudoClass(enum CXnDomProperty::TPseudoClass) + ?ReplaceChildL@CXnDomNode@@QAEXPAV1@0@Z @ 25 NONAME ; void CXnDomNode::ReplaceChildL(class CXnDomNode *, class CXnDomNode *) + ?Length@CXnDomList@@QBEHXZ @ 26 NONAME ; int CXnDomList::Length(void) const + ?SetOwnershipL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 27 NONAME ; void CXnDomNode::SetOwnershipL(class TDesC8 const &) + ?AppendPCDataL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 28 NONAME ; void CXnDomNode::AppendPCDataL(class TDesC8 const &) + ?ReleaseData@CXnDomPropertyValue@@QAEXXZ @ 29 NONAME ; void CXnDomPropertyValue::ReleaseData(void) + ?ItemIndex@CXnDomList@@QBEHABVMXnDomListItem@@@Z @ 30 NONAME ; int CXnDomList::ItemIndex(class MXnDomListItem const &) const + ?FloatValueL@CXnDomPropertyValue@@QBENXZ @ 31 NONAME ; double CXnDomPropertyValue::FloatValueL(void) const + ?LayoutNode@CXnDomNode@@QAEPAVCXnNode@@XZ @ 32 NONAME ; class CXnNode * CXnDomNode::LayoutNode(void) + ?StringPoolIndexL@CXnDomPropertyValue@@QBEFXZ @ 33 NONAME ; short CXnDomPropertyValue::StringPoolIndexL(void) const + ?FindByName@CXnDomList@@QAEPAVMXnDomListItem@@ABVTDesC8@@@Z @ 34 NONAME ; class MXnDomListItem * CXnDomList::FindByName(class TDesC8 const &) + ?First@CXnDomList@@QAEPAVMXnDomListItem@@XZ @ 35 NONAME ; class MXnDomListItem * CXnDomList::First(void) + ?ValueStringPoolIndex@CXnDomAttribute@@QBEFXZ @ 36 NONAME ; short CXnDomAttribute::ValueStringPoolIndex(void) const + ?NewL@CXnDomDocument@@SAPAV1@PBVHBufC8@@@Z @ 37 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(class HBufC8 const *) + ?DeleteChild@CXnDomNode@@QAEXPAV1@@Z @ 38 NONAME ; void CXnDomNode::DeleteChild(class CXnDomNode *) + ?NewL@CXnDomPropertyValue@@SAPAV1@PAVCXnDomStringPool@@@Z @ 39 NONAME ; class CXnDomPropertyValue * CXnDomPropertyValue::NewL(class CXnDomStringPool *) + ?AddChildL@CXnDomNode@@QAEXPAV1@@Z @ 40 NONAME ; void CXnDomNode::AddChildL(class CXnDomNode *) + ?SwapStringPoolL@CXnDomAttribute@@QAEXPAVCXnDomStringPool@@@Z @ 41 NONAME ; void CXnDomAttribute::SwapStringPoolL(class CXnDomStringPool *) + ?ChildNodes@CXnDomNode@@QAEAAVCXnDomList@@XZ @ 42 NONAME ; class CXnDomList & CXnDomNode::ChildNodes(void) + ?NodeId@CXnDomNode@@QBEHXZ @ 43 NONAME ; int CXnDomNode::NodeId(void) const + ?IsNoneIdent@CXnDomPropertyValue@@QAEHXZ @ 44 NONAME ; int CXnDomPropertyValue::IsNoneIdent(void) + ?NewL@CXnDomProperty@@SAPAV1@ABVTDesC8@@PAVCXnDomStringPool@@@Z @ 45 NONAME ; class CXnDomProperty * CXnDomProperty::NewL(class TDesC8 const &, class CXnDomStringPool *) + ?ItemIndex@CXnDomNode@@QBEHABVMXnDomListItem@@@Z @ 46 NONAME ; int CXnDomNode::ItemIndex(class MXnDomListItem const &) const + ?Item@CXnDomList@@QBEPAVMXnDomListItem@@H@Z @ 47 NONAME ; class MXnDomListItem * CXnDomList::Item(int) const + ?ExternalizeL@CXnDomDocument@@QBEXAAVRWriteStream@@@Z @ 48 NONAME ; void CXnDomDocument::ExternalizeL(class RWriteStream &) const + ?SetNamespaceL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 49 NONAME ; void CXnDomNode::SetNamespaceL(class TDesC8 const &) + ?CloneL@CXnDomPropertyValue@@QAEPAV1@XZ @ 50 NONAME ; class CXnDomPropertyValue * CXnDomPropertyValue::CloneL(void) + ?ContentType@CXnDomNode@@QAEABW4TContentType@@XZ @ 51 NONAME ; enum TContentType const & CXnDomNode::ContentType(void) + ?DeleteItem@CXnDomList@@QAEXPAVMXnDomListItem@@@Z @ 52 NONAME ; void CXnDomList::DeleteItem(class MXnDomListItem *) + ?PCData@CXnDomNode@@QAEABVTDesC8@@XZ @ 53 NONAME ; class TDesC8 const & CXnDomNode::PCData(void) + ?Reset@CXnDomList@@QAEXXZ @ 54 NONAME ; void CXnDomList::Reset(void) + ?SwapStringPoolL@CXnDomPropertyValue@@QAEXPAVCXnDomStringPool@@@Z @ 55 NONAME ; void CXnDomPropertyValue::SwapStringPoolL(class CXnDomStringPool *) + ?PropertyList@CXnDomNode@@QAEAAVCXnDomList@@XZ @ 56 NONAME ; class CXnDomList & CXnDomNode::PropertyList(void) + ?CloneL@CXnDomAttribute@@QAEPAV1@XZ @ 57 NONAME ; class CXnDomAttribute * CXnDomAttribute::CloneL(void) + ?RootNode@CXnDomDocument@@QBEPAVCXnDomNode@@XZ @ 58 NONAME ; class CXnDomNode * CXnDomDocument::RootNode(void) const + ??1CXnDomPropertyValue@@UAE@XZ @ 59 NONAME ; CXnDomPropertyValue::~CXnDomPropertyValue(void) + ?SetLayoutNode@CXnDomNode@@QAEXPAVCXnNode@@@Z @ 60 NONAME ; void CXnDomNode::SetLayoutNode(class CXnNode *) + ?PropertyValueList@CXnDomProperty@@QAEAAVCXnDomList@@XZ @ 61 NONAME ; class CXnDomList & CXnDomProperty::PropertyValueList(void) + ??1CXnDomDocument@@UAE@XZ @ 62 NONAME ; CXnDomDocument::~CXnDomDocument(void) + ?StringPool@CXnDomDocument@@QBEPAVCXnDomStringPool@@XZ @ 63 NONAME ; class CXnDomStringPool * CXnDomDocument::StringPool(void) const + ?DeleteItem@CXnDomList@@QAEXH@Z @ 64 NONAME ; void CXnDomList::DeleteItem(int) + ?NewL@CXnDomDepthIterator@@SAPAV1@AAVCXnDomNode@@@Z @ 65 NONAME ; class CXnDomDepthIterator * CXnDomDepthIterator::NewL(class CXnDomNode &) + ?RemoveItem@CXnDomList@@QAEXH@Z @ 66 NONAME ; void CXnDomList::RemoveItem(int) + ?CloneL@CXnDomDocument@@QAEPAV1@XZ @ 67 NONAME ; class CXnDomDocument * CXnDomDocument::CloneL(void) + ?NameStringPoolIndex@CXnDomAttribute@@QBEFXZ @ 68 NONAME ; short CXnDomAttribute::NameStringPoolIndex(void) const + ?PrimitiveValueType@CXnDomPropertyValue@@QBE?AW4TPrimitiveValueType@1@XZ @ 69 NONAME ; enum CXnDomPropertyValue::TPrimitiveValueType CXnDomPropertyValue::PrimitiveValueType(void) const + ?StringPool@CXnDomNode@@QBEPAVCXnDomStringPool@@XZ @ 70 NONAME ; class CXnDomStringPool * CXnDomNode::StringPool(void) const + ?SetInherited@CXnDomProperty@@QAEXH@Z @ 71 NONAME ; void CXnDomProperty::SetInherited(int) + ?SetRgbColorL@CXnDomPropertyValue@@QAEXABVTRgb@@@Z @ 72 NONAME ; void CXnDomPropertyValue::SetRgbColorL(class TRgb const &) + ?AttributeValue@CXnDomNode@@QBEABVTDesC8@@ABV2@@Z @ 73 NONAME ; class TDesC8 const & CXnDomNode::AttributeValue(class TDesC8 const &) const + ?SetRootNode@CXnDomDocument@@QAEXPAVCXnDomNode@@@Z @ 74 NONAME ; void CXnDomDocument::SetRootNode(class CXnDomNode *) + ?DeleteAttributeList@CXnDomNode@@QAEXXZ @ 75 NONAME ; void CXnDomNode::DeleteAttributeList(void) + ?Inherited@CXnDomProperty@@QAEHXZ @ 76 NONAME ; int CXnDomProperty::Inherited(void) + ?NewL@CXnDomDocument@@SAPAV1@XZ @ 77 NONAME ; class CXnDomDocument * CXnDomDocument::NewL(void) + ?SetValueL@CXnDomAttribute@@QAEXABVTDesC8@@@Z @ 78 NONAME ; void CXnDomAttribute::SetValueL(class TDesC8 const &) + ?AddItemL@CXnDomList@@QAEXPAVMXnDomListItem@@H@Z @ 79 NONAME ; void CXnDomList::AddItemL(class MXnDomListItem *, int) + ?Namespace@CXnDomNode@@QAEABVTDesC8@@XZ @ 80 NONAME ; class TDesC8 const & CXnDomNode::Namespace(void) + ?NewL@CXnDomAttribute@@SAPAV1@ABVTDesC8@@PAVCXnDomStringPool@@@Z @ 81 NONAME ; class CXnDomAttribute * CXnDomAttribute::NewL(class TDesC8 const &, class CXnDomStringPool *) + ?NewL@CXnDomProperty@@SAPAV1@FPAVCXnDomStringPool@@@Z @ 82 NONAME ; class CXnDomProperty * CXnDomProperty::NewL(short, class CXnDomStringPool *) + ?ReadL@CXnDomDocument@@QAEPAVCXnDomNode@@AAVRReadStream@@@Z @ 83 NONAME ; class CXnDomNode * CXnDomDocument::ReadL(class RReadStream &) + ?SwapStringPoolL@CXnDomProperty@@QAEXPAVCXnDomStringPool@@@Z @ 84 NONAME ; void CXnDomProperty::SwapStringPoolL(class CXnDomStringPool *) + ?SetNodeId@CXnDomNode@@QAEXH@Z @ 85 NONAME ; void CXnDomNode::SetNodeId(int) + ?PseudoClass@CXnDomProperty@@QBE?AW4TPseudoClass@1@XZ @ 86 NONAME ; enum CXnDomProperty::TPseudoClass CXnDomProperty::PseudoClass(void) const ?SetStringValueL@CXnDomPropertyValue@@QAEXW4TPrimitiveValueType@1@ABVTDesC8@@@Z @ 87 NONAME ; void CXnDomPropertyValue::SetStringValueL(enum CXnDomPropertyValue::TPrimitiveValueType, class TDesC8 const &) ?SetFloatValueL@CXnDomPropertyValue@@QAEXW4TPrimitiveValueType@1@N@Z @ 88 NONAME ; void CXnDomPropertyValue::SetFloatValueL(enum CXnDomPropertyValue::TPrimitiveValueType, double) ?Name@CXnDomNode@@UAEABVTDesC8@@XZ @ 89 NONAME ; class TDesC8 const & CXnDomNode::Name(void) @@ -92,18 +92,17 @@ ?First@CXnDomDepthIterator@@UAEPAVCXnDomNode@@XZ @ 91 NONAME ; class CXnDomNode * CXnDomDepthIterator::First(void) ?Name@CXnDomProperty@@UAEABVTDesC8@@XZ @ 92 NONAME ; class TDesC8 const & CXnDomProperty::Name(void) ?NextL@CXnDomDepthIterator@@UAEPAVCXnDomNode@@XZ @ 93 NONAME ; class CXnDomNode * CXnDomDepthIterator::NextL(void) - ?NewL@CXnDomPropertyValue@@SAPAV1@AAVCXnDomStringPool@@@Z @ 94 NONAME ; class CXnDomPropertyValue * CXnDomPropertyValue::NewL(class CXnDomStringPool &) - ?StringPoolIndex@CXnDomProperty@@QBEFXZ @ 95 NONAME ; short CXnDomProperty::StringPoolIndex(void) const - ?CreateElementNSL@CXnDomDocument@@QAEPAVCXnDomNode@@ABVTDesC8@@0@Z @ 96 NONAME ; class CXnDomNode * CXnDomDocument::CreateElementNSL(class TDesC8 const &, class TDesC8 const &) - ?CloneL@CXnDomNode@@QAEPAV1@AAVCXnDomStringPool@@@Z @ 97 NONAME ; class CXnDomNode * CXnDomNode::CloneL(class CXnDomStringPool &) - ?SetStringPoolIndexL@CXnDomPropertyValue@@QAEXW4TPrimitiveValueType@1@F@Z @ 98 NONAME ; void CXnDomPropertyValue::SetStringPoolIndexL(enum CXnDomPropertyValue::TPrimitiveValueType, short) + ?StringPoolIndex@CXnDomProperty@@QBEFXZ @ 94 NONAME ; short CXnDomProperty::StringPoolIndex(void) const + ?CreateElementNSL@CXnDomDocument@@QAEPAVCXnDomNode@@ABVTDesC8@@0@Z @ 95 NONAME ; class CXnDomNode * CXnDomDocument::CreateElementNSL(class TDesC8 const &, class TDesC8 const &) + ?CloneL@CXnDomNode@@QAEPAV1@AAVCXnDomStringPool@@@Z @ 96 NONAME ; class CXnDomNode * CXnDomNode::CloneL(class CXnDomStringPool &) + ?SetStringPoolIndexL@CXnDomPropertyValue@@QAEXW4TPrimitiveValueType@1@F@Z @ 97 NONAME ; void CXnDomPropertyValue::SetStringPoolIndexL(enum CXnDomPropertyValue::TPrimitiveValueType, short) + ?StringPool@CXnDomProperty@@QBEPAVCXnDomStringPool@@XZ @ 98 NONAME ; class CXnDomStringPool * CXnDomProperty::StringPool(void) const ?SetParent@CXnDomNode@@QAEXPAV1@@Z @ 99 NONAME ; void CXnDomNode::SetParent(class CXnDomNode *) ?DomNodeCount@CXnDomDocument@@QBEHXZ @ 100 NONAME ; int CXnDomDocument::DomNodeCount(void) const ?CloneL@CXnDomProperty@@QAEPAV1@AAVCXnDomStringPool@@@Z @ 101 NONAME ; class CXnDomProperty * CXnDomProperty::CloneL(class CXnDomStringPool &) - ?Size@CXnDomDocument@@QBEHXZ @ 102 NONAME ; int CXnDomDocument::Size(void) const - ?NewL@CXnDomProperty@@SAPAV1@ABVTDesC8@@AAVCXnDomStringPool@@@Z @ 103 NONAME ; class CXnDomProperty * CXnDomProperty::NewL(class TDesC8 const &, class CXnDomStringPool &) - ??1CXnDomProperty@@UAE@XZ @ 104 NONAME ; CXnDomProperty::~CXnDomProperty(void) - ?LastNode@CXnDomDocument@@QBEPAVCXnDomNode@@XZ @ 105 NONAME ; class CXnDomNode * CXnDomDocument::LastNode(void) const - ?SetOwnershipL@CXnDomNode@@QAEXABVTDesC8@@@Z @ 106 NONAME ; void CXnDomNode::SetOwnershipL(class TDesC8 const &) - ?ReadL@CXnDomDocument@@QAEPAVCXnDomNode@@AAVRReadStream@@@Z @ 107 NONAME ; class CXnDomNode * CXnDomDocument::ReadL(class RReadStream &) + ?SwapStringPoolL@CXnDomNode@@QAEXPAVCXnDomStringPool@@@Z @ 102 NONAME ; void CXnDomNode::SwapStringPoolL(class CXnDomStringPool *) + ?Size@CXnDomDocument@@QBEHXZ @ 103 NONAME ; int CXnDomDocument::Size(void) const + ?StringPool@CXnDomList@@QBEPAVCXnDomStringPool@@XZ @ 104 NONAME ; class CXnDomStringPool * CXnDomList::StringPool(void) const + ??1CXnDomProperty@@UAE@XZ @ 105 NONAME ; CXnDomProperty::~CXnDomProperty(void) + ?LastNode@CXnDomDocument@@QBEPAVCXnDomNode@@XZ @ 106 NONAME ; class CXnDomNode * CXnDomDocument::LastNode(void) const diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/eabi/xn3domdocumentu.def --- a/idlehomescreen/xmluirendering/dom/eabi/xn3domdocumentu.def Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/eabi/xn3domdocumentu.def Mon Jan 18 20:10:36 2010 +0200 @@ -4,15 +4,15 @@ _ZN10CXnDomList10FindByNameERK6TDesC8 @ 3 NONAME _ZN10CXnDomList10RemoveItemEP14MXnDomListItem @ 4 NONAME _ZN10CXnDomList10RemoveItemEi @ 5 NONAME - _ZN10CXnDomList4LastEv @ 6 NONAME - _ZN10CXnDomList5FirstEv @ 7 NONAME - _ZN10CXnDomList5ResetEv @ 8 NONAME - _ZN10CXnDomList8AddItemLEP14MXnDomListItem @ 9 NONAME - _ZN10CXnDomList8AddItemLEP14MXnDomListItemi @ 10 NONAME - _ZN10CXnDomNode10ChildNodesEv @ 11 NONAME - _ZN10CXnDomNode10LayoutNodeEv @ 12 NONAME - _ZN10CXnDomNode10SetPCDataLERK6TDesC8 @ 13 NONAME - _ZN10CXnDomNode10SetRefNodeEi @ 14 NONAME + _ZN10CXnDomList15SwapStringPoolLEP16CXnDomStringPool @ 6 NONAME + _ZN10CXnDomList4LastEv @ 7 NONAME + _ZN10CXnDomList5FirstEv @ 8 NONAME + _ZN10CXnDomList5ResetEv @ 9 NONAME + _ZN10CXnDomList8AddItemLEP14MXnDomListItem @ 10 NONAME + _ZN10CXnDomList8AddItemLEP14MXnDomListItemi @ 11 NONAME + _ZN10CXnDomNode10ChildNodesEv @ 12 NONAME + _ZN10CXnDomNode10LayoutNodeEv @ 13 NONAME + _ZN10CXnDomNode10SetPCDataLERK6TDesC8 @ 14 NONAME _ZN10CXnDomNode11ContentTypeEv @ 15 NONAME _ZN10CXnDomNode11DeleteChildEPS_ @ 16 NONAME _ZN10CXnDomNode12PropertyListEv @ 17 NONAME @@ -20,25 +20,25 @@ _ZN10CXnDomNode13ReplaceChildLEPS_S0_ @ 19 NONAME _ZN10CXnDomNode13SetLayoutNodeEP7CXnNode @ 20 NONAME _ZN10CXnDomNode13SetNamespaceLERK6TDesC8 @ 21 NONAME - _ZN10CXnDomNode14CreateRefNodeLEv @ 22 NONAME + _ZN10CXnDomNode13SetOwnershipLERK6TDesC8 @ 22 NONAME _ZN10CXnDomNode14SetContentTypeERK12TContentType @ 23 NONAME - _ZN10CXnDomNode17CloneWithoutKidsLER16CXnDomStringPool @ 24 NONAME + _ZN10CXnDomNode15SwapStringPoolLEP16CXnDomStringPool @ 24 NONAME _ZN10CXnDomNode19DeleteAttributeListEv @ 25 NONAME _ZN10CXnDomNode4NameEv @ 26 NONAME _ZN10CXnDomNode6CloneLER16CXnDomStringPool @ 27 NONAME - _ZN10CXnDomNode6CloneLER16CXnDomStringPoolRK6TDesC8 @ 28 NONAME - _ZN10CXnDomNode6PCDataEv @ 29 NONAME - _ZN10CXnDomNode9AddChildLEPS_ @ 30 NONAME - _ZN10CXnDomNode9AddChildLEPS_i @ 31 NONAME - _ZN10CXnDomNode9NamespaceEv @ 32 NONAME - _ZN10CXnDomNode9SetNodeIdEi @ 33 NONAME - _ZN10CXnDomNode9SetParentEPS_ @ 34 NONAME - _ZN14CXnDomDocument11SetRootNodeEP10CXnDomNode @ 35 NONAME - _ZN14CXnDomDocument12InternalizeLER11RReadStream @ 36 NONAME - _ZN14CXnDomDocument16CreateElementNSLERK6TDesC8S2_ @ 37 NONAME - _ZN14CXnDomDocument4NewLEPK6HBufC8 @ 38 NONAME - _ZN14CXnDomDocument4NewLER11RReadStream @ 39 NONAME - _ZN14CXnDomDocument4NewLEv @ 40 NONAME + _ZN10CXnDomNode6PCDataEv @ 28 NONAME + _ZN10CXnDomNode9AddChildLEPS_ @ 29 NONAME + _ZN10CXnDomNode9AddChildLEPS_i @ 30 NONAME + _ZN10CXnDomNode9NamespaceEv @ 31 NONAME + _ZN10CXnDomNode9SetNodeIdEi @ 32 NONAME + _ZN10CXnDomNode9SetParentEPS_ @ 33 NONAME + _ZN14CXnDomDocument11SetRootNodeEP10CXnDomNode @ 34 NONAME + _ZN14CXnDomDocument12InternalizeLER11RReadStream @ 35 NONAME + _ZN14CXnDomDocument16CreateElementNSLERK6TDesC8S2_ @ 36 NONAME + _ZN14CXnDomDocument4NewLEPK6HBufC8 @ 37 NONAME + _ZN14CXnDomDocument4NewLER11RReadStream @ 38 NONAME + _ZN14CXnDomDocument4NewLEv @ 39 NONAME + _ZN14CXnDomDocument5ReadLER11RReadStream @ 40 NONAME _ZN14CXnDomDocument6CloneLEv @ 41 NONAME _ZN14CXnDomDocument9MarshallLEv @ 42 NONAME _ZN14CXnDomDocumentD0Ev @ 43 NONAME @@ -47,102 +47,101 @@ _ZN14CXnDomProperty10IsValueSetEv @ 46 NONAME _ZN14CXnDomProperty12SetInheritedEi @ 47 NONAME _ZN14CXnDomProperty14SetPseudoClassENS_12TPseudoClassE @ 48 NONAME - _ZN14CXnDomProperty17PropertyValueListEv @ 49 NONAME - _ZN14CXnDomProperty4NameEv @ 50 NONAME - _ZN14CXnDomProperty4NewLERK6TDesC8R16CXnDomStringPool @ 51 NONAME - _ZN14CXnDomProperty4NewLEsR16CXnDomStringPool @ 52 NONAME - _ZN14CXnDomProperty6CloneLER16CXnDomStringPool @ 53 NONAME - _ZN14CXnDomProperty6CloneLEv @ 54 NONAME - _ZN14CXnDomProperty9InheritedEv @ 55 NONAME - _ZN14CXnDomPropertyD0Ev @ 56 NONAME - _ZN14CXnDomPropertyD1Ev @ 57 NONAME - _ZN14CXnDomPropertyD2Ev @ 58 NONAME - _ZN15CXnDomAttribute4NameEv @ 59 NONAME - _ZN15CXnDomAttribute4NewLERK6TDesC8R16CXnDomStringPool @ 60 NONAME - _ZN15CXnDomAttribute5ValueEv @ 61 NONAME - _ZN15CXnDomAttribute6CloneLEv @ 62 NONAME - _ZN15CXnDomAttribute9SetValueLERK6TDesC8 @ 63 NONAME - _ZN15CXnDomAttributeD0Ev @ 64 NONAME - _ZN15CXnDomAttributeD1Ev @ 65 NONAME - _ZN15CXnDomAttributeD2Ev @ 66 NONAME - _ZN16CXnDomStringPool10AddStringLERK6TDesC8 @ 67 NONAME - _ZN19CXnDomDepthIterator4NewLER10CXnDomNode @ 68 NONAME - _ZN19CXnDomDepthIterator5FirstEv @ 69 NONAME - _ZN19CXnDomDepthIterator5NextLEv @ 70 NONAME - _ZN19CXnDomDepthIteratorD0Ev @ 71 NONAME - _ZN19CXnDomDepthIteratorD1Ev @ 72 NONAME - _ZN19CXnDomDepthIteratorD2Ev @ 73 NONAME - _ZN19CXnDomPropertyValue11IsAutoIdentEv @ 74 NONAME - _ZN19CXnDomPropertyValue11IsNoneIdentEv @ 75 NONAME - _ZN19CXnDomPropertyValue11ReleaseDataEv @ 76 NONAME - _ZN19CXnDomPropertyValue11StringValueEv @ 77 NONAME - _ZN19CXnDomPropertyValue12SetRgbColorLERK4TRgb @ 78 NONAME - _ZN19CXnDomPropertyValue12StringValueLEv @ 79 NONAME - _ZN19CXnDomPropertyValue14IsInheritIdentEv @ 80 NONAME - _ZN19CXnDomPropertyValue14SetFloatValueLENS_19TPrimitiveValueTypeEd @ 81 NONAME - _ZN19CXnDomPropertyValue15SetStringValueLENS_19TPrimitiveValueTypeERK6TDesC8 @ 82 NONAME - _ZN19CXnDomPropertyValue19SetStringPoolIndexLENS_19TPrimitiveValueTypeEs @ 83 NONAME - _ZN19CXnDomPropertyValue4NewLER16CXnDomStringPool @ 84 NONAME - _ZN19CXnDomPropertyValue6CloneLEv @ 85 NONAME - _ZN19CXnDomPropertyValueD0Ev @ 86 NONAME - _ZN19CXnDomPropertyValueD1Ev @ 87 NONAME - _ZN19CXnDomPropertyValueD2Ev @ 88 NONAME - _ZNK10CXnDomList10StringPoolEv @ 89 NONAME - _ZNK10CXnDomList4ItemEi @ 90 NONAME - _ZNK10CXnDomList6LengthEv @ 91 NONAME - _ZNK10CXnDomList9ItemIndexERK14MXnDomListItem @ 92 NONAME - _ZNK10CXnDomNode10StringPoolEv @ 93 NONAME - _ZNK10CXnDomNode13AttributeListEv @ 94 NONAME - _ZNK10CXnDomNode14AttributeValueERK6TDesC8 @ 95 NONAME - _ZNK10CXnDomNode15DescendantCountEv @ 96 NONAME - _ZNK10CXnDomNode6NodeIdEv @ 97 NONAME - _ZNK10CXnDomNode6ParentEv @ 98 NONAME - _ZNK10CXnDomNode9IsRefNodeEv @ 99 NONAME - _ZNK10CXnDomNode9ItemIndexERK14MXnDomListItem @ 100 NONAME - _ZNK14CXnDomDocument10StringPoolEv @ 101 NONAME - _ZNK14CXnDomDocument12DomNodeCountEv @ 102 NONAME - _ZNK14CXnDomDocument12ExternalizeLER12RWriteStream @ 103 NONAME - _ZNK14CXnDomDocument4SizeEv @ 104 NONAME - _ZNK14CXnDomDocument8LastNodeEv @ 105 NONAME - _ZNK14CXnDomDocument8RootNodeEv @ 106 NONAME - _ZNK14CXnDomProperty10StringPoolEv @ 107 NONAME - _ZNK14CXnDomProperty11PseudoClassEv @ 108 NONAME - _ZNK14CXnDomProperty15StringPoolIndexEv @ 109 NONAME - _ZNK15CXnDomAttribute19NameStringPoolIndexEv @ 110 NONAME - _ZNK15CXnDomAttribute20ValueStringPoolIndexEv @ 111 NONAME - _ZNK19CXnDomPropertyValue11FloatValueLEv @ 112 NONAME - _ZNK19CXnDomPropertyValue14RgbColorValueLEv @ 113 NONAME - _ZNK19CXnDomPropertyValue16StringPoolIndexLEv @ 114 NONAME - _ZNK19CXnDomPropertyValue18PrimitiveValueTypeEv @ 115 NONAME - _ZTI10CXnDomList @ 116 NONAME ; ## - _ZTI10CXnDomNode @ 117 NONAME ; ## - _ZTI14CXnDomDocument @ 118 NONAME ; ## - _ZTI14CXnDomProperty @ 119 NONAME ; ## - _ZTI15CXnDomAttribute @ 120 NONAME ; ## - _ZTI16CXnDomStringPool @ 121 NONAME ; ## - _ZTI19CXnDomDepthIterator @ 122 NONAME ; ## - _ZTI19CXnDomPropertyValue @ 123 NONAME ; ## - _ZTV10CXnDomList @ 124 NONAME ; ## - _ZTV10CXnDomNode @ 125 NONAME ; ## - _ZTV14CXnDomDocument @ 126 NONAME ; ## - _ZTV14CXnDomProperty @ 127 NONAME ; ## - _ZTV15CXnDomAttribute @ 128 NONAME ; ## - _ZTV16CXnDomStringPool @ 129 NONAME ; ## - _ZTV19CXnDomDepthIterator @ 130 NONAME ; ## - _ZTV19CXnDomPropertyValue @ 131 NONAME ; ## - _ZThn4_N10CXnDomNode4NameEv @ 132 NONAME ; ## - _ZThn4_N14CXnDomProperty4NameEv @ 133 NONAME ; ## - _ZThn4_N14CXnDomPropertyD0Ev @ 134 NONAME ; ## - _ZThn4_N14CXnDomPropertyD1Ev @ 135 NONAME ; ## - _ZThn4_N15CXnDomAttribute4NameEv @ 136 NONAME ; ## - _ZThn4_N15CXnDomAttributeD0Ev @ 137 NONAME ; ## - _ZThn4_N15CXnDomAttributeD1Ev @ 138 NONAME ; ## - _ZThn4_N19CXnDomDepthIterator5FirstEv @ 139 NONAME ; ## - _ZThn4_N19CXnDomDepthIterator5NextLEv @ 140 NONAME ; ## - _ZThn4_N19CXnDomDepthIteratorD0Ev @ 141 NONAME ; ## - _ZThn4_N19CXnDomDepthIteratorD1Ev @ 142 NONAME ; ## - _ZThn4_N19CXnDomPropertyValueD0Ev @ 143 NONAME ; ## - _ZThn4_N19CXnDomPropertyValueD1Ev @ 144 NONAME ; ## - _ZN10CXnDomNode13SetOwnershipLERK6TDesC8 @ 145 NONAME - _ZN14CXnDomDocument5ReadLER11RReadStream @ 146 NONAME + _ZN14CXnDomProperty15SwapStringPoolLEP16CXnDomStringPool @ 49 NONAME + _ZN14CXnDomProperty17PropertyValueListEv @ 50 NONAME + _ZN14CXnDomProperty4NameEv @ 51 NONAME + _ZN14CXnDomProperty4NewLERK6TDesC8P16CXnDomStringPool @ 52 NONAME + _ZN14CXnDomProperty4NewLEsP16CXnDomStringPool @ 53 NONAME + _ZN14CXnDomProperty6CloneLER16CXnDomStringPool @ 54 NONAME + _ZN14CXnDomProperty6CloneLEv @ 55 NONAME + _ZN14CXnDomProperty9InheritedEv @ 56 NONAME + _ZN14CXnDomPropertyD0Ev @ 57 NONAME + _ZN14CXnDomPropertyD1Ev @ 58 NONAME + _ZN14CXnDomPropertyD2Ev @ 59 NONAME + _ZN15CXnDomAttribute15SwapStringPoolLEP16CXnDomStringPool @ 60 NONAME + _ZN15CXnDomAttribute4NameEv @ 61 NONAME + _ZN15CXnDomAttribute4NewLERK6TDesC8P16CXnDomStringPool @ 62 NONAME + _ZN15CXnDomAttribute5ValueEv @ 63 NONAME + _ZN15CXnDomAttribute6CloneLEv @ 64 NONAME + _ZN15CXnDomAttribute9SetValueLERK6TDesC8 @ 65 NONAME + _ZN15CXnDomAttributeD0Ev @ 66 NONAME + _ZN15CXnDomAttributeD1Ev @ 67 NONAME + _ZN15CXnDomAttributeD2Ev @ 68 NONAME + _ZN19CXnDomDepthIterator4NewLER10CXnDomNode @ 69 NONAME + _ZN19CXnDomDepthIterator5FirstEv @ 70 NONAME + _ZN19CXnDomDepthIterator5NextLEv @ 71 NONAME + _ZN19CXnDomDepthIteratorD0Ev @ 72 NONAME + _ZN19CXnDomDepthIteratorD1Ev @ 73 NONAME + _ZN19CXnDomDepthIteratorD2Ev @ 74 NONAME + _ZN19CXnDomPropertyValue11IsAutoIdentEv @ 75 NONAME + _ZN19CXnDomPropertyValue11IsNoneIdentEv @ 76 NONAME + _ZN19CXnDomPropertyValue11ReleaseDataEv @ 77 NONAME + _ZN19CXnDomPropertyValue11StringValueEv @ 78 NONAME + _ZN19CXnDomPropertyValue12SetRgbColorLERK4TRgb @ 79 NONAME + _ZN19CXnDomPropertyValue12StringValueLEv @ 80 NONAME + _ZN19CXnDomPropertyValue14IsInheritIdentEv @ 81 NONAME + _ZN19CXnDomPropertyValue14SetFloatValueLENS_19TPrimitiveValueTypeEd @ 82 NONAME + _ZN19CXnDomPropertyValue15SetStringValueLENS_19TPrimitiveValueTypeERK6TDesC8 @ 83 NONAME + _ZN19CXnDomPropertyValue15SwapStringPoolLEP16CXnDomStringPool @ 84 NONAME + _ZN19CXnDomPropertyValue19SetStringPoolIndexLENS_19TPrimitiveValueTypeEs @ 85 NONAME + _ZN19CXnDomPropertyValue4NewLEP16CXnDomStringPool @ 86 NONAME + _ZN19CXnDomPropertyValue6CloneLEv @ 87 NONAME + _ZN19CXnDomPropertyValueD0Ev @ 88 NONAME + _ZN19CXnDomPropertyValueD1Ev @ 89 NONAME + _ZN19CXnDomPropertyValueD2Ev @ 90 NONAME + _ZNK10CXnDomList10StringPoolEv @ 91 NONAME + _ZNK10CXnDomList4ItemEi @ 92 NONAME + _ZNK10CXnDomList6LengthEv @ 93 NONAME + _ZNK10CXnDomList9ItemIndexERK14MXnDomListItem @ 94 NONAME + _ZNK10CXnDomNode10StringPoolEv @ 95 NONAME + _ZNK10CXnDomNode13AttributeListEv @ 96 NONAME + _ZNK10CXnDomNode14AttributeValueERK6TDesC8 @ 97 NONAME + _ZNK10CXnDomNode15DescendantCountEv @ 98 NONAME + _ZNK10CXnDomNode6NodeIdEv @ 99 NONAME + _ZNK10CXnDomNode6ParentEv @ 100 NONAME + _ZNK10CXnDomNode9ItemIndexERK14MXnDomListItem @ 101 NONAME + _ZNK14CXnDomDocument10StringPoolEv @ 102 NONAME + _ZNK14CXnDomDocument12DomNodeCountEv @ 103 NONAME + _ZNK14CXnDomDocument12ExternalizeLER12RWriteStream @ 104 NONAME + _ZNK14CXnDomDocument4SizeEv @ 105 NONAME + _ZNK14CXnDomDocument8LastNodeEv @ 106 NONAME + _ZNK14CXnDomDocument8RootNodeEv @ 107 NONAME + _ZNK14CXnDomProperty10StringPoolEv @ 108 NONAME + _ZNK14CXnDomProperty11PseudoClassEv @ 109 NONAME + _ZNK14CXnDomProperty15StringPoolIndexEv @ 110 NONAME + _ZNK15CXnDomAttribute19NameStringPoolIndexEv @ 111 NONAME + _ZNK15CXnDomAttribute20ValueStringPoolIndexEv @ 112 NONAME + _ZNK19CXnDomPropertyValue11FloatValueLEv @ 113 NONAME + _ZNK19CXnDomPropertyValue14RgbColorValueLEv @ 114 NONAME + _ZNK19CXnDomPropertyValue16StringPoolIndexLEv @ 115 NONAME + _ZNK19CXnDomPropertyValue18PrimitiveValueTypeEv @ 116 NONAME + _ZTI10CXnDomList @ 117 NONAME + _ZTI10CXnDomNode @ 118 NONAME + _ZTI14CXnDomDocument @ 119 NONAME + _ZTI14CXnDomProperty @ 120 NONAME + _ZTI15CXnDomAttribute @ 121 NONAME + _ZTI16CXnDomStringPool @ 122 NONAME + _ZTI19CXnDomDepthIterator @ 123 NONAME + _ZTI19CXnDomPropertyValue @ 124 NONAME + _ZTV10CXnDomList @ 125 NONAME + _ZTV10CXnDomNode @ 126 NONAME + _ZTV14CXnDomDocument @ 127 NONAME + _ZTV14CXnDomProperty @ 128 NONAME + _ZTV15CXnDomAttribute @ 129 NONAME + _ZTV16CXnDomStringPool @ 130 NONAME + _ZTV19CXnDomDepthIterator @ 131 NONAME + _ZTV19CXnDomPropertyValue @ 132 NONAME + _ZThn4_N10CXnDomNode4NameEv @ 133 NONAME + _ZThn4_N14CXnDomProperty4NameEv @ 134 NONAME + _ZThn4_N14CXnDomPropertyD0Ev @ 135 NONAME + _ZThn4_N14CXnDomPropertyD1Ev @ 136 NONAME + _ZThn4_N15CXnDomAttribute4NameEv @ 137 NONAME + _ZThn4_N15CXnDomAttributeD0Ev @ 138 NONAME + _ZThn4_N15CXnDomAttributeD1Ev @ 139 NONAME + _ZThn4_N19CXnDomDepthIterator5FirstEv @ 140 NONAME + _ZThn4_N19CXnDomDepthIterator5NextLEv @ 141 NONAME + _ZThn4_N19CXnDomDepthIteratorD0Ev @ 142 NONAME + _ZThn4_N19CXnDomDepthIteratorD1Ev @ 143 NONAME + _ZThn4_N19CXnDomPropertyValueD0Ev @ 144 NONAME + _ZThn4_N19CXnDomPropertyValueD1Ev @ 145 NONAME diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/group/xndomdocument.mmp --- a/idlehomescreen/xmluirendering/dom/group/xndomdocument.mmp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/group/xndomdocument.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -34,6 +34,7 @@ SOURCE xndomlist.cpp SOURCE xndomdepthiterator.cpp SOURCE xndomstringpool.cpp +SOURCE xndomstringpooloptimizer.cpp USERINCLUDE . USERINCLUDE ../inc diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/src/xndomattribute.cpp --- a/idlehomescreen/xmluirendering/dom/src/xndomattribute.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/src/xndomattribute.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -28,7 +28,7 @@ // might leave. // ----------------------------------------------------------------------------- // -CXnDomAttribute::CXnDomAttribute( CXnDomStringPool& aStringPool ): +CXnDomAttribute::CXnDomAttribute( CXnDomStringPool* aStringPool ): iStringPool( aStringPool ), iNameRef( KErrNotFound ), iValueRef( KErrNotFound ) @@ -43,7 +43,7 @@ // void CXnDomAttribute::ConstructL( const TDesC8& aName ) { - iNameRef = iStringPool.AddStringL( aName ); + iNameRef = iStringPool->AddStringL( aName ); } // ----------------------------------------------------------------------------- // CXnDomAttribute::NewL @@ -52,7 +52,7 @@ // EXPORT_C CXnDomAttribute* CXnDomAttribute::NewL( const TDesC8& aName, - CXnDomStringPool& aStringPool ) + CXnDomStringPool* aStringPool ) { CXnDomAttribute* self = new( ELeave ) CXnDomAttribute( aStringPool ); @@ -71,7 +71,7 @@ // CXnDomAttribute* CXnDomAttribute::NewL( RReadStream& aStream, - CXnDomStringPool& aStringPool ) + CXnDomStringPool* aStringPool ) { CXnDomAttribute* self = new( ELeave ) CXnDomAttribute( aStringPool ); CleanupStack::PushL( self ); @@ -108,13 +108,13 @@ // CXnDomAttribute* CXnDomAttribute::CloneL( CXnDomStringPool& aStringPool ) { - const TDesC8& name = iStringPool.String( iNameRef ); + const TDesC8& name = iStringPool->String( iNameRef ); - CXnDomAttribute* clone = CXnDomAttribute::NewL( name, aStringPool ); + CXnDomAttribute* clone = CXnDomAttribute::NewL( name, &aStringPool ); CleanupStack::PushL( clone ); if ( iValueRef > KErrNotFound ) { - const TDesC8& value = iStringPool.String( iValueRef ); + const TDesC8& value = iStringPool->String( iValueRef ); clone->SetValueL( value ); } CleanupStack::Pop( clone ); @@ -128,7 +128,7 @@ // EXPORT_C const TDesC8& CXnDomAttribute::Name() { - return iStringPool.String( iNameRef ); + return iStringPool->String( iNameRef ); } // ----------------------------------------------------------------------------- @@ -147,7 +147,7 @@ { if ( iValueRef > KErrNotFound ) { - return iStringPool.String( iValueRef ); + return iStringPool->String( iValueRef ); } return KNullDesC8; } @@ -160,15 +160,32 @@ { return iValueRef; } + // ----------------------------------------------------------------------------- // CXnDomAttribute::SetValueL // ----------------------------------------------------------------------------- // EXPORT_C void CXnDomAttribute::SetValueL( const TDesC8& aValue ) { - iValueRef = iStringPool.AddStringL( aValue ); + iValueRef = iStringPool->AddStringL( aValue ); } +// ----------------------------------------------------------------------------- +// CXnDomAttribute::SwapStringPoolL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomAttribute::SwapStringPoolL( CXnDomStringPool* aStringPool ) + { + if( !aStringPool ) + { + User::Leave( KErrArgument ); + } + + iNameRef = aStringPool->AddStringL( iStringPool->String( iNameRef ) ); + iValueRef = aStringPool->AddStringL( iStringPool->String( iValueRef ) ); + + iStringPool = aStringPool; + } // ----------------------------------------------------------------------------- // CXnDomAttribute::Size @@ -201,7 +218,7 @@ // void CXnDomAttribute::InternalizeL( RReadStream& aStream ) { - iNameRef = aStream.ReadInt16L() + iStringPool.Offset(); - iValueRef = aStream.ReadInt16L() + iStringPool.Offset(); + iNameRef = aStream.ReadInt16L(); + iValueRef = aStream.ReadInt16L(); } // End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/src/xndomdocument.cpp --- a/idlehomescreen/xmluirendering/dom/src/xndomdocument.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/src/xndomdocument.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -53,7 +53,7 @@ const TDesC8& aName, const TDesC8& aNamespace ) { - return CXnDomNode::NewL( aName, aNamespace, *iDomStringPool ); + return CXnDomNode::NewL( aName, aNamespace, iDomStringPool ); } // ----------------------------------------------------------------------------- // CXnDomDocument::CXnDomDocument @@ -73,6 +73,9 @@ void CXnDomDocument::ConstructL() { iDomStringPool = CXnDomStringPool::NewL(); + // Add KNullDesC8 to string pool index 0 for safety reasons. + // Some components use 0 as initial value for their string references. + iDomStringPool->AddStringL( KNullDesC8 ); } // ----------------------------------------------------------------------------- @@ -191,7 +194,7 @@ TBool rootNodeExist( aStream.ReadInt8L() ); if ( rootNodeExist ) { - iRootNode = CXnDomNode::NewL( aStream, *iDomStringPool ); + iRootNode = CXnDomNode::NewL( aStream, iDomStringPool ); } } @@ -273,9 +276,9 @@ // CXnDomDocument::StringPool // ----------------------------------------------------------------------------- // -EXPORT_C CXnDomStringPool& CXnDomDocument::StringPool() const +EXPORT_C CXnDomStringPool* CXnDomDocument::StringPool() const { - return *iDomStringPool; + return iDomStringPool; } // ----------------------------------------------------------------------------- @@ -285,16 +288,25 @@ // EXPORT_C CXnDomNode* CXnDomDocument::ReadL( RReadStream& aStream ) - { - CXnDomNode* rootNode = NULL; + { + CXnDomStringPool* localStringPool = CXnDomStringPool::NewL( ETrue ); + CleanupStack::PushL( localStringPool ); + aStream >> *localStringPool; - aStream >> *iDomStringPool; + iDomStringPool->AddAllL( *localStringPool ); + + CXnDomNode* rootNode = NULL; TBool rootNodeExist( aStream.ReadInt8L() ); if ( rootNodeExist ) { - rootNode = CXnDomNode::NewL( aStream, *iDomStringPool ); + rootNode = CXnDomNode::NewL( aStream, localStringPool ); + CleanupStack::PushL( rootNode ); + rootNode->SwapStringPoolL( iDomStringPool ); + CleanupStack::Pop( rootNode ); } + + CleanupStack::PopAndDestroy( localStringPool ); return rootNode; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/src/xndomlist.cpp --- a/idlehomescreen/xmluirendering/dom/src/xndomlist.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/src/xndomlist.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -37,7 +37,7 @@ // CXnDomList::CXnDomList( TListType aListType, - CXnDomStringPool& aStringPool, + CXnDomStringPool* aStringPool, TInt aGranularity ): iListType( aListType ), iList( aGranularity ), @@ -61,7 +61,7 @@ // CXnDomList* CXnDomList::NewL( TListType aListType, - CXnDomStringPool& aStringPool, + CXnDomStringPool* aStringPool, TInt aGranularity) { CXnDomList* self = @@ -80,7 +80,7 @@ // CXnDomList* CXnDomList::NewL( RReadStream& aStream, - CXnDomStringPool& aStringPool ) + CXnDomStringPool* aStringPool ) { CXnDomList* self = new( ELeave ) CXnDomList( ENodeList, aStringPool ); @@ -290,11 +290,25 @@ // CXnDomList::StringPool // ----------------------------------------------------------------------------- // -EXPORT_C CXnDomStringPool& CXnDomList::StringPool() const +EXPORT_C CXnDomStringPool* CXnDomList::StringPool() const { return iStringPool; } + +// ----------------------------------------------------------------------------- +// CXnDomAttribute::SwapStringPoolL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomList::SwapStringPoolL( CXnDomStringPool* aStringPool ) + { + if( !aStringPool ) + { + User::Leave( KErrArgument ); + } + iStringPool = aStringPool; + } + // ----------------------------------------------------------------------------- // CXnDomList::Size // ----------------------------------------------------------------------------- diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/src/xndomnode.cpp --- a/idlehomescreen/xmluirendering/dom/src/xndomnode.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/src/xndomnode.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -24,8 +24,6 @@ // LOCAL CONSTANTS AND MACROS const TInt KNotDefined = -1; -_LIT8( KIdAttr, "id" ); -_LIT8( KRefAttr, "ref" ); const TInt KPropertyListGranularity = 8; // ============================ MEMBER FUNCTIONS =============================== @@ -35,8 +33,11 @@ // might leave. // ----------------------------------------------------------------------------- // -CXnDomNode::CXnDomNode(CXnDomStringPool& aStringPool) : - iStringPool(aStringPool), iNodeId(KNotDefined) +CXnDomNode::CXnDomNode(CXnDomStringPool* aStringPool) : + iNameRef( KNotDefined ), + iNSRef( KNotDefined ), + iStringPool( aStringPool ), + iNodeId( KNotDefined ) { } @@ -47,8 +48,8 @@ // void CXnDomNode::ConstructL(const TDesC8& aName, const TDesC8& aNS) { - iNameRef = iStringPool.AddStringL(aName); - iNSRef = iStringPool.AddStringL(aNS); + iNameRef = iStringPool->AddStringL(aName); + iNSRef = iStringPool->AddStringL(aNS); iChildList = CXnDomList::NewL(CXnDomList::ENodeList, iStringPool); iAttributeList @@ -64,7 +65,7 @@ // ----------------------------------------------------------------------------- // CXnDomNode* CXnDomNode::NewL(const TDesC8& aName, const TDesC8& aNS, - CXnDomStringPool& aStringPool) + CXnDomStringPool* aStringPool) { CXnDomNode* self = new (ELeave) CXnDomNode(aStringPool); @@ -81,7 +82,7 @@ // ----------------------------------------------------------------------------- // CXnDomNode* CXnDomNode::NewL(RReadStream& aStream, - CXnDomStringPool& aStringPool) + CXnDomStringPool* aStringPool) { CXnDomNode* self = new (ELeave) CXnDomNode(aStringPool); @@ -103,24 +104,23 @@ delete iPCData; } -// ----------------------------------------------------------------------------- +// --------------------------------------------------------------------- // CXnDomNode::CloneL // Clones this node and it's child nodes. This is a recursive function. // ----------------------------------------------------------------------------- // EXPORT_C CXnDomNode* CXnDomNode::CloneL(CXnDomStringPool& aStringPool) { - const TDesC8& name = iStringPool.String(iNameRef); - const TDesC8& ns = iStringPool.String(iNSRef); + const TDesC8& name = iStringPool->String(iNameRef); + const TDesC8& ns = iStringPool->String(iNSRef); - CXnDomNode* clone = CXnDomNode::NewL(name, ns, aStringPool); + CXnDomNode* clone = CXnDomNode::NewL(name, ns, &aStringPool); CleanupStack::PushL(clone); if (iPCData) { clone->AppendPCDataL(*iPCData); } clone->iNodeId = iNodeId; - clone->iRefNode = iRefNode; TInt childCount(iChildList->Length()); @@ -163,118 +163,19 @@ } // ----------------------------------------------------------------------------- -// CXnDomNode::CloneWithoutKidsL -// Clones only this node. This is a recursive function. -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnDomNode* CXnDomNode::CloneWithoutKidsL( - CXnDomStringPool& aStringPool) - { - const TDesC8& name = iStringPool.String(iNameRef); - const TDesC8& ns = iStringPool.String(iNSRef); - - CXnDomNode* clone = CXnDomNode::NewL(name, ns, aStringPool); - CleanupStack::PushL(clone); - if (iPCData) - { - clone->AppendPCDataL(*iPCData); - } - clone->iNodeId = iNodeId; - clone->iRefNode = iRefNode; - - TInt attrCount(iAttributeList->Length()); - for (TInt j = 0; j < attrCount; j++) - { - CXnDomAttribute - * attrClone = - static_cast (iAttributeList->Item(j))->CloneL( - aStringPool); - CleanupStack::PushL(attrClone); - clone->iAttributeList->AddItemL(attrClone); - CleanupStack::Pop(attrClone); - } - - TInt propertyCount(iPropertyList->Length()); - for (TInt k = 0; k < propertyCount; k++) - { - CXnDomProperty - * propClone = - static_cast (iPropertyList->Item(k))->CloneL( - aStringPool); - CleanupStack::PushL(propClone); - clone->iPropertyList->AddItemL(propClone); - CleanupStack::Pop(propClone); - } - CleanupStack::Pop(clone); - return clone; - } - -// ----------------------------------------------------------------------------- -// CXnDomNode::CreateRefNodeL -// Recursive function to create referer nodes. -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnDomNode* CXnDomNode::CreateRefNodeL() - { - const TDesC8& name = iStringPool.String(iNameRef); - const TDesC8& ns = iStringPool.String(iNSRef); - - CXnDomNode* ref = CXnDomNode::NewL(name, ns, iStringPool); - CleanupStack::PushL(ref); - - ref->iRefNode = ETrue; - - TInt childCount(iChildList->Length()); - - for (TInt i = 0; i < childCount; i++) - { - CXnDomNode - * childRef = - static_cast (iChildList->Item(i))->CreateRefNodeL(); - CleanupStack::PushL(childRef); - childRef->iParentNode = ref; - ref->iChildList->AddItemL(childRef); - CleanupStack::Pop(childRef); - } - - CXnDomAttribute* attr = NULL; - if (!iRefNode) - { - attr = static_cast (iAttributeList->FindByName( - KIdAttr)); - } - else - { - attr = static_cast (iAttributeList->FindByName( - KRefAttr)); - } - - if (attr) - { - CXnDomAttribute* newAttr = CXnDomAttribute::NewL(KRefAttr, - iStringPool); - CleanupStack::PushL(newAttr); - newAttr->SetValueL(attr->Value()); - ref->iAttributeList->AddItemL(newAttr); - CleanupStack::Pop(newAttr); - } - else - { - //referred node don't have an id or ref, thats not ok. - User::Leave(KErrArgument); - } - - CleanupStack::Pop(ref); - return ref; - } - -// ----------------------------------------------------------------------------- // CXnDomNode::Name // ----------------------------------------------------------------------------- // EXPORT_C const TDesC8& CXnDomNode::Name() { - return iStringPool.String(iNameRef); + if( iNameRef == KNotDefined ) + { + return KNullDesC8(); + } + else + { + return iStringPool->String( iNameRef ); + } } // ----------------------------------------------------------------------------- @@ -283,7 +184,14 @@ // EXPORT_C const TDesC8& CXnDomNode::Namespace() { - return iStringPool.String(iNSRef); + if( iNSRef == KNotDefined ) + { + return KNullDesC8(); + } + else + { + return iStringPool->String( iNSRef ); + } } // ----------------------------------------------------------------------------- @@ -469,29 +377,12 @@ // CXnDomNode::StringPool // ----------------------------------------------------------------------------- // -EXPORT_C CXnDomStringPool& CXnDomNode::StringPool() const +EXPORT_C CXnDomStringPool* CXnDomNode::StringPool() const { return iStringPool; } // ----------------------------------------------------------------------------- -// CXnDomNode::SetRefNode -// ----------------------------------------------------------------------------- -// -EXPORT_C void CXnDomNode::SetRefNode(TBool aRefNode) - { - iRefNode = aRefNode; - } - -// ----------------------------------------------------------------------------- -// CXnDomNode::IsRefNode -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CXnDomNode::IsRefNode() const - { - return iRefNode; - } -// ----------------------------------------------------------------------------- // CXnDomNode::Size // ----------------------------------------------------------------------------- // @@ -529,10 +420,9 @@ // void CXnDomNode::ExternalizeL(RWriteStream& aStream) const { - aStream.WriteInt16L(iNameRef); aStream.WriteInt16L(iNSRef); - aStream.WriteInt8L(iRefNode); + aStream.WriteInt8L( 0 ); // ref node legacy. if (iPCData) { @@ -555,11 +445,14 @@ // CXnDomNode::InternalizeL // ----------------------------------------------------------------------------- // -void CXnDomNode::InternalizeL(RReadStream& aStream) +void CXnDomNode::InternalizeL( RReadStream& aStream ) { - iNameRef = aStream.ReadInt16L() + iStringPool.Offset(); - iNSRef = aStream.ReadInt16L() + iStringPool.Offset(); - iRefNode = aStream.ReadInt8L(); + iNameRef = aStream.ReadInt16L(); + + iNSRef = KNotDefined; // This is set later by call to setnamespace, + aStream.ReadInt16L(); // so only consume legacy data from stream. + + aStream.ReadInt8L(); // Consume legacy ref node parameter. TInt len(0); TBool exist(aStream.ReadInt8L()); @@ -589,49 +482,6 @@ } iAttributeList = CXnDomList::NewL(aStream, iStringPool); - - iPropertyList = CXnDomList::NewL(aStream, iStringPool); - } - -// ----------------------------------------------------------------------------- -// CXnDomNode::ReadL -// ----------------------------------------------------------------------------- -// -void CXnDomNode::ReadL(RReadStream& aStream) - { - iNameRef = aStream.ReadInt16L(); - iNSRef = aStream.ReadInt16L(); - iRefNode = aStream.ReadInt8L(); - - TBool exist(aStream.ReadInt8L()); - if (exist) - { - TInt len(0); - len = aStream.ReadInt16L(); - delete iPCData; - iPCData = NULL; - iPCData = HBufC8::NewL(aStream, len); - } - - iNodeId = aStream.ReadInt32L(); - - iChildList = CXnDomList::NewL(aStream, iStringPool); - TInt count(iChildList->Length()); - for (TInt i = 0; i < count; i++) - { - CXnDomNode* node = static_cast (iChildList->Item(i)); - if (node) - { - node->SetParent(this); - } - else - { - User::Leave(KErrArgument); - } - } - - iAttributeList = CXnDomList::NewL(aStream, iStringPool); - iPropertyList = CXnDomList::NewL(aStream, iStringPool); } @@ -712,67 +562,7 @@ // EXPORT_C void CXnDomNode::SetNamespaceL(const TDesC8& aNS) { - iNSRef = iStringPool.AddStringL(aNS); - } - -// ----------------------------------------------------------------------------- -// CXnDomNode::CloneL -// Clones this node and it's child nodes and sets new namespace. This is a -// recursive function. -// ----------------------------------------------------------------------------- -// -EXPORT_C CXnDomNode* CXnDomNode::CloneL(CXnDomStringPool& aStringPool, - const TDesC8& aNS) - { - const TDesC8& name = iStringPool.String(iNameRef); - - CXnDomNode* clone = CXnDomNode::NewL(name, aNS, aStringPool); - CleanupStack::PushL(clone); - if (iPCData) - { - clone->AppendPCDataL(*iPCData); - } - clone->iNodeId = iNodeId; - clone->iRefNode = iRefNode; - - TInt childCount(iChildList->Length()); - - for (TInt i = 0; i < childCount; i++) - { - CXnDomNode* childClone = - static_cast (iChildList->Item(i))->CloneL( - aStringPool, aNS); - CleanupStack::PushL(childClone); - childClone->iParentNode = clone; - clone->iChildList->AddItemL(childClone); - CleanupStack::Pop(childClone); - } - - TInt attrCount(iAttributeList->Length()); - for (TInt j = 0; j < attrCount; j++) - { - CXnDomAttribute - * attrClone = - static_cast (iAttributeList->Item(j))->CloneL( - aStringPool); - CleanupStack::PushL(attrClone); - clone->iAttributeList->AddItemL(attrClone); - CleanupStack::Pop(attrClone); - } - - TInt propertyCount(iPropertyList->Length()); - for (TInt k = 0; k < propertyCount; k++) - { - CXnDomProperty - * propClone = - static_cast (iPropertyList->Item(k))->CloneL( - aStringPool); - CleanupStack::PushL(propClone); - clone->iPropertyList->AddItemL(propClone); - CleanupStack::Pop(propClone); - } - CleanupStack::Pop(clone); - return clone; + iNSRef = iStringPool->AddStringL(aNS); } // ----------------------------------------------------------------------------- @@ -793,4 +583,55 @@ } } +// ----------------------------------------------------------------------------- +// CXnDomNode::SwapStringPoolL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomNode::SwapStringPoolL( CXnDomStringPool* aStringPool ) + { + if( !aStringPool ) + { + User::Leave( KErrArgument ); + } + + if( iNameRef != KNotDefined ) + { + iNameRef = aStringPool->AddStringL( iStringPool->String( iNameRef ) ); + } + + if( iNSRef != KNotDefined ) + { + iNSRef = aStringPool->AddStringL( iStringPool->String( iNSRef ) ); + } + + iChildList->SwapStringPoolL( aStringPool ); + TInt count = iChildList->Length(); + for( TInt i = 0; i < count; i++ ) + { + CXnDomNode* obj = + static_cast ( iChildList->Item( i ) ); + obj->SwapStringPoolL( aStringPool ); + } + + iAttributeList->SwapStringPoolL( aStringPool ); + count = iAttributeList->Length(); + for( TInt i = 0; i < count; i++ ) + { + CXnDomAttribute* obj = + static_cast ( iAttributeList->Item( i ) ); + obj->SwapStringPoolL( aStringPool ); + } + + count = iPropertyList->Length(); + iPropertyList->SwapStringPoolL( aStringPool ); + for( TInt i = 0; i < count; i++ ) + { + CXnDomProperty* obj = + static_cast ( iPropertyList->Item( i ) ); + obj->SwapStringPoolL( aStringPool ); + } + + iStringPool = aStringPool; + } + // End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/src/xndomproperty.cpp --- a/idlehomescreen/xmluirendering/dom/src/xndomproperty.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/src/xndomproperty.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -30,7 +30,7 @@ // might leave. // ----------------------------------------------------------------------------- // -CXnDomProperty::CXnDomProperty( CXnDomStringPool& aStringPool ): +CXnDomProperty::CXnDomProperty( CXnDomStringPool* aStringPool ): iStringPool( aStringPool ) { } @@ -42,7 +42,7 @@ // CXnDomProperty::CXnDomProperty( TInt16 aStringPoolIndex, - CXnDomStringPool& aStringPool ): + CXnDomStringPool* aStringPool ): iStringPool( aStringPool ), iNameRef( aStringPoolIndex ) { @@ -54,7 +54,7 @@ // void CXnDomProperty::ConstructL( const TDesC8& aName ) { - iNameRef = iStringPool.AddStringL( aName ); + iNameRef = iStringPool->AddStringL( aName ); iPropValList = CXnDomList::NewL( CXnDomList::EPropertyValueList, iStringPool ); } // ----------------------------------------------------------------------------- @@ -73,7 +73,7 @@ // EXPORT_C CXnDomProperty* CXnDomProperty::NewL( const TDesC8& aName, - CXnDomStringPool& aStringPool ) + CXnDomStringPool* aStringPool ) { CXnDomProperty* self = new( ELeave ) CXnDomProperty( aStringPool ); @@ -91,7 +91,7 @@ // CXnDomProperty* CXnDomProperty::NewL( RReadStream& aStream, - CXnDomStringPool& aStringPool ) + CXnDomStringPool* aStringPool ) { CXnDomProperty* self = new( ELeave ) CXnDomProperty( aStringPool ); @@ -110,7 +110,7 @@ // EXPORT_C CXnDomProperty* CXnDomProperty::NewL( TInt16 aStringPoolIndex, - CXnDomStringPool& aStringPool ) + CXnDomStringPool* aStringPool ) { CXnDomProperty* self = new (ELeave) CXnDomProperty( aStringPoolIndex, aStringPool ); @@ -157,8 +157,8 @@ // EXPORT_C CXnDomProperty* CXnDomProperty::CloneL( CXnDomStringPool& aStringPool ) { - const TDesC8& name = iStringPool.String( iNameRef ); - CXnDomProperty* clone = CXnDomProperty::NewL( name, aStringPool ); + const TDesC8& name = iStringPool->String( iNameRef ); + CXnDomProperty* clone = CXnDomProperty::NewL( name, &aStringPool ); CleanupStack::PushL(clone); TInt count( iPropValList->Length() ); @@ -182,7 +182,7 @@ // EXPORT_C const TDesC8& CXnDomProperty::Name() { - return iStringPool.String( iNameRef ); + return iStringPool->String( iNameRef ); } // ----------------------------------------------------------------------------- @@ -225,7 +225,7 @@ // CXnDomProperty::StringPool // ----------------------------------------------------------------------------- // -EXPORT_C CXnDomStringPool& CXnDomProperty::StringPool() const +EXPORT_C CXnDomStringPool* CXnDomProperty::StringPool() const { return iStringPool; } @@ -237,6 +237,31 @@ { return iNameRef; } + +// ----------------------------------------------------------------------------- +// CXnDomProperty::SwapStringPoolL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomProperty::SwapStringPoolL( CXnDomStringPool* aStringPool ) + { + if( !aStringPool ) + { + User::Leave( KErrArgument ); + } + + iNameRef = aStringPool->AddStringL( iStringPool->String( iNameRef ) ); + + TInt count = iPropValList->Length(); + for( TInt i = 0; i < count; i++ ) + { + CXnDomPropertyValue* val = + static_cast( iPropValList->Item(i) ); + val->SwapStringPoolL( aStringPool ); + } + + iStringPool = aStringPool; + } + // ----------------------------------------------------------------------------- // CXnDomProperty::PseudoClass // ----------------------------------------------------------------------------- @@ -288,7 +313,7 @@ // void CXnDomProperty::InternalizeL( RReadStream& aStream ) { - iNameRef = aStream.ReadInt16L() + iStringPool.Offset(); + iNameRef = aStream.ReadInt16L(); iPropValList = CXnDomList::NewL( aStream, iStringPool ); iInherited = TBool( aStream.ReadInt8L() ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/src/xndompropertyvalue.cpp --- a/idlehomescreen/xmluirendering/dom/src/xndompropertyvalue.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/src/xndompropertyvalue.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -36,7 +36,7 @@ // might leave. // ----------------------------------------------------------------------------- // -CXnDomPropertyValue::CXnDomPropertyValue( CXnDomStringPool& aStringPool ): +CXnDomPropertyValue::CXnDomPropertyValue( CXnDomStringPool* aStringPool ): iStringPool( aStringPool ), iPrimitiveValueType( (TPrimitiveValueType)KErrNotFound ) { @@ -57,7 +57,7 @@ // ----------------------------------------------------------------------------- // EXPORT_C CXnDomPropertyValue* CXnDomPropertyValue::NewL( - CXnDomStringPool& aStringPool ) + CXnDomStringPool* aStringPool ) { CXnDomPropertyValue* self = new( ELeave ) CXnDomPropertyValue( aStringPool ); @@ -74,7 +74,7 @@ // CXnDomPropertyValue* CXnDomPropertyValue::NewL( RReadStream& aStream, - CXnDomStringPool& aStringPool ) + CXnDomStringPool* aStringPool ) { CXnDomPropertyValue* self = new( ELeave ) CXnDomPropertyValue( aStringPool ); @@ -162,7 +162,7 @@ // CXnDomPropertyValue* CXnDomPropertyValue::CloneL( CXnDomStringPool& aStringPool ) { - CXnDomPropertyValue* clone = CXnDomPropertyValue::NewL( aStringPool ); + CXnDomPropertyValue* clone = CXnDomPropertyValue::NewL( &aStringPool ); CleanupStack::PushL( clone ); clone->iPrimitiveValueType = iPrimitiveValueType; @@ -199,7 +199,7 @@ case EAttr: case EUnknown: { - const TDesC8& value = iStringPool.String( iData.iStringRef ); + const TDesC8& value = iStringPool->String( iData.iStringRef ); clone->iData.iStringRef = aStringPool.AddStringL( value ); clone->iIdent = iIdent; break; @@ -327,7 +327,7 @@ } - return iStringPool.String( iData.iStringRef ); + return iStringPool->String( iData.iStringRef ); } // ----------------------------------------------------------------------------- // const TDesC& CXnDomPropertyValue::StringValue @@ -352,7 +352,7 @@ } - return iStringPool.String( iData.iStringRef ); + return iStringPool->String( iData.iStringRef ); } // ----------------------------------------------------------------------------- // TReal CXnDomPropertyValue::SetStringValueL @@ -382,7 +382,7 @@ ReleaseData(); iPrimitiveValueType = aValueType; - TInt stringRef = iStringPool.AddStringL( aStringValue ); + TInt stringRef = iStringPool->AddStringL( aStringValue ); iData.iStringRef = stringRef; if ( aStringValue.Compare( KAuto ) == 0 ) @@ -572,7 +572,35 @@ } return iData.iStringRef; } + +// ----------------------------------------------------------------------------- +// CXnDomPropertyValue::SwapStringPoolL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CXnDomPropertyValue::SwapStringPoolL( CXnDomStringPool* aStringPool ) + { + if( !aStringPool ) + { + User::Leave( KErrArgument ); + } + + if( iPrimitiveValueType == EString || + iPrimitiveValueType == EIdent || + iPrimitiveValueType == EUri || + iPrimitiveValueType == EAttr || + iPrimitiveValueType == EUnknown ) + { + if( iData.iStringRef != NULL && + iData.iStringRef != -1 ) + { + iData.iStringRef = + aStringPool->AddStringL( iStringPool->String( iData.iStringRef ) ); + } + } + iStringPool = aStringPool; + } + // ----------------------------------------------------------------------------- // CXnDomPropertyValue::Size()const // Count size of this object's data. @@ -733,7 +761,6 @@ case EUnknown: { aStream >> iData.iStringRef; - iData.iStringRef += iStringPool.Offset(); iIdent = static_cast( aStream.ReadInt8L() ); } break; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/dom/src/xndomstringpool.cpp --- a/idlehomescreen/xmluirendering/dom/src/xndomstringpool.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/dom/src/xndomstringpool.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -19,7 +19,7 @@ // INCLUDE FILES #include "xndomstringpool.h" - +#include "xndomstringpooloptimizer.h" // ============================ LOCAL FUNCTIONS ================================ @@ -30,9 +30,9 @@ // might leave. // ----------------------------------------------------------------------------- // -CXnDomStringPool::CXnDomStringPool() +CXnDomStringPool::CXnDomStringPool( const TBool aAllowDuplicates ) : + iAllowDuplicates( aAllowDuplicates ) { - iStringPoolOffsetCurrent = iStringPoolOffsetNext = 0; } // ----------------------------------------------------------------------------- @@ -49,9 +49,10 @@ // Two-phased constructor. // ----------------------------------------------------------------------------- // -CXnDomStringPool* CXnDomStringPool::NewL() +CXnDomStringPool* CXnDomStringPool::NewL( const TBool aAllowDuplicates ) { - CXnDomStringPool* self = new( ELeave ) CXnDomStringPool; + CXnDomStringPool* self = + new( ELeave ) CXnDomStringPool( aAllowDuplicates ); CleanupStack::PushL( self ); self->ConstructL(); @@ -66,9 +67,10 @@ // Two-phased stream constructor. // ----------------------------------------------------------------------------- // -CXnDomStringPool* CXnDomStringPool::NewL( RReadStream& aStream ) +CXnDomStringPool* CXnDomStringPool::NewL( RReadStream& aStream, + const TBool aAllowDuplicates ) { - CXnDomStringPool* self = new( ELeave ) CXnDomStringPool; + CXnDomStringPool* self = new( ELeave ) CXnDomStringPool( aAllowDuplicates ); CleanupStack::PushL( self ); aStream >> *self; CleanupStack::Pop(self); @@ -84,6 +86,7 @@ CXnDomStringPool::~CXnDomStringPool() { iStringPool.ResetAndDestroy(); + iStringPoolOptimizer.Close(); } // ----------------------------------------------------------------------------- @@ -91,15 +94,23 @@ // ----------------------------------------------------------------------------- // CXnDomStringPool* CXnDomStringPool::CloneL() - { - CXnDomStringPool* clone = CXnDomStringPool::NewL(); + { + CXnDomStringPool* clone = NULL; + if( iAllowDuplicates ) + { + clone = CXnDomStringPool::NewL( ETrue ); + } + else + { + clone = CXnDomStringPool::NewL( EFalse ); + } CleanupStack::PushL( clone ); TInt count( iStringPool.Count() ); - for ( TInt i=0; iDes().AllocLC(); - clone->iStringPool.AppendL( tmp ); + clone->DoAddStringL( tmp ); CleanupStack::Pop( tmp ); } CleanupStack::Pop( clone ); @@ -110,32 +121,56 @@ // CXnDomNode::AddStringL // ----------------------------------------------------------------------------- // -EXPORT_C TInt CXnDomStringPool::AddStringL( const TDesC8& aString ) - { - TBool found( EFalse ); - TInt index( 0 ); - - TInt count( iStringPool.Count() ); - for (; index < count && !found; ) +TInt CXnDomStringPool::AddStringL( const TDesC8& aString ) + { + TInt index = iStringPoolOptimizer.GetIndex( aString ); + + if( index == KErrNotFound ) + { + HBufC8* string = aString.AllocLC(); + index = DoAddStringL( string ); + CleanupStack::Pop( string ); + } + + return index; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::AddStringL +// ----------------------------------------------------------------------------- +// +TInt CXnDomStringPool::AddStringL( HBufC8* aString ) + { + if( !aString ) { - if ( iStringPool[ index ]->Des().Compare( aString ) == 0 ) - { - found = ETrue; - } - else - { - index++; - } + User::Leave( KErrArgument ); + } + + TInt index = iStringPoolOptimizer.GetIndex( *aString ); + + if( index == KErrNotFound ) + { + index = DoAddStringL( aString ); + } + else + { + delete aString; } - if ( !found ) + + return index; + } + +// ----------------------------------------------------------------------------- +// CXnDomNode::AddStringL +// ----------------------------------------------------------------------------- +// +void CXnDomStringPool::AddAllL( CXnDomStringPool& aStringPool ) + { + const TInt count = aStringPool.Count(); + for( TInt i = 0; i < count; i++ ) { - HBufC8* tmp = aString.AllocLC(); - iStringPool.AppendL( tmp ); - CleanupStack::Pop( tmp ); - index = iStringPool.Count()-1; //Last item - iStringPoolOffsetNext++; - } - return index; + AddStringL( aStringPool.String( i ) ); + } } // ----------------------------------------------------------------------------- @@ -143,10 +178,17 @@ // ----------------------------------------------------------------------------- // const TDesC8& CXnDomStringPool::String( const TInt aStringRef ) - { - return (*iStringPool[ aStringRef ]); + { + if( aStringRef >= 0 && aStringRef < iStringPool.Count() ) + { + return (*iStringPool[ aStringRef ]); + } + else + { + return KNullDesC8; + } } - + // ----------------------------------------------------------------------------- // CXnDomStringPool::Size // ----------------------------------------------------------------------------- @@ -167,6 +209,15 @@ } // ----------------------------------------------------------------------------- +// CXnDomStringPool::Count +// ----------------------------------------------------------------------------- +// +TInt CXnDomStringPool::Count() const + { + return iStringPool.Count(); + } + +// ----------------------------------------------------------------------------- // CXnDomStringPool::ExternalizeL // ----------------------------------------------------------------------------- // @@ -189,27 +240,39 @@ void CXnDomStringPool::InternalizeL( RReadStream& aStream ) { TInt len(0); - TInt16 count ( aStream.ReadInt16L() ); - - iStringPoolOffsetCurrent = iStringPoolOffsetNext; - iStringPoolOffsetNext += count; + TInt16 count ( aStream.ReadInt16L() ); for ( TInt i=0; i 0 ) + { + const TInt estimate = FindInsertionIndexEstimate( + aEntry.iString, + 0, + iEntries.Count() - 1 ); + + if( estimate != KErrNotFound ) + { + for( TInt i = estimate; i < iEntries.Count(); i++ ) + { + if( aEntry.iString.Compare( iEntries[i].iString ) < 0 ) + { + positionFound = ETrue; + iEntries.InsertL( aEntry, i ); + break; + } + } + } + } + + if( !positionFound ) + { + iEntries.AppendL( aEntry ); + } + } + +// ----------------------------------------------------------------------------- +// TXnDomStringPoolOptimizer::TXnDomStringPoolOptimizerGetIndex +// ----------------------------------------------------------------------------- +// +TInt TXnDomStringPoolOptimizer::GetIndex( const TDesC8& aString ) + { + if( iEntries.Count() == 0 ) + { + return KErrNotFound; + } + + TInt index = FindEntry( aString, 0, iEntries.Count() - 1 ); + if( index > 0 && index < iEntries.Count() ) + { + return iEntries[index].iIndex; + } + else + { + // Error code. + return index; + } + } + +// ----------------------------------------------------------------------------- +// TXnDomStringPoolOptimizer::Close +// ----------------------------------------------------------------------------- +// +void TXnDomStringPoolOptimizer::Close() + { + iEntries.Close(); + } + +// ----------------------------------------------------------------------------- +// TXnDomStringPoolOptimizer::Count +// ----------------------------------------------------------------------------- +// +TInt TXnDomStringPoolOptimizer::Count() + { + return iEntries.Count(); + } + +// ----------------------------------------------------------------------------- +// TXnDomStringPoolOptimizer::Entry +// ----------------------------------------------------------------------------- +// +TXnDomStringPoolOptimizerEntry& TXnDomStringPoolOptimizer::Entry( + const TInt aIndex ) + { + return iEntries[ aIndex ]; + } + +// ----------------------------------------------------------------------------- +// TXnDomStringPoolOptimizer::Reset +// ----------------------------------------------------------------------------- +// +void TXnDomStringPoolOptimizer::Reset() + { + iEntries.Reset(); + } + +// ----------------------------------------------------------------------------- +// TXnDomStringPoolOptimizer::FindEntry +// ----------------------------------------------------------------------------- +// +TInt TXnDomStringPoolOptimizer::FindEntry( const TDesC8& aString, + const TInt aLeft, + const TInt aRight ) + { + if( aLeft > aRight ) + { + return KErrNotFound; + } + + const TUint middle = ( aLeft + aRight ) >> 1; // >> 1 means "divided by two". + TXnDomStringPoolOptimizerEntry& entryAtMiddle = iEntries[ middle ]; + const TInt comparisonResult = aString.Compare( entryAtMiddle.iString ); + + if( comparisonResult > 0 ) + { + return FindEntry( aString, middle + 1, aRight); + } + else if( comparisonResult < 0 ) + { + return FindEntry( aString, aLeft, middle - 1 ); + } + else + { + return middle; + } + } + +// ----------------------------------------------------------------------------- +// TXnDomStringPoolOptimizer::FindEntry +// ----------------------------------------------------------------------------- +// +TInt TXnDomStringPoolOptimizer::FindInsertionIndexEstimate( const TDesC8& aString, + const TInt aLeft, + const TInt aRight ) + { + if( ( aRight - aLeft ) <= KMaxEstimateThreshold ) + { + return aLeft; + } + + const TUint middle = ( aLeft + aRight ) >> 1; + + TXnDomStringPoolOptimizerEntry& entryAtMiddle = iEntries[ middle ]; + const TInt comparisonResult = aString.Compare( entryAtMiddle.iString ); + + if( comparisonResult > 0 ) + { + return FindInsertionIndexEstimate( aString, middle, aRight); + } + else if( comparisonResult < 0 ) + { + return FindInsertionIndexEstimate( aString, aLeft, middle ); + } + else + { + // Should not go here. There should be only one of a kind in the list. + return KErrNotFound; + } + } + +// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp --- a/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -94,7 +94,7 @@ TAny* aData ) { CXnDomList* propertyList = reinterpret_cast( aData ); - CXnDomStringPool& stringPool = propertyList->StringPool(); + CXnDomStringPool* stringPool = propertyList->StringPool(); for ( TInt i=0; i #include #include +#include // User includes #include "xnnodepluginif.h" @@ -1740,7 +1741,10 @@ iContainer = &aContainer; - UpdateSoftkeyAppearancesL(); + CEikCba* cba( static_cast< CEikCba* >( aContainer.ButtonGroup() ) ); + cba->SetButtonGroupFlags( cba->ButtonGroupFlags() | EEikCbaFlagSemiTransparent ); + + UpdateSoftkeyAppearancesL(); if (iContainer) { @@ -2125,7 +2129,7 @@ // void CXnMenuAdapter::HandleMenuPropertyChangeL(CXnNodePluginIf* aNode, CXnProperty* aProperty) { - if ( !aNode ) + if ( !aNode || !aProperty ) { return; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/group/xnnewstickerfactory.mmp --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/group/xnnewstickerfactory.mmp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/group/xnnewstickerfactory.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -31,7 +31,6 @@ SOURCE xnnewsticker.cpp SOURCE xnnewstickeradapter.cpp SOURCE xnnewstickercontrol.cpp -SOURCE xnnewstickersvgcontrol.cpp USERINCLUDE ../inc USERINCLUDE ../../../inc diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickeradapter.h --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickeradapter.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickeradapter.h Mon Jan 18 20:10:36 2010 +0200 @@ -26,7 +26,7 @@ // FORWARD DECLARATIONS class CXnNodePluginIf; class CXnNewstickerControl; -class CXnNewstickerSvgControl; +class CAknMarqueeControl; // CONSTANTS // The default values for the newsticker control @@ -51,25 +51,12 @@ XnNewstickerInterface::MXnNewstickerCallbackInterface { public: - - /** - * State of the whole control. - */ - enum TState - { - ENotStarted = 1, // No scrolling has been done - EPaused, // Text is shown, but not scrolled - EText, // Text is shown and scrolled continuously - EAnimation, // SVG animation is shown - EScrollEnded // Looping is false and scrolling has ended - }; - + enum TScrollBehaviour { EScroll, - ESlide, EAlternate, - EScrollAlternate + EScrollAlternate, }; public: @@ -92,27 +79,27 @@ * Append new title to the end of the title list. * @param aTitle The new title to add. */ - void AppendTitleL(const TDesC& aTitle); + void AppendTitleL( const TDesC& aTitle ); /** * Insert new title to the end of the title list. * @param aTitle The new title to add. * @param aIndex The place to add the title. */ - void InsertTitleL(const TDesC& aTitle, TInt aIndex); + void InsertTitleL( const TDesC& aTitle, TInt aIndex ); /** * Update title text. * @param aTitle The new title to add. * @param aIndex The place to update the title. */ - void UpdateTitleL(const TDesC& aTitle, TInt aIndex); + void UpdateTitleL( const TDesC& aTitle, TInt aIndex ); /** * Delete the title. * @param aIndex The title index to delete. */ - void DeleteTitleL(TInt aIndex); + void DeleteTitleL( TInt aIndex ); /** * Returns index of the currently selected title. @@ -125,14 +112,7 @@ * @param aIndex The index to return the title. * @return The title of the given index. */ - const TDesC& Title(TInt aIndex); - - /** - * Set the separator image for all titles. - * @param aIcon The separator image. This must be mif icon. - * @return KErrNone if successful, KErrArgument if the icon is not mif. - */ - TInt SetSeparatorImageL(CGulIcon* aIcon); + const TDesC& Title( TInt aIndex ); /** * Delete all titles. @@ -140,88 +120,45 @@ void ClearTitles(); /** - * Append the SVG title to be shown. - * @param aByteData The SVG data. - */ - void AppendSvgTitleL(const TDesC8& aByteData); - - /** - * Insert the SVG title to be shown. - * @param aByteData The SVG data. - */ - void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex); - - /** * Set callback interface. * @param aCallback The callback interface pointer. */ void SetCallbackInterfaceL( - XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback); + XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback ); /** * Start showing the titles. */ - void StartL(); + void Start(); /** * Stop showing the titles. */ - void StopL(); - + void Stop(); + + /** + * Stops alternate counter. + */ + void StopAlternateCounter(); + /** - * Show SVG next. + * Resets and unenables narquee control. */ - void ShowSvgL(); + void StopMarquee(); + + /** + * Starts alternate counter. + */ + void StartAlternateCounter(); /** * Callback which will be called by the CPeriodic. * @param aPtr User defined pointer. * @return ETrue if the method should be called again. */ - static TInt PeriodicEventL(TAny * aPtr); - - /** - * Draw background for the newsticker control area. - * @param aRect The visivle area of newsticker component. - * @param aGc Window graphics context. - */ - void DrawBackgroundL(const TRect& aRect, CWindowGc& aGc) const; - - - /** - * Returns the bitmap context. - * @return Bitmap context. - */ - inline CBitmapContext* BufferGc() const { return iBufferGc; }; - - - /** - * Returns the background bitmap - * @return Background bitmap - */ - inline const CFbsBitmap* BackgroundBitmap() const { return iBackgroundBitmap; }; - - /** - * Returns the state of the newsticker control. - * @return Current state. - */ - inline TState CurrentState() const { return iState; }; - - /** - * Returns the current scroll behaviour - * @return current scroll behaviour - */ - inline TInt ScrollBehaviour() const { return iScrollBehaviour; }; - - /** - * Reset periodic timer to set display time. - */ - void SetTimerToDisplaytime(); - - /** - * Reset periodic timer to set scroll delay time. - */ - void SetTimerToScrolltime(); + static TInt PeriodicEventL( TAny * aPtr ); + + void MakeVisible( TBool aVisible ); public: // from base classes @@ -230,7 +167,7 @@ * Called when the title has been shown and is now offscreen. * @param aTitleIndex The title that has been completely shown. */ - void TitleScrolled(TInt aTitleIndex); + void TitleScrolled( TInt aTitleIndex ); /** * See CCoeControl documentation @@ -238,44 +175,28 @@ void SizeChanged(); /** - * See CCoeControl documentation - */ - void HandlePointerEventL(const TPointerEvent& aPointerEvent); - - /** - * See CCoeControl documentation - */ - void FocusChanged(TDrawNow aDrawNow); - - /** - * See CCoeControl documentation - */ - TKeyResponse OfferKeyEventL( - const TKeyEvent& aKeyEvent, TEventCode aType); - - /** * See CXnControlAdapter documentation */ - void Draw(const TRect& aRect) const; + void Draw( const TRect& aRect ) const; /** * Enter power save mode. This is done when application goes to background or lights go off. * Derived classes should override this function and stop animations, timers etc. when the function is called. */ - void DoEnterPowerSaveModeL(TModeEvent aEvent); + void DoEnterPowerSaveModeL( TModeEvent aEvent ); /** * Exit power save mode. This is done when application comes to foreground or lights go on. * Derived classes should override this function and restart animations, timers etc. when the function is called. */ - void DoExitPowerSaveModeL(TModeEvent aEvent); + void DoExitPowerSaveModeL( TModeEvent aEvent ); /** * From CXnControlAdapter Handles the property changes. * @since Series 60 3.1 * @return void. */ - void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + void DoHandlePropertyChangeL( CXnProperty* aProperty = NULL ); /** * Skin change notification. @@ -283,23 +204,29 @@ */ void SkinChanged(); - void ReportNewstickerEventL(const TDesC8& aEventName); + /** + * Reports newsticker event + * + */ + void ReportNewstickerEvent( const TDesC8& aEventName ); /** - * See CCoeControl documentation + * Draws text + * Text drawing function is selected by scrolling behaviour */ - void DrawNow() const; + void DrawText( const TDesC& aText, const TRect& aRect ); /** - * If newsticker is not focusable, finds and draws focusable parent + * ETrue if marquee control redrawing is needed. EFalse if truncated text is needed */ - TBool DrawFocusableParentL() const; + TBool Redraw() { return iRedraw; } + private: - CXnNewstickerAdapter(CXnControlAdapter* aParent, CXnNodePluginIf& aNode); + CXnNewstickerAdapter( CXnControlAdapter* aParent, CXnNodePluginIf& aNode ); - void ConstructL(); + void ConstructL( CXnControlAdapter* aParent ); /** * Sets text properties, such as color, font, etc. @@ -310,34 +237,38 @@ * Sets newsticker timing properties. */ void SetNewstickerPropertiesL(); - - /** - * Creates a new doublebuffer for newsticker. - */ - void UpdateDoubleBufferL(); - - /** - * Draws a reconstructed background for newsticker. - */ - void UpdateBackgroundL() const; - - /** - * Same as SizeChanged(), but this is an L function. - */ - void SizeChangedL(); - - /** - * Checks if feed can be started - */ - TBool CheckDisplayL( CXnNodePluginIf& aNode ); - - void RestartL(); - private: + + /** + * From CoeControl,CountComponentControls. + */ + TInt CountComponentControls() const; /** - * The state of the newsticker control. - */ - TState iState; + * From CCoeControl,ComponentControl. + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * Callback function for marquee control + */ + static TInt RedrawCallback( TAny* aPtr ); + + /** + * FScrolls alternative text. Function is called by periodic timer + */ + void DoScroll(); + + /** + * Draws text directly to screen if scrollins is not needed + */ + void DrawStaticText( CWindowGc& aGc, const TDesC& aText ) const; + + /** + * Draws scrolling text to screen via marquee control + */ + TBool DrawMarqueeText( CWindowGc& aGc, const TDesC& aText ) const; + + private: /** * The timer to use for scrolling events. @@ -356,22 +287,11 @@ * Own. */ CXnNewstickerControl* iControl; - - /** - * The control handling the svg title showing - * Own. - */ - CXnNewstickerSvgControl* iSvgControl; - + /** - * Delay between loops in microseconds. - */ - TInt iDelay; - - /** - * The interval between ticks. - */ - TInt iInterval; + * The delay before first event + */ + TInt iAlternateDelay; /** * The alternate interval between ticks. @@ -379,21 +299,6 @@ TInt iAlternateInterval; /** - * The current interval between ticks. - */ - TInt iCurrentInterval; - - /** - * Amount of loops executed - */ - TInt iLoops; - - /** - * The animation time in microseconds. - */ - TInt iAnimationTime; - - /** * UI node * Not own. */ @@ -401,43 +306,14 @@ /** * Font for control. - * Own. + * Not own. */ CFont* iFont; /** * Whether the font needs to be released or not. */ - TBool iReleaseFont; - - /** - * Bitmap device. Used to draw on the drawing buffer - * Own. - */ - CFbsBitmapDevice* iBufferDevice; - - /** - * Drawing buffer - * Own. - */ - CFbsBitmap* iDrawingBuffer; - - /** - * Bitmap Graphic Context. Used to draw on the drawing buffer - * Own. - */ - CBitmapContext* iBufferGc; - - /** - * Pointer to background bitmap. - * Own. - */ - mutable CFbsBitmap* iBackgroundBitmap; - - /** - * For the display property (content is either shown or not) - */ - TBool iDisplay; + TInt iReleaseFont; /** * For keeping track of the current powersave mode state @@ -447,12 +323,56 @@ /** * Current scroll behaviour */ - TInt iScrollBehaviour; + TScrollBehaviour iScrollBehaviour; /** * Restart animation after title has been updated */ TBool iRestartAfterUpdate; + + /** + * marquee control for scrolling + * own + */ + CAknMarqueeControl* iMarqueeControl; + + /** + * Current text color + */ + TRgb iTextColor; + + /** + * Current text alignment + */ + TInt iTextAlignment; + + /** + * Current baseline + */ + TInt iTextBaseline; + + /** + * Current underlining behaviour + */ + TFontUnderline iUnderlining; + + /** + * Current strikethrough behaviour + */ + TFontStrikethrough iStrikethrough; + + /** + * is scroll looping activated + */ + TBool iScrollLooping; + + /** + * is marquee control redraw needed + */ + TBool iRedraw; + + + }; #endif // XNNEWSTICKERADAPTER_H diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickercontrol.h --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickercontrol.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickercontrol.h Mon Jan 18 20:10:36 2010 +0200 @@ -24,7 +24,6 @@ // FORWARD DECLARATIONS class CXnNewstickerAdapter; -class CFont; // CLASS DECLARATION @@ -49,27 +48,7 @@ * @param aStartDelay The delay before the animation starts * @return Pointer to this. */ - static CXnNewstickerControl* NewL(CXnNewstickerAdapter* aAdapter); - - /** - * Sets newsticker scroll amount. - * @param aScrollAmount A scroll amount. - * @return void - */ - void SetScrollAmount(TInt aScrollAmount); - - /** - * Sets the rect of the visible area. - * @param aContentRect The visible rect. - * @return void - */ - void SetNewstickerRect(TRect& aContentRect); - - /** - * Checks whether a western layout is used. - * @return Returns true if wesern layout is in use. - */ - TBool IsWestern(); + static CXnNewstickerControl* NewL( CXnNewstickerAdapter* aAdapter ); // Routed from MXnNewstickerInterface. @@ -77,47 +56,40 @@ * Append new title to the end of the title list. * @param aTitle The new title to add. */ - void AppendTitleL(const TDesC& aTitle); + void AppendTitleL( const TDesC& aTitle ); /** * Insert new title to the end of the title list. * @param aTitle The new title to add. * @param aIndex The place to add the title. */ - void InsertTitleL(const TDesC& aTitle, TInt aIndex); + void InsertTitleL( const TDesC& aTitle, TInt aIndex ); /** * Update title in the title list. * @param aTitle The new title to add. * @param aIndex The place to add the title. */ - void UpdateTitleL(const TDesC& aTitle, TInt aIndex); + void UpdateTitleL( const TDesC& aTitle, TInt aIndex ); /** * Delete the title. * @param aIndex The title index to delete. */ - void DeleteTitleL(TInt aIndex); + void DeleteTitleL( TInt aIndex ); /** * Returns index of the currently selected title. * @return The index of the current title. */ - TInt CurrentTitleIndex(); + TInt CurrentTitleIndex() const; /** * Return the title of the given index. * @param aIndex The index to return the title. * @return The title of the given index. */ - const TDesC& Title(TInt aIndex); - - /** - * Set the separator image for all titles. - * @param aIcon The separator image. This must be mif icon. - * @return KErrNone if successful, KErrArgument if the icon is not mif. - */ - TInt SetSeparatorImageL(CGulIcon* aIcon); + const TDesC& Title(TInt aIndex) const; /** * Delete all titles. @@ -125,198 +97,34 @@ void ClearTitles(); /** - * Append the SVG title to be shown. - * @param aByteData The SVG data. - */ - void AppendSvgTitleL(const TDesC8& aByteData); - - /** - * Insert the SVG title to be shown. - * @param aByteData The SVG data. - */ - void InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex); - - /** - * Return the current svg title. - * @return The current svg title. - */ - const TDesC8& CurrentSvgTitle(); - - /** * Return the number of titles in the list. * @return The number of titles in the list. */ TInt TitleCount() const; - - /** - * Move to the next title. - */ - void MoveToNextL(); - - /** - * Move to the previous title. - */ - void MoveToPrevL(); - - /** - * Move to first title - */ - void MoveToFirstL(); - - /** - * Move to last title - */ - void MoveToLastL(); - - /** - * Move to the previous title. - */ - void MoveToCurrent(); - - /** - * Sets font for bitmap graphic context. - * @param aFont Font family. - */ - void SetFont(CFont* aFont); - - /** - * Sets text color for bitmap graphic context. - * @param aColor Color in RGB format. - */ - void SetTextColor(TRgb aColor); - - /** - * Sets the underline style for all subsequently drawn text. - * @param aStyle Underline style, which can be either on of off. - */ - void SetTextUnderlineStyle(TFontUnderline aStyle); - - /** - * Sets the strikethrough style for all subsequently drawn text. - * @param aStyle Strikethrough style, which can be either on of off. - */ - void SetTextStrikethroughStyle(TFontStrikethrough aStyle); /** * Destructor */ virtual ~CXnNewstickerControl(); - /** - * Creates background bitmap - */ - void CreateBufferBitmapL(); - /** - * Advance text and issue a callback to parent + * Selects title to be shown */ - void DoScrollL(); - - /** - * Blit visible stuff to d-buffer. Drawing direction is left-to-right. - */ - void PrepareToDrawLtrL(); - - /** - * Blit visible stuff to d-buffer. Drawing direction is right-to-left. - */ - void PrepareToDrawRtlL(); - - /** - * Blit double buffer to gc. - */ - void Draw(); + const TDesC& SelectTitle(); /** - * Blit double buffer to gc. Draws only the last title truncated. - */ - void DrawStatic(); - - /** - * Sets iFirstdrawingOffset as a start position. - */ - void SetBeginningState(); - - /** - * Return the font - * @return font - */ - inline const CFont* Font() { return iFont; }; - - /** - * Return the text color. - * @return Text color. - */ - inline const TRgb TextColor() { return iTextColor; }; - - /** - * Return font underline flag. - * @return Font underline flag. - */ - inline const TFontUnderline TextUnderlineStyle() { return iUnderlining; }; - - /** - * Return the font strikethrough flag. - * @return Font strikethrough flag. + * Sets the current title to default ( last one ) or move to next one */ - inline const TFontStrikethrough TextStrikethroughStyle() { return iStrikethrough; }; - - /** - * Set scroll looping property - */ - void SetScrollLooping( TBool aLoop ); - - /** - * Return scroll looping property - * @return TBool - */ - TBool ScrollLooping(); - - /** - * @return ETrue if all the text fits on the drawing rect. In that case no scrolling and - * text alignment should be used - */ - TBool TextFitInNewstickerRect(); - - /** - * @param aAlignment ( ELayoutAlignCenter, ELayoutAlignLeft or ELayoutAlignRight ) - * ELayoutAlignLeft default in western, ELayoutAlignRight in AH. - */ - void SetTextAlignment(TInt aAlignment); - - /** - * @return ETrue if the current text fits on - * the drawing rect (when scrolling behaviour is scroll-alternate) - * EFalse otherwise. - * If this is ETrue then no scrolling and text alignment should be used - */ - TBool CalculateCurrentTextFitInNewstickerRect(); + TBool SetCurrentTitle( TBool aSetDefault = EFalse ); + private: CXnNewstickerControl(CXnNewstickerAdapter* aAdapter); void ConstructL(); - - /** - * Calculate the indexes and offset after new title has been inserted. - * @param aIndex The inserted index. - */ - void CountIndexAfterInsertL(TInt aIndex); /** - * @return ETrue if all the text fits on the drawing rect (when scrolling behaviour is slide) - * EFalse otherwise. - * If this is ETrue then no scrolling and text alignment should be used - */ - TBool CalculateTextFitInNewstickerRect(); - - /** - * @return text alignment from properties if text fits to the rect or scroll behaviour is alternate. - * otherwise returns default alignment value (left in western, right in AH). - */ - CGraphicsContext::TTextAlign TextAlignment(); - /** * Get the index of the next title that has content * * @param aStartSearch The index where to start search @@ -324,213 +132,26 @@ * * @return The next index that has content or -1 if nothing was found */ - TInt GetNextTitleWithContent( TInt aStartSearch, TBool aBackwards = EFalse ); - - TBool IsVisibleTitles(); - - private: // Data + TInt GetNextTitleWithContent( TInt aStartSearch, TBool aBackwards = EFalse ) const; /** - * Helper class containing the title text and its length in pixels. - * - * @lib xnnewstickerfactory.dll - * @since Series 60 3.2 + * Checks is there any visible titles in array */ - class CTitleData : public CBase - { - public: - - /** - * Destructor - */ - virtual ~CTitleData(); - - /** - * Two-phased constructor. - * @param aTitle The title text. - * @param aLenghtInPixels The lenght of title text in pixels. - * @return Pointer to this. - */ - static CTitleData* NewL(const TDesC& aTitle, TInt aLenghtInPixels); - - /** - * Two-phased constructor. - * @param aTitle The title text. - * @param aLenghtInPixels The lenght of title text in pixels. - * @return Pointer to this. - */ - static CTitleData* NewLC(const TDesC& aTitle, TInt aLenghtInPixels); - - /** - * Two-phased constructor. - * @param aByteData The SVG title. - * @param aLenghtInPixels The lenght of title text in pixels. - * @return Pointer to this. - */ - static CTitleData* NewL(const TDesC8& aByteData); - - /** - * Two-phased constructor. - * @param aByteData The SVG title. - * @param aLenghtInPixels The lenght of title text in pixels. - * @return Pointer to this. - */ - static CTitleData* NewLC(const TDesC8& aByteData); - - /** - * Return the title text. - * @return The title text. - */ - const TDesC& TitleText(); - - /** - * Set new title text - */ - void SetTitleTextL(const TDesC& aTitle); - - /** - * Return the title text lenght in pixels. - * @return The title text lenght in pixels. - */ - TInt TitleTextLengthInPixels(); - - /** - * Return the title text lenght in pixels. - * @param aLenghtInPixels The lenght of title text in pixels. - */ - void SetTitleTextLengthInPixels(TInt aLenghtInPixels); - - /** - * ETrue if the title is svg, EFalse if it is text. - * @return ETrue if the title is svg, EFalse if it is text. - */ - TBool IsSvgTitle(); - - /** - * Return the svg title data. - * @return The svg title data. - */ - const TDesC8& SvgTitleData(); - - private: - - CTitleData(TInt aLenghtInPixels = 0); - - void ConstructL(const TDesC& aTitle); - - void ConstructL(const TDesC8& aByteData); - - private: // Data - - /** - * ETrue if the title is SVG, EFalse if it is text. - */ - TBool iTitleIsSvg; - - /** - * The title text. Owned. - */ - HBufC* iText; - - /** - * The svg title. Owned. - */ - HBufC8* iData; - - /** - * The title text length in pixels. - */ - TInt iTextLenghtInPixels; - }; - + TBool IsVisibleTitles() const; + + private: // Data + /** - * List of titles to show. - */ - RPointerArray iTitles; - - /** - * The index of the title which is drawn first. + * The array for title texts + * owned */ - TInt iFirstDrawingTitleIndex; - - /** - * The number of pixels of the first title and separator image which - * have already been shown. In other words, the number of the pixels - * that are not visible in the screen. The iFirstDrawingTitleIndex - * is updated when: - * iFirstDrawingOffset > iTextLenghtInPixels + iSeparatorImageWidth - */ - TInt iFirstDrawingOffset; - - /** - * The width of the.separator image. - */ - TInt iImageWidthInPixels; + RPointerArray iTitleTexts; /** * The index of the title which is selected if user activates the * control. */ TInt iCurrentTitleIndex; - - /** - * The separator image. - * Owned. - */ - CGulIcon* iSeparatorimage; - - /** - * The separator image including the gap between image and text. - * Owned. - */ - TInt iSeparatorImageWidth; - - /** - * Font - * Not own. - */ - CFont* iFont; - - /** - * Baseline for the text. - */ - TInt iTextBaseline; - - /** - * Color for the text - */ - TRgb iTextColor; - - /** - * Whether to use underlining for the text - */ - TFontUnderline iUnderlining; - - /** - * Whether to use strikethrough for the text - */ - TFontStrikethrough iStrikethrough; - - /** - * A rect in which the scrolling text is shown. - */ - TRect iContentRect; - - /** - * Amount of pixels the text moves in a tick. - */ - TInt iSpeed; - - /** - * Whether the scrolling texts will loop or not. - * If false, the scrolling will end at the last index. - */ - TBool iScrollLooping; - - /** - * Whether the text direction is LTR or RTL. - */ - TBool iIsWestern; /** * Parent control adapter @@ -538,15 +159,9 @@ */ CXnNewstickerAdapter* iAdapter; - /** - * ETrue if there is only one title, it fits in the rect and - * scroll behaviour is slide - */ - TBool iTextFitInNewstickerRect; - /** - * Text alignment from the properties - */ - TInt iTextAlignment; + + + }; #endif // XNNEWSTICKERCONTROL_H diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickersvgcontrol.h --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/inc/xnnewstickersvgcontrol.h Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ -/* -* Copyright (c) 2002-2006 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: Svg scrolling functionality. -* -*/ - - -#ifndef XNNEWSTICKERSVGCONTROL_H -#define XNNEWSTICKERSVGCONTROL_H - -// INCLUDES -#include -#include - -// CONSTANTS - -// FORWARD DECLARATIONS -class CXnNewstickerAdapter; -class CSvgEngineInterfaceImpl; - -// CLASS DECLARATION - -/** -* @ingroup group_xnnewstickerfactory -* -* Newsticker control for XUIKON svg scrolling functionality. -* -* @lib xn3newstickerfactory.dll -* @since Series 60 3.2 -*/ -class CXnNewstickerSvgControl : public CBase, public MSvgRequestObserver - { - public: - /** - * Two-phased constructor. - * @param aAdapter Parent control - * @return Pointer to this. - */ - static CXnNewstickerSvgControl* NewL(CXnNewstickerAdapter* aAdapter); - - /** - * Destructor - */ - virtual ~CXnNewstickerSvgControl(); - - public: // New functions - /** - * Start showing the SVG until StopL is called. - * @param aSvgData The svg byte data to show. - */ - void StartL(const TDesC8& aSvgData); - - /** - * Stop the SVG showing and started with the StartL. - */ - void StopL(); - - /** - * Sets the rect of the visible area. - * @since S60 v3.1 - * @param aContentRect The visible rect. - * @param aDevice The current graphics device. - * @return void - */ - void SetSvgRectL(TRect& aContentRect, CGraphicsDevice& aDevice ); - - /** - * Draws the SVG into screen - */ - void Draw() const; - - public: //From MSvgRequestObserver - - /** - * This method is called by the SVG Engine when all data for a certain - * step, such as animation frame, have been updated. This usually means - * the off-screen image (passed in to 'ConstructL' of CSvgEngineInterface) - * has been updated. The client usually redraws the image onto - * the screen. - */ - void UpdateScreen(); - - /** - * This method is for future extension, in which an external script engine - * could be used to evaluate a script description. - * - * @param : aScript -- A description of script from the "on" attribute. - * @param : aCallerElement -- The element that calls the script by a - * an event of the "on" attribute. - * @return : For future use. Value is ignored. - */ - TBool ScriptCall(const TDesC& aScript, CSvgElementImpl* aCallerElement); - - /** - * This method is called to retrieve the file handle of an image name. - * The session (RFs) object passed in is guaranteed to be connected, so - * the client must NOT call aSession.Connect(). - * - * The implementation for the client of this method is usually if not always: - * TInt X::FetchImage(const TDesC& aFilename, RFs& aSession, RFile& aFileHandle) - * { - * // Check for "http", get data from remote site, save to disk - * // Get absolute path to aFilename: absolutepath - * return aFileHandle.Open(aSession, absolutepath, EFileRead); - * } - * - * Note: Use EFileShareReadersOnly to prevent file locking. - * - * The API AssignImageData() can be used to avoid block the parsing - * thread due this method taking too long to return. This is - * accomplished by returning a non-KErrNone value (i.e. KErrNotFound), - * and storing the URI parameter. The image data then could be - * assigned the the URI in another thread/Active-Object. - * - * @param : aUri -- the relative path of an image file. - * @param : aSession -- File session used by client to open file. - * @param : aFileHandle -- File handle used by client to open file. - * @return : KErrNone if Open command successful, otherwise error-code - * from Open command. The SVG engine will proceed loading the file - * only if the return value is KErrNone. - */ - TInt FetchImage(const TDesC& aUri, RFs& aSession, RFile& aFileHandle); - - /** - * This method is called to retrieve the file handle of an svg font file. - * This file must be SVG 1.1 .svg file. When the engine comes acrossed - * a font-family name that it doesnt know it will request "fontfamilyname".svg - * file through this method. The client can either provide the svg file - * or the engine will default to system text. - * - * The usage of this method is exactly the same as the FetchImage method above - * - * @param : aUri -- the relative path of an image file. - * @param : aSession -- File session used by client to open file. - * @param : aFileHandle -- File handle used by client to open file. - * @return : KErrNone if Open command successful, otherwise error-code - * from Open command. The SVG engine will proceed loading the file - * only if the return value is KErrNone. - */ - TInt FetchFont(const TDesC& aUri, RFs& aSession, RFile& aFileHandle); - - /** - * This Method updates the presentation status - * @param : TInt32& aNoOfAnimation - */ - void UpdatePresentation(const TInt32& aNoOfAnimation); - - private: - - CXnNewstickerSvgControl(CXnNewstickerAdapter* aAdapter); - - void ConstructL(); - - private: // Data - /** - * Parent control adapter - * Not own. - */ - CXnNewstickerAdapter* iAdapter; - - /** - * Pointer to SVG rendering engine - * Owned. - */ - CSvgEngineInterfaceImpl* iSVGEngine; - - /** - * Pointer to svg bitmap. - * Own. - */ - CFbsBitmap* iBitmap; - - /** - * Pointer to svg mask. - * Own. - */ - CFbsBitmap* iMaskBitmap; - - /** - * A rect in which the svg is shown. - */ - TRect iContentRect; - - /** - * Defines whether the content has been loaded - */ - TBool iHasContent; - }; - -#endif // XNNEWSTICKERSVGCONTROL_H - -// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewsticker.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewsticker.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewsticker.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -131,18 +131,6 @@ (ControlAdapter()))->Title(aIndex); } - -// --------------------------------------------------------- -// CXnNewsticker::SetSeparatorImageL -// --------------------------------------------------------- -// -TInt CXnNewsticker::SetSeparatorImageL(CGulIcon* aIcon) - { - return (static_cast - (ControlAdapter()))->SetSeparatorImageL(aIcon); - } - - // --------------------------------------------------------- // CXnNewsticker::ClearTitles // --------------------------------------------------------- @@ -153,27 +141,6 @@ (ControlAdapter()))->ClearTitles(); } - -// --------------------------------------------------------- -// CXnNewsticker::AppendSvgTitleL -// --------------------------------------------------------- -// -void CXnNewsticker::AppendSvgTitleL(const TDesC8& aByteData) - { - (static_cast - (ControlAdapter()))->AppendSvgTitleL(aByteData); - } - -// --------------------------------------------------------- -// CXnNewsticker::InsertSvgTitleL -// --------------------------------------------------------- -// -void CXnNewsticker::InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) - { - (static_cast - (ControlAdapter()))->InsertSvgTitleL(aByteData, aIndex); - } - // --------------------------------------------------------- // CXnNewsticker::SetCallbackInterfaceL // --------------------------------------------------------- diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickeradapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickeradapter.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickeradapter.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -19,6 +19,8 @@ #include #include #include +#include +#include // User includes #include "xnviewnodeimpl.h" @@ -32,9 +34,13 @@ #include "xnnewstickeradapter.h" #include "xnnewstickercontrol.h" -#include "xnnewstickersvgcontrol.h" #include "xncomponentnodeimpl.h" + +const TInt KThousandCoef = 1000; +const TInt KByteLength = 8; + + // ============================= LOCAL FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -45,130 +51,30 @@ // return The value of the property. If not found, KErrNotFound returned. // ----------------------------------------------------------------------------- // -static TInt GetIntPropertyL( - CXnNodePluginIf& aNode, - const TDesC8& aProperty) +static TInt GetIntPropertyL( CXnNodePluginIf& aNode, const TDesC8& aProperty ) { CXnProperty* prop = aNode.GetPropertyL(aProperty); if(prop) { CXnDomPropertyValue* value = - static_cast(prop->Property()->PropertyValueList().Item(0)); + static_cast( + prop->Property()->PropertyValueList().Item(0) ); + if(CXnDomPropertyValue::ENumber == value->PrimitiveValueType()) { - TInt integer = static_cast(prop->FloatValueL()); + TInt integer = static_cast( prop->FloatValueL() ); + return integer; } } + return KErrNotFound; - } + } // ----------------------------------------------------------------------------- -// CopyBitmapData -// Copies a data from source bitmap to target bitmap. +// CXnNewstickerAdapter::SetNewstickerPropertiesL // ----------------------------------------------------------------------------- // -static TInt CopyBitmapData( - CFbsBitmap& aTarget, - const CFbsBitmap& aSource, - TPoint aSourcePoint) - { - TSize targetSize(aTarget.SizeInPixels()); - TSize sourceSize(aSource.SizeInPixels()); - TInt lineLength(targetSize.iWidth); - TInt maxSourceLineLength(sourceSize.iWidth - aSourcePoint.iX); - if(lineLength > maxSourceLineLength) - { - lineLength = maxSourceLineLength; - } - TInt rowCount(targetSize.iHeight); - TInt maxSourceRowCount(sourceSize.iHeight - aSourcePoint.iY); - if(rowCount > maxSourceRowCount) - { - rowCount = maxSourceRowCount; - } - - // Get bitmap display mode - TDisplayMode displayMode(aSource.DisplayMode()); - - // Create buffer for a scan line - HBufC8* scanLine = HBufC8::New( - aSource.ScanLineLength(lineLength, displayMode)); - if(!scanLine) - { - return KErrNoMemory; - } - - TPtr8 scanPtr(scanLine->Des()); - - // Copy all rows to destination bitmap - for(TInt row(0); row < rowCount; row++) - { - aSource.GetScanLine(scanPtr, - TPoint(aSourcePoint.iX, aSourcePoint.iY + row), - lineLength, displayMode); - aTarget.SetScanLine(scanPtr, row); - } - delete scanLine; - return KErrNone; - } - -// --------------------------------------------------------- -// CXnNewstickerAdapter::CheckDisplayL -// --------------------------------------------------------- -// -TBool CXnNewstickerAdapter::CheckDisplayL( CXnNodePluginIf& aNode ) - { - if( iPowerSaveMode ) - { - iDisplay = EFalse; - - return iDisplay; - } - - CXnProperty* displayProp( aNode.DisplayL() ); - - if( displayProp ) - { - const TDesC8& display( displayProp->StringValue() ); - - if( display != XnPropertyNames::style::common::display::KBlock ) - { - return EFalse; - } - } - - CXnProperty* visibilityProp( aNode.VisibilityL()); - - if( visibilityProp ) - { - const TDesC8& visibility( visibilityProp->StringValue() ); - - if( visibility != XnPropertyNames::style::common::visibility::KVisible ) - { - return EFalse; - } - } - - - CXnNodePluginIf* parent( aNode.ParentL() ); - - TBool ret( ETrue ); - - if( parent ) - { - ret = CheckDisplayL( *parent ); - } - - iDisplay = ret; - - return iDisplay; - } - -// --------------------------------------------------------- -// CXnNewstickerAdapter::SetNewstickerPropertiesL -// --------------------------------------------------------- -// void CXnNewstickerAdapter::SetNewstickerPropertiesL() { // scroll amount @@ -180,20 +86,19 @@ scrollamount = KXnNewstickerScrollAmount; } - CXnProperty* prop( iNode.GetPropertyL( XnPropertyNames::newsticker::KScrollBehaviour ) ); + CXnProperty* prop( iNode.GetPropertyL( + XnPropertyNames::newsticker::KScrollBehaviour ) ); if( prop ) { - if ( prop->StringValue() == XnPropertyNames::newsticker::scroll_behaviour::KAlternate ) + if ( prop->StringValue() == + XnPropertyNames::newsticker::scroll_behaviour::KAlternate ) { scrollamount = 0; iScrollBehaviour = EAlternate; } - else if ( prop->StringValue() == XnPropertyNames::newsticker::scroll_behaviour::KSlide ) - { - iScrollBehaviour = ESlide; - } - else if ( prop->StringValue() == XnPropertyNames::newsticker::scroll_behaviour::KScrollAlternate ) + else if ( prop->StringValue() == + XnPropertyNames::newsticker::scroll_behaviour::KScrollAlternate ) { iScrollBehaviour = EScrollAlternate; } @@ -207,9 +112,9 @@ iScrollBehaviour = EScroll; } - iControl->SetScrollAmount( scrollamount ); + iMarqueeControl->SetSpeedInPixels( scrollamount ); - if( iScrollBehaviour == EScroll || iScrollBehaviour == ESlide ) + if( iScrollBehaviour == EScroll ) { // scroll delay TInt scrolldelay = GetIntPropertyL( iNode, @@ -221,10 +126,11 @@ } else { - scrolldelay *= 1000; // change to microseconds + scrolldelay *= KThousandCoef; // change to microseconds } - iInterval = scrolldelay; + iMarqueeControl->SetInterval( scrolldelay ); + iAlternateInterval = scrolldelay; // start delay TInt startdelay = GetIntPropertyL( iNode, @@ -236,10 +142,11 @@ } else { - startdelay *= 1000; // change to microseconds + startdelay *= KThousandCoef; // change to microseconds } - iDelay = startdelay; + iMarqueeControl->SetDelay( startdelay ); + iAlternateDelay = startdelay; } else if( iScrollBehaviour == EScrollAlternate ) { @@ -253,10 +160,11 @@ } else { - scrolldelay *= 1000; // change to microseconds + scrolldelay *= KThousandCoef; // change to microseconds } - iInterval = scrolldelay; + iMarqueeControl->SetInterval( scrolldelay ); + iAlternateInterval = scrolldelay; TInt alternateTime( GetIntPropertyL( iNode, XnPropertyNames::newsticker::KDisplayTime ) ); @@ -265,7 +173,7 @@ alternateTime = 0; } - alternateTime *= 1000; // change to ms + alternateTime *= KThousandCoef; // change to ms iAlternateInterval = alternateTime; @@ -279,10 +187,11 @@ } else { - startdelay *= 1000; // change to microseconds + startdelay *= KThousandCoef; // change to microseconds } - iDelay = startdelay; + iMarqueeControl->SetDelay( startdelay ); + iAlternateDelay = startdelay; } else // TScrollBehaviour::EAlternate { @@ -293,37 +202,31 @@ alternateTime = 0; } - alternateTime *= 1000; // change to ms - - iDelay = 0; - iInterval = alternateTime; - } + alternateTime *= KThousandCoef; // change to ms - // animation time - iAnimationTime = GetIntPropertyL( iNode, - XnPropertyNames::newsticker::KXnNewstickerAnimationDelay ); // ms - - if( KErrNotFound == iAnimationTime ) - { - iAnimationTime = KAnimationTime; - } - else - { - iAnimationTime *= 1000; // change to microseconds - } + iMarqueeControl->SetDelay( 0 ); + iMarqueeControl->SetInterval( alternateTime ); + + iAlternateDelay = 0; + iAlternateInterval = alternateTime; + } // _s60-scroll-loop property. True by default. - CXnProperty* loopProp( iNode.GetPropertyL( XnPropertyNames::newsticker::KScrollLoop ) ); + CXnProperty* loopProp( iNode.GetPropertyL( + XnPropertyNames::newsticker::KScrollLoop ) ); if( loopProp && loopProp->StringValue() == XnPropertyNames::KFalse ) { - iControl->SetScrollLooping( EFalse ); + iScrollLooping = EFalse; } else { - iControl->SetScrollLooping( ETrue ); - } - CXnProperty* restartProperty( iNode.GetPropertyL( XnPropertyNames::newsticker::KRestartAfterUpdate ) ); + iScrollLooping = ETrue; + } + + CXnProperty* restartProperty( iNode.GetPropertyL( + XnPropertyNames::newsticker::KRestartAfterUpdate ) ); + if ( restartProperty && restartProperty->StringValue() == XnPropertyNames::KTrue ) { iRestartAfterUpdate = ETrue; @@ -337,13 +240,14 @@ // Symbian static 1st phase constructor // ----------------------------------------------------------------------------- // -CXnNewstickerAdapter* CXnNewstickerAdapter::NewL(CXnControlAdapter* aParent, - CXnNodePluginIf& aNode) +CXnNewstickerAdapter* CXnNewstickerAdapter::NewL( CXnControlAdapter* aParent, + CXnNodePluginIf& aNode ) { CXnNewstickerAdapter* self = new( ELeave ) CXnNewstickerAdapter( aParent, aNode ); CleanupStack::PushL( self ); - self->ConstructL(); + self->ConstructL( aParent ); CleanupStack::Pop(); + return self; } @@ -352,28 +256,32 @@ // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::ConstructL() +void CXnNewstickerAdapter::ConstructL( CXnControlAdapter* aParent ) { CXnControlAdapter::ConstructL( iNode ); iControl = CXnNewstickerControl::NewL( this ); - iSvgControl = CXnNewstickerSvgControl::NewL( this ); + + iMarqueeControl = CAknMarqueeControl::NewL(); + TCallBack callback( RedrawCallback, this ); + iMarqueeControl->SetRedrawCallBack( callback ); + iMarqueeControl->SetContainerWindowL( *aParent ); + iMarqueeControl->ActivateL(); iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - iPowerSaveMode = ETrue; - - iRestartAfterUpdate = EFalse; SetTextPropertiesL(); SetNewstickerPropertiesL(); RPointerArray children = iNode.ChildrenL(); CleanupClosePushL( children ); + for( TInt i = 0; i < children.Count(); ++i ) { CXnNodePluginIf* child( children[i] ); CXnType* xnType = child->Type(); + // We only care for nodes if ( xnType && xnType->Type() == XnPropertyNames::title::KTitle ) { @@ -402,6 +310,9 @@ } } CleanupStack::PopAndDestroy( &children ); + + iControl->SetCurrentTitle( ETrue ); + } // ----------------------------------------------------------------------------- @@ -409,9 +320,18 @@ // C++ default constructor // ----------------------------------------------------------------------------- // -CXnNewstickerAdapter::CXnNewstickerAdapter(CXnControlAdapter* /*aParent*/, - CXnNodePluginIf& aNode) - : iState(ENotStarted), iNode(aNode) +CXnNewstickerAdapter::CXnNewstickerAdapter( CXnControlAdapter* /*aParent*/, + CXnNodePluginIf& aNode ) + : iNode( aNode ), + iPowerSaveMode( ETrue ), + iRestartAfterUpdate( EFalse ), + iTextColor( KRgbBlack ), + iTextAlignment( ELayoutAlignLeft ), + iTextBaseline( 0 ), + iUnderlining( EUnderlineOff ), + iStrikethrough( EStrikethroughOff ), + iScrollLooping( ETrue ), + iRedraw( ETrue ) { } @@ -422,31 +342,22 @@ // CXnNewstickerAdapter::~CXnNewstickerAdapter() { - if( iPeriodicTimer ) + if( iPeriodicTimer && iPeriodicTimer->IsActive() ) { iPeriodicTimer->Cancel(); } delete iPeriodicTimer; - if( iFont && iReleaseFont ) + if( iFont && ( iReleaseFont == 1 ) ) { CWsScreenDevice* dev = iCoeEnv->ScreenDevice(); dev->ReleaseFont( iFont ); } - + + delete iMarqueeControl; delete iControl; - - if( iState == EAnimation ) - { - TRAP_IGNORE( iSvgControl->StopL() ); - } - - delete iSvgControl; - delete iBufferDevice; - delete iDrawingBuffer; - delete iBufferGc; - delete iBackgroundBitmap; + } // ----------------------------------------------------------------------------- @@ -456,35 +367,36 @@ // void CXnNewstickerAdapter::SetTextPropertiesL() { - if (iFont && iReleaseFont) + if (iFont && ( iReleaseFont == 1 ) ) { CWsScreenDevice* dev = iCoeEnv->ScreenDevice(); dev->ReleaseFont(iFont); iFont = NULL; } + CXnUtils::CreateFontL(iNode, iFont, iReleaseFont); - iControl->SetFont(iFont); TBool colorSet(EFalse); CXnProperty* colorProperty = iNode.GetPropertyL(XnPropertyNames::appearance::common::KColor); - if (colorProperty != NULL) + + if( colorProperty ) { CXnDomProperty* domProperty = colorProperty->Property(); if(domProperty) { - TRgb textColor; TInt error( KErrNotSupported ); CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* > ( domProperty->PropertyValueList().Item( 0 ) ); + if( value->IsAutoIdent() ) { MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - error = AknsUtils::GetCachedColor(skinInstance, textColor, KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6); + error = AknsUtils::GetCachedColor( skinInstance, iTextColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); } else if( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor ) { - textColor = value->RgbColorValueL(); + iTextColor = value->RgbColorValueL(); error = KErrNone; } else @@ -497,30 +409,32 @@ TInt index = 0; TAknsItemID skinID; - TBool idResolved = CXnUtils::ResolveSkinItemIDL( colorString->Des(), skinID, index ); + TBool idResolved = CXnUtils::ResolveSkinItemIDL( + colorString->Des(), skinID, index ); if( idResolved ) { MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - error = AknsUtils::GetCachedColor( skinInstance, textColor, skinID, index ); + error = AknsUtils::GetCachedColor( + skinInstance, iTextColor, skinID, index ); } else // use auto value if skin id is invalid. { MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - error = AknsUtils::GetCachedColor(skinInstance, textColor, KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6); + error = AknsUtils::GetCachedColor(skinInstance, iTextColor, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6); } CleanupStack::PopAndDestroy( colorString ); } - if (error == KErrNone) + + if ( error == KErrNone ) { - iControl->SetTextColor(textColor); colorSet = ETrue; } } } - if(!colorSet) // Use text skin color + if( !colorSet ) // Use text skin color { MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); TRgb textColor; @@ -528,471 +442,317 @@ KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6); if (error == KErrNone) { - iControl->SetTextColor(textColor); + iTextColor = textColor; } } CXnProperty* textDecorationProp = iNode.GetPropertyL(XnPropertyNames::appearance::common::KTextDecoration); - if(textDecorationProp) + + if( textDecorationProp ) { CXnDomList& propertyValueList = textDecorationProp->Property()->PropertyValueList(); TInt valueCount = propertyValueList.Length(); - for (TInt i = 0; i < valueCount; ++i) + + for( TInt i = 0; i < valueCount; ++i ) { CXnDomPropertyValue* value = static_cast<CXnDomPropertyValue*>(propertyValueList.Item(i)); if (value->StringValueL() == XnPropertyNames::appearance::common::textdecoration::KUnderline) { - iControl->SetTextUnderlineStyle(EUnderlineOn); + iUnderlining = EUnderlineOn; } if (value->StringValueL() == XnPropertyNames::appearance::common::textdecoration::KLinethrough) { - iControl->SetTextStrikethroughStyle(EStrikethroughOn); + iStrikethrough = EStrikethroughOn; } } } TGulAlignmentValue alignment = CXnUtils::TextAlignment( iNode ); - TInt textAlignment( ELayoutAlignLeft ); // all are vertically top aligned by default (avkon) - switch( alignment ) { case EHCenterVCenter: - textAlignment = ELayoutAlignCenter; + iTextAlignment = ELayoutAlignCenter; break; + case EHRightVCenter: - textAlignment = ELayoutAlignRight; + iTextAlignment = ELayoutAlignRight; break; + default: + iTextAlignment = ELayoutAlignLeft; break; - } - - iControl->SetTextAlignment(textAlignment); + } } -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::AppendTitleL -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::AppendTitleL(const TDesC& aTitle) +void CXnNewstickerAdapter::AppendTitleL( const TDesC& aTitle ) { - iControl->AppendTitleL(aTitle); - iNode.SetDirtyL(); - } - -// --------------------------------------------------------- -// CXnNewstickerAdapter::InsertTitleL -// --------------------------------------------------------- -// -void CXnNewstickerAdapter::InsertTitleL(const TDesC& aTitle, TInt aIndex) - { - iControl->InsertTitleL(aTitle, aIndex); + iControl->AppendTitleL( aTitle ); iNode.SetDirtyL(); } -// --------------------------------------------------------- -// CXnNewstickerAdapter::UpdateTitleL -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::InsertTitleL +// ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::UpdateTitleL(const TDesC& aTitle, TInt aIndex) +void CXnNewstickerAdapter::InsertTitleL( const TDesC& aTitle, TInt aIndex ) { - iControl->UpdateTitleL(aTitle, aIndex); + iControl->InsertTitleL( aTitle, aIndex ); iNode.SetDirtyL(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::UpdateTitleL +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::UpdateTitleL( const TDesC& aTitle, TInt aIndex ) + { + iControl->UpdateTitleL( aTitle, aIndex ); + iNode.SetDirtyL(); + if ( iRestartAfterUpdate ) { - RestartL(); + Stop(); + Start(); } } -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::DeleteTitleL -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::DeleteTitleL(TInt aIndex) +void CXnNewstickerAdapter::DeleteTitleL( TInt aIndex ) { - if( iState == EAnimation && iControl->CurrentTitleIndex() == aIndex ) - { - // About to delete the currently showing animation - iSvgControl->StopL(); - iControl->DeleteTitleL( aIndex ); - - RestartL(); - } - else - { - iControl->DeleteTitleL(aIndex); - } - + iControl->DeleteTitleL( aIndex ); iNode.SetDirtyL(); } -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::CurrentTitleIndex -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // TInt CXnNewstickerAdapter::CurrentTitleIndex() { return iControl->CurrentTitleIndex(); } -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::Title -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // -const TDesC& CXnNewstickerAdapter::Title(TInt aIndex) +const TDesC& CXnNewstickerAdapter::Title( TInt aIndex ) { - return iControl->Title(aIndex); + return iControl->Title( aIndex ); } -// --------------------------------------------------------- -// CXnNewstickerAdapter::SetSeparatorImageL -// --------------------------------------------------------- -// -TInt CXnNewstickerAdapter::SetSeparatorImageL(CGulIcon* aIcon) - { - return iControl->SetSeparatorImageL(aIcon); - } - -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::ClearTitles -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // void CXnNewstickerAdapter::ClearTitles() { iControl->ClearTitles(); - TRAP_IGNORE(iNode.SetDirtyL()); - } - -// --------------------------------------------------------- -// CXnNewstickerAdapter::AppendSvgTitleL -// --------------------------------------------------------- -// -void CXnNewstickerAdapter::AppendSvgTitleL(const TDesC8& aByteData) - { - iControl->AppendSvgTitleL(aByteData); + TRAP_IGNORE( iNode.SetDirtyL() ); } -// --------------------------------------------------------- -// CXnNewstickerAdapter::InsertSvgTitleL -// --------------------------------------------------------- -// -void CXnNewstickerAdapter::InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) - { - iControl->InsertSvgTitleL(aByteData, aIndex); - } - -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::SetCallbackInterfaceL -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // void CXnNewstickerAdapter::SetCallbackInterfaceL( - XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback) + XnNewstickerInterface::MXnNewstickerCallbackInterface* aCallback ) { iCallback = aCallback; } -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::TitleScrolled -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::TitleScrolled(TInt aTitleIndex) +void CXnNewstickerAdapter::TitleScrolled( TInt aTitleIndex ) { - if (iCallback) + if( iCallback ) { - iCallback->TitleScrolled(aTitleIndex); - } - // if not looping, see if the last item was scrolled... - if( !iControl->ScrollLooping() && - aTitleIndex == iControl->TitleCount() - 1 ) - { - iState = EScrollEnded; - TRAP_IGNORE( StopL() ); - DrawNow(); + iCallback->TitleScrolled( aTitleIndex ); } } // ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::DrawBackground() -// ----------------------------------------------------------------------------- -// -void CXnNewstickerAdapter::DrawBackgroundL(const TRect& aRect, CWindowGc& aGc) const - { - RPointerArray<CXnControlAdapter> adapters; - - for ( CXnNodePluginIf* node = &iNode; node; ) - { - CXnControlAdapter* adapter( node->Control() ); - - if ( adapter ) - { - adapters.Append( adapter ); - } - - node = node->ParentL(); - } - - for ( TInt i = adapters.Count() - 1; i >= 0; --i ) - { - adapters[i]->Draw( aRect, aGc ); - } - - adapters.Reset(); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::SetTimerToDisplaytime() +// CXnNewstickerAdapter::StartL // ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::SetTimerToDisplaytime() - { - if( iCurrentInterval != iAlternateInterval ) - { - iPeriodicTimer->Cancel(); - - iPeriodicTimer->Start( - TTimeIntervalMicroSeconds32( iAlternateInterval ), - TTimeIntervalMicroSeconds32( iAlternateInterval ), - TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); - iCurrentInterval = iAlternateInterval; - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::SetTimerToScrolltime() -// ----------------------------------------------------------------------------- -// -void CXnNewstickerAdapter::SetTimerToScrolltime() +void CXnNewstickerAdapter::Start() { - if( iCurrentInterval != iInterval ) + if( IsVisible() && !iPowerSaveMode ) { - iPeriodicTimer->Cancel(); - - iPeriodicTimer->Start( - TTimeIntervalMicroSeconds32( iInterval ), - TTimeIntervalMicroSeconds32( iInterval ), - TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); - iCurrentInterval = iInterval; - } - } -// --------------------------------------------------------- -// CXnNewstickerAdapter::StartL -// --------------------------------------------------------- -// -void CXnNewstickerAdapter::StartL() - { - if( iDisplay && !iPowerSaveMode ) - { - if( iControl->TitleCount() == 0 ) + if( iControl->TitleCount() < 1 ) { // Nothing to show return; } - - if( iPeriodicTimer && !iPeriodicTimer->IsActive() ) + + switch( iScrollBehaviour ) { - TInt startDelay( ( iState == ENotStarted ) ? iDelay : KNoDelay ); - - // Start - if ( ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && - iControl->CalculateCurrentTextFitInNewstickerRect() ) + case EScroll: + { + iMarqueeControl->EnableMarquee( ETrue ); + iRedraw = ETrue; + } + break; + + case EAlternate: { - iPeriodicTimer->Start( - TTimeIntervalMicroSeconds32( startDelay ), - TTimeIntervalMicroSeconds32( iAlternateInterval ), - TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); - iCurrentInterval = iAlternateInterval; + iMarqueeControl->EnableMarquee( EFalse ); + StartAlternateCounter(); } - else + break; + + case EScrollAlternate: { - iPeriodicTimer->Start( - TTimeIntervalMicroSeconds32( startDelay ), - TTimeIntervalMicroSeconds32( iInterval ), - TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); - iCurrentInterval = iInterval; + iMarqueeControl->EnableMarquee( ETrue ); + StartAlternateCounter(); + iRedraw = ETrue; } - - iState = EText; - } + break; + + default: + break; + } } } -// --------------------------------------------------------- -// CXnNewstickerAdapter::StopL -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::Stop +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::Stop() + { + StopAlternateCounter(); + StopMarquee(); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::StopAlternateCounter +// ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::StopL() +void CXnNewstickerAdapter::StopAlternateCounter() + { + if( iPeriodicTimer && iPeriodicTimer->IsActive() ) + { + iPeriodicTimer->Cancel(); + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::StopMarquee +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::StopMarquee() { - if( iState == EAnimation ) + iMarqueeControl->Reset(); + iMarqueeControl->EnableMarquee( EFalse ); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::StartCounter +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::StartAlternateCounter() + { + if( iPeriodicTimer && iPeriodicTimer->IsActive() ) { - iSvgControl->StopL(); + iPeriodicTimer->Cancel(); } - // Have we already been started - if( iPeriodicTimer->IsActive() ) - { - // Yes, cancel and set the state - iPeriodicTimer->Cancel(); - - if ( iState == EScrollEnded ) - { - iControl->MoveToLastL(); - iControl->DrawStatic(); - } - else if ( iState == EText || iState == EAnimation ) - { - iState = EPaused; - } - } - // Entering power save mode => Move to last item and draw it - if ( ( iScrollBehaviour == EAlternate || - iScrollBehaviour == EScrollAlternate ) - && iPowerSaveMode ) - { - iState = EPaused; - iControl->MoveToLastL(); - iControl->DrawStatic(); - } + iPeriodicTimer->Start( + TTimeIntervalMicroSeconds32( iAlternateDelay ), + TTimeIntervalMicroSeconds32( iAlternateInterval ), + TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); } -// --------------------------------------------------------- -// CXnNewstickerAdapter::ShowSvgL -// --------------------------------------------------------- -// -void CXnNewstickerAdapter::ShowSvgL() - { - // Get next animation from model and start it - iSvgControl->StartL( iControl->CurrentSvgTitle() ); - - // Set the end timer - iState = EAnimation; - - iPeriodicTimer->Cancel(); - - iPeriodicTimer->Start( - TTimeIntervalMicroSeconds32( iAnimationTime ), - TTimeIntervalMicroSeconds32( iAnimationTime ), - TCallBack( CXnNewstickerAdapter::PeriodicEventL, this ) ); - iCurrentInterval = iAnimationTime; - } - -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::PeriodicEventL -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // TInt CXnNewstickerAdapter::PeriodicEventL( TAny* aPtr ) { CXnNewstickerAdapter* self = static_cast< CXnNewstickerAdapter* >( aPtr ); - - if( self->iState == EText ) - { - // Do the text scroll - self->iControl->DoScrollL(); - } - else if( self->iState == EAnimation ) - { - self->iSvgControl->StopL(); - self->TitleScrolled( self->iControl->CurrentTitleIndex() ); - // Animation scroll has been ended, start the next scroll - self->iState = ENotStarted; - self->iPeriodicTimer->Cancel(); - self->StartL(); - // Do the first draw - self->iControl->SetBeginningState(); - self->iControl->DoScrollL(); - } - + self->DoScroll(); + return KErrNone; } -void CXnNewstickerAdapter::RestartL() +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::MakeVisible() +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::MakeVisible( TBool aVisible ) { - if ( iPowerSaveMode ) + if( aVisible ) { - return; + Start(); } - // Restart - iState = ENotStarted; - iPeriodicTimer->Cancel(); - - iControl->MoveToFirstL(); - StartL(); - - // Do the first draw - iControl->SetBeginningState(); + else + { + Stop(); + } + + CCoeControl::MakeVisible( aVisible ); } -// --------------------------------------------------------- + +// ----------------------------------------------------------------------------- // CXnNewstickerAdapter::SizeChanged() -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // void CXnNewstickerAdapter::SizeChanged() { - CXnControlAdapter::SizeChanged(); - TRAP_IGNORE( SizeChangedL() ); + CXnControlAdapter::SizeChanged(); + iMarqueeControl->SetExtent( iNode.Rect().iTl, iNode.Rect().Size() ); + + iTextBaseline = iNode.Rect().Height() / 2 + iFont->AscentInPixels() / 2; } -// --------------------------------------------------------- -// CXnNewstickerAdapter::SizeChangedL() -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::CountComponentControls() const +// ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::SizeChangedL() - { - UpdateDoubleBufferL(); - - TRect rect( Rect() ); - - iControl->SetNewstickerRect( rect ); - iSvgControl->SetSvgRectL( rect, *SystemGc().Device() ); +TInt CXnNewstickerAdapter::CountComponentControls() const + { + return 1; // return nbr of controls inside this container } // ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::HandlePointerEventL +// CXnNewstickerAdapter::ComponentControl(TInt aIndex) const // ----------------------------------------------------------------------------- -// -void CXnNewstickerAdapter::HandlePointerEventL(const TPointerEvent& aPointerEvent) +// +CCoeControl* CXnNewstickerAdapter::ComponentControl( TInt aIndex ) const { - if ( AknLayoutUtils::PenEnabled() ) - { - CXnControlAdapter::HandlePointerEventL(aPointerEvent); + switch ( aIndex ) + { + case 0: + return iMarqueeControl; + + default: + return NULL; } } + // ----------------------------------------------------------------------------- // CXnNewstickerAdapter::DoHandlePropertyChangeL // ----------------------------------------------------------------------------- // -void CXnNewstickerAdapter::DoHandlePropertyChangeL( CXnProperty* aProperty ) +void CXnNewstickerAdapter::DoHandlePropertyChangeL( CXnProperty* /*aProperty*/ ) { SetTextPropertiesL(); SetNewstickerPropertiesL(); - //New code to check do we need Start or Stop Newsticker - if( aProperty ) - { - const TDesC8& name( aProperty->Property()->Name() ); - - if( name == XnPropertyNames::style::common::KDisplay || - name == XnPropertyNames::style::common::KVisibility ) - { - if( CheckDisplayL( iNode ) ) - { - StartL(); - } - else - { - StopL(); - } - } - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::FocusChanged -// ----------------------------------------------------------------------------- -// -void CXnNewstickerAdapter::FocusChanged(TDrawNow /*aDrawNow*/) - { } // ----------------------------------------------------------------------------- @@ -1005,257 +765,183 @@ TRAP_IGNORE( SetTextPropertiesL() ); } -void CXnNewstickerAdapter::ReportNewstickerEventL(const TDesC8& aEventName) - { - TBuf8<8>index(KNullDesC8); - index.Num(CurrentTitleIndex()); - - iNode.ReportTriggerEventL(aEventName, - XnPropertyNames::action::trigger::name::KTitleIndex, index); - } // ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::OfferKeyEventL +// CXnNewstickerAdapter::ReportNewstickerEventL // ----------------------------------------------------------------------------- // -TKeyResponse CXnNewstickerAdapter::OfferKeyEventL( - const TKeyEvent& aKeyEvent, TEventCode aType) - { - TKeyResponse resp = EKeyWasNotConsumed; - TBool restart = EFalse; - - CXnControlAdapter::OfferKeyEventL(aKeyEvent, aType); - - if(aType == EEventKey) - { - if (aKeyEvent.iScanCode == EStdKeyRightArrow) - { - restart = ETrue; - if(iControl->IsWestern()) - { - iControl->MoveToNextL(); - } - else - { - iControl->MoveToPrevL(); - } - StopL(); - } - else if (aKeyEvent.iScanCode == EStdKeyLeftArrow) - { - restart = ETrue; - if(iControl->IsWestern()) - { - iControl->MoveToPrevL(); - } - else - { - iControl->MoveToNextL(); - } - StopL(); - } - } - if(aType == EEventKeyUp) - { - if (aKeyEvent.iScanCode == EStdKeyDevice3) // rocker - { - restart = ETrue; - StopL(); - iControl->MoveToCurrent(); - } - } - - if( restart ) - { - // Restart and do the first draw - iState = ENotStarted; - StartL(); - iControl->DoScrollL(); - } - - return resp; +void CXnNewstickerAdapter::ReportNewstickerEvent( const TDesC8& aEventName ) + { + TBuf8<KByteLength>index( KNullDesC8 ); + index.Num( CurrentTitleIndex() ); + + TRAP_IGNORE( iNode.ReportTriggerEventL( aEventName, + XnPropertyNames::action::trigger::name::KTitleIndex, index ); ) } // ----------------------------------------------------------------------------- // CXnNewstickerAdapter::Draw // Draws the text component // ----------------------------------------------------------------------------- -void CXnNewstickerAdapter::Draw(const TRect& aRect) const - { - CXnControlAdapter::Draw( aRect ); - - TRAP_IGNORE( UpdateBackgroundL() ); - // In powersave-/editmode only draw the last title. - if ( iScrollBehaviour == EAlternate && iPowerSaveMode ) - { - iControl->DrawStatic(); - - // Blit double buffer - SystemGc().BitBlt( Rect().iTl, iDrawingBuffer ); - } - else if( iState == EText || iState == EPaused && - iControl->CurrentTitleIndex() >= 0 ) - { - iControl->Draw(); - - // Blit double buffer - SystemGc().BitBlt( Rect().iTl, iDrawingBuffer ); - } - else if( iState == EAnimation ) - { - iSvgControl->Draw(); - - // Blit double buffer - SystemGc().BitBlt( Rect().iTl, iDrawingBuffer ); - } - else if( iState == EScrollEnded ) - { - iControl->DrawStatic(); - SystemGc().BitBlt( Rect().iTl, iDrawingBuffer ); - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::UpdateDoubleBufferL -// ----------------------------------------------------------------------------- -// -void CXnNewstickerAdapter::UpdateDoubleBufferL() - { - TDisplayMode displayMode( SystemGc().Device()->DisplayMode() ); - - // Create double buffer - if( iDrawingBuffer ) - { - delete iDrawingBuffer; - iDrawingBuffer = NULL; - delete iBufferDevice; - iBufferDevice = NULL; - delete iBufferGc; - iBufferGc = NULL; - } - - iDrawingBuffer = new ( ELeave ) CFbsBitmap(); - iDrawingBuffer->Create( iNode.Rect().Size(), displayMode ); - iBufferDevice = CFbsBitmapDevice::NewL( iDrawingBuffer ); - iBufferDevice->CreateBitmapContext( iBufferGc ); - iBufferGc->UseFont( iControl->Font() ); - iBufferGc->SetPenColor( iControl->TextColor() ); - iBufferGc->SetStrikethroughStyle( iControl->TextStrikethroughStyle() ); - iBufferGc->SetUnderlineStyle( iControl->TextUnderlineStyle() ); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::UpdateBackgroundL -// ----------------------------------------------------------------------------- -// -void CXnNewstickerAdapter::UpdateBackgroundL() const - { - TDisplayMode displayMode( SystemGc().Device()->DisplayMode() ); - - // Create "screenshot" from the background appearance - if( iBackgroundBitmap ) - { - delete iBackgroundBitmap; - iBackgroundBitmap = NULL; - } - - iBackgroundBitmap = new ( ELeave ) CFbsBitmap(); - iBackgroundBitmap->Create( iNode.Rect().Size(), displayMode ); - - CFbsBitmap* tmpBitmap = new ( ELeave ) CFbsBitmap(); - CleanupStack::PushL( tmpBitmap ); - - CWsScreenDevice* scrDevice = static_cast< CWsScreenDevice* >( SystemGc().Device() ); - - TSize tmpSize( scrDevice->SizeInPixels() ); - - tmpBitmap->Create( tmpSize, displayMode ); - - CFbsBitmapDevice* tmpDevice = CFbsBitmapDevice::NewL( tmpBitmap ); - CleanupStack::PushL( tmpDevice ); - - CBitmapContext* bc( NULL ); - - tmpDevice->CreateBitmapContext( bc ); - CleanupStack::PushL( bc ); - - DrawBackgroundL( iNode.Rect(), reinterpret_cast< CWindowGc& >( *bc ) ); - - CopyBitmapData( *iBackgroundBitmap, *tmpBitmap, iNode.Rect().iTl ); - - CleanupStack::PopAndDestroy( 3 ); +void CXnNewstickerAdapter::Draw( const TRect& aRect ) const + { + const_cast<CXnNewstickerAdapter*>(this)->DrawText( iControl->SelectTitle(), aRect ); } // ----------------------------------------------------------------------------- // CXnNewstickerAdapter::DoEnterPowerSaveModeL // Enter power save mode // ----------------------------------------------------------------------------- -void CXnNewstickerAdapter::DoEnterPowerSaveModeL(TModeEvent /*aEvent*/) - { - iDisplay = EFalse; +void CXnNewstickerAdapter::DoEnterPowerSaveModeL( TModeEvent /*aEvent*/ ) + { iPowerSaveMode = ETrue; - - StopL(); + Stop(); } // ----------------------------------------------------------------------------- // CXnNewstickerAdapter::DoExitPowerSaveModeL // Exit power save mode // ----------------------------------------------------------------------------- -void CXnNewstickerAdapter::DoExitPowerSaveModeL(TModeEvent /*aEvent*/) +void CXnNewstickerAdapter::DoExitPowerSaveModeL( TModeEvent /*aEvent*/ ) { iPowerSaveMode = EFalse; - - if( CheckDisplayL( iNode ) ) + + if( IsVisible() ) { - RestartL(); - - if( iDrawingBuffer ) - { - DrawNow(); - } + Start(); } } // ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::DrawNow -// Draw +// CXnNewstickerAdapter::DrawText +// Text drawing function is selected by scrolling behaviour // ----------------------------------------------------------------------------- -void CXnNewstickerAdapter::DrawNow() const +void CXnNewstickerAdapter::DrawText( const TDesC& aText, const TRect& aRect ) + { + CWindowGc& gc = SystemGc(); + + TRect rect = iNode.Rect(); + + CXnControlAdapter::Draw( aRect ); + + gc.SetPenColor( iTextColor ); + gc.UseFont( iFont ); + gc.SetUnderlineStyle( iUnderlining ); + gc.SetStrikethroughStyle( iStrikethrough ); + + TInt textWidth = iFont->TextWidthInPixels( aText ); + TInt rectWidth = rect.Width(); + + switch( iScrollBehaviour ) + { + case EScroll: + case EScrollAlternate: + { + if( !iRedraw || textWidth < rectWidth ) + { + iMarqueeControl->Stop(); + DrawStaticText( gc, aText ); + } + else + { + iMarqueeControl->Start(); + TBool isLast = DrawMarqueeText( gc, aText ); + + if( isLast ) + { + if( !iScrollLooping ) + { + iRedraw = EFalse; + } + + iMarqueeControl->Reset(); + StartAlternateCounter(); + } + } + } + break; + + case EAlternate: + { + DrawStaticText( gc, aText ); + } + break; + + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::RedrawCallback +// Callback function for marquee control +// ----------------------------------------------------------------------------- +// +TInt CXnNewstickerAdapter::RedrawCallback( TAny* aPtr ) { - TBool parentDrawn = EFalse; - TRAP_IGNORE( parentDrawn = DrawFocusableParentL() ); - if ( !parentDrawn ) + CXnNewstickerAdapter* self = static_cast<CXnNewstickerAdapter*>( aPtr ); + self->DrawNow(); + + return self->Redraw(); + + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::DoScroll +// Scrolls alternative text. Function is called by periodic timer +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::DoScroll() + { + ReportNewstickerEvent( XnPropertyNames::action::trigger::name::KTitleScrolled ); + + if( iControl->SetCurrentTitle() ) { - CCoeControl::DrawNow(); + // stop alternate scrolling if current index is last + StopAlternateCounter(); + } + + DrawNow(); + + ReportNewstickerEvent( XnPropertyNames::action::trigger::name::KTitleToScroll ); + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::DrawStatic +// Draws text directly to screen when scrolling is not needed +// ----------------------------------------------------------------------------- +// +void CXnNewstickerAdapter::DrawStaticText( CWindowGc& aGc, const TDesC& aText ) const + { + HBufC* text = HBufC::New( aText.Length() + KAknBidiExtraSpacePerLine ); + + if( text ) + { + TRect rect = iNode.Rect(); + TInt maxLength = rect.Width(); + TPtr ptr = text->Des(); + AknBidiTextUtils::ConvertToVisualAndClip( + aText, ptr, *iFont, maxLength, maxLength ); + + aGc.DrawText( *text, rect, iTextBaseline, + ( CGraphicsContext::TTextAlign )iTextAlignment ); + + delete text; } } // ----------------------------------------------------------------------------- -// CXnNewstickerAdapter::DrawFocusableParentL -// Draws focusable parent +// CXnNewstickerAdapter::DrawScrolling +// Draws scrolling text to screen via marquee control // ----------------------------------------------------------------------------- -TBool CXnNewstickerAdapter::DrawFocusableParentL() const +// +TBool CXnNewstickerAdapter::DrawMarqueeText( CWindowGc& aGc, const TDesC& aText ) const { - TBool parentDrawn = EFalse; + TRect rect = iNode.Rect(); - if ( !iNode.IsFocusedState() ) - { - // node is not focusable, find focusable and focused parent - CXnNodePluginIf* parent = iNode.ParentL(); - while ( parent && !parent->IsFocusedState() ) - { - parent = parent->ParentL(); - } - - if (parent) - { - // focusable parent found, draw it - parent->Control()->DrawNow(); - parentDrawn = ETrue; - } - } - - return parentDrawn; + // returns true when all loops have been executed + return iMarqueeControl->DrawText( aGc, rect, aText, iTextBaseline, + ( CGraphicsContext::TTextAlign )iTextAlignment, *iFont ); } + // End of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickercontrol.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickercontrol.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickercontrol.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -18,209 +18,26 @@ // INCLUDE FILES #include <AknUtils.h> -#include <gulicon.h> #include <AknsDrawUtils.h> #include <AknBidiTextUtils.h> #include "xnnewstickercontrol.h" #include "xnnewstickeradapter.h" -#include "xnproperty.h" + // CONSTANTS -/** -* for the empty space in pixels between text and image. -*/ -const TInt KGap = 10; - // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::CTitleData -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CXnNewstickerControl::CTitleData::CTitleData(TInt aLenghtInPixels) : - iTitleIsSvg(EFalse), iTextLenghtInPixels(aLenghtInPixels) - { - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CXnNewstickerControl::CTitleData::~CTitleData() - { - delete iText; - delete iData; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::CTitleData::ConstructL(const TDesC& aTitle) - { - delete iText; - iText = NULL; - iText = aTitle.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::CTitleData::ConstructL(const TDesC8& aByteData) - { - iTitleIsSvg = ETrue; - iData = aByteData.AllocL(); - iText = KNullDesC().AllocL(); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnNewstickerControl::CTitleData* CXnNewstickerControl::CTitleData::NewL( - const TDesC& aTitle, TInt aLenghtInPixels) - { - CXnNewstickerControl::CTitleData* self = - CXnNewstickerControl::CTitleData::NewLC(aTitle, aLenghtInPixels); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnNewstickerControl::CTitleData* CXnNewstickerControl::CTitleData::NewLC( - const TDesC& aTitle, TInt aLenghtInPixels) - { - CXnNewstickerControl::CTitleData* self = - new(ELeave) CXnNewstickerControl::CTitleData(aLenghtInPixels); - CleanupStack::PushL(self); - self->ConstructL(aTitle); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnNewstickerControl::CTitleData* CXnNewstickerControl::CTitleData::NewL( - const TDesC8& aByteData) - { - CXnNewstickerControl::CTitleData* self = - CXnNewstickerControl::CTitleData::NewLC(aByteData); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnNewstickerControl::CTitleData* CXnNewstickerControl::CTitleData::NewLC( - const TDesC8& aByteData) - { - CXnNewstickerControl::CTitleData* self = - new(ELeave) CXnNewstickerControl::CTitleData(); - CleanupStack::PushL(self); - self->ConstructL(aByteData); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::TitleText -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -const TDesC& CXnNewstickerControl::CTitleData::TitleText() - { - return *iText; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::SetTitleText -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::CTitleData::SetTitleTextL(const TDesC& aTitle) - { - HBufC* newTitle = aTitle.AllocL(); - delete iText; - iText = newTitle; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::TitleTextLengthInPixels -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CXnNewstickerControl::CTitleData::TitleTextLengthInPixels() - { - return iTextLenghtInPixels; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::SetTitleTextLengthInPixels -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::CTitleData::SetTitleTextLengthInPixels(TInt aLenghtInPixels) - { - iTextLenghtInPixels = aLenghtInPixels; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::IsSvgTitle -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CXnNewstickerControl::CTitleData::IsSvgTitle() - { - return iTitleIsSvg; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CTitleData::SvgTitleData -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -const TDesC8& CXnNewstickerControl::CTitleData::SvgTitleData() - { - return *iData; - } - -// ----------------------------------------------------------------------------- // CXnNewstickerControl::CXnNewstickerControl // C++ default constructor can NOT contain any code, that // might leave. // ----------------------------------------------------------------------------- // -CXnNewstickerControl::CXnNewstickerControl(CXnNewstickerAdapter* aAdapter) : - iFirstDrawingTitleIndex(0), - iFirstDrawingOffset(0), - iImageWidthInPixels(0), - iCurrentTitleIndex(-1), - iSeparatorimage(NULL), - iSeparatorImageWidth(0), - iFont(NULL), - iTextBaseline(0), - iTextColor(KRgbBlack), - iUnderlining(EUnderlineOff), - iStrikethrough(EStrikethroughOff), - iIsWestern(ETrue), - iAdapter(aAdapter), - iTextAlignment(ELayoutAlignLeft) +CXnNewstickerControl::CXnNewstickerControl( CXnNewstickerAdapter* aAdapter ) : + iCurrentTitleIndex( -1 ), + iAdapter( aAdapter ) { } @@ -231,11 +48,7 @@ // void CXnNewstickerControl::ConstructL() { - if(AknLayoutUtils::LayoutMirrored()) - { - iIsWestern = EFalse; - iTextAlignment = ELayoutAlignRight; - } + } // ----------------------------------------------------------------------------- @@ -243,12 +56,12 @@ // Two-phased constructor. // ----------------------------------------------------------------------------- // -CXnNewstickerControl* CXnNewstickerControl::NewL(CXnNewstickerAdapter* aAdapter) +CXnNewstickerControl* CXnNewstickerControl::NewL( CXnNewstickerAdapter* aAdapter ) { - CXnNewstickerControl* self = new(ELeave)CXnNewstickerControl(aAdapter); - CleanupStack::PushL(self); + CXnNewstickerControl* self = new(ELeave)CXnNewstickerControl( aAdapter ); + CleanupStack::PushL( self ); self->ConstructL(); - CleanupStack::Pop(); + CleanupStack::Pop(); // self return self; } @@ -259,55 +72,7 @@ // CXnNewstickerControl::~CXnNewstickerControl() { - iTitles.ResetAndDestroy(); - delete iSeparatorimage; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetScrollAmount -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::SetScrollAmount(TInt aScrollAmount) - { - iSpeed = aScrollAmount; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetNewstickerRect -// Set visible rect. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::SetNewstickerRect(TRect& aContentRect) - { - if(iContentRect != aContentRect) - { - iContentRect = aContentRect; - iTextBaseline = iContentRect.Height() / 2 + iFont->AscentInPixels() / 2; - SetBeginningState(); - for(TInt i = 0; i < iTitles.Count(); i++) - { - if(!iTitles[i]->IsSvgTitle()) - { - TInt textWidth = iFont->TextWidthInPixels( - iTitles[i]->TitleText()); - iTitles[i]->SetTitleTextLengthInPixels(textWidth); - } - } - CalculateTextFitInNewstickerRect(); - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::IsWestern -// Returns ETrue if western layout is used, otherwise EFalse is returned. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CXnNewstickerControl::IsWestern() - { - return iIsWestern; + iTitleTexts.ResetAndDestroy(); } // ----------------------------------------------------------------------------- @@ -315,1096 +80,214 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -void CXnNewstickerControl::AppendTitleL(const TDesC& aTitle) +void CXnNewstickerControl::AppendTitleL( const TDesC& aTitle ) { - TInt textWidth = iFont->TextWidthInPixels(aTitle); - CTitleData* title = CTitleData::NewLC(aTitle, textWidth); - iTitles.AppendL(title); - CleanupStack::Pop(title); - - CalculateTextFitInNewstickerRect(); + HBufC* title = aTitle.AllocLC(); + iTitleTexts.AppendL( title ); + CleanupStack::Pop( title ); + } - // if this is the first item - if(iTitles.Count() == 1) +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::InsertTitleL +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::InsertTitleL( const TDesC& aTitle, TInt aIndex ) + { + if( aIndex >= 0 && aIndex < iTitleTexts.Count() ) { - iCurrentTitleIndex = 0; - iAdapter->StartL(); + HBufC* title = aTitle.AllocLC(); + iTitleTexts.InsertL( title, aIndex ); + CleanupStack::Pop( title ); + } + else + { + AppendTitleL( aTitle ); } } -// --------------------------------------------------------- -// CXnNewstickerControl::InsertTitleL -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::UpdateTitleL +// ----------------------------------------------------------------------------- // -void CXnNewstickerControl::InsertTitleL(const TDesC& aTitle, TInt aIndex) +void CXnNewstickerControl::UpdateTitleL( const TDesC& aTitle, TInt aIndex ) { - TInt textWidth = iFont->TextWidthInPixels(aTitle); - CTitleData* title = CTitleData::NewLC(aTitle, textWidth); - iTitles.InsertL(title, aIndex); - CleanupStack::Pop(title); - - - CountIndexAfterInsertL(aIndex); - CalculateTextFitInNewstickerRect(); - } - -// --------------------------------------------------------- -// CXnNewstickerControl::UpdateTitleL -// --------------------------------------------------------- -// -void CXnNewstickerControl::UpdateTitleL(const TDesC& aTitle, TInt aIndex) - { - if ( aIndex >= 0 && aIndex < iTitles.Count() ) + if( aIndex >= 0 && aIndex < iTitleTexts.Count() ) { - CTitleData* titleData = iTitles[aIndex]; - TInt textWidth = iFont->TextWidthInPixels(aTitle); - titleData->SetTitleTextL(aTitle); - titleData->SetTitleTextLengthInPixels(textWidth); - CalculateTextFitInNewstickerRect(); + HBufC* oldTitle = iTitleTexts[ aIndex ]; + iTitleTexts.Remove( aIndex ); + + delete oldTitle; + oldTitle = NULL; + + HBufC* title = aTitle.AllocLC(); + iTitleTexts.InsertL( title, aIndex ); + CleanupStack::Pop( title ); } else { - AppendTitleL(aTitle); + AppendTitleL( aTitle ); } } -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // CXnNewstickerControl::DeleteTitle -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- // -void CXnNewstickerControl::DeleteTitleL(TInt aIndex) +void CXnNewstickerControl::DeleteTitleL( TInt aIndex ) { - TInt count = iTitles.Count(); - if (aIndex >= 0 && aIndex < count) + TInt count = iTitleTexts.Count(); + + if( aIndex >= 0 && aIndex < count ) { // If the last item will be deleted if(count == 1) { - iAdapter->StopL(); - iFirstDrawingTitleIndex = GetNextTitleWithContent( 0 ); - SetBeginningState(); + iAdapter->Stop(); iCurrentTitleIndex = -1; } - if (aIndex == iFirstDrawingTitleIndex) - { - // If this happens to be the last item in the list - if(aIndex == count - 1) - { - iFirstDrawingTitleIndex = GetNextTitleWithContent( 0 ); - } - SetBeginningState(); - iCurrentTitleIndex = iFirstDrawingTitleIndex; - } - - // Check if the title was deleted before the current title - else if (aIndex < iFirstDrawingTitleIndex) - { - iCurrentTitleIndex--; - iFirstDrawingTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex-1, ETrue); - } - UpdateTitleL(KNullDesC, aIndex); - CalculateTextFitInNewstickerRect(); - } - } - -// --------------------------------------------------------- -// CXnNewstickerControl::CurrentTitleIndex -// --------------------------------------------------------- -// -TInt CXnNewstickerControl::CurrentTitleIndex() - { - return iCurrentTitleIndex; - } - -// --------------------------------------------------------- -// CXnNewstickerControl::Title -// --------------------------------------------------------- -// -const TDesC& CXnNewstickerControl::Title(TInt aIndex) - { - if (aIndex < 0 || aIndex >= iTitles.Count()) - { - return KNullDesC; - } - - if (iTitles[aIndex]->IsSvgTitle()) - { - return KNullDesC; - } - - return iTitles[aIndex]->TitleText(); - } - -// --------------------------------------------------------- -// CXnNewstickerControl::SetSeparatorImageL -// --------------------------------------------------------- -// -TInt CXnNewstickerControl::SetSeparatorImageL(CGulIcon* aIcon) - { - CFbsBitmap* bitmap = aIcon->Bitmap(); - if(AknIconUtils::IsMifIcon(bitmap)) - { - delete iSeparatorimage; - iSeparatorimage = aIcon; - TInt maxHeight = iContentRect.Height(); - TSize size = TSize(maxHeight, maxHeight); - AknIconUtils::SetSize(bitmap, size, EAspectRatioPreservedAndUnusedSpaceRemoved); - iSeparatorImageWidth = bitmap->SizeInPixels().iWidth + KGap; - return KErrNone; - } - else - { - iSeparatorimage = NULL; - return KErrNotSupported; - } - } - -// --------------------------------------------------------- -// CXnNewstickerControl::ClearTitles -// --------------------------------------------------------- -// -void CXnNewstickerControl::ClearTitles() - { - TRAP_IGNORE(iAdapter->StopL()); - iFirstDrawingTitleIndex = 0; - SetBeginningState(); - iCurrentTitleIndex = -1; - // Don't delete just clear the contents - for( TInt i = 0; i < iTitles.Count(); ++i ) - { - TRAP_IGNORE( UpdateTitleL( KNullDesC, i ) ); - } - iTextFitInNewstickerRect = EFalse; - } - -// --------------------------------------------------------- -// CXnNewstickerControl::AppendSvgTitleL -// --------------------------------------------------------- -// -void CXnNewstickerControl::AppendSvgTitleL(const TDesC8& aByteData) - { - CTitleData* title = CTitleData::NewLC(aByteData); - iTitles.AppendL(title); - CleanupStack::Pop(title); - - // if this is the first item - if(iTitles.Count() == 1) - { - iCurrentTitleIndex = 0; - iAdapter->StartL(); - } - } - -// --------------------------------------------------------- -// CXnNewstickerControl::InsertSvgTitleL -// --------------------------------------------------------- -// -void CXnNewstickerControl::InsertSvgTitleL(const TDesC8& aByteData, TInt aIndex) - { - CTitleData* title = CTitleData::NewLC(aByteData); - iTitles.InsertL(title, aIndex); - CleanupStack::Pop(title); - CountIndexAfterInsertL(aIndex); - } - -// --------------------------------------------------------- -// CXnNewstickerControl::CurrentSvgTitle -// --------------------------------------------------------- -// -const TDesC8& CXnNewstickerControl::CurrentSvgTitle() - { - if ( iFirstDrawingTitleIndex < 0 || iFirstDrawingTitleIndex >= iTitles.Count() ) - { - return KNullDesC8; - } - - CTitleData* title = iTitles[iFirstDrawingTitleIndex]; - // Is it SVG title - if (title->IsSvgTitle()) - { - // Yes, advance the title index - iFirstDrawingTitleIndex++; - if (iFirstDrawingTitleIndex >= iTitles.Count()) - { - iFirstDrawingTitleIndex = 0; - } - // Return the data - return title->SvgTitleData(); - } - - // Not svg title, return empty desc - return KNullDesC8; - } - -// --------------------------------------------------------- -// CXnNewstickerControl::TitleCount -// --------------------------------------------------------- -// -TInt CXnNewstickerControl::TitleCount() const - { - return iTitles.Count(); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::MoveToNext -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::MoveToNextL() - { - // If there are no titles, don't do anything. - if (!IsVisibleTitles()) - { - return ; - } - // Skip notification of the first title - if ( iCurrentTitleIndex != GetNextTitleWithContent( 0 ) ) - { - iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleScrolled); - } - // Don't report the last TitleToScroll in case the scroll ended - if ( iAdapter->CurrentState() != CXnNewstickerAdapter::EScrollEnded ) - { - iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleToScroll); - } - iAdapter->TitleScrolled(iFirstDrawingTitleIndex); - if (iAdapter->CurrentState() == CXnNewstickerAdapter::EAnimation) - { - iCurrentTitleIndex = GetNextTitleWithContent( iCurrentTitleIndex + 1 ); - iFirstDrawingTitleIndex = iCurrentTitleIndex; - } - else - { - iCurrentTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex + 1); - iFirstDrawingTitleIndex = iCurrentTitleIndex; - } - - // Check that we are still in range - if (iFirstDrawingTitleIndex >= iTitles.Count() || iFirstDrawingTitleIndex < 0) - { - iFirstDrawingTitleIndex = GetNextTitleWithContent( 0 ); - iCurrentTitleIndex = iFirstDrawingTitleIndex; - } - - SetBeginningState(); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::MoveToFirstL -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::MoveToFirstL() - { - // If there are no titles, don't do anything. - if (!IsVisibleTitles()) - { - return ; - } - // Something already scrolling, report scroll done - if ( iAdapter->CurrentState() == CXnNewstickerAdapter::EText ) - { - iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleScrolled); - iAdapter->TitleScrolled(iFirstDrawingTitleIndex); - } - - TInt start = 0; // iIsWestern ? 0 : (iTitles.Count() - 1); - - iCurrentTitleIndex = GetNextTitleWithContent( start ); - iFirstDrawingTitleIndex = iCurrentTitleIndex; - iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleToScroll); - SetBeginningState(); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::MoveToLastL -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::MoveToLastL() - { - // If there are no titles, don't do anything. - if (!IsVisibleTitles()) - { - return ; - } - // Something already scrolling, report scroll done - if ( iAdapter->CurrentState() == CXnNewstickerAdapter::EText ) - { - iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleScrolled); - iAdapter->TitleScrolled(iFirstDrawingTitleIndex); - } - - TInt start = iTitles.Count() - 1; // iIsWestern ? (iTitles.Count() - 1) : 0; - - iCurrentTitleIndex = GetNextTitleWithContent( start, ETrue ); - iFirstDrawingTitleIndex = iCurrentTitleIndex; - iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleToScroll); - SetBeginningState(); - } -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::MoveToPrev -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::MoveToPrevL() - { - // If there are no titles, don't do anything. - if (!IsVisibleTitles()) - { - return ; - } - - iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleScrolled); - - if (iAdapter->CurrentState() == CXnNewstickerAdapter::EAnimation) - { - iCurrentTitleIndex = GetNextTitleWithContent( iCurrentTitleIndex - 1, ETrue ); - iFirstDrawingTitleIndex = iCurrentTitleIndex; - } - else - { - iFirstDrawingTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex - 1, ETrue ); - iCurrentTitleIndex = iFirstDrawingTitleIndex; - } - // Check that we are still in range - if (iFirstDrawingTitleIndex >= iTitles.Count() || iFirstDrawingTitleIndex < 0) - { - iFirstDrawingTitleIndex = GetNextTitleWithContent( iTitles.Count() - 1, ETrue ); - iCurrentTitleIndex = iFirstDrawingTitleIndex; - } - - iAdapter->ReportNewstickerEventL(XnPropertyNames::action::trigger::name::KTitleToScroll); - SetBeginningState(); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::MoveToCurrent -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::MoveToCurrent() - { - // If there are no titles, don't do anything. - if (!IsVisibleTitles()) - { - return ; - } - - iFirstDrawingTitleIndex = iCurrentTitleIndex; - SetBeginningState(); - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CountIndexAfterInsert -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::CountIndexAfterInsertL(TInt aIndex) - { - // Check if the new title was inserted before the first drawing title - if (aIndex <= iFirstDrawingTitleIndex) - { - iCurrentTitleIndex++; - iFirstDrawingTitleIndex++; - } - - // if this is the first item - if(iTitles.Count() == 1 && GetNextTitleWithContent( 0 ) == 0) - { - iCurrentTitleIndex = 0; - iFirstDrawingTitleIndex = 0; - iAdapter->StartL(); - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetFont -// ----------------------------------------------------------------------------- -void CXnNewstickerControl::SetFont(CFont* aFont) - { - if(iFont != aFont) - { - for(TInt i = 0; i < iTitles.Count(); i++) - { - if(!iTitles[i]->IsSvgTitle()) - { - TInt textWidth = aFont->TextWidthInPixels( - iTitles[i]->TitleText()); - iTitles[i]->SetTitleTextLengthInPixels(textWidth); - } - } - iFont = aFont; - iTextBaseline = iContentRect.Height() / 2 + iFont->AscentInPixels() / 2; - CBitmapContext* gc = iAdapter->BufferGc(); - if(gc) - { - gc->UseFont(aFont); - } - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetTextColor -// ----------------------------------------------------------------------------- -void CXnNewstickerControl::SetTextColor(TRgb aColor) - { - iTextColor = aColor; - CBitmapContext* gc = iAdapter->BufferGc(); - if(gc) - { - gc->SetPenColor(iTextColor); - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetTextUnderlineStyle -// ----------------------------------------------------------------------------- -void CXnNewstickerControl::SetTextUnderlineStyle(TFontUnderline aStyle) - { - iUnderlining = aStyle; - CBitmapContext* gc = iAdapter->BufferGc(); - if(gc) - { - gc->SetUnderlineStyle(iUnderlining); - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetTextUnderlineStyle -// ----------------------------------------------------------------------------- -void CXnNewstickerControl::SetTextStrikethroughStyle(TFontStrikethrough aStyle) - { - iStrikethrough = aStyle; - CBitmapContext* gc = iAdapter->BufferGc(); - if(gc) - { - gc->SetStrikethroughStyle(iStrikethrough); + UpdateTitleL( KNullDesC, aIndex ); } } // ----------------------------------------------------------------------------- -// CXnNewstickerControl::PrepareToDrawL -// (other items were commented in a header). +// CXnNewstickerControl::CurrentTitleIndex // ----------------------------------------------------------------------------- // -void CXnNewstickerControl::PrepareToDrawLtrL() +TInt CXnNewstickerControl::CurrentTitleIndex() const { - CBitmapContext* gc = iAdapter->BufferGc(); - const CFbsBitmap* background = iAdapter->BackgroundBitmap(); - if(!gc || !background || !IsVisibleTitles() ) - { - return; - } - iFirstDrawingTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex ); - if ( iFirstDrawingTitleIndex < 0 || iFirstDrawingTitleIndex >= iTitles.Count() ) - { - return; - } - if (iTitles[iFirstDrawingTitleIndex]->IsSvgTitle()) - { - // Show SVG title - iAdapter->ShowSvgL(); - - // Just in case, draw background to d-buffer - gc->BitBlt(TPoint(0,0), background); - return; - } - - CGraphicsContext::TTextAlign alignment = TextAlignment(); - if ( iTextFitInNewstickerRect || - iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate && iTitles.Count() == 1 ) - { - iAdapter->StopL(); - SetBeginningState(); - } - - TInt drawingPos(-iFirstDrawingOffset); - - // At first, draw background - gc->BitBlt(TPoint(0,0), background); - TInt textLeft = iTitles[iFirstDrawingTitleIndex]->TitleTextLengthInPixels() - - iFirstDrawingOffset; - TInt drawingTitleIndex = iFirstDrawingTitleIndex; - TInt drawingOffset(0); - - // Main drawing loop. This loop runs as long as drawing area is not filled - // if Scroll behaviour is slide, then short text drawn only once. - FOREVER - { - TRect clipRect(TPoint(drawingPos,0), TPoint(iContentRect.Width(), iContentRect.Height())); - if ( iTextFitInNewstickerRect ) - { - clipRect.SetWidth( clipRect.Width()-drawingPos); - } - // if the rest text fits into visible area - if (textLeft <= iContentRect.Width() - drawingOffset) - { - gc->DrawText(iTitles[drawingTitleIndex]->TitleText(), - clipRect, - iTextBaseline, - alignment); - - TInt drawnLength = iTitles[drawingTitleIndex]->TitleTextLengthInPixels() + KGap; - drawingPos += drawnLength; - drawingOffset = drawingPos; - - // Update title index, if needed - drawingTitleIndex++; - if(drawingTitleIndex >= iTitles.Count()) - { - drawingTitleIndex = 0; - if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide || iTextFitInNewstickerRect ) - { - // what a dirty code! - break; - } - } - if(iSeparatorimage) - { - textLeft = 0; - } - else - { - if (iTitles[drawingTitleIndex]->IsSvgTitle()) - { - return; - } - else - { - textLeft = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); - } - } - } - else - { - // Clip the text if needed in alternate mode - if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate ) - { - HBufC* title = iTitles[drawingTitleIndex]->TitleText().AllocLC(); - TPtr titlePtr = title->Des(); - TInt maxLength = iContentRect.Width(); - AknBidiTextUtils::ConvertToVisualAndClipL( - titlePtr, *iFont, maxLength, maxLength ); - gc->DrawText( titlePtr, clipRect, iTextBaseline, alignment ); - CleanupStack::PopAndDestroy( title ); - } - else - { - gc->DrawText(iTitles[drawingTitleIndex]->TitleText(), - clipRect, - iTextBaseline, - alignment); - - } - break; - } - - if(iSeparatorimage) - { - TInt imageLeft = iSeparatorImageWidth - KGap; - - // if the rest of the image fits into visible area - if (imageLeft <= iContentRect.Width() - drawingOffset) - { - gc->BitBltMasked(TPoint(drawingPos, 0), iSeparatorimage->Bitmap(), - TRect(TPoint(0,0), - iSeparatorimage->Bitmap()->SizeInPixels()), iSeparatorimage->Mask(), ETrue); - drawingPos += iSeparatorImageWidth; - drawingOffset = drawingPos; - textLeft = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); - if (iTitles[drawingTitleIndex]->IsSvgTitle()) - { - return; - } - } - else - { - gc->BitBltMasked(TPoint(drawingPos, 0), iSeparatorimage->Bitmap(), - TRect(TPoint(0,0), iSeparatorimage->Bitmap()->SizeInPixels()), - iSeparatorimage->Mask(), ETrue); - break; - } - } - - if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate || - iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate ) - { - break; - } - } + return iCurrentTitleIndex; } // ----------------------------------------------------------------------------- -// CXnNewstickerControl::PrepareToDrawRtlL -// (other items were commented in a header). +// CXnNewstickerControl::Title // ----------------------------------------------------------------------------- // -void CXnNewstickerControl::PrepareToDrawRtlL() +const TDesC& CXnNewstickerControl::Title( TInt aIndex ) const { - CBitmapContext* gc = iAdapter->BufferGc(); - const CFbsBitmap* background = iAdapter->BackgroundBitmap(); - if(!gc || !background || !IsVisibleTitles() ) - { - return; - } - if ( iFirstDrawingTitleIndex < 0 || iFirstDrawingTitleIndex >= iTitles.Count() ) + if( aIndex >= 0 && aIndex < iTitleTexts.Count() ) { - return; - } - if (iTitles[iFirstDrawingTitleIndex]->IsSvgTitle()) - { - // Show SVG title - iAdapter->ShowSvgL(); - - // Just in case, draw background to d-buffer - gc->BitBlt(TPoint(0,0), background); - return; + return *iTitleTexts[ aIndex ]; } - CGraphicsContext::TTextAlign alignment = TextAlignment(); - if ( iTextFitInNewstickerRect || - iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate && iTitles.Count() == 1 ) - { - SetBeginningState(); - iAdapter->StopL(); - } - - // At first, draw background - gc->BitBlt(TPoint(0,0), background); - - TInt textLeft = iFirstDrawingOffset - - iTitles[iFirstDrawingTitleIndex]->TitleTextLengthInPixels(); - if(textLeft >= iContentRect.Width() ) - { - textLeft = 0; - } - TInt drawingTitleIndex = iFirstDrawingTitleIndex; - TInt drawingOffset(iContentRect.iBr.iX); - - TRect clipRect(TPoint(0,0), TPoint(iFirstDrawingOffset, iContentRect.Height())); - TInt clipWidth = clipRect.Width(); - // Main drawing loop. This loop runs as long as drawing area is not filled - FOREVER - { - // if the rest text fits into visible area - if (textLeft <= drawingOffset) - { - HBufC* title = iTitles[drawingTitleIndex]->TitleText().AllocLC(); - TPtr titlePtr = title->Des(); - - // convert to visual, do not clip - TInt maxLength = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); - AknBidiTextUtils::ConvertToVisualAndClipL( titlePtr, *iFont, - maxLength, maxLength ); - - gc->DrawText( titlePtr, clipRect, iTextBaseline, alignment ); - CleanupStack::PopAndDestroy( title ); - - TInt drawnLength = iTitles[drawingTitleIndex]->TitleTextLengthInPixels() + KGap; - clipWidth -= drawnLength; - clipRect.SetWidth(clipWidth); - drawingOffset = clipRect.iBr.iX; + return KNullDesC; + } - // Update title index - drawingTitleIndex++; - if(drawingTitleIndex >= iTitles.Count()) - { - drawingTitleIndex = 0; - if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide || iTextFitInNewstickerRect) - { - // what a dirty code! - break; - } - } - if(iSeparatorimage) - { - textLeft = 0xfff; - } - else - { - if (iTitles[drawingTitleIndex]->IsSvgTitle()) - { - return; - } - else - { - textLeft = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); - } - } - } - else - { - // Clip the text if needed in alternate mode - if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate ) - { - HBufC* title = iTitles[drawingTitleIndex]->TitleText().AllocLC(); - TPtr titlePtr = title->Des(); - TInt maxLength = iContentRect.Width(); - AknBidiTextUtils::ConvertToVisualAndClipL( - titlePtr, *iFont, maxLength, maxLength ); - gc->DrawText( titlePtr, clipRect, iTextBaseline, alignment ); - CleanupStack::PopAndDestroy( title ); - } - else - { - gc->DrawText(iTitles[drawingTitleIndex]->TitleText(), clipRect, - iTextBaseline, alignment); - } - break; - } - - if(iSeparatorimage) - { - TInt imageLeft = iSeparatorImageWidth - KGap; - - // if the rest of the image fits into visible area - if (imageLeft <= drawingOffset) - { - gc->BitBltMasked(TPoint(clipRect.iBr.iX - imageLeft, 0), - iSeparatorimage->Bitmap(), TRect(TPoint(0,0), - iSeparatorimage->Bitmap()->SizeInPixels()), - iSeparatorimage->Mask(), ETrue); - clipWidth -= iSeparatorImageWidth; - clipRect.SetWidth(clipWidth); - drawingOffset = clipRect.iBr.iX; - textLeft = iTitles[drawingTitleIndex]->TitleTextLengthInPixels(); - if (iTitles[drawingTitleIndex]->IsSvgTitle()) - { - return; - } - } - else - { - gc->BitBltMasked(TPoint(clipRect.iBr.iX - imageLeft, 0), - iSeparatorimage->Bitmap(), TRect(TPoint(0,0), - iSeparatorimage->Bitmap()->SizeInPixels()), - iSeparatorimage->Mask(), ETrue); - break; - } - } - - if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate || - iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate ) - { - break; - } +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::ClearTitles +// ----------------------------------------------------------------------------- +// +void CXnNewstickerControl::ClearTitles() + { + iAdapter->Stop(); + iCurrentTitleIndex = -1; + // Don't delete just clear the contents + for( TInt i=0; i < iTitleTexts.Count(); i++ ) + { + TRAP_IGNORE( UpdateTitleL( KNullDesC, i ) ); } } // ----------------------------------------------------------------------------- -// CXnNewstickerControl::DoScrollL -// (other items were commented in a header). +// CXnNewstickerControl::TitleCount // ----------------------------------------------------------------------------- // -void CXnNewstickerControl::DoScrollL() +TInt CXnNewstickerControl::TitleCount() const { - // If there are no titles, don't do anything. - if( !IsVisibleTitles() || iFirstDrawingTitleIndex < 0 || - iFirstDrawingTitleIndex >= iTitles.Count() ) - { - return; - } - - iAdapter->DrawNow(); - - if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScroll || - iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide || - ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && - !CalculateCurrentTextFitInNewstickerRect() ) ) - { - iAdapter->SetTimerToScrolltime(); - iFirstDrawingOffset += iSpeed; // advance text - TInt titleLen = iTitles[iFirstDrawingTitleIndex]->TitleTextLengthInPixels() + - iSeparatorImageWidth; - - // if 100% (or more) has been drawn update... - if ((iIsWestern && iFirstDrawingOffset >= titleLen) || - (!iIsWestern && iFirstDrawingOffset - titleLen >= iContentRect.Width())) - { - iAdapter->TitleScrolled(iFirstDrawingTitleIndex); - iFirstDrawingTitleIndex = GetNextTitleWithContent( iFirstDrawingTitleIndex + 1); - if(iFirstDrawingTitleIndex >= iTitles.Count()) - { - iFirstDrawingTitleIndex = GetNextTitleWithContent( 0 ); - if (iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide ) - { - if ( iIsWestern ) - { - iFirstDrawingOffset = -(iContentRect.iBr.iX-iContentRect.iTl.iX-KGap); - } - else - { - iFirstDrawingOffset = 0; - } - } - else - { - iFirstDrawingOffset -= titleLen + KGap; - } - } - else - { - iFirstDrawingOffset -= titleLen + KGap; - } - iCurrentTitleIndex = iFirstDrawingTitleIndex; - - if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && - CalculateCurrentTextFitInNewstickerRect() ) - { - MoveToNextL(); - } - } - // but if less than 100% and more than 75% has been drawn, update only current title index. - else if (((iIsWestern && iFirstDrawingOffset >= titleLen * 0.75) || - (!iIsWestern && iFirstDrawingOffset - titleLen >= iContentRect.iBr.iX * 0.75)) && - iFirstDrawingTitleIndex == iCurrentTitleIndex) - { - iCurrentTitleIndex++; - if(iCurrentTitleIndex >= iTitles.Count()) - { - iCurrentTitleIndex = 0; - } - iCurrentTitleIndex = GetNextTitleWithContent( iCurrentTitleIndex ); - - if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && - CalculateCurrentTextFitInNewstickerRect() ) - { - MoveToNextL(); - } - } - } - else if( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && - CalculateCurrentTextFitInNewstickerRect() ) - { - iAdapter->SetTimerToDisplaytime(); - MoveToNextL(); - } - else - { - MoveToNextL(); - } + return iTitleTexts.Count(); } // ----------------------------------------------------------------------------- -// CXnNewstickerControl::Draw -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::Draw() - { - if( IsVisibleTitles() > 0 ) - { - if( iIsWestern ) - { - TRAP_IGNORE( PrepareToDrawLtrL() ); - } - else - { - TRAP_IGNORE( PrepareToDrawRtlL() ); - } - } - else - { - CBitmapContext* gc = iAdapter->BufferGc(); - const CFbsBitmap* background = iAdapter->BackgroundBitmap(); - if ( gc && background ) - { - gc->BitBlt(TPoint(0,0), background); - } - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::DrawStatic +// CXnNewstickerControl::SelectTitle // (other items were commented in a header). // ----------------------------------------------------------------------------- // -void CXnNewstickerControl::DrawStatic() +const TDesC& CXnNewstickerControl::SelectTitle() { - // draw to buffer gc - CBitmapContext* gc = iAdapter->BufferGc(); - const CFbsBitmap* background = iAdapter->BackgroundBitmap(); - if( !gc || !background || !IsVisibleTitles() ) - { - return; - } - gc->BitBlt( TPoint(0,0), background ); - - // Get the last title - TInt index = GetNextTitleWithContent( iTitles.Count() - 1, ETrue ); - const TDesC& title = Title( index ); + if( IsVisibleTitles() ) + { + if( iCurrentTitleIndex < 0 || iCurrentTitleIndex >= iTitleTexts.Count() ) + { + // Get the last title + TInt index = + GetNextTitleWithContent( iTitleTexts.Count() - 1, ETrue ); + iCurrentTitleIndex = index; + } + + return Title( iCurrentTitleIndex ); + } - // truncate text if needed - HBufC* visualText = HBufC::New(title.Length() + KAknBidiExtraSpacePerLine); - if (visualText) - { - TPtr visualTextPtr(visualText->Des()); - TInt maxLength = iContentRect.Width(); - AknBidiTextUtils::ConvertToVisualAndClip( - title, visualTextPtr, *iFont, maxLength, maxLength ); - - TRect blitRect( 0, 0, iContentRect.Width(), iContentRect.Height() ); - gc->DrawText( *visualText, blitRect, iTextBaseline, TextAlignment() ); - delete visualText; - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetBeginningState -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::SetBeginningState() - { - iFirstDrawingOffset = 0; - if(!iIsWestern) - { - iFirstDrawingOffset = iContentRect.Width(); - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetScrollLooping -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::SetScrollLooping( TBool aLoop ) - { - iScrollLooping = aLoop; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::ScrollLooping -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CXnNewstickerControl::ScrollLooping() - { - return iScrollLooping; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::TextFitInNewstickerRect -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CXnNewstickerControl::TextFitInNewstickerRect() - { - return iTextFitInNewstickerRect; + return KNullDesC; } // ----------------------------------------------------------------------------- -// CXnNewstickerControl::CalculateTextFitInNewstickerRect -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CXnNewstickerControl::CalculateTextFitInNewstickerRect() - { - if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::ESlide && - iTitles.Count() == 1 ) - { - const TInt count = iTitles.Count(); - TInt textWidth=0; - const TInt rectWidth = iContentRect.Width(); - for (TInt i=0; i<count && textWidth<rectWidth;i++) - { - textWidth += iTitles[i]->TitleTextLengthInPixels(); - } - iTextFitInNewstickerRect = (textWidth<rectWidth); - } - else - { - iTextFitInNewstickerRect = EFalse; - } - return iTextFitInNewstickerRect; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::CalculateCurrentTextFitInNewstickerRect -// (other items were commented in a header). +// CXnNewstickerControl::GetNextTitleWithContent // ----------------------------------------------------------------------------- // -TBool CXnNewstickerControl::CalculateCurrentTextFitInNewstickerRect() - { - if ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate ) - { - const TInt count = iTitles.Count(); - TInt textWidth=0; - const TInt rectWidth = iContentRect.Width(); - if( iCurrentTitleIndex >= 0 && iCurrentTitleIndex < count ) - { - textWidth = iTitles[iCurrentTitleIndex]->TitleTextLengthInPixels(); - } - return ( textWidth < rectWidth ); - } - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::SetTextAlignment -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerControl::SetTextAlignment(TInt aAlignment) - { - iTextAlignment = aAlignment; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerControl::TextAlignment -// if title fits to the drawing rect and scrolling behaviour is ESlide then -// use alignment value -// if scroll behaviour is alternate then use alignment value -// otherwise return ELeft in western and ERight on AH -// ----------------------------------------------------------------------------- -// -CGraphicsContext::TTextAlign CXnNewstickerControl::TextAlignment() - { - CGraphicsContext::TTextAlign alignment = iIsWestern ? CGraphicsContext::ELeft : CGraphicsContext::ERight; - - if ( iTextFitInNewstickerRect || iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EAlternate || - ( iAdapter->ScrollBehaviour() == CXnNewstickerAdapter::EScrollAlternate && - CalculateCurrentTextFitInNewstickerRect() ) ) - { - switch( iTextAlignment ) - { - default: - case ELayoutAlignLeft: - alignment = CGraphicsContext::ELeft; - break; - case ELayoutAlignRight: - alignment = CGraphicsContext::ERight; - break; - case ELayoutAlignCenter: - alignment = CGraphicsContext::ECenter; - break; - } - } - return alignment; - } - -TInt CXnNewstickerControl::GetNextTitleWithContent( TInt aStartSearch, TBool aBackwards ) +TInt CXnNewstickerControl::GetNextTitleWithContent( TInt aStartSearch, + TBool aBackwards ) const { TInt dir = 1; - if ( aBackwards ) + if( aBackwards ) { dir = -1; } - for( TInt i = aStartSearch; i < iTitles.Count() && i >= 0; i += dir ) + + for( TInt i = aStartSearch; i < iTitleTexts.Count() && i >= 0; i += dir ) { - if ( iTitles[i]->TitleTextLengthInPixels() != 0 ) + if( iTitleTexts[i]->Compare( KNullDesC ) != KErrNone ) { return i; } } + return aStartSearch; } -TBool CXnNewstickerControl::IsVisibleTitles() +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::SetCurrentTitle +// ----------------------------------------------------------------------------- +// +TBool CXnNewstickerControl::SetCurrentTitle( TBool aSetDefault ) { - for( TInt i = 0; i < iTitles.Count() ; ++i ) + TBool ret( EFalse ); + TInt lastIndex( iTitleTexts.Count() - 1 ); + + if( aSetDefault ) + { + iCurrentTitleIndex = GetNextTitleWithContent( lastIndex, ETrue ); + } + else if( iCurrentTitleIndex >= lastIndex ) + { + iCurrentTitleIndex = GetNextTitleWithContent( 0 ); + } + else { - if ( iTitles[i]->TitleTextLengthInPixels() != 0 ) + iCurrentTitleIndex = GetNextTitleWithContent( iCurrentTitleIndex + 1 ); + } + + if( iCurrentTitleIndex == lastIndex) + { + ret = ETrue; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerControl::IsVisibleTitles +// ----------------------------------------------------------------------------- +// +TBool CXnNewstickerControl::IsVisibleTitles() const + { + for( TInt i=0; i < iTitleTexts.Count(); i++ ) + { + if( iTitleTexts[i]->Compare( KNullDesC ) != KErrNone ) { return ETrue; } } + return EFalse; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickerfactory.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickerfactory.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickerfactory.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -116,7 +116,8 @@ const TImplementationProxy ImplementationTable[] = { #ifdef __EABI__ - IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION, CXnNewstickerFactory::NewL) + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION, + CXnNewstickerFactory::NewL) #else {{AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION}, CXnNewstickerFactory::NewL} #endif diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickersvgcontrol.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnnewstickerfactory/src/xnnewstickersvgcontrol.cpp Thu Jan 07 12:39:41 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -/* -* Copyright (c) 2002-2006 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: Text scrolling functionality. -* -*/ - - -// INCLUDE FILES -#include <SVGEngineInterfaceImpl.h> - -#include "xnnewstickersvgcontrol.h" -#include "xnnewstickeradapter.h" - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CXnNewstickerSvgControl::CXnNewstickerSvgControl -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CXnNewstickerSvgControl::CXnNewstickerSvgControl(CXnNewstickerAdapter* aAdapter) : - iAdapter(aAdapter) - { - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerSvgControl::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CXnNewstickerSvgControl::ConstructL() - { - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerSvgControl::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXnNewstickerSvgControl* CXnNewstickerSvgControl::NewL(CXnNewstickerAdapter* aAdapter) - { - CXnNewstickerSvgControl* self = new(ELeave)CXnNewstickerSvgControl(aAdapter); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerSvgControl::~CXnNewstickerSvgControl() -// Destructor. -// ----------------------------------------------------------------------------- -// -CXnNewstickerSvgControl::~CXnNewstickerSvgControl() - { - delete iBitmap; - delete iMaskBitmap; - if(iSVGEngine) - { - iSVGEngine->Destroy(); - delete iSVGEngine; - } - } - -// --------------------------------------------------------- -// CXnNewstickerSvgControl::StartL -// --------------------------------------------------------- -// -void CXnNewstickerSvgControl::StartL(const TDesC8& aSvgData) - { - iHasContent = ETrue; - if(!iSVGEngine) - { - TFontSpec fspec; - iSVGEngine = CSvgEngineInterfaceImpl::NewL(iBitmap,this, fspec); - } - - MSvgError* error = iSVGEngine->Load(aSvgData); - User::LeaveIfError(error->SystemErrorCode()); - - // Get the size of the bitmap and set the SVG size to match - TSize tmpsize = iBitmap->SizeInPixels(); - iSVGEngine->SetSvgDimensionToFrameBuffer(tmpsize.iWidth, tmpsize.iHeight); - iSVGEngine->SetBackgroundColor(0x00FFFFFF, NULL); - iSVGEngine->Start(); - } - -// --------------------------------------------------------- -// CXnNewstickerSvgControl::StopL -// --------------------------------------------------------- -// -void CXnNewstickerSvgControl::StopL() - { - iHasContent = EFalse; - if(iSVGEngine) - { - iSVGEngine->Stop(); - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerSvgControl::SetSvgRectL -// Set visible rect. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerSvgControl::SetSvgRectL(TRect& aContentRect, CGraphicsDevice& aDevice ) - { - iContentRect = aContentRect; - - TDisplayMode displayMode = aDevice.DisplayMode(); - - if(iBitmap) - { - delete iBitmap; - iBitmap = NULL; - } - iBitmap = new (ELeave) CFbsBitmap(); - iBitmap->Create(iContentRect.Size(),displayMode); - - if(iMaskBitmap) - { - delete iMaskBitmap; - iMaskBitmap = NULL; - } - iMaskBitmap = new (ELeave) CFbsBitmap(); - iMaskBitmap->Create(iContentRect.Size(),EGray256); - - if(iSVGEngine && iHasContent) - { - iSVGEngine->SetFrameBuffer(iBitmap); - TSize tmpsize = iBitmap->SizeInPixels(); - iSVGEngine->SetSvgDimensionToFrameBuffer(tmpsize.iWidth, tmpsize.iHeight); - } - } - -// ----------------------------------------------------------------------------- -// CXnNewstickerSvgControl::Draw -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CXnNewstickerSvgControl::Draw() const - { - TPoint point(iContentRect.iTl); - iAdapter->BufferGc()->BitBlt(TPoint(0,0), iAdapter->BackgroundBitmap()); - iAdapter->BufferGc()->BitBltMasked(TPoint(0,0), iBitmap, - TRect(iBitmap->SizeInPixels()), iMaskBitmap, ETrue); - } - -// --------------------------------------------------------------------------- -// From class MSvgRequestObserver. -// CXnNewstickerSvgControl::UpdateScreen -// --------------------------------------------------------------------------- -// -void CXnNewstickerSvgControl::UpdateScreen() - { - iSVGEngine->GenerateMask(iMaskBitmap, NULL); - - iAdapter->DrawNow(); - } - -// --------------------------------------------------------------------------- -// From class MSvgRequestObserver. -// CXnNewstickerSvgControl::ScriptCall -// --------------------------------------------------------------------------- -// -TBool CXnNewstickerSvgControl::ScriptCall( - const TDesC& /*aScript*/, - CSvgElementImpl* /*aCallerElement*/) - { - return EFalse; - } - -// --------------------------------------------------------------------------- -// From class MSvgRequestObserver. -// CXnNewstickerSvgControl::FetchImage -// --------------------------------------------------------------------------- -// -TInt CXnNewstickerSvgControl::FetchImage( - const TDesC& /*aUri*/, - RFs& /*aSession*/, - RFile& /*aFileHandle*/) - { - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// From class MSvgRequestObserver. -// CXnNewstickerSvgControl::FetchFont -// --------------------------------------------------------------------------- -// -TInt CXnNewstickerSvgControl::FetchFont( - const TDesC& /*aUri*/, - RFs& /*aSession*/, - RFile& /*aFileHandle*/) - { - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// From class MSvgRequestObserver. -// CXnNewstickerSvgControl::UpdatePresentation -// --------------------------------------------------------------------------- -// -void CXnNewstickerSvgControl::UpdatePresentation(const TInt32& /*aNoOfAnimation*/) - { - } - -// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontroladapter.cpp --- a/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontroladapter.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontroladapter.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -155,7 +155,7 @@ if( aValue >= minRange && aValue <= maxRange ) { CXnDomStringPool& sp = iNode.UiEngineL()->StringPool(); - CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( sp ); + CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( &sp ); CleanupStack::PushL( value ); value->SetFloatValueL( CXnDomPropertyValue::ENumber, aValue ); CXnProperty* valueProperty = CXnProperty::NewL( XnPropertyNames::action::KValue, value, sp ); @@ -184,7 +184,7 @@ CXnDomStringPool& sp = iNode.UiEngineL()->StringPool(); // Set min value property - CXnDomPropertyValue* minValue = CXnDomPropertyValue::NewL( sp ); + CXnDomPropertyValue* minValue = CXnDomPropertyValue::NewL( &sp ); CleanupStack::PushL( minValue ); minValue->SetFloatValueL( CXnDomPropertyValue::ENumber, aMinimumValue ); CXnProperty* minValueProperty = CXnProperty::NewL( XnPropertyNames::volumecontrol::KMinRange, minValue, sp ); @@ -194,7 +194,7 @@ CleanupStack::Pop( minValueProperty ); // Set max value property - CXnDomPropertyValue* maxValue = CXnDomPropertyValue::NewL( sp ); + CXnDomPropertyValue* maxValue = CXnDomPropertyValue::NewL( &sp ); CleanupStack::PushL( maxValue ); maxValue->SetFloatValueL( CXnDomPropertyValue::ENumber, aMaximumValue ); CXnProperty* maxValueProperty = CXnProperty::NewL( XnPropertyNames::volumecontrol::KMaxRange, maxValue, sp ); @@ -249,7 +249,7 @@ if( aProperty->Property()->Name() == XnPropertyNames::volumecontrol::KVolumeLevelAdjustment ) { CXnDomStringPool& sp = iNode.UiEngineL()->StringPool(); - CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( sp ); + CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( &sp ); CleanupStack::PushL( value ); const TDesC8& strValue = aProperty->StringValue(); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp --- a/idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -85,6 +85,7 @@ SOURCE xninactivitymonitor.cpp SOURCE xnfocuscontrol.cpp SOURCE xnextrenderingpluginwrapper.cpp +SOURCE xnbackgroundmanager.cpp START RESOURCE xnuiengine.rss HEADER @@ -147,6 +148,8 @@ LIBRARY hscontentinfo.lib LIBRARY hsccproviderclient.lib LIBRARY extrenderingplugin.lib +LIBRARY disknotifyhandler.lib +LIBRARY platformenv.lib #if defined(_XN3_DEBUG_) || defined(AI3_DEBUG_PERFORMANCE) LIBRARY flogger.lib diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,244 @@ +/* +* 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 the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Background manager +* +*/ + +#ifndef CXNBACKGROUNDMANAGER_H +#define CXNBACKGROUNDMANAGER_H + +// System includes +#include <coecntrl.h> +#include <aknssrvclient.h> +#include <coeview.h> +#include <disknotifyhandler.h> + +// CLASS DECLARATION +class CXnViewManager; +class CXnViewData; +class CAknsLayeredBackgroundControlContext; + +namespace hspswrapper + { + class CHspsWrapper; + } + +using namespace hspswrapper; + +/** +* Background manager. +* +* @since S60 v5.0 +*/ +NONSHARABLE_CLASS( CXnBackgroundManager ) : public CCoeControl, + public MAknsSkinChangeObserver, public MCoeViewActivationObserver, + public MDiskNotifyHandlerCallback + { +public: + + /** + * Two-phased constructor. + * @param aWrapper HSPS wrapper + * @return new instance of CXnWallpaperView. + */ + static CXnBackgroundManager* NewL( CXnViewManager& aViewManager, CHspsWrapper& aWrapper ); + + /** + * Destructor. + */ + ~CXnBackgroundManager(); + + /** + * Caches wallpaper image. + * + * @since S60 5.0 + * @param aFileName WallpaperImage image path and filename to be cached + * @return Error code. + */ + TInt CacheWallpaperL( const TDesC& aFileName, CXnViewData& aViewData ); + + /** + * Changes wallpaper image of the current page. + * + * @since S60 5.0 + * @param aFileName WallpaperImage image path and filename + */ + void AddWallpaperL( const TDesC& aFileName ); + + /** + * Checks whether page specific wallpaper feature is activated or not. + * + * @since S60 5.0 + */ + TBool ActivatedL(); + + /** + * Shows wallpaper change dialog + * + * @since S60 5.0 + */ + void SetWallpaperL(); + + /** + * Handles wallpaper changing in page change + * + * @since S60 5.0 + * @param aOldView Old view + * @param aNewView New view + */ + void WallpaperChanged( CXnViewData& aOldView, CXnViewData& aNewView ); + +private: // Functions from base classes + + /** + * see CCoeControl + */ + void Draw(const TRect& aRect) const; + + /** + * see CCoeControl + */ + void SizeChanged(); + + /** + * see MAknsSkinChangeObserver + */ + void SkinContentChanged(); + + /** + * see MAknsSkinChangeObserver + */ + void SkinConfigurationChanged( + const TAknsSkinStatusConfigurationChangeReason aReason ); + + /** + * see MAknsSkinChangeObserver + */ + void SkinPackageChanged( + const TAknsSkinStatusPackageChangeReason aReason ); + + /** + * @see MCoeViewActivationObserver + */ + void HandleViewActivation( const TVwsViewId& aNewlyActivatedViewId, + const TVwsViewId& aViewIdToBeDeactivated ); + + /** + * From MDiskNotifyHandlerCallback. + */ + void HandleNotifyDisk( TInt aError, const TDiskEvent& aEvent ); + +private: + + /** + * C++ default constructor. + */ + CXnBackgroundManager( CXnViewManager& aViewManager, CHspsWrapper& aWrapper ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + void SaveWallpaperL(); + TInt SetSettingPropertyL( const TDesC8& aPluginId, const TDesC8& aItemId, + const TDesC8& aPropertyName, const TDesC8& aPropertyValue ); + void UpdateWallpapersL(); + void CleanCache(); + void RemoveWallpaperL( CXnViewData& aViewData ); + void RemoveWallpaperFromCache( const TDesC& aFileName ); + void RemovableDiskInsertedL(); + void CheckFeatureTypeL(); + void AddPageSpecificWallpaperL( const TDesC& aFileName ); + void AddCommonWallpaperL( const TDesC& aFileName, TBool aSave = ETrue ); + void ReadWallpaperFromCenrepL(); + +private: // data + + /** + * Provides needed services + */ + CXnViewManager& iViewManager; + + /** + * Hsps wrapper + */ + CHspsWrapper& iHspsWrapper; + + /** + * skin server to detect when wallpaper has changed + * Own. + */ + RAknsSrvSession iSkinSrv; + + /** + * File server session. + * Own. + */ + RFs iFsSession; + + /** + * Notifier for disk drive status changes. + * Own. + */ + CDiskNotifyHandler* iDiskNotifier; + + /** + * Background control context. + * Own. + */ + CAknsLayeredBackgroundControlContext* iBgContext; + + /** + * Current view rect, which is basically the whole screen. + */ + TRect iRect; + + /** + * States whether page specific wallpaper is supported or + * same wallpaper is shown in all pages. + */ + TBool iFeatureSuppoted; + + /** + * Internal wallpaper update in progress + */ + TInt iIntUpdate; + + /** + * States whether transparent CBA and status pane is used. + * Homescreen uses transparency, but e.g. Widget catalog does not. + */ + TBool iTransparencyEnabled; + + /** + * Pointer to wallpaper image. This is used only if same wallpaper + * is shared among all HS pages. + * Own. + */ + CFbsBitmap* iBgImage; + + /** + * Path of the wallpaper image, including filename. + * This is used only if same wallpaper + * is shared among all HS pages. + * Own. + */ + HBufC* iBgImagePath; + + }; + +#endif // CXNBACKGROUNDMANAGER_H + +// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h Mon Jan 18 20:10:36 2010 +0200 @@ -103,8 +103,6 @@ private: // data - /** Background control context, Owned */ - CAknsLayeredBackgroundControlContext* iBgContext; /** Compound Control, Not owned */ CCoeControl* iControl; }; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/inc/xneditor.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h Mon Jan 18 20:10:36 2010 +0200 @@ -38,6 +38,7 @@ class CXnViewManager; class CXnViewData; class CRepository; +class CXnBackgroundManager; namespace hspswrapper { @@ -194,6 +195,14 @@ */ TInt IdFromCrep ( TDes8& aUid ) const; + /** + * Returns the Background manager object owned by this. + * + * @since S60 5.0 + * @return BgManager + */ + CXnBackgroundManager& BgManager() const; + private: // from MHsContentController @@ -214,7 +223,11 @@ TInt ActivateViewL( CHsContentInfo& aInfo ); TInt ActivateAppL( CHsContentInfo& aInfo ); + + TInt ActiveViewL( CHsContentInfo& aInfo ); + TInt ActiveAppL( CHsContentInfo& aInfo ); + private: // constructors @@ -297,6 +310,8 @@ CHspsWrapper* iHspsWrapper; /** CPS wrapper, owned */ CCpsWrapper* iCpsWrapper; + /** Provides background services, owned */ + CXnBackgroundManager* iBgManager; /** Publisher map, owned */ CPublisherMap* iPublisherMap; /** Add widget listquery, not owned */ diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h Mon Jan 18 20:10:36 2010 +0200 @@ -24,6 +24,7 @@ // Forward declarations class CXnViewManager; +class CFbsBitmap; // Constants @@ -201,18 +202,54 @@ CXnNode* ViewNode() const; /** + * Set wallpaper image. Ovnership is transferred. + * + * @param aBitmap Background image file name. + */ + void SetWallpaperImage( CFbsBitmap* aBitmap ); + + /** + * Get background image. Ovnership is NOT transferred. + * + * @return Pointer to background image. + * Returns NULL if image has not been set. + */ + CFbsBitmap* WallpaperImage() const; + + /** + * Set path of the wallpaper image. + * + * @param aFileName Image path, including file name. + */ + void SetWallpaperImagePathL( const TDesC& aFileName ); + + /** + * Get the path of wallpaper image. + * + * @return Image path, including file name. + * Returns KNullCDes if wallpaper has not been set. + */ + const TDesC& WallpaperImagePath() const; + + /** * Sets view's locking_status attribute (locked/none) to determine if view * is prevented from removing/deleting or not * * @param aLockingStatusString attr. locking_status ("locked"/"none") */ void SetLockingStatus( const TDesC8& aLockingStatusString ); + private: // data /** Focused Node, Not owned */ CXnNode* iFocusedNode; + /** Pointer to wallpaper image, Owned */ + CFbsBitmap* iBgImage; + + /** Path of the wallpaper image, including filename */ + HBufC* iBgImagePath; }; #include "xnviewdata.inl" diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -60,7 +60,7 @@ User::AllocSize( start ); #endif //_XN_PERFORMANCE_TEST_ - CAknViewAppUi::BaseConstructL( EAknEnableSkin | EAknEnableMSK ); + CAknViewAppUi::BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); CAknToolbar* toolbar( CurrentFixedToolbar() ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,794 @@ +/* +* 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 the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Background manager. +* +*/ + + +// INCLUDE FILES +#include "xnbackgroundmanager.h" +#include "hspswrapper.h" +#include "xnviewmanager.h" +#include "xnviewdata.h" +#include "xnplugindefs.h" +#include "hspssapi.h" +#include "xnappuiadapter.h" +#include "xnwallpaperview.h" +#include "xnrootdata.h" + +// SYSTEM INCLUDE FILES +#include <aknlistquerydialog.h> +#include <xnuiengine.rsg> +#include <aknskinsinternalcrkeys.h> +#include <activeidle2domaincrkeys.h> +#include <aknswallpaperutils.h> +#include <imageconversion.h> +#include <bitmaptransforms.h> + +#include <aknsutils.h> +#include <aknsdrawutils.h> +#include <aknscontrolcontext.h> +#include <aknslayeredbackgroundcontrolcontext.h> +#include <driveinfo.h> + +using namespace hspswrapper; + +_LIT8( KSingle, "single" ); +const TUid KDummyUid = { 0x0000000 }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CXnBackgroundManager::CXnBackgroundManager( CXnViewManager& aViewManager, CHspsWrapper& aWrapper ) + : iViewManager( aViewManager ), + iHspsWrapper( aWrapper ), + iTransparencyEnabled( ETrue ) + { + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::ConstructL() + { + // Register for view activation & deactivation + iViewManager.AppUiAdapter().AddViewActivationObserverL( this ); + + CreateWindowL(); + + iBgContext = CAknsLayeredBackgroundControlContext::NewL( + KAknsIIDQsnBgScreenIdle, TRect(), ETrue, 1 ); + + TRect bgRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect ); + SetRect( bgRect ); + + Window().SetOrdinalPosition( -1 ); + + MakeVisible( ETrue ); + ActivateL(); + iIntUpdate = 0; + User::LeaveIfError( iSkinSrv.Connect( this ) ); + iSkinSrv.EnableSkinChangeNotify(); + + // Start listening for drive events. + User::LeaveIfError( iFsSession.Connect() ); + + // Start listening file server notifications. + iDiskNotifier = CDiskNotifyHandler::NewL( *this, iFsSession ); + User::LeaveIfError( iDiskNotifier->NotifyDisk() ); + + // Reads from cenrep wheteher page specific wallpaper is enabled or not + CheckFeatureTypeL(); + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnBackgroundManager* CXnBackgroundManager::NewL( CXnViewManager& aViewManager, + CHspsWrapper& aWrapper ) + { + CXnBackgroundManager* self = new (ELeave) CXnBackgroundManager( aViewManager, + aWrapper ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnBackgroundManager::~CXnBackgroundManager() + { + CleanCache(); + iSkinSrv.Close(); + delete iDiskNotifier; + iFsSession.Close(); + delete iBgContext; + delete iBgImage; + delete iBgImagePath; + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::Draw +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::Draw(const TRect& aRect) const + { + if( iTransparencyEnabled ) + { + if( iFeatureSuppoted ) + { + CXnViewData& viewData( iViewManager.ActiveViewData() ); + CFbsBitmap* wallpaper = viewData.WallpaperImage(); + if( wallpaper ) + { + SystemGc().BitBlt( TPoint(0, 0), wallpaper ); + return; + } + } + else if( iBgImage ) + { + SystemGc().BitBlt( TPoint(0, 0), iBgImage ); + return; + } + } + MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); + AknsDrawUtils::Background( skin, iBgContext, this, + SystemGc(), aRect ); + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::SizeChanged +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::SizeChanged() + { + iRect = Rect(); + if( iFeatureSuppoted ) + { + TRAP_IGNORE( UpdateWallpapersL() ); + } + else + { + if( iBgImagePath ) + { + delete iBgImage; + iBgImage = NULL; + TRAP_IGNORE( iBgImage = iSkinSrv.WallpaperImageL( *iBgImagePath ) ); + } + } + iBgContext->SetRect( iRect ); + } + +// ----------------------------------------------------------------------------- +// Handle disk drive notifications. +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::HandleNotifyDisk( + TInt /*aError*/, + const TDiskEvent& aEvent ) + { + if( aEvent.iType == MDiskNotifyHandlerCallback::EDiskStatusChanged ) + { + if( !( aEvent.iInfo.iDriveAtt & KDriveAttInternal ) ) + { + TBool diskRemoved( aEvent.iInfo.iType == EMediaNotPresent ); + if( diskRemoved ) + { + // TODO: + //TRAP_IGNORE( RemovableDiskRemovedL() ); + } + else + { + TRAP_IGNORE( RemovableDiskInsertedL() ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::CacheWallpaperL +// ----------------------------------------------------------------------------- +// +TInt CXnBackgroundManager::CacheWallpaperL( const TDesC& aFileName, CXnViewData& aViewData ) + { + if( aFileName == KNullDesC ) + { + return KErrArgument; + } + + aViewData.SetWallpaperImagePathL( aFileName ); + aViewData.SetWallpaperImage( NULL ); + + TBool err( KErrNone ); + TRAP( err, iSkinSrv.AddWallpaperL( aFileName, iRect.Size() ) ); + if( err == KErrNone ) + { + CFbsBitmap* bitmap( NULL ); + CleanupStack::PushL( bitmap ); + TRAP( err, bitmap = iSkinSrv.WallpaperImageL( aFileName ) ); + if( err == KErrNone && bitmap ) + { + aViewData.SetWallpaperImage( bitmap ); // Ownership tranferred + } + else + { + iSkinSrv.RemoveWallpaper( aFileName ); + } + CleanupStack::Pop(); + } + return err; + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::AddWallpaperL +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::AddWallpaperL( const TDesC& aFileName ) + { + if( iFeatureSuppoted ) + { + AddPageSpecificWallpaperL( aFileName ); + } + else + { + AddCommonWallpaperL( aFileName ); + } + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::ActivatedL +// --------------------------------------------------------------------------- +// +TBool CXnBackgroundManager::ActivatedL() + { + return iFeatureSuppoted; + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::WallpaperChanged +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::WallpaperChanged( CXnViewData& aOldView, CXnViewData& aNewView ) + { + if( iFeatureSuppoted && + aOldView.WallpaperImagePath().Compare( aNewView.WallpaperImagePath() ) ) + { + DrawNow(); + TInt err = AknsWallpaperUtils::SetIdleWallpaper( aNewView.WallpaperImagePath(), NULL ); + if( err == KErrNone ) + { + iIntUpdate++; + } + } + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::SaveWallpaperL +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::SaveWallpaperL() + { + // Save wallpaper to HSPS + if( iFeatureSuppoted ) + { + TBuf8<KMaxFileName> wallpaper8; + CXnViewData& viewData( iViewManager.ActiveViewData() ); + wallpaper8.Copy( viewData.WallpaperImagePath() ); + SetSettingPropertyL( viewData.PluginId(), KWallpaper, + KPath, wallpaper8 ); + } + else + { + CRepository* repository = CRepository::NewLC( TUid::Uid( KCRUidActiveIdleLV ) ); + if ( repository ) + { + if( iBgImagePath ) + { + User::LeaveIfError( repository->Set( KAIWallpaperPath, + *iBgImagePath ) ); + } + else + { + User::LeaveIfError( repository->Set( KAIWallpaperPath, + KNullDesC ) ); + } + } + CleanupStack::PopAndDestroy( repository ); + } + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::SetSettingPropertyL +// --------------------------------------------------------------------------- +// +TInt CXnBackgroundManager::SetSettingPropertyL( const TDesC8& aPluginId, + const TDesC8& aItemId, const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ) + { + if ( aPluginId == KNullDesC8() || + aItemId == KNullDesC8() || + aPropertyName == KNullDesC8() ) + { + return KErrArgument; + } + + CHspsConfiguration* pluginConf( + iHspsWrapper.GetPluginConfigurationL( aPluginId ) ); + if ( !pluginConf ) + { + return KErrNotFound; + } + CleanupStack::PushL( pluginConf ); + + // Find. + CPropertyMap* property = NULL; + RPointerArray<CItemMap>& settings = pluginConf->Settings(); + for( TInt i = 0; i < settings.Count(); i++ ) + { + CItemMap* setting = settings[i]; + if ( !setting ) + { + continue; + } + + if ( setting->ItemId() == aItemId ) + { + RPointerArray<CPropertyMap>& properties = setting->Properties(); + for( TInt j = 0; j < properties.Count(); j++ ) + { + CPropertyMap* tmpProperty = properties[j]; + if ( !tmpProperty ) + { + continue; + } + + if ( tmpProperty->Name() == aPropertyName ) + { + property = tmpProperty; + break; + } + } + break; + } + } + + TInt ret = KErrNone; + + // Set. + if ( property ) + { + property->SetValueL( aPropertyValue ); + ret = iHspsWrapper.SetPluginSettingsL( aPluginId, settings ); + } + else + { + ret = KErrNotFound; + } + + CleanupStack::PopAndDestroy( pluginConf ); + + return ret; + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::SetWallpaperL +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::SetWallpaperL() + { + TInt selectedIndex( 0 ); + + CAknListQueryDialog* query = + new ( ELeave ) CAknListQueryDialog( &selectedIndex ); + CleanupStack::PushL( query ); + query->PrepareLC( R_LISTQUERY_CHANGE_WALLPAPER ); + + if ( query->RunLD() ) + { + if ( selectedIndex == 0 ) + { + AddWallpaperL( KNullDesC ); + } + else if ( selectedIndex == 1 ) + { + iViewManager.AppUiAdapter().ActivateLocalViewL( KWallpaperViewUid, + KDummyUid, KSingle ); + } + } + CleanupStack::Pop( query ); + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::SkinContentChanged +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::SkinContentChanged() + { + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::SkinConfigurationChanged +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::SkinConfigurationChanged( + const TAknsSkinStatusConfigurationChangeReason aReason ) + { + if ( aReason == EAknsSkinStatusWallpaperChanged ) + { + if( iIntUpdate > 0 ) + { + iIntUpdate--; + } + else + { + TRAP_IGNORE( ReadWallpaperFromCenrepL() ); + } + } + else if ( aReason == EAknsSkinStatusConfigurationDeployed ) + { + DrawNow(); + } + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::SkinPackageChanged +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::SkinPackageChanged( + const TAknsSkinStatusPackageChangeReason /*aReason*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CXnBackgroundManager::HandleViewActivation() +// ---------------------------------------------------------------------------- +// +void CXnBackgroundManager::HandleViewActivation( + const TVwsViewId& aNewlyActivatedViewId, + const TVwsViewId& aViewIdToBeDeactivated ) + { + TVwsViewId viewId( iViewManager.AppUiAdapter().View().ViewId() ); + if ( viewId == aNewlyActivatedViewId && !iTransparencyEnabled ) + { + iTransparencyEnabled = ETrue; + DrawNow(); + } + else if ( viewId == aViewIdToBeDeactivated && iTransparencyEnabled ) + { + iTransparencyEnabled = EFalse; + DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::CleanCache +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::CleanCache() + { + iSkinSrv.RemoveAllWallpapers(); + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::RemoveWallpaper +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::RemoveWallpaperFromCache( const TDesC& aFileName ) + { + CXnViewData& activeViewData( iViewManager.ActiveViewData() ); + CXnRootData& rootData = iViewManager.ActiveAppData(); + RPointerArray<CXnPluginData>& rootDataArr = rootData.PluginData(); + + for( TInt i = 0; i < rootDataArr.Count(); i++ ) + { + CXnViewData* viewData = static_cast<CXnViewData*>( rootDataArr[i] ); + if( viewData == &activeViewData ) + { + continue; + } + else if( viewData->WallpaperImagePath() == aFileName ) + { + // Some other view has same wallpaper image. + // This must not be removed from the cache. + return; + } + } + // Image is not needed anymore. Can be removed from the cache. + iSkinSrv.RemoveWallpaper( aFileName ); + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::RemoveWallpaper +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::RemoveWallpaperL( CXnViewData& aViewData ) + { + aViewData.SetWallpaperImagePathL( KNullDesC ); + aViewData.SetWallpaperImage( NULL ); + SetSettingPropertyL( aViewData.PluginId(), KWallpaper, KPath, KNullDesC8 ); + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::UpdateWallpapersL +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::UpdateWallpapersL() + { + CXnRootData& rootData = iViewManager.ActiveAppData(); + if( !&rootData ) + { + return; + } + RPointerArray<CXnPluginData>& rootDataArr = rootData.PluginData(); + + for( TInt i = 0; i < rootDataArr.Count(); i++ ) + { + CXnViewData* viewData = static_cast<CXnViewData*>( rootDataArr[i] ); + const TDesC& path = viewData->WallpaperImagePath(); + if( path != KNullDesC ) + { + CFbsBitmap* bitmap = iSkinSrv.WallpaperImageL( path ); + if( bitmap ) + { + viewData->SetWallpaperImage( bitmap ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnBackgroundManager::RemovableDiskInsertedL +// ----------------------------------------------------------------------------- +// +void CXnBackgroundManager::RemovableDiskInsertedL() + { + if( iFeatureSuppoted ) + { + CXnRootData& rootData = iViewManager.ActiveAppData(); + if( !&rootData ) + { + return; + } + RPointerArray<CXnPluginData>& rootDataArr = rootData.PluginData(); + TInt drawingNeeded( EFalse ); + for( TInt i = 0; i < rootDataArr.Count(); i++ ) + { + CXnViewData* viewData = static_cast<CXnViewData*>( rootDataArr[i] ); + const TDesC& path = viewData->WallpaperImagePath(); + CFbsBitmap* bitmap = viewData->WallpaperImage(); + if( path != KNullDesC && !bitmap ) + { + TInt err = CacheWallpaperL( path, *viewData ); + if( err == KErrNone ) + { + drawingNeeded = ETrue; + } + } + } + if( drawingNeeded ) + { + DrawNow(); + } + } + else + { + if( iBgImagePath ) + { + AddCommonWallpaperL( *iBgImagePath, EFalse ); + } + } + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::CheckFeatureTypeL +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::CheckFeatureTypeL() + { + iFeatureSuppoted = EFalse; + CRepository* repository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + CleanupStack::PushL( repository ); + if ( repository ) + { + // Get wallpaper handling type from cenrep + TInt type; + TInt err = repository->Get( KAIWallpaperChangeType, type ); + if ( err == KErrNone && type == 1) + { + iFeatureSuppoted = ETrue; + } + else + { + TFileName path; + err = repository->Get( KAIWallpaperPath, path ); + if ( !err && path.Length()) + { + AddCommonWallpaperL( path, EFalse ); + } + } + } + CleanupStack::PopAndDestroy( repository ); + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::AddPageSpecificWallpaperL +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::AddPageSpecificWallpaperL( const TDesC& aFileName ) + { + CXnViewData& viewData( iViewManager.ActiveViewData() ); + const TDesC& old = viewData.WallpaperImagePath(); + + if( aFileName.Compare( old ) ) + { + // Remove old from the cache + if( old != KNullDesC ) + { + RemoveWallpaperFromCache( old ); + } + + // Add new to the cache + if( aFileName != KNullDesC ) + { + if( CacheWallpaperL( aFileName, viewData ) == KErrNone ) + { + SaveWallpaperL(); // to HSPS + } + else + { + return; + } + } + + // WallpaperImage changed back to default. Update view data. + else + { + viewData.SetWallpaperImagePathL( KNullDesC ); + viewData.SetWallpaperImage( NULL ); + } + + // Update screen + DrawNow(); + + TInt err = AknsWallpaperUtils::SetIdleWallpaper( aFileName, NULL ); + if( err == KErrNone ) + { + iIntUpdate++; + } + } + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::AddCommonWallpaperL +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::AddCommonWallpaperL( const TDesC& aFileName, + TBool aSave ) + { + // Remove old from the cache + if( iBgImagePath ) + { + iSkinSrv.RemoveWallpaper( aFileName ); + delete iBgImagePath; + iBgImagePath = NULL; + } + delete iBgImage; + iBgImage = NULL; + + if( aFileName != KNullDesC ) + { + iBgImagePath = aFileName.AllocL(); + + TBool err( KErrNone ); + TRAP( err, iSkinSrv.AddWallpaperL( aFileName, iRect.Size() ) ); + if( err ) + { + return; + } + TRAP( err, iBgImage = iSkinSrv.WallpaperImageL( aFileName ) ); + if( err ) + { + iSkinSrv.RemoveWallpaper( aFileName ); + delete iBgImage; + iBgImage = NULL; + return; + } + } + + // Update screen + DrawNow(); + + // Save path to cenrep + if( aSave ) + { + SaveWallpaperL(); + } + + TInt err = AknsWallpaperUtils::SetIdleWallpaper( aFileName, NULL ); + if( !err ) + { + iIntUpdate++; + } + } + +// --------------------------------------------------------------------------- +// CXnBackgroundManager::ReadWallpaperFromCenrepL +// --------------------------------------------------------------------------- +// +void CXnBackgroundManager::ReadWallpaperFromCenrepL() + { + CRepository* repository = CRepository::NewLC( KCRUidPersonalisation ); + if ( repository ) + { + // Get wallpaper type from cenrep + TInt wallpaperType; + TInt err = repository->Get( KPslnWallpaperType, wallpaperType ); + if ( err == KErrNone ) + { + if ( wallpaperType == 0 ) + { + if( iFeatureSuppoted ) + { + CXnViewData& viewData( iViewManager.ActiveViewData() ); + RemoveWallpaperFromCache( viewData.WallpaperImagePath() ); + RemoveWallpaperL( viewData ); + } + else + { + if( iBgImagePath ) + { + iSkinSrv.RemoveWallpaper( *iBgImagePath ); + delete iBgImagePath; + iBgImagePath = NULL; + } + delete iBgImage; + iBgImage = NULL; + SaveWallpaperL(); + } + } + else if ( wallpaperType == 1 ) + { + // WallpaperImage is image + // Get wallpaper image path from cenrep and save it + TFileName wallpaper; + err = repository->Get( KPslnIdleBackgroundImagePath, wallpaper ); + if ( err == KErrNone ) + { + if( iFeatureSuppoted ) + { + AddPageSpecificWallpaperL( wallpaper ); + } + else + { + AddCommonWallpaperL( wallpaper, EFalse ); + } + } + } + DrawNow(); + } + + CleanupStack::PopAndDestroy( repository ); + } + } + +// End of File diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -69,7 +69,6 @@ // CXnBgControl::~CXnBgControl() { - delete iBgContext; } // ----------------------------------------------------------------------------- @@ -89,13 +88,18 @@ void CXnBgControl::ConstructL() { CreateWindowL(); + + TRgb backgroundColour = KRgbWhite; + if( KErrNone == Window().SetTransparencyAlphaChannel() ) + { + backgroundColour.SetAlpha( 0 ); + } + Window().SetBackgroundColor( backgroundColour ); EnableDragEvents(); Window().SetPointerGrab( ETrue ); - - iBgContext = CAknsLayeredBackgroundControlContext::NewL( - KAknsIIDWallpaper, TRect(), ETrue, 1 ); + ActivateL(); @@ -141,15 +145,6 @@ // void CXnBgControl::SizeChanged() { - TRect rect; - -#ifdef RD_FULLSCREEN_WALLPAPER - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect ); -#else - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); -#endif - - iBgContext->SetRect( rect ); } // ----------------------------------------------------------------------------- @@ -171,10 +166,8 @@ // No background needed for dragging widget screenshot } else - { - MAknsSkinInstance* skin( AknsUtils::SkinInstance() ); - - AknsDrawUtils::Background( skin, iBgContext, this, gc, aRect ); + { + gc.Clear( aRect ); } } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -124,14 +124,15 @@ adapter->SetComponent( aTargetComponent ); adapter->SetComponentsToInheritVisibility( ETrue ); - adapter->MakeVisible( EFalse ); - + if ( type != KToolTip ) { // Don't activate tooltip yet adapter->ActivateL(); } - + + adapter->MakeVisible( EFalse ); + CleanupStack::Pop( aTargetComponent ); return response; diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -32,6 +32,9 @@ #include "xndomattribute.h" #include "xnpanic.h" #include "xnplugindefs.h" +#include "xnviewmanager.h" +#include "xneditor.h" +#include "xnbackgroundmanager.h" // Constants _LIT8( KStateWaitConfirmation, "WaitForConfirmation" ); @@ -52,6 +55,48 @@ using namespace hspswrapper; // ======== LOCAL FUNCTIONS ======== +// -------------------------------------------------------------------------- +// ItemValueL +// Get property value from configuration. +// -------------------------------------------------------------------------- +// +static HBufC* ItemValueL( CHspsConfiguration& aConfiguration, const TDesC8& aItemId, const TDesC8& aName ) + { + HBufC* ret = NULL; + + RPointerArray<CItemMap>& settingsList = aConfiguration.Settings(); + for( TInt i = 0; i < settingsList.Count(); i++ ) + { + CItemMap* setting = settingsList[i]; + if( !setting ) + { + continue; + } + + if( setting->ItemId() == aItemId ) + { + RPointerArray<CPropertyMap>& properties = setting->Properties(); + for( TInt j = 0; j < properties.Count(); j++ ) + { + CPropertyMap* property = properties[j]; + if( !property ) + { + continue; + } + + if( property->Name() == aName ) + { + ret = HBufC::NewL( property->Value().Length() ); + ret->Des().Copy( property->Value() ); + break; + } + } + break; + } + } + return ret; + } + // --------------------------------------------------------------------------- // Finds recursively node by name // @return returns pointer to desired node, NULL if nothing found @@ -164,7 +209,7 @@ return; } - CXnDomStringPool& sp( node->StringPool() ); + CXnDomStringPool* sp( node->StringPool() ); for ( TInt i = 0; i < aProperties.Count(); i++ ) { @@ -451,7 +496,7 @@ return NULL; } - + RPointerArray< CXnPluginData >& array( aRootData.PluginData() ); TInt index( 0 ); @@ -561,7 +606,22 @@ UpdatePluginFromSettingsL( *configuration, *viewRoot ); aViewData.SetUseEmptyWidget( UseEmptyWidget( *viewRoot ) ); + + // Read wallpaper image path from HSPS + CXnBackgroundManager& bgManager = aViewData.ViewManager(). + Editor().BgManager(); + // if page specific wallpaper feature is enabled + if( bgManager.ActivatedL() ) + { + HBufC* bgImage = ItemValueL( *configuration, KWallpaper, KPath ); + CleanupStack::PushL( bgImage ); + if( bgImage && bgImage->Length() > 0 ) + { + bgManager.CacheWallpaperL( bgImage->Des(), aViewData ); + } + CleanupStack::PopAndDestroy( bgImage ); + } if ( pluginNode ) { // This assumes all <plugin> elements are siblings diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -1152,7 +1152,7 @@ TRAP( error, tmpProperty = CXnProperty::NewL( KNullDesC8, tmpValue, - aNode.UiEngine()->ODT()->DomDocument().StringPool() ); ); + *aNode.UiEngine()->ODT()->DomDocument().StringPool() ); ); if ( error != KErrNone ) { delete tmpValue; @@ -1335,7 +1335,7 @@ CXnProperty* tmpProperty = NULL; TRAP( error, tmpProperty = CXnProperty::NewL( KNullDesC8, tmpValue, - aNode.UiEngine()->ODT()->DomDocument().StringPool() ); ); + *aNode.UiEngine()->ODT()->DomDocument().StringPool() ); ); if ( error != KErrNone ) { delete tmpValue; @@ -3107,7 +3107,7 @@ tmpProperty = CXnProperty::NewL( KNullDesC8, tmpValue, - aNode.UiEngine()->ODT()->DomDocument().StringPool() ); + *aNode.UiEngine()->ODT()->DomDocument().StringPool() ); CleanupStack::Pop( tmpValue ); TSize imageSize = returnValue->SizeInPixels(); CleanupStack::PushL( tmpProperty ); @@ -3206,7 +3206,7 @@ CleanupStack::PushL( nameValue ); nameValue->SetStringValueL( CXnDomPropertyValue::EString, aName ); CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::KName, - nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + nameValue, *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -3216,7 +3216,7 @@ CleanupStack::PushL( valueValue ); valueValue->SetStringValueL( CXnDomPropertyValue::EString, aValue ); CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, - valueValue, aUiEngine.ODT()->DomDocument().StringPool() ); + valueValue, *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( valueValue ); CleanupStack::PushL( value ); node->SetPropertyL( value ); @@ -3249,7 +3249,7 @@ CleanupStack::PushL( nameValue ); nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, - nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + nameValue, *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -3285,7 +3285,7 @@ CleanupStack::PushL( nameValue ); nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, - nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + nameValue, *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -3535,7 +3535,7 @@ CXnUiEngine& aUiEngine, const TDesC8& aDirection ) { - CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() ); + CXnDomStringPool* sp( aUiEngine.ODT()->DomDocument().StringPool() ); CXnNode* node = CXnNode::NewL(); CleanupStack::PushL( node ); @@ -3558,7 +3558,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, - nameValue, sp ); + nameValue, *sp ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); @@ -3573,7 +3573,7 @@ CXnProperty* reason = CXnProperty::NewL( XnPropertyNames::action::trigger::name::swipe::KDirection, - reasonValue, sp ); + reasonValue, *sp ); CleanupStack::Pop( reasonValue ); @@ -4039,6 +4039,14 @@ node->IsStateSet( XnPropertyNames::style::common::KFocus ) && node->IsStateSet( XnPropertyNames::style::common::KPressedDown ) ) ) { +#ifdef RD_TACTILE_FEEDBACK + MTouchFeedback* feedback( MTouchFeedback::Instance() ); + + if ( feedback ) + { + feedback->InstantFeedback( ETouchFeedbackBasic ); + } +#endif node->SetStateL( XnPropertyNames::style::common::KActive ); } } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -115,12 +115,12 @@ { CXnUiEngine* engine( aNode.UiEngine() ); - CXnDomStringPool& sp( aNode.DomNode()->StringPool() ); + CXnDomStringPool* sp( aNode.DomNode()->StringPool() ); CXnProperty* prop = CXnProperty::NewL( XnPropertyNames::style::common::KVisibility, aVisibility, - CXnDomPropertyValue::EString, sp ); + CXnDomPropertyValue::EString, *sp ); CleanupStack::PushL( prop ); aNode.SetPropertyL( prop ); @@ -303,7 +303,7 @@ DrawNow( iLastDrawRect ); } - iDrawPos = TPoint::EUninitialized; + iDrawPos.SetXY( 0, 0 ); iLastDrawRect = TRect::EUninitialized; } } @@ -459,9 +459,9 @@ if ( iState == CXnEditMode::EDragging ) { node->SetStateL( XnPropertyNames::style::common::KFocus ); - #ifdef RD_TACTILE_FEEDBACK - Feedback( ETouchFeedbackSensitive ); - #endif +#ifdef RD_TACTILE_FEEDBACK + Feedback( ETouchFeedbackSensitive ); +#endif } else if ( iDraggingNode && !iDraggingNode->MarginRect().Contains( aPointerEvent.iPosition ) ) @@ -540,7 +540,10 @@ } } else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) - { + { +#ifdef RD_TACTILE_FEEDBACK + Feedback( ETouchFeedbackBasic ); +#endif // Cancel if ( !iTargetNode || !iDraggingNode || iDraggingNode == iTargetNode || @@ -754,10 +757,12 @@ iDraggingNode->Parent()->SetDirtyL( XnDirtyLevel::ELayoutAndRender ); } - iDraggingNode = iTargetNode = NULL; - - iPreviousPos = iStylusDownPos = TPoint::EUninitialized; - + iDraggingNode = NULL; + iTargetNode = NULL; + + iPreviousPos.SetXY( 0, 0 ); + iStylusDownPos.SetXY( 0, 0 ); + iState = CXnEditMode::EDragAndDrop; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -56,6 +56,7 @@ #include "xnrootdata.h" #include "xnviewdata.h" #include "xnwallpaperview.h" +#include "xnbackgroundmanager.h" #include "xneditor.h" #include "xnpanic.h" @@ -173,7 +174,7 @@ if ( node ) { - CXnDomStringPool& sp( node->StringPool() ); + CXnDomStringPool* sp( node->StringPool() ); // create new property CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( sp ); @@ -181,7 +182,7 @@ value->SetStringValueL( CXnDomPropertyValue::EString, aValue ); - CXnProperty* prop = CXnProperty::NewL( aAttribute, value, sp ); + CXnProperty* prop = CXnProperty::NewL( aAttribute, value, *sp ); CleanupStack::Pop( value ); CleanupStack::PushL( prop ); @@ -311,6 +312,7 @@ iCpsWrapper = CCpsWrapper::NewL( *this ); iHspsWrapper = CHspsWrapper::NewL( aUid, this ); iRepository= CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + iBgManager = CXnBackgroundManager::NewL( iViewManager, *iHspsWrapper ); } // --------------------------------------------------------------------------- @@ -325,6 +327,7 @@ delete iHspsWrapper; delete iPublisherMap; delete iRepository; + delete iBgManager; } // ----------------------------------------------------------------------------- @@ -1586,6 +1589,15 @@ } // ----------------------------------------------------------------------------- +// CXnEditor::BgManager +// ----------------------------------------------------------------------------- +// +CXnBackgroundManager& CXnEditor::BgManager() const + { + return *iBgManager; + } + +// ----------------------------------------------------------------------------- // from MHsContentController // ----------------------------------------------------------------------------- // @@ -1788,4 +1800,80 @@ return iViewManager.ActivateAppL( aInfo.Uid() ); } +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::ActiveViewL( CHsContentInfo& aInfo ) + { + + TInt err( KErrNone ); + + // Get active application configuration + CHspsConfiguration* app( iHspsWrapper->GetAppConfigurationL() ); + CleanupStack::PushL( app ); + + // Get list of views included in active application configuration + RPointerArray< CPluginMap >& plugins( app->PluginMaps() ); + CPluginMap* plugin( NULL ); + + // Find active view + for ( TInt i = 0; i < plugins.Count() && !plugin; i++ ) + { + if ( plugins[ i ]->ActivationState() ) + { + plugin = plugins[ i ]; + } + } + + if ( plugin ) + { + CHspsConfiguration* view( iHspsWrapper->GetPluginConfigurationL( plugin->PluginId() ) ); + CleanupStack::PushL( view ); + + aInfo.SetNameL( view->PluginInfo().Name() ); + aInfo.SetUidL( view->PluginInfo().Uid() ); + aInfo.SetTypeL( view->PluginInfo().Type() ); + aInfo.SetDescriptionL( view->PluginInfo().Description() ); + aInfo.SetIconPathL( view->PluginInfo().LogoIcon() ); + + CleanupStack::PopAndDestroy( view ); + } + else + { + err = KErrNotFound; + } + + CleanupStack::PopAndDestroy( app ); + return err; + } + +// ----------------------------------------------------------------------------- +// from MHsContentController +// ----------------------------------------------------------------------------- +// +TInt CXnEditor::ActiveAppL( CHsContentInfo& aInfo ) + { + + TInt err( KErrNone ); + CHspsConfiguration* app = iHspsWrapper->GetAppConfigurationL(); + CleanupStack::PushL( app ); + + if ( app->PluginInfo().Uid().Length() > 0 ) + { + aInfo.SetNameL( app->PluginInfo().Name() ); + aInfo.SetUidL( app->PluginInfo().Uid() ); + aInfo.SetTypeL( app->PluginInfo().Type() ); + aInfo.SetDescriptionL( app->PluginInfo().Description() ); + aInfo.SetIconPathL( app->PluginInfo().LogoIcon() ); + } + else + { + err = KErrNotFound; + } + + CleanupStack::PopAndDestroy( app ); + return err; + } + // End of file diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnextrenderingpluginwrapper.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnextrenderingpluginwrapper.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnextrenderingpluginwrapper.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -24,12 +24,15 @@ // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::NewL() +// // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper* CXnExtRenderingPluginWrapper::NewL( CXnNodePluginIf& aNode, CXnExtRenderingPluginAdapter& aAdapter ) { - CXnExtRenderingPluginWrapper* self = new ( ELeave ) CXnExtRenderingPluginWrapper( aAdapter ); + CXnExtRenderingPluginWrapper* self = + new ( ELeave ) CXnExtRenderingPluginWrapper( aAdapter ); + CleanupStack::PushL( self ); self->ConstructL( aNode ); CleanupStack::Pop( self ); @@ -38,25 +41,30 @@ // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::ConstructL() +// // ---------------------------------------------------------------------------- // void CXnExtRenderingPluginWrapper::ConstructL( CXnNodePluginIf& aNode ) { iNode = &aNode; + CXnControlAdapter::ConstructL( aNode ); } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::CXnExtRenderingPluginWrapper() +// // ---------------------------------------------------------------------------- // -CXnExtRenderingPluginWrapper::CXnExtRenderingPluginWrapper( CXnExtRenderingPluginAdapter& aAdapter ) +CXnExtRenderingPluginWrapper::CXnExtRenderingPluginWrapper( + CXnExtRenderingPluginAdapter& aAdapter ) { iAdapter = &aAdapter; } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::~CXnExtRenderingPluginWrapper() +// // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::~CXnExtRenderingPluginWrapper() @@ -66,6 +74,7 @@ // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::CountComponentControls() +// // ---------------------------------------------------------------------------- // TInt CXnExtRenderingPluginWrapper::CountComponentControls() const @@ -75,31 +84,42 @@ // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::ComponentControl() +// // ---------------------------------------------------------------------------- // -CCoeControl* CXnExtRenderingPluginWrapper::ComponentControl( TInt aIndex ) const +CCoeControl* CXnExtRenderingPluginWrapper::ComponentControl( + TInt aIndex ) const { if( aIndex == 0 ) { return iAdapter; } - else - { - return NULL; - } + + return NULL; } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::OfferKeyEventL() +// // ---------------------------------------------------------------------------- // -TKeyResponse CXnExtRenderingPluginWrapper::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) +TKeyResponse CXnExtRenderingPluginWrapper::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType ) { - return iAdapter->OfferKeyEventL( aKeyEvent, aType ); + TKeyResponse resp( iAdapter->OfferKeyEventL( aKeyEvent, aType ) ); + + if ( resp == EKeyWasNotConsumed ) + { + // iAdapter did't consume the event, pass it to base clsas + resp = CXnControlAdapter::OfferKeyEventL( aKeyEvent, aType ); + } + + return resp; } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::SizeChanged() +// // ---------------------------------------------------------------------------- // void CXnExtRenderingPluginWrapper::SizeChanged() @@ -109,68 +129,84 @@ // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::SkinChanged() +// // ---------------------------------------------------------------------------- // void CXnExtRenderingPluginWrapper::SkinChanged() { CXnControlAdapter::SkinChanged(); + iAdapter->SkinChanged(); } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::SetContainerWindowL() +// // ---------------------------------------------------------------------------- // -void CXnExtRenderingPluginWrapper::SetContainerWindowL(const CCoeControl& aContainer) +void CXnExtRenderingPluginWrapper::SetContainerWindowL( + const CCoeControl& aContainer ) { CXnControlAdapter::SetContainerWindowL( aContainer ); + iAdapter->SetContainerWindowL( *this ); } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::MakeVisible() +// // ---------------------------------------------------------------------------- // void CXnExtRenderingPluginWrapper::MakeVisible( TBool aVisible ) { - CXnControlAdapter::MakeVisible( aVisible ); - iAdapter->MakeVisible( aVisible ); + // Base class will call MakeVisible to component controls + CXnControlAdapter::MakeVisible( aVisible ); } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::FocusChanged() +// // ---------------------------------------------------------------------------- // void CXnExtRenderingPluginWrapper::FocusChanged( TDrawNow aDrawNow ) { CXnControlAdapter::FocusChanged( aDrawNow ); - iAdapter->FocusChanged( aDrawNow ); + + TBool focused( IsFocused() ? ETrue : EFalse ); + + iAdapter->SetFocus( focused, aDrawNow ); } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::HandleScreenDeviceChangedL() +// // ---------------------------------------------------------------------------- // void CXnExtRenderingPluginWrapper::HandleScreenDeviceChangedL() { CXnControlAdapter::HandleScreenDeviceChangedL(); + iAdapter->HandleResourceChange( KEikDynamicLayoutVariantSwitch ); } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::DoEnterPowerSaveModeL() +// // ---------------------------------------------------------------------------- // -void CXnExtRenderingPluginWrapper::DoEnterPowerSaveModeL( TModeEvent /*aEvent*/ ) +void CXnExtRenderingPluginWrapper::DoEnterPowerSaveModeL( + TModeEvent /*aEvent*/ ) { iAdapter->EnterPowerSaveModeL(); } // ---------------------------------------------------------------------------- // CXnExtRenderingPluginWrapper::DoExitPowerSaveModeL() +// // ---------------------------------------------------------------------------- // -void CXnExtRenderingPluginWrapper::DoExitPowerSaveModeL( TModeEvent /*aEvent*/ ) +void CXnExtRenderingPluginWrapper::DoExitPowerSaveModeL( + TModeEvent /*aEvent*/ ) { iAdapter->ExitPowerSaveModeL(); } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -182,9 +182,20 @@ if ( IsVisible() || iRefused ) { CXnNode* node( iAppUiAdapter.UiEngine().FocusedNode() ); - + if ( node ) - { + { + CXnProperty* prop( NULL ); + + TRAP_IGNORE( prop = node->GetPropertyL( + XnPropertyNames::common::KFocusAppearance ) ); + + if ( prop && prop->StringValue() == XnPropertyNames::KNone ) + { + // Current element refuses to draw focus appearance + return; + } + TRect innerRect( aRect ); innerRect.Shrink( diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -91,7 +91,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnlistquerydialogadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnlistquerydialogadapter.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnlistquerydialogadapter.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -349,12 +349,14 @@ HBufC8* nameStr( attribute->Value().AllocLC()); TPtr8 namePtr = nameStr->Des(); - //Find '(' char - TInt pos = namePtr.Locate('('); - TBuf8<4> index; - index.AppendNum( aIndex ); - namePtr.Replace( pos+1, 1, index ); + TInt startIndex = namePtr.Locate( '(' ); + TInt endIndex = namePtr.Locate( ')' ); + TInt dataLength = endIndex - startIndex - 1; + TBuf8<4> data; + data.AppendNum( aIndex ); + namePtr.Replace( startIndex+1, dataLength, data ); + attribute->SetValueL( namePtr ); CleanupStack::PopAndDestroy( nameStr ); } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -50,6 +50,7 @@ #include "xnlistquerydialogadapter.h" #include "xneffectmanager.h" #include "xnviewadapter.h" +#include "xnbackgroundmanager.h" // Local constants _LIT8( KRef, "ref" ); @@ -1912,7 +1913,7 @@ XnPropertyNames::action::trigger::name::keyevent::KEventType ); CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::KName, - nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + nameValue, *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -1923,7 +1924,7 @@ valueValue->SetFloatValueL( CXnDomPropertyValue::ENumber, aType ); CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, valueValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( valueValue ); CleanupStack::PushL( value ); node->SetPropertyL( value ); @@ -1957,7 +1958,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -1970,7 +1971,7 @@ CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, valueValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( valueValue ); CleanupStack::PushL( value ); node->SetPropertyL( value ); @@ -2004,7 +2005,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -2016,7 +2017,7 @@ CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, valueValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( valueValue ); CleanupStack::PushL( value ); node->SetPropertyL( value ); @@ -2050,7 +2051,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -2063,7 +2064,7 @@ CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, valueValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( valueValue ); CleanupStack::PushL( value ); node->SetPropertyL( value ); @@ -2097,7 +2098,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -2110,7 +2111,7 @@ CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, valueValue, - aUiEngine.ODT()->DomDocument().StringPool()) ; + *aUiEngine.ODT()->DomDocument().StringPool()) ; CleanupStack::Pop( valueValue ); CleanupStack::PushL( value ); node->SetPropertyL( value ); @@ -2141,7 +2142,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -2208,7 +2209,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -3290,7 +3291,7 @@ RPointerArray< CXnPluginData>& plugins( aEngine.ViewManager()->ActiveViewData().PluginData() ); - CXnDomStringPool& sp( aEventNode.StringPool() ); + CXnDomStringPool* sp( aEventNode.StringPool() ); CXnDomList& children( aEventNode.ChildNodes() ); @@ -3401,7 +3402,7 @@ if ( !plugins[i]->Occupied() && useEmpty ) { // Make empty space visible - SetStringPropertyToNodeL( sp, *node, + SetStringPropertyToNodeL( *sp, *node, XnPropertyNames::style::common::KVisibility, XnPropertyNames::style::common::visibility::KVisible ); } @@ -3483,7 +3484,7 @@ RPointerArray< CXnPluginData>& plugins( aEngine.ViewManager()->ActiveViewData().PluginData() ); - CXnDomStringPool& sp( aEventNode.StringPool() ); + CXnDomStringPool* sp( aEventNode.StringPool() ); if ( keyEditMode ) { @@ -3510,7 +3511,7 @@ if ( !plugins[i]->Occupied() && useEmpty ) { // Make empty space blank - SetStringPropertyToNodeL( sp, *node, + SetStringPropertyToNodeL( *sp, *node, XnPropertyNames::style::common::KVisibility, XnPropertyNames::style::common::visibility::KBlank ); } @@ -3637,7 +3638,7 @@ { if ( aNode ) { - CXnDomStringPool& sp = aEngine.ODT()->DomDocument().StringPool(); + CXnDomStringPool* sp = aEngine.ODT()->DomDocument().StringPool(); CXnDomProperty* prop = CXnDomProperty::NewL( aName, sp ); CleanupStack::PushL( prop ); @@ -3681,7 +3682,7 @@ { if ( aNode ) { - CXnDomStringPool& sp = aEngine.ODT()->DomDocument().StringPool(); + CXnDomStringPool* sp = aEngine.ODT()->DomDocument().StringPool(); CXnDomProperty* prop = CXnDomProperty::NewL( aName, sp ); CleanupStack::PushL( prop ); @@ -3730,7 +3731,7 @@ { if ( aNode ) { - CXnDomStringPool& sp = aEngine.ODT()->DomDocument().StringPool(); + CXnDomStringPool* sp = aEngine.ODT()->DomDocument().StringPool(); CXnDomProperty* prop = CXnDomProperty::NewL( aName, sp ); CleanupStack::PushL( prop ); @@ -4403,12 +4404,12 @@ XnPropertyNames::action::trigger::name::KEditMode ) ); CleanupStack::PushL( trigger ); - CXnDomStringPool& sp( aEngine.ODT()->DomDocument().StringPool() ); + CXnDomStringPool* sp( aEngine.ODT()->DomDocument().StringPool() ); CXnProperty* value( CXnProperty::NewL( XnPropertyNames::action::KValue, XnPropertyNames::action::trigger::name::editmode::KEnter, - CXnDomPropertyValue::EString, sp ) ); + CXnDomPropertyValue::EString, *sp ) ); CleanupStack::PushL( value ); trigger->SetPropertyL( value ); @@ -4426,12 +4427,12 @@ XnPropertyNames::action::trigger::name::KEditMode ) ); CleanupStack::PushL( trigger ); - CXnDomStringPool& sp( aEngine.ODT()->DomDocument().StringPool() ); + CXnDomStringPool* sp( aEngine.ODT()->DomDocument().StringPool() ); CXnProperty* value( CXnProperty::NewL( XnPropertyNames::action::KValue, XnPropertyNames::action::trigger::name::editmode::KExit, - CXnDomPropertyValue::EString, sp ) ); + CXnDomPropertyValue::EString, *sp ) ); CleanupStack::PushL( value ); trigger->SetPropertyL( value ); @@ -4468,7 +4469,7 @@ } else if ( nameString == XnPropertyNames::action::event::KSetWallpaper ) { - aEngine.Editor()->SetWallpaperL(); + aEngine.Editor()->BgManager().SetWallpaperL(); return ETrue; } @@ -6891,13 +6892,13 @@ node = aSiblingArray[i]; if ( DisplayValueMatchL( *node, KBlock ) ) { - CXnDomStringPool& sp = node->DomNode()->StringPool(); + CXnDomStringPool* sp = node->DomNode()->StringPool(); //Switch the display to 'none' to visible siblings. - SetStringPropertyToNodeL( sp, *node, KDisplay, KNone ); + SetStringPropertyToNodeL( *sp, *node, KDisplay, KNone ); node = aSiblingArray[toBeDisplayed]; toBeDisplayed++; //Switch the display to 'block' to hidden siblings. - SetStringPropertyToNodeL( sp, *node, KDisplay, KBlock ); + SetStringPropertyToNodeL( *sp, *node, KDisplay, KBlock ); } } } @@ -6917,13 +6918,13 @@ node = aSiblingArray[--i]; if ( DisplayValueMatchL( *node, KBlock ) ) { - CXnDomStringPool& sp = node->DomNode()->StringPool(); + CXnDomStringPool* sp = node->DomNode()->StringPool(); //Switch the display to 'none' to visible siblings. - SetStringPropertyToNodeL( sp, *node, KDisplay, KNone ); + SetStringPropertyToNodeL( *sp, *node, KDisplay, KNone ); node = aSiblingArray[toBeDisplayed]; toBeDisplayed--; //Switch the display to 'block' to hidden siblings. - SetStringPropertyToNodeL( sp, *node, KDisplay, KBlock ); + SetStringPropertyToNodeL( *sp, *node, KDisplay, KBlock ); } } } @@ -7021,14 +7022,14 @@ if ( oldestIndex - 1 >= 0 ) { node = aChildren[oldestIndex - 1]; - CXnDomStringPool& sp = node->DomNode()->StringPool(); - SetStringPropertyToNodeL( sp, *node, KDisplay, KBlock ); + CXnDomStringPool* sp = node->DomNode()->StringPool(); + SetStringPropertyToNodeL( *sp, *node, KDisplay, KBlock ); // find youngest sibling with display block TInt index( 0 ); node = FindYoungestSiblingWithDisplayL( aChildren, KBlock, index ); if ( node ) { - SetStringPropertyToNodeL( sp, *node, KDisplay, KNone ); + SetStringPropertyToNodeL( *sp, *node, KDisplay, KNone ); } } else @@ -7069,14 +7070,14 @@ if ( index < siblingCount - 1 ) { node = aChildren[index + 1]; - CXnDomStringPool& sp = node->DomNode()->StringPool(); - SetStringPropertyToNodeL( sp , *node, KDisplay, KBlock ); + CXnDomStringPool* sp = node->DomNode()->StringPool(); + SetStringPropertyToNodeL( *sp , *node, KDisplay, KBlock ); // find oldest sibling with display block TInt oldestIndex( 0 ); node = FindOldestSiblingWithDisplayL( aChildren, KBlock, oldestIndex ); if ( node ) { - SetStringPropertyToNodeL( sp, *node, KDisplay, KNone ); + SetStringPropertyToNodeL( *sp, *node, KDisplay, KNone ); } } else // we are end of list @@ -7223,7 +7224,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -7464,14 +7465,14 @@ SetDirtyL( XnDirtyLevel::ERender ); - CXnDomStringPool& sp( iDomNode->StringPool() ); + CXnDomStringPool* sp( iDomNode->StringPool() ); CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( sp ); CleanupStack::PushL( newValue ); newValue->SetStringValueL( CXnDomPropertyValue::EString, KNullDesC8 ); // create property CXnProperty* prop = CXnProperty::NewL( - XnPropertyNames::common::KPCData, newValue, sp ); + XnPropertyNames::common::KPCData, newValue, *sp ); CleanupStack::Pop( newValue ); CleanupStack::PushL( prop ); @@ -7516,7 +7517,7 @@ // Searchs and shoes tooltips // ----------------------------------------------------------------------------- // -void CXnNodeImpl::ShowPopupsL( TRect aRect, TInt aSource ) +void CXnNodeImpl::ShowPopupsL( TRect aRect, TInt /*aSource*/ ) { if ( iHandleTooltip ) { @@ -10014,7 +10015,7 @@ iAdaptive |= XnAdaptive::EIgnoreDirty; SetStringPropertyToNodeL( - DomNode()->StringPool(), *Node(), + *DomNode()->StringPool(), *Node(), XnPropertyNames::style::common::KWidth, XnPropertyNames::style::common::KAuto ); @@ -10030,7 +10031,7 @@ iAdaptive |= XnAdaptive::EIgnoreDirty; SetStringPropertyToNodeL( - DomNode()->StringPool(), *Node(), + *DomNode()->StringPool(), *Node(), XnPropertyNames::style::common::KHeight, XnPropertyNames::style::common::KAuto ); @@ -10062,7 +10063,7 @@ iAdaptive |= XnAdaptive::EIgnoreDirty; SetFloatPropertyToNodeL( - DomNode()->StringPool(), *Node(), + *DomNode()->StringPool(), *Node(), XnPropertyNames::style::common::KWidth, aFixedSize.iWidth, CXnDomPropertyValue::EPx ); @@ -10074,7 +10075,7 @@ iAdaptive |= XnAdaptive::EIgnoreDirty; SetFloatPropertyToNodeL( - DomNode()->StringPool(), *Node(), + *DomNode()->StringPool(), *Node(), XnPropertyNames::style::common::KHeight, aFixedSize.iHeight, CXnDomPropertyValue::EPx ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnnodepluginif.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnnodepluginif.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodepluginif.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -489,7 +489,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, nameValue, - iNode->UiEngine()->ODT()->DomDocument().StringPool() ); + *iNode->UiEngine()->ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); @@ -504,7 +504,7 @@ CXnProperty* index = CXnProperty::NewL( aValueName, indexValue, - iNode->UiEngine()->ODT()->DomDocument().StringPool() ); + *iNode->UiEngine()->ODT()->DomDocument().StringPool() ); CleanupStack::Pop( indexValue ); CleanupStack::PushL( index ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -370,10 +370,10 @@ continue; } CXnDomProperty* clone = - CXnDomProperty::NewL( attribute->NameStringPoolIndex(), aStringPool ); + CXnDomProperty::NewL( attribute->NameStringPoolIndex(), &aStringPool ); CleanupStack::PushL( clone ); CXnDomPropertyValue* propertyValue = - CXnDomPropertyValue::NewL( aStringPool ); + CXnDomPropertyValue::NewL( &aStringPool ); CleanupStack::PushL( propertyValue ); propertyValue->SetStringPoolIndexL( CXnDomPropertyValue::EString, attribute->ValueStringPoolIndex() ); @@ -626,7 +626,7 @@ { CXnDomNode* root( aRootData.Owner() ); - CXnDomStringPool& sp( root->StringPool() ); + CXnDomStringPool* sp( root->StringPool() ); CXnAppUiAdapter& appui( iManager.AppUiAdapter() ); @@ -638,7 +638,7 @@ dom->SetLayoutNode( node ); node->SetDomNode( dom ); - CreateNodesL( root, sp, aRootData ); + CreateNodesL( root, *sp, aRootData ); // root doesn't have any controls @@ -654,10 +654,10 @@ // <view> element CXnDomNode* view( aViewData.Node() ); - CXnDomStringPool& sp( view->StringPool() ); + CXnDomStringPool* sp( view->StringPool() ); // from <view> element - CreateNodesL( view, sp, aViewData ); + CreateNodesL( view, *sp, aViewData ); CreateControlsL( view, aViewData ); // By default make controls invisible @@ -713,10 +713,10 @@ // <widget> element CXnDomNode* widget( aPluginData.Node() ); - CXnDomStringPool& sp( widget->StringPool() ); + CXnDomStringPool* sp( widget->StringPool() ); // from <widget> element - CreateNodesL( widget, sp, aPluginData ); + CreateNodesL( widget, *sp, aPluginData ); CreateControlsL( widget, aPluginData ); HandleWidgetBackgroundL( widget->LayoutNode() ); @@ -1220,6 +1220,8 @@ } } + __ASSERT_DEBUG( parentAdapter, User::Leave( KErrGeneral ) ); + CXnControlAdapter* adapter( NULL ); if( aName == KStylusPopupNodeName ) @@ -1236,7 +1238,7 @@ XnPropertyNames::style::common::KPosition, XnPropertyNames::style::common::position::KFloating, CXnDomPropertyValue::EString, - aNode.UiEngine()->ODT()->DomDocument().StringPool() ); + *aNode.UiEngine()->ODT()->DomDocument().StringPool() ); CleanupStack::PushL( prop ); aNode.SetPropertyL( prop ); CleanupStack::Pop( prop ); @@ -1304,7 +1306,7 @@ CXnProperty* bgColor = CXnProperty::NewL( XnPropertyNames::appearance::common::KBackGroundColor, - value, uiengine->ODT()->DomDocument().StringPool() ); + value, *uiengine->ODT()->DomDocument().StringPool() ); CleanupStack::Pop( value ); CleanupStack::PushL( bgColor ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnplugindata.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnplugindata.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnplugindata.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -116,7 +116,7 @@ // void CXnPluginData::ConstructL() { - iLoader = CPeriodic::NewL( CActive::EPriorityUserInput ); + iLoader = CPeriodic::NewL( CActive::EPriorityStandard ); } // ----------------------------------------------------------------------------- diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnproperty.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnproperty.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnproperty.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -162,7 +162,7 @@ void CXnProperty::ConstructL( const TDesC8& aName, CXnDomPropertyValue* aPropertyValue, CXnDomStringPool& aStringPool ) { - iProperty = CXnDomProperty::NewL( aName, aStringPool ); + iProperty = CXnDomProperty::NewL( aName, &aStringPool ); iIsDomPropertyOwned = ETrue; CXnDomList& propertyValueList = iProperty->PropertyValueList(); @@ -179,10 +179,10 @@ CXnDomPropertyValue::TPrimitiveValueType aValueType, CXnDomStringPool& aStringPool ) { - iProperty = CXnDomProperty::NewL( aPropertyName, aStringPool ); + iProperty = CXnDomProperty::NewL( aPropertyName, &aStringPool ); iIsDomPropertyOwned = ETrue; - CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( aStringPool ); + CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( &aStringPool ); CleanupStack::PushL( newValue ); newValue->SetStringValueL( aValueType, aPropertyValue ); @@ -204,10 +204,10 @@ CXnDomPropertyValue::TPrimitiveValueType aValueType, CXnDomStringPool& aStringPool ) { - iProperty = CXnDomProperty::NewL( aPropertyName, aStringPool ); + iProperty = CXnDomProperty::NewL( aPropertyName, &aStringPool ); iIsDomPropertyOwned = ETrue; - CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( aStringPool ); + CXnDomPropertyValue* newValue = CXnDomPropertyValue::NewL( &aStringPool ); CleanupStack::PushL( newValue ); newValue->SetFloatValueL( aValueType, aPropertyValue ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss --- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss Mon Jan 18 20:10:36 2010 +0200 @@ -131,8 +131,7 @@ items = { LBUF {txt = qtn_hs_default; }, - LBUF {txt = qtn_hs_image; }, - LBUF {txt = qtn_hs_slideshow; } + LBUF {txt = qtn_hs_image; } }; } diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -198,7 +198,7 @@ // EXPORT_C CXnDomStringPool& TXnUiEngineAppIf::StringPool() { - return iUiEngine->ODT()->DomDocument().StringPool(); + return *iUiEngine->ODT()->DomDocument().StringPool(); } // ----------------------------------------------------------------------------- diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -52,6 +52,8 @@ #include "xnnode.h" #include "xnpanic.h" #include "xneffectmanager.h" +#include "xneditor.h" +#include "xnbackgroundmanager.h" #ifdef _XN_PERFORMANCE_TEST_ #include "xntimemon.h" @@ -7779,7 +7781,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, - nameValue, aUiEngine.ODT()->DomDocument().StringPool() ); + nameValue, *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); @@ -7838,7 +7840,7 @@ // static CXnNode* BuildScreenDeviceChangeTriggerNodeLC( CXnUiEngine& aUiEngine ) { - CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() ); + CXnDomStringPool* sp( aUiEngine.ODT()->DomDocument().StringPool() ); CXnNode* node = CXnNode::NewL(); CleanupStack::PushL( node ); @@ -7859,7 +7861,7 @@ XnPropertyNames::action::trigger::name::KScreenDeviceChange ); CXnProperty* name = CXnProperty::NewL( - XnPropertyNames::action::trigger::KName, nameValue, sp ); + XnPropertyNames::action::trigger::KName, nameValue, *sp ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); @@ -7885,7 +7887,7 @@ reasonValue->SetStringValueL( CXnDomPropertyValue::EString, *reasonString ); CXnProperty* reason = CXnProperty::NewL( XnPropertyNames::action::trigger:: - name::uidefinitionmodification::KReason, reasonValue, sp ); + name::uidefinitionmodification::KReason, reasonValue, *sp ); CleanupStack::Pop( reasonValue ); @@ -8934,6 +8936,12 @@ // Update client rect SetClientRectL( iAppUiAdapter.ClientRect(), EFalse ); + // Update background rect + // Bg rect is always screen size. + TRect bgRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect ); + Editor()->BgManager().SetRect( bgRect ); + iEditMode->HandleScreenDeviceChangedL(); // Force relayout @@ -9373,7 +9381,7 @@ iClientRect ); iAppUiAdapter.ViewAdapter().BgControl().SetRect( aRect ); - + if ( aDrawNow ) { RootNode()->SetDirtyL(); @@ -9507,7 +9515,7 @@ void CXnUiEngineImpl::PositionStylusPopupL( CXnNode& aNode, CXnNode& aReference, const TPoint& aPosition ) { - CXnDomStringPool& sp( aNode.DomNode()->StringPool() ); + CXnDomStringPool* sp( aNode.DomNode()->StringPool() ); TXnDirtyRegion* dirtyRegion = FindDirtyRegionL( *iCurrentView ); RRegion region; region.Copy( dirtyRegion->iRegion ); @@ -9516,14 +9524,14 @@ // Set initial position to (0, 0) to calculate popup metrics CXnProperty* top = CXnProperty::NewL( XnPropertyNames::style::common::KTop, 0, - CXnDomPropertyValue::EPx, sp ); + CXnDomPropertyValue::EPx, *sp ); CleanupStack::PushL( top ); aNode.SetPropertyL( top ); CleanupStack::Pop( top ); top = NULL; CXnProperty* left = CXnProperty::NewL( XnPropertyNames::style::common::KLeft, 0, - CXnDomPropertyValue::EPx, sp ); + CXnDomPropertyValue::EPx, *sp ); CleanupStack::PushL( left ); aNode.SetPropertyL( left ); CleanupStack::Pop( left ); @@ -9533,7 +9541,7 @@ CXnProperty* display = CXnProperty::NewL( XnPropertyNames::style::common::KDisplay, XnPropertyNames::style::common::display::KBlock, - CXnDomPropertyValue::EString, sp ); + CXnDomPropertyValue::EString, *sp ); CleanupStack::PushL( display ); aNode.SetPropertyL( display ); CleanupStack::Pop( display ); @@ -9717,13 +9725,13 @@ // Set positions top = CXnProperty::NewL( XnPropertyNames::style::common::KTop, tl.iY, - CXnDomPropertyValue::EPx, sp ); + CXnDomPropertyValue::EPx, *sp ); CleanupStack::PushL( top ); aNode.SetPropertyL( top ); CleanupStack::Pop( top ); left = CXnProperty::NewL( XnPropertyNames::style::common::KLeft, tl.iX, - CXnDomPropertyValue::EPx, sp ); + CXnDomPropertyValue::EPx, *sp ); CleanupStack::PushL( left ); aNode.SetPropertyL( left ); CleanupStack::Pop( left ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -197,7 +197,7 @@ // EXPORT_C CXnDomStringPool& TXnUiEnginePluginIf::StringPool() { - return iUiEngine->ODT()->DomDocument().StringPool(); + return *iUiEngine->ODT()->DomDocument().StringPool(); } // ----------------------------------------------------------------------------- diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -81,7 +81,7 @@ CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, nameValue, - aUiEngine.ODT()->DomDocument().StringPool() ); + *aUiEngine.ODT()->DomDocument().StringPool() ); CleanupStack::Pop( nameValue ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -116,11 +116,11 @@ // static CXnNode* BuildEditStateTriggerL( CXnUiEngine& aUiEngine ) { - CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() ); + CXnDomStringPool* sp( aUiEngine.ODT()->DomDocument().StringPool() ); CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, - KNullDesC8, CXnDomPropertyValue::EString, sp ); + KNullDesC8, CXnDomPropertyValue::EString, *sp ); CleanupStack::PushL( value ); CXnNode* trigger( BuildTriggerL( diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -196,8 +196,11 @@ iManager.Parser().DestroyView( *this ); } - - Flush(); + delete iBgImage; + iBgImage = NULL; + Flush(); + delete iBgImagePath; + iBgImagePath = NULL; } // ----------------------------------------------------------------------------- @@ -274,6 +277,51 @@ } // ----------------------------------------------------------------------------- +// CXnViewData::SetWallpaperImage +// Store background image. Ownership is transferred. +// ----------------------------------------------------------------------------- +// +void CXnViewData::SetWallpaperImage( CFbsBitmap* aBitmap ) + { + delete iBgImage; + iBgImage = aBitmap; + } + +// ----------------------------------------------------------------------------- +// CXnViewData::WallpaperImage +// Get wallpaper image. +// ----------------------------------------------------------------------------- +// +CFbsBitmap* CXnViewData::WallpaperImage() const + { + return iBgImage; + } + +// ----------------------------------------------------------------------------- +// CXnViewData::SetWallpaperImagePathL +// ----------------------------------------------------------------------------- +// +void CXnViewData::SetWallpaperImagePathL( const TDesC& aFileName ) + { + delete iBgImagePath; + iBgImagePath = NULL; + iBgImagePath = aFileName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CXnViewData::WallpaperImagePath +// ----------------------------------------------------------------------------- +// +const TDesC& CXnViewData::WallpaperImagePath() const + { + if( iBgImagePath ) + { + return *iBgImagePath; + } + return KNullDesC; + } + +// ----------------------------------------------------------------------------- // CXnViewData::ResourcesL() // Gets this view data's resources // ----------------------------------------------------------------------------- diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -50,6 +50,7 @@ #include "xncomponentnodeimpl.h" #include "xnnodepluginif.h" #include "xnoomsyshandler.h" +#include "xnbackgroundmanager.h" // Constants _LIT8( KEmptyWidgetUid, "0x2001f47f" ); @@ -115,11 +116,11 @@ node->SetImpl( impl ); node->SetUiEngine( aUiEngine ); - CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() ); + CXnDomStringPool* sp( aUiEngine.ODT()->DomDocument().StringPool() ); CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName, aStringValue, - CXnDomPropertyValue::EString, sp ); + CXnDomPropertyValue::EString, *sp ); CleanupStack::PushL( name ); node->SetPropertyL( name ); @@ -127,7 +128,7 @@ CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue, - KNullDesC8, CXnDomPropertyValue::EString, sp ); + KNullDesC8, CXnDomPropertyValue::EString, *sp ); CleanupStack::PushL( value ); node->SetPropertyL( value ); @@ -871,6 +872,7 @@ if ( next.Occupied() ) { iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); + UpdateWallpaperL( current, next ); } } @@ -893,6 +895,7 @@ if ( prev.Occupied() ) { iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ); + UpdateWallpaperL( current, prev ); } } @@ -1633,6 +1636,15 @@ } // ----------------------------------------------------------------------------- +// CXnViewManager::UpdateWallpaperL +// ----------------------------------------------------------------------------- +// +void CXnViewManager::UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew ) + { + iEditor->BgManager().WallpaperChanged( aCurrent, aNew ); + } + +// ----------------------------------------------------------------------------- // CXnViewManager::ShowOperationFailedMessageL // ----------------------------------------------------------------------------- // diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -21,6 +21,7 @@ #include "xnwallpapercontainer.h" #include "xnuiengine.h" #include "xneditor.h" +#include "xnbackgroundmanager.h" // SYSTEM INCLUDE FILES #include <aknappui.h> @@ -93,7 +94,7 @@ // void CXnWallpaperView::DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, + TUid /*aCustomMessageId*/, const TDesC8& aCustomMessage ) { iAvkonAppUi->StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ); @@ -124,19 +125,9 @@ // set wallpaper. if( files->MdcaCount() == 1 ) { - AknsWallpaperUtils::SetIdleWallpaper( - files->MdcaPoint( 0 ), - NULL ); - } - //set slideshow - else - { - AknsWallpaperUtils::SetSlidesetWallpaper( - *files, - NULL ); + iEngine.Editor()->BgManager().AddWallpaperL( files->MdcaPoint( 0 ) ); } } - CleanupStack::PopAndDestroy( files ); iAvkonAppUi->ActivateViewL( aPrevViewId ); diff -r 5315654608de -r 08c6ee43b396 idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -266,10 +266,10 @@ // we can close it if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) { - CXnDomStringPool& sp = + CXnDomStringPool* sp = iNode.Node().DomNode()->StringPool(); CXnProperty* prop = CXnProperty::NewL( KDisplay, KNone, - CXnDomPropertyValue::EString, sp ); + CXnDomPropertyValue::EString, *sp ); CleanupStack::PushL( prop ); iNode.Node().SetPropertyL( prop ); CleanupStack::Pop( prop ); diff -r 5315654608de -r 08c6ee43b396 menufw/menufwui/matrixmenu/src/mmappui.cpp --- a/menufw/menufwui/matrixmenu/src/mmappui.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/menufw/menufwui/matrixmenu/src/mmappui.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -12,8 +12,8 @@ * Contributors: * * Description: Application UI class -* Version : %version: MM_176.1.28.1.54 % << Don't touch! Updated by Synergy at check-out. -* Version : %version: MM_176.1.28.1.54 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_176.1.28.1.56 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_176.1.28.1.56 % << Don't touch! Updated by Synergy at check-out. * */ @@ -214,22 +214,15 @@ iIsKastorEffectStarted = ETrue; TInt lastItemIndex = iCurrentContainer->NumberOfItems() - 1; - TBool makeLastItemVisible = lastItemIndex >= 0 && - iCurrentContainer->ItemIsFullyVisible( lastItemIndex ); - + if ( lastItemIndex >= 0 && iCurrentContainer->ItemIsFullyVisible( lastItemIndex ) && + !iCurrentContainer->IsHighlightVisible() ) + { + iCurrentContainer->SetManualHighlightL( lastItemIndex, EFalse ); + } + iCurrentContainer->SetRect( ClientRect() ); iDummyContainer->SetRect( ClientRect() ); - // This fixes a problem (view scrolled one row up) that occurs when - // switching from portrait to landscape orientation with scrollbar - // in bottom position. - if ( makeLastItemVisible ) - { - iCurrentContainer->Widget()->View()->SetTopItemIndex( - iCurrentContainer->Widget()->View()-> - CalcNewTopItemIndexSoItemIsVisible( lastItemIndex ) ); - } - THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); while( iterator.NextKey() ) { @@ -1527,12 +1520,19 @@ aMenuPane-> ItemData( aMenuPane->MenuItemCommandId( i ) ) ); } + + TInt itemSpecificMenuItemsCount = 0; //get custom menu items and their positions while ( menuIterator->HasNext() ) { CHnMenuItemModel* menuItem = menuIterator->GetNext(); - if ( !menuItem->IsItemSpecific() || !ignoreItemSpecific ) + TBool isItemSpecific = menuItem->IsItemSpecific(); + if ( isItemSpecific ) + { + ++itemSpecificMenuItemsCount; + } + if ( !isItemSpecific || !ignoreItemSpecific ) { CEikMenuPaneItem::SData menuData; menuData.iCommandId = menuItem->Command(); @@ -1570,6 +1570,11 @@ menuItemMap.InsertL( menuItem->Position(), menuData ); } } + + // DynInitMenuPaneL always gets called immediately after an item is touched and + // because of that it is possible to enable/disable settings that affect long + // tap behavior here. + iCurrentContainer->EnableLongTapAnimation( itemSpecificMenuItemsCount > 0 ); aMenuPane->Reset(); positionArray.Sort(); diff -r 5315654608de -r 08c6ee43b396 menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def --- a/menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def Thu Jan 07 12:39:41 2010 +0200 +++ b/menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def Mon Jan 18 20:10:36 2010 +0200 @@ -1,42 +1,43 @@ EXPORTS - ?SetHighlightVisibilityL@CMmWidgetContainer@@UAEXH@Z @ 1 NONAME ; void CMmWidgetContainer::SetHighlightVisibilityL(int) - ?SetDefaultHighlightL@CMmGridContainer@@UAEXH@Z @ 2 NONAME ; void CMmGridContainer::SetDefaultHighlightL(int) - ?PrepareForGarbage@CMmWidgetContainer@@QAEXXZ @ 3 NONAME ; void CMmWidgetContainer::PrepareForGarbage(void) - ?GetPreviousHighlight@CMmWidgetContainer@@UAEHXZ @ 4 NONAME ; int CMmWidgetContainer::GetPreviousHighlight(void) - ?SetHasFocusL@CMmWidgetContainer@@QAEXH@Z @ 5 NONAME ; void CMmWidgetContainer::SetHasFocusL(int) - ?HandleItemAdditionL@CMmWidgetContainer@@UAEXXZ @ 6 NONAME ; void CMmWidgetContainer::HandleItemAdditionL(void) - ?NewLC@CMmTemplateLibrary@@SAPAV1@XZ @ 7 NONAME ; class CMmTemplateLibrary * CMmTemplateLibrary::NewLC(void) - ?IsDraggable@CMmWidgetContainer@@QAEHXZ @ 8 NONAME ; int CMmWidgetContainer::IsDraggable(void) - ?HandleItemRemovalL@CMmWidgetContainer@@UAEXXZ @ 9 NONAME ; void CMmWidgetContainer::HandleItemRemovalL(void) - ?NumberOfItemsChangedL@CMmWidgetContainer@@QAEXW4TItemsChangeType@@@Z @ 10 NONAME ; void CMmWidgetContainer::NumberOfItemsChangedL(enum TItemsChangeType) - ?RestoreWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 11 NONAME ; void CMmWidgetContainer::RestoreWidgetPosition(void) - ?GetSuiteModelL@CMmWidgetContainer@@QAEPAVCHnSuiteModel@@XZ @ 12 NONAME ; class CHnSuiteModel * CMmWidgetContainer::GetSuiteModelL(void) - ?HandleForegroundGainedL@CMmWidgetContainer@@UAEXXZ @ 13 NONAME ; void CMmWidgetContainer::HandleForegroundGainedL(void) - ?NewL@CMmHighlightTimer@@SAPAV1@PAVCMmWidgetContainer@@@Z @ 14 NONAME ; class CMmHighlightTimer * CMmHighlightTimer::NewL(class CMmWidgetContainer *) - ?NewL@CMmTemplateLibrary@@SAPAV1@XZ @ 15 NONAME ; class CMmTemplateLibrary * CMmTemplateLibrary::NewL(void) - ?CancelDragL@CMmWidgetContainer@@QAEXH@Z @ 16 NONAME ; void CMmWidgetContainer::CancelDragL(int) - ?SetManualHighlightL@CMmWidgetContainer@@UAEXHH@Z @ 17 NONAME ; void CMmWidgetContainer::SetManualHighlightL(int, int) - ?HandleOptionsMenuVisibilityChangeL@CMmWidgetContainer@@UAEXH@Z @ 18 NONAME ; void CMmWidgetContainer::HandleOptionsMenuVisibilityChangeL(int) - ?ItemIsFullyVisible@CMmWidgetContainer@@QAEHH@Z @ 19 NONAME ; int CMmWidgetContainer::ItemIsFullyVisible(int) - ?NewGridContainerL@CMmWidgetContainer@@SAPAV1@ABVTRect@@PAVMObjectProvider@@PAVCMmTemplateLibrary@@@Z @ 20 NONAME ; class CMmWidgetContainer * CMmWidgetContainer::NewGridContainerL(class TRect const &, class MObjectProvider *, class CMmTemplateLibrary *) - ?NumberOfItems@CMmWidgetContainer@@QAEHXZ @ 21 NONAME ; int CMmWidgetContainer::NumberOfItems(void) - ?WidgetType@CMmWidgetContainer@@UAE?AW4THnSuiteWidgetType@@XZ @ 22 NONAME ; enum THnSuiteWidgetType CMmWidgetContainer::WidgetType(void) - ?GetHighlight@CMmWidgetContainer@@UAEHXZ @ 23 NONAME ; int CMmWidgetContainer::GetHighlight(void) - ?ItemIconZoomL@CMmWidgetContainer@@QAEXH@Z @ 24 NONAME ; void CMmWidgetContainer::ItemIconZoomL(int) - ?ResetWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 25 NONAME ; void CMmWidgetContainer::ResetWidgetPosition(void) - ?HandleBackgroundGainedL@CMmWidgetContainer@@UAEXXZ @ 26 NONAME ; void CMmWidgetContainer::HandleBackgroundGainedL(void) - ?CacheWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 27 NONAME ; void CMmWidgetContainer::CacheWidgetPosition(void) - ?NewLC@CMmHighlightTimer@@SAPAV1@PAVCMmWidgetContainer@@@Z @ 28 NONAME ; class CMmHighlightTimer * CMmHighlightTimer::NewLC(class CMmWidgetContainer *) - ?SetEmptyTextL@CMmListBoxContainer@@UAEXABVTDesC16@@@Z @ 29 NONAME ; void CMmListBoxContainer::SetEmptyTextL(class TDesC16 const &) - ?SetObserver@CMmWidgetContainer@@UAEXPAVMMmWidgetObserver@@@Z @ 30 NONAME ; void CMmWidgetContainer::SetObserver(class MMmWidgetObserver *) - ?IsHighlightVisible@CMmWidgetContainer@@UAEHXZ @ 31 NONAME ; int CMmWidgetContainer::IsHighlightVisible(void) - ?GetItemRectL@CMmWidgetContainer@@QAE?AVTRect@@H@Z @ 32 NONAME ; class TRect CMmWidgetContainer::GetItemRectL(int) - ?EndLongTapL@CMmWidgetContainer@@UAEXH@Z @ 33 NONAME ; void CMmWidgetContainer::EndLongTapL(int) - ?SetIsFaded@CMmWidgetContainer@@QAEXH@Z @ 34 NONAME ; void CMmWidgetContainer::SetIsFaded(int) - ?NewListBoxContainerL@CMmWidgetContainer@@SAPAV1@ABVTRect@@PAVMObjectProvider@@PAVCMmTemplateLibrary@@@Z @ 35 NONAME ; class CMmWidgetContainer * CMmWidgetContainer::NewListBoxContainerL(class TRect const &, class MObjectProvider *, class CMmTemplateLibrary *) - ?StopMovingL@CMmWidgetContainer@@QAEXXZ @ 36 NONAME ; void CMmWidgetContainer::StopMovingL(void) - ?SetDefaultHighlightL@CMmListBoxContainer@@UAEXH@Z @ 37 NONAME ; void CMmListBoxContainer::SetDefaultHighlightL(int) - ?SetEmptyTextL@CMmGridContainer@@UAEXABVTDesC16@@@Z @ 38 NONAME ; void CMmGridContainer::SetEmptyTextL(class TDesC16 const &) - ?SetLongTapObserver@CMmWidgetContainer@@UAEXPAVMMmLongTapObserver@@@Z @ 39 NONAME ; void CMmWidgetContainer::SetLongTapObserver(class MMmLongTapObserver *) - ?ScrollToItemL@CMmWidgetContainer@@QAEHH@Z @ 40 NONAME ; int CMmWidgetContainer::ScrollToItemL(int) + ?GetPreviousHighlight@CMmWidgetContainer@@UAEHXZ @ 1 NONAME ; int CMmWidgetContainer::GetPreviousHighlight(void) + ?HandleItemRemovalL@CMmWidgetContainer@@UAEXXZ @ 2 NONAME ; void CMmWidgetContainer::HandleItemRemovalL(void) + ?SetObserver@CMmWidgetContainer@@UAEXPAVMMmWidgetObserver@@@Z @ 3 NONAME ; void CMmWidgetContainer::SetObserver(class MMmWidgetObserver *) + ?ItemIconZoomL@CMmWidgetContainer@@QAEXH@Z @ 4 NONAME ; void CMmWidgetContainer::ItemIconZoomL(int) + ?SetDefaultHighlightL@CMmListBoxContainer@@UAEXH@Z @ 5 NONAME ; void CMmListBoxContainer::SetDefaultHighlightL(int) + ?GetItemRectL@CMmWidgetContainer@@QAE?AVTRect@@H@Z @ 6 NONAME ; class TRect CMmWidgetContainer::GetItemRectL(int) + ?ScrollToItemL@CMmWidgetContainer@@QAEHH@Z @ 7 NONAME ; int CMmWidgetContainer::ScrollToItemL(int) + ?IsHighlightVisible@CMmWidgetContainer@@UAEHXZ @ 8 NONAME ; int CMmWidgetContainer::IsHighlightVisible(void) + ?HandleBackgroundGainedL@CMmWidgetContainer@@UAEXXZ @ 9 NONAME ; void CMmWidgetContainer::HandleBackgroundGainedL(void) + ?SetHasFocusL@CMmWidgetContainer@@QAEXH@Z @ 10 NONAME ; void CMmWidgetContainer::SetHasFocusL(int) + ?NewGridContainerL@CMmWidgetContainer@@SAPAV1@ABVTRect@@PAVMObjectProvider@@PAVCMmTemplateLibrary@@@Z @ 11 NONAME ; class CMmWidgetContainer * CMmWidgetContainer::NewGridContainerL(class TRect const &, class MObjectProvider *, class CMmTemplateLibrary *) + ?SetLongTapObserver@CMmWidgetContainer@@UAEXPAVMMmLongTapObserver@@@Z @ 12 NONAME ; void CMmWidgetContainer::SetLongTapObserver(class MMmLongTapObserver *) + ?EndLongTapL@CMmWidgetContainer@@UAEXH@Z @ 13 NONAME ; void CMmWidgetContainer::EndLongTapL(int) + ?NumberOfItems@CMmWidgetContainer@@QAEHXZ @ 14 NONAME ; int CMmWidgetContainer::NumberOfItems(void) + ?GetSuiteModelL@CMmWidgetContainer@@QAEPAVCHnSuiteModel@@XZ @ 15 NONAME ; class CHnSuiteModel * CMmWidgetContainer::GetSuiteModelL(void) + ?NewLC@CMmTemplateLibrary@@SAPAV1@XZ @ 16 NONAME ; class CMmTemplateLibrary * CMmTemplateLibrary::NewLC(void) + ?NewL@CMmTemplateLibrary@@SAPAV1@XZ @ 17 NONAME ; class CMmTemplateLibrary * CMmTemplateLibrary::NewL(void) + ?NumberOfItemsChangedL@CMmWidgetContainer@@QAEXW4TItemsChangeType@@@Z @ 18 NONAME ; void CMmWidgetContainer::NumberOfItemsChangedL(enum TItemsChangeType) + ?SetManualHighlightL@CMmWidgetContainer@@UAEXHH@Z @ 19 NONAME ; void CMmWidgetContainer::SetManualHighlightL(int, int) + ?IsDraggable@CMmWidgetContainer@@QAEHXZ @ 20 NONAME ; int CMmWidgetContainer::IsDraggable(void) + ?HandleForegroundGainedL@CMmWidgetContainer@@UAEXXZ @ 21 NONAME ; void CMmWidgetContainer::HandleForegroundGainedL(void) + ?SetDefaultHighlightL@CMmGridContainer@@UAEXH@Z @ 22 NONAME ; void CMmGridContainer::SetDefaultHighlightL(int) + ?WidgetType@CMmWidgetContainer@@UAE?AW4THnSuiteWidgetType@@XZ @ 23 NONAME ; enum THnSuiteWidgetType CMmWidgetContainer::WidgetType(void) + ?SetEmptyTextL@CMmGridContainer@@UAEXABVTDesC16@@@Z @ 24 NONAME ; void CMmGridContainer::SetEmptyTextL(class TDesC16 const &) + ?HandleItemAdditionL@CMmWidgetContainer@@UAEXXZ @ 25 NONAME ; void CMmWidgetContainer::HandleItemAdditionL(void) + ?StopMovingL@CMmWidgetContainer@@QAEXXZ @ 26 NONAME ; void CMmWidgetContainer::StopMovingL(void) + ?SetEmptyTextL@CMmListBoxContainer@@UAEXABVTDesC16@@@Z @ 27 NONAME ; void CMmListBoxContainer::SetEmptyTextL(class TDesC16 const &) + ?NewListBoxContainerL@CMmWidgetContainer@@SAPAV1@ABVTRect@@PAVMObjectProvider@@PAVCMmTemplateLibrary@@@Z @ 28 NONAME ; class CMmWidgetContainer * CMmWidgetContainer::NewListBoxContainerL(class TRect const &, class MObjectProvider *, class CMmTemplateLibrary *) + ?PrepareForGarbage@CMmWidgetContainer@@QAEXXZ @ 29 NONAME ; void CMmWidgetContainer::PrepareForGarbage(void) + ?GetHighlight@CMmWidgetContainer@@UAEHXZ @ 30 NONAME ; int CMmWidgetContainer::GetHighlight(void) + ?NewLC@CMmHighlightTimer@@SAPAV1@PAVCMmWidgetContainer@@@Z @ 31 NONAME ; class CMmHighlightTimer * CMmHighlightTimer::NewLC(class CMmWidgetContainer *) + ?RestoreWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 32 NONAME ; void CMmWidgetContainer::RestoreWidgetPosition(void) + ?EnableLongTapAnimation@CMmWidgetContainer@@QAEXH@Z @ 33 NONAME ; void CMmWidgetContainer::EnableLongTapAnimation(int) + ?SetHighlightVisibilityL@CMmWidgetContainer@@UAEXH@Z @ 34 NONAME ; void CMmWidgetContainer::SetHighlightVisibilityL(int) + ?NewL@CMmHighlightTimer@@SAPAV1@PAVCMmWidgetContainer@@@Z @ 35 NONAME ; class CMmHighlightTimer * CMmHighlightTimer::NewL(class CMmWidgetContainer *) + ?ResetWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 36 NONAME ; void CMmWidgetContainer::ResetWidgetPosition(void) + ?HandleOptionsMenuVisibilityChangeL@CMmWidgetContainer@@UAEXH@Z @ 37 NONAME ; void CMmWidgetContainer::HandleOptionsMenuVisibilityChangeL(int) + ?ItemIsFullyVisible@CMmWidgetContainer@@QAEHH@Z @ 38 NONAME ; int CMmWidgetContainer::ItemIsFullyVisible(int) + ?SetIsFaded@CMmWidgetContainer@@QAEXH@Z @ 39 NONAME ; void CMmWidgetContainer::SetIsFaded(int) + ?CacheWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 40 NONAME ; void CMmWidgetContainer::CacheWidgetPosition(void) + ?CancelDragL@CMmWidgetContainer@@QAEXH@Z @ 41 NONAME ; void CMmWidgetContainer::CancelDragL(int) diff -r 5315654608de -r 08c6ee43b396 menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def --- a/menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def Thu Jan 07 12:39:41 2010 +0200 +++ b/menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def Mon Jan 18 20:10:36 2010 +0200 @@ -32,12 +32,13 @@ _ZN18CMmWidgetContainer20NewListBoxContainerLERK5TRectP15MObjectProviderP18CMmTemplateLibrary @ 31 NONAME _ZN18CMmWidgetContainer21NumberOfItemsChangedLE16TItemsChangeType @ 32 NONAME _ZN18CMmWidgetContainer21RestoreWidgetPositionEv @ 33 NONAME - _ZN18CMmWidgetContainer23HandleBackgroundGainedLEv @ 34 NONAME - _ZN18CMmWidgetContainer23HandleForegroundGainedLEv @ 35 NONAME - _ZN18CMmWidgetContainer23SetHighlightVisibilityLEi @ 36 NONAME - _ZN18CMmWidgetContainer34HandleOptionsMenuVisibilityChangeLEi @ 37 NONAME - _ZN19CMmListBoxContainer13SetEmptyTextLERK7TDesC16 @ 38 NONAME - _ZN19CMmListBoxContainer20SetDefaultHighlightLEi @ 39 NONAME - _ZThn52_N18CMmWidgetContainer23HandleBackgroundGainedLEv @ 40 NONAME - _ZThn52_N18CMmWidgetContainer23HandleForegroundGainedLEv @ 41 NONAME + _ZN18CMmWidgetContainer22EnableLongTapAnimationEi @ 34 NONAME + _ZN18CMmWidgetContainer23HandleBackgroundGainedLEv @ 35 NONAME + _ZN18CMmWidgetContainer23HandleForegroundGainedLEv @ 36 NONAME + _ZN18CMmWidgetContainer23SetHighlightVisibilityLEi @ 37 NONAME + _ZN18CMmWidgetContainer34HandleOptionsMenuVisibilityChangeLEi @ 38 NONAME + _ZN19CMmListBoxContainer13SetEmptyTextLERK7TDesC16 @ 39 NONAME + _ZN19CMmListBoxContainer20SetDefaultHighlightLEi @ 40 NONAME + _ZThn52_N18CMmWidgetContainer23HandleBackgroundGainedLEv @ 41 NONAME + _ZThn52_N18CMmWidgetContainer23HandleForegroundGainedLEv @ 42 NONAME diff -r 5315654608de -r 08c6ee43b396 menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h --- a/menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h Thu Jan 07 12:39:41 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h Mon Jan 18 20:10:36 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_48.1.35 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_48.1.36 % << Don't touch! Updated by Synergy at check-out. * */ @@ -361,6 +361,18 @@ * Destructor. */ ~CMmWidgetContainer(); + + /** + * Enables/disables animation during long tap. + * Tactile feedback is also enabled and disabled with the animation. + * Changes made with this method will be effective on the next long + * tap, i.e. it is not possible to stop an already started animation + * by using this method. + * + * @param aEnable ETrue - enable, EFalse - disable long tap animation + * and long tap tactile feedback + */ + IMPORT_C void EnableLongTapAnimation( TBool aEnable ); /** * from CCoeControl. diff -r 5315654608de -r 08c6ee43b396 menufw/menufwui/mmwidgets/src/mmgrid.cpp --- a/menufw/menufwui/mmwidgets/src/mmgrid.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmgrid.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_94 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_95 % << Don't touch! Updated by Synergy at check-out. * */ @@ -250,6 +250,7 @@ if ( aPointerEvent.iType == TPointerEvent::EButton1Up || aPointerEvent.iType == TPointerEvent::EButton1Down ) { + iListBoxFlags &= ~ELeftDownInViewRect; // prevent kinetic scrolling CAknGrid::HandlePointerEventL( aPointerEvent ); } else if ( View()->XYPosToItemIndex( diff -r 5315654608de -r 08c6ee43b396 menufw/menufwui/mmwidgets/src/mmlistbox.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -133,6 +133,7 @@ if ( aPointerEvent.iType == TPointerEvent::EButton1Up || aPointerEvent.iType == TPointerEvent::EButton1Down ) { + iListBoxFlags &= ~ELeftDownInViewRect; // prevent kinetic scrolling CEikFormattedCellListBoxTypedef::HandlePointerEventL( aPointerEvent ); } else if ( View()->XYPosToItemIndex( diff -r 5315654608de -r 08c6ee43b396 menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp --- a/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Thu Jan 07 12:39:41 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_71.1.17.1.44 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_71.1.17.1.47 % << Don't touch! Updated by Synergy at check-out. * */ @@ -134,6 +134,18 @@ // // ----------------------------------------------------------------------------- // +EXPORT_C void CMmWidgetContainer::EnableLongTapAnimation( TBool aEnable ) + { + if ( iLongTapDetector ) + { + iLongTapDetector->EnableLongTapAnimation( aEnable ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void CMmWidgetContainer::SizeChanged() { if ( iWidget && iWidgetRect != Rect() ) @@ -222,9 +234,17 @@ aType == KAknsMessageSkinChange ) { static_cast<CMmListBoxItemDrawer*>( iDrawer )->InvalidateCache(); + CMmTemplateLibrary * templateLibrary = + static_cast<CMmListBoxItemDrawer*>( iDrawer )->TemplateLibrary(); + templateLibrary->CleanAndClearCache(); } CCoeControl::HandleResourceChange( aType ); + + if ( aType == KEikDynamicLayoutVariantSwitch && !IsHighlightVisible() ) + { + SetDefaultHighlightL( EFalse ); + } } // ----------------------------------------------------------------------------- @@ -636,6 +656,10 @@ if ( iLongTapDetector ) { + if ( !itemExists ) + { + iLongTapDetector->EnableLongTapAnimation( EFalse ); + } TPointerEvent longTapPointerEvent = aPointerEvent; if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat ) { diff -r 5315654608de -r 08c6ee43b396 menufw/menusuites/foldersuite/data/matrixmenudata.xml --- a/menufw/menusuites/foldersuite/data/matrixmenudata.xml Thu Jan 07 12:39:41 2010 +0200 +++ b/menufw/menusuites/foldersuite/data/matrixmenudata.xml Mon Jan 18 20:10:36 2010 +0200 @@ -17,22 +17,6 @@ <!-- </menu:folder> --> <!--Contacts application--> <menu:application uid="0x101F4CCE"/> - <!--music suite--> - <menu:suite title_name="&qtn_apps_music_title;" - long_name="&qtn_apps_music_list;" - short_name="&qtn_apps_music_grid;" - suite_name="musicsuite" - icon_file="z:\resource\apps\matrixmenudata.mif" - icon_id="16384" - mask_id="16385" - icon_skin_minor_id="0x2176" - icon_skin_major_id="0x101F86E3"/> - <!-- application used in music suite should be hidden from menu --> - <menu:folder flags="hidden"> - <menu:application uid="0x102072C3"/> <!-- Music Player (MusicPlayer)--> - <menu:application uid="0x10207A89"/> <!-- Radio --> - <menu:application uid="0x101FFB51"/> <!-- Music Store --> - </menu:folder> <!--Internet folder--> <!-- now using qgnmenugroupweb available in skin --> <menu:folder title_name="&qtn_apps_browserng_title;" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,34 @@ +/* +* ============================================================================ +* Name : bld.inf +* Part of : Huriganes / Context Services +* Description : Build info file for Context Services. +* Version : %version: sa1spcx1#55 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#include <platform_paths.hrh> + +PRJ_EXPORTS + +// stub sis files +../sis/stubs/hgctxsrv_stub.sis /epoc32/release/winscw/udeb/z/system/install/hgctxsrv_stub.sis + +// iby files +../rom/hgcontextservices.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hgcontextservices.iby) + + + +#include "../hgfswpreviewprovider/group/bld.inf" +#include "../hgfswserver/group/bld.inf" + +#include "../hgctxutils/group/bld.inf" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgctxutils/BWINS/hgcontextservicesutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgctxutils/BWINS/hgcontextservicesutilsu.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,8 @@ +EXPORTS + ??1CHgPropertyListener@@UAE@XZ @ 1 NONAME ; CHgPropertyListener::~CHgPropertyListener(void) + ?Value@CHgCenrepListener@@QAEHXZ @ 2 NONAME ; int CHgCenrepListener::Value(void) + ?NewL@CHgCenrepListener@@SAPAV1@ABVTUid@@KAAVMHgCenrepChangeObserver@@@Z @ 3 NONAME ; class CHgCenrepListener * CHgCenrepListener::NewL(class TUid const &, unsigned long, class MHgCenrepChangeObserver &) + ??1CHgCenrepListener@@UAE@XZ @ 4 NONAME ; CHgCenrepListener::~CHgCenrepListener(void) + ??0CHgPropertyListener@@QAE@VTUid@@IAAVMHgPropertyChangeObserver@@@Z @ 5 NONAME ; CHgPropertyListener::CHgPropertyListener(class TUid, unsigned int, class MHgPropertyChangeObserver &) + ?NewLC@CHgCenrepListener@@SAPAV1@ABVTUid@@KAAVMHgCenrepChangeObserver@@@Z @ 6 NONAME ; class CHgCenrepListener * CHgCenrepListener::NewLC(class TUid const &, unsigned long, class MHgCenrepChangeObserver &) + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgctxutils/EABI/hgcontextservicesutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgctxutils/EABI/hgcontextservicesutilsu.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,13 @@ +EXPORTS + _ZN17CHgCenrepListener4NewLERK4TUidmR23MHgCenrepChangeObserver @ 1 NONAME + _ZN17CHgCenrepListener5NewLCERK4TUidmR23MHgCenrepChangeObserver @ 2 NONAME + _ZN17CHgCenrepListener5ValueEv @ 3 NONAME + _ZN17CHgCenrepListenerD0Ev @ 4 NONAME + _ZN17CHgCenrepListenerD1Ev @ 5 NONAME + _ZN17CHgCenrepListenerD2Ev @ 6 NONAME + _ZN19CHgPropertyListenerC1E4TUidjR25MHgPropertyChangeObserver @ 7 NONAME + _ZN19CHgPropertyListenerC2E4TUidjR25MHgPropertyChangeObserver @ 8 NONAME + _ZN19CHgPropertyListenerD0Ev @ 9 NONAME + _ZN19CHgPropertyListenerD1Ev @ 10 NONAME + _ZN19CHgPropertyListenerD2Ev @ 11 NONAME + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgctxutils/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgctxutils/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,29 @@ +/* +* ============================================================================ +* Name : bld.inf +* Part of : Huriganes / Context Services Utils +* Description : Project definition file for project Context Services Client +* Version : %version: sa1spcx1#15 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#include <platform_paths.hrh> + +PRJ_EXPORTS +../inc/hgproplistener.h |../../inc/hgproplistener.h +../inc/hgcenreplistener.h |../../inc/hgcenreplistener.h + +PRJ_MMPFILES +hgcontextservicesutils.mmp + +PRJ_TESTMMPFILES + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgctxutils/group/hgcontextservicesutils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgctxutils/group/hgcontextservicesutils.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,43 @@ +/* +* =========================================================================== +* Name : hgcontextservicesutils.mmp +* Part of : Huriganes / Context Services Utils +* Description : Project definition file for project Context Services +* Version : %version: sa1spcx1#24 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#include <platform_paths.hrh> +#include <data_caging_paths.hrh> + + +TARGET hgcontextservicesutils.dll +TARGETTYPE dll +UID 0x1000008d + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +USERINCLUDE ../inc +USERINCLUDE ../../trace + +SOURCEPATH ../src +SOURCE hgproplistener.cpp +SOURCE hgcenreplistener.cpp + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY centralrepository.lib + +DEBUGLIBRARY flogger.lib + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgctxutils/inc/hgcenreplistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgctxutils/inc/hgcenreplistener.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,85 @@ +/* +* =========================================================================== +* Name : HgCenrepListener.h +* Part of : Hg +* Description : Class to get notifications about changes to a cenrep key +* +* Copyright © 2008 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 __CENREPLISTENER_H__ +#define __CENREPLISTENER_H__ + +#include <e32base.h> + +class CRepository; + +/** + * Observer interface for getting notifications about a cenrep key change. + */ +class MHgCenrepChangeObserver + { +public: + virtual void CenrepChanged( TUint32 aKey, TInt aNewValue ) = 0; + }; + +/** + * Class to get notifications about changes to a cenrep key. + */ +NONSHARABLE_CLASS( CHgCenrepListener ) : public CActive + { +public: + /** + * Fist step constructor + */ + IMPORT_C static CHgCenrepListener* NewL(const TUid& aRep, TUint32 aKey, + MHgCenrepChangeObserver& aObserver); + + /** + * Fist step constructor + */ + IMPORT_C static CHgCenrepListener* NewLC(const TUid& aRep, TUint32 aKey, + MHgCenrepChangeObserver& aObserver); + + /** + * Destructor. + */ + IMPORT_C ~CHgCenrepListener(); + + /** + * Returns the current value of the watched key. + */ + IMPORT_C TInt Value(); + +private: + /** + * Constructor. + * Starts listening for the key. + */ + CHgCenrepListener(TUint32 aKey, + MHgCenrepChangeObserver& aObserver ); + + /** + * Second step constructor + */ + void ConstructL(const TUid& aRep); + + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + + MHgCenrepChangeObserver& iObserver; + CRepository* iRep; + TUint32 iKey; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgctxutils/inc/hgproplistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgctxutils/inc/hgproplistener.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,65 @@ +/* +* =========================================================================== +* Name : HgPropListener.h +* Part of : Hg +* Description : Class to get notifications about changes to a P&S property +* +* Copyright © 2008 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 __PROPLISTENER_H__ +#define __PROPLISTENER_H__ + +#include <e32base.h> +#include <e32property.h> + +/** + * Observer interface for getting notifications about a P&S property change. + */ +class MHgPropertyChangeObserver + { +public: + virtual void PropertyChanged( TUid aCategory, TUint aKey ) = 0; + }; + +/** + * Class to get notifications about changes to a P&S property. + */ +NONSHARABLE_CLASS( CHgPropertyListener ) : public CActive + { +public: + /** + * Constructor. + * Starts listening for the property with the given category/key. + */ + IMPORT_C CHgPropertyListener( TUid aCategory, + TUint aKey, MHgPropertyChangeObserver& aObserver ); + + /** + * Destructor. + */ + IMPORT_C ~CHgPropertyListener(); + +private: + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + + MHgPropertyChangeObserver& iObserver; + RProperty iProperty; + TUid iCategory; + TUint iKey; + }; + +#endif + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgctxutils/src/hgcenreplistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgctxutils/src/hgcenreplistener.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,114 @@ +/* +* =========================================================================== +* Name : HgCenrepListener.cpp +* Part of : Hg +* Description : Active class to get notifications about changes to a cenrep key +* +* Copyright © 2008 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. +* =========================================================================== +*/ + +#include <e32cmn.h> +#include <centralrepository.h> +#include "hgcenreplistener.h" + +// ----------------------------------------------------------------------------- +// NewL +// ----------------------------------------------------------------------------- +EXPORT_C CHgCenrepListener* CHgCenrepListener::NewL(const TUid& aRep, TUint32 aKey, + MHgCenrepChangeObserver& aObserver) + { + CHgCenrepListener* self = CHgCenrepListener::NewLC(aRep, aKey, aObserver); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// NewLC +// ----------------------------------------------------------------------------- +EXPORT_C CHgCenrepListener* CHgCenrepListener::NewLC(const TUid& aRep, TUint32 aKey, + MHgCenrepChangeObserver& aObserver) + { + CHgCenrepListener *self = new(ELeave) CHgCenrepListener(aKey, aObserver); + CleanupStack::PushL(self); + self->ConstructL(aRep); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgCenrepListener +// ----------------------------------------------------------------------------- +CHgCenrepListener::CHgCenrepListener(TUint32 aKey, + MHgCenrepChangeObserver& aObserver) +: CActive( CActive::EPriorityStandard ), iObserver( aObserver ), iKey( aKey ) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +void CHgCenrepListener::ConstructL(const TUid& aRep) + { + iRep = CRepository::NewL( aRep ); + iRep->NotifyRequest( iKey, iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// ~CHgCenrepListener +// ----------------------------------------------------------------------------- +EXPORT_C CHgCenrepListener::~CHgCenrepListener() + { + Cancel(); + delete iRep; + } + +// ----------------------------------------------------------------------------- +// DoCancel +// ----------------------------------------------------------------------------- +void CHgCenrepListener::DoCancel() + { + iRep->NotifyCancelAll(); + } + +// ----------------------------------------------------------------------------- +// RunL +// ----------------------------------------------------------------------------- +void CHgCenrepListener::RunL() + { + if ( iStatus.Int() != KErrCancel ) + { + iObserver.CenrepChanged( iKey, Value() ); + iRep->NotifyRequest( iKey, iStatus ); + SetActive(); + } + } + +// ----------------------------------------------------------------------------- +// RunError +// ----------------------------------------------------------------------------- +TInt CHgCenrepListener::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Value +// ----------------------------------------------------------------------------- +EXPORT_C TInt CHgCenrepListener::Value() + { + TInt val = 0; + iRep->Get( iKey, val ); + return val; + } + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgctxutils/src/hgproplistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgctxutils/src/hgproplistener.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,66 @@ +/* +* =========================================================================== +* Name : HgPropListener.cpp +* Part of : Hg +* Description : Active class to get notifications about changes to a P&S property +* +* Copyright © 2008 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. +* =========================================================================== +*/ + +#include <e32cmn.h> + +#include "hgproplistener.h" + +EXPORT_C CHgPropertyListener::CHgPropertyListener( + TUid aCategory, TUint aKey, MHgPropertyChangeObserver& aObserver ) + : CActive( CActive::EPriorityStandard), + iObserver( aObserver ), iCategory( aCategory ), iKey( aKey ) + { + CActiveScheduler::Add( this ); + TInt err = iProperty.Attach( iCategory, iKey ); + if ( err == KErrNone ) + { + iProperty.Subscribe( iStatus ); + SetActive(); + } + } + +EXPORT_C CHgPropertyListener::~CHgPropertyListener() + { + Cancel(); + iProperty.Close(); + } + +void CHgPropertyListener::DoCancel() + { + iProperty.Cancel(); + } + +void CHgPropertyListener::RunL() + { + if ( iStatus.Int() != KErrCancel ) // when cancelling the subscribe it completes with KErrCancel + { + iObserver.PropertyChanged( iCategory, iKey ); + iProperty.Subscribe( iStatus ); + SetActive(); + } + } + +TInt CHgPropertyListener::RunError( TInt /*aError*/ ) + { + iProperty.Subscribe( iStatus ); + SetActive(); + return KErrNone; + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/bwins/hgpreviewprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/bwins/hgpreviewprovideru.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + ??1CHgFastSwapPreviewProvider@@UAE@XZ @ 1 NONAME ; CHgFastSwapPreviewProvider::~CHgFastSwapPreviewProvider(void) + ?ChangeScreen@CHgFastSwapPreviewProvider@@QAEHH@Z @ 2 NONAME ; int CHgFastSwapPreviewProvider::ChangeScreen(int) + ?NewL@CHgFastSwapPreviewProvider@@SAPAV1@AAVMHgFastSwapPreviewObserver@@@Z @ 3 NONAME ; class CHgFastSwapPreviewProvider * CHgFastSwapPreviewProvider::NewL(class MHgFastSwapPreviewObserver &) + ?Register@CHgFastSwapPreviewProvider@@QAEHH@Z @ 4 NONAME ; int CHgFastSwapPreviewProvider::Register(int) + ?SetPreviewParam@CHgFastSwapPreviewProvider@@QAEHABVTSize@@W4TDisplayMode@@@Z @ 5 NONAME ; int CHgFastSwapPreviewProvider::SetPreviewParam(class TSize const &, enum TDisplayMode) + ?TakePreview@CHgFastSwapPreviewProvider@@QAEHXZ @ 6 NONAME ; int CHgFastSwapPreviewProvider::TakePreview(void) + ?Unregister@CHgFastSwapPreviewProvider@@QAEHH@Z @ 7 NONAME ; int CHgFastSwapPreviewProvider::Unregister(int) + ?AckPreview@CHgFastSwapPreviewProvider@@QAEXH@Z @ 8 NONAME ; void CHgFastSwapPreviewProvider::AckPreview(int) + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/eabi/hgpreviewprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/eabi/hgpreviewprovideru.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,12 @@ +EXPORTS + _ZN26CHgFastSwapPreviewProvider10UnregisterEi @ 1 NONAME + _ZN26CHgFastSwapPreviewProvider11TakePreviewEv @ 2 NONAME + _ZN26CHgFastSwapPreviewProvider12ChangeScreenEi @ 3 NONAME + _ZN26CHgFastSwapPreviewProvider15SetPreviewParamERK5TSize12TDisplayMode @ 4 NONAME + _ZN26CHgFastSwapPreviewProvider4NewLER26MHgFastSwapPreviewObserver @ 5 NONAME + _ZN26CHgFastSwapPreviewProvider8RegisterEi @ 6 NONAME + _ZN26CHgFastSwapPreviewProviderD0Ev @ 7 NONAME + _ZN26CHgFastSwapPreviewProviderD1Ev @ 8 NONAME + _ZN26CHgFastSwapPreviewProviderD2Ev @ 9 NONAME + _ZN26CHgFastSwapPreviewProvider10AckPreviewEi @ 10 NONAME + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,33 @@ +/* +* ============================================================================== +* Name : %name: bld.inf % +* Part of : Hg fast swap preview provider plugin +* Description : bld.inf +* Version : %version: 1 % +* +* Copyright (c) 2008 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. +* ============================================================================== +*/ + +#include <platform_paths.hrh> + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/hgfastswappreviewprovider.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hgfastswappreviewprovider.iby) +../inc/hgpreviewprovider.h |../../inc/hgpreviewprovider.h +../inc/hgpreviewobserver.h |../../inc/hgpreviewobserver.h + +PRJ_MMPFILES +previewprovider.mmp + +#include "../wsplugin/group/bld.inf" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/group/previewprovider.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/group/previewprovider.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,40 @@ +/* +* ============================================================================== +* Name : %name: previewprovider.mmp % +* Part of : Hg fast swap preview provider plugin +* Description : MMP file for previewprovider dll +* Version : %version: sa1spcx1#2 % +* +* Copyright (c) 2008 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. +* ============================================================================== +*/ + +#include <platform_paths.hrh> +#include <defaultcaps.hrh> + +TARGET hgpreviewprovider.dll +TARGETTYPE DLL +UID 0x1000008D 0x20016BEB +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +USERINCLUDE ../inc +USERINCLUDE ../../trace + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE previewprovider.cpp + +LIBRARY euser.lib +LIBRARY ws32.lib +LIBRARY estor.lib +DEBUGLIBRARY flogger.lib diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/inc/hgfastswappreviewproviderlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/inc/hgfastswappreviewproviderlogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,26 @@ +/* +* ============================================================================ +* Name : hgfastswappreviewproviderlogging.h +* Part of : Classic UI / Teleport +* Description : Defines logs for hgfastswappreviewprovider +* Version : %version: sa1spcx1#3 % +* +* Copyright (c) 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1.1 +*/ + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KHgLogFile, "hgfastswappreviewprovider.txt" ); +_LIT( KHgLogPath, "teleport" ); +#define _HGLOG_LOG_COMPONENT_ID 0x20016BEC + +#endif +#include "hglogging.h" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewobserver.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,60 @@ +/* +* ============================================================================== +* Name : %name: hgpreviewobserver.h % +* Part of : Hg fast swap preview provider plugin +* Description : Preview provider API +* Version : %version: 1 % +* +* Copyright (c) 2008 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 HGPREVIEWOBSERVER_H +#define HGPREVIEWOBSERVER_H + +// INCLUDES +#include <e32base.h> + +/** + * Observer for preview screenshot changes. Client must implement this and + * register itself when calling CHgFastSwapPreviewProvider::NewL. Callback + * methods are called whenever there is a new preview screenshot taken from + * the applications or when an application is exited. + * + * @see CHgFastSwapPreviewProvider + */ +class MHgFastSwapPreviewObserver + { +public: + + /** + * Called when application has changed and screenshot has been taken. + * New sceenshots will be taken and provided to the client via this + * callback every time the application goes to background. + * + * @param aWgId Window group id of the application. + * @param aFbsHandle Handle to screenshot CFbsBitmap. + */ + virtual void HandleFswPpApplicationChange( TInt aWgId, TInt aFbsHandle ) = 0; + + /** + * Called when application has been exited. Client can free the resources + * related to aWgId (for example a copied bitmap) since the application is + * no more running. + * + * @param aWgId Window group id of the application. + */ + virtual void HandleFswPpApplicationUnregistered( TInt aWgId ) = 0; + }; + +#endif // HGPREVIEWOBSERVER_H + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewprovider.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,130 @@ +/* +* ============================================================================== +* Name : %name: hgpreviewprovider.h % +* Part of : Hg fast swap preview provider plugin +* Description : Preview provider API +* Version : %version: sa1spcx1#2 % +* +* Copyright (c) 2008 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 HGPREVIEWPROVIDER_H +#define HGPREVIEWPROVIDER_H + +// INCLUDES +#include <e32base.h> +#include <gdi.h> + +// FORWARD DECLARATIONS +class CHgFastSwapPreviewProviderClient; +class MHgFastSwapPreviewObserver; + +/** + * Preview provider API class. Applications (window groups) must be + * registered before screenshots can be received. Also, closed apps + * should be unregistered to save resources. + * TakePreview() can be called to take a screenshot right away. + * A client needing notifications has to create an instance + * so that screenshots can be delivered to it via MHgFastSwapPreviewObserver. + * + * @see MHgFastSwapPreviewObserver + * @lib hgpreviewprovider.lib + */ +NONSHARABLE_CLASS( CHgFastSwapPreviewProvider ) : public CBase + { +public: + + /** + * Two phased constructor. + * @see MHgFastSwapPreviewObserver + * + * @param aObs Observer. + */ + IMPORT_C static CHgFastSwapPreviewProvider* NewL( + MHgFastSwapPreviewObserver& aObs ); + + /** + * Destructor. + */ + IMPORT_C ~CHgFastSwapPreviewProvider(); + + /** + * Registers window group for screenshots. + * + * @param aWgId Window group id. + * @return Error code. + */ + IMPORT_C TInt Register( TInt aWgId ); + + /** + * Unregisters window group. + * + * @param aWgId Window group id. + * @return Error code. + */ + IMPORT_C TInt Unregister( TInt aWgId ); + + /** + * Change screen. + * + * @param aScreenId Screen id. + * @return Error code. + */ + IMPORT_C TInt ChangeScreen( TInt aScreenId ); + + /** + * Defines the dimensions and format of the screenshots. + * @see TDisplayMode. + * + * @param aSize Size to be used for the preview screenshots. + * @param aMode Color depth to be used for the preview screenshots. + * @return Error code. + */ + IMPORT_C TInt SetPreviewParam( const TSize& aSize, TDisplayMode aMode ); + + /** + * Takes a screenshot. + * + * @return Error code. + */ + IMPORT_C TInt TakePreview(); + + /** + * Ack preview ready message + */ + IMPORT_C void AckPreview( TInt aPreviewId ); + +private: + + /** + * C++ constructor. + */ + CHgFastSwapPreviewProvider(); + + /** + * 2nd phase constructor. + * + * @param aObs Observer. + */ + void ConstructL( MHgFastSwapPreviewObserver& aObs ); + +private: + + /** + * Implementation class. + */ + CHgFastSwapPreviewProviderClient* iClient; + }; + +#endif // HGPREVIEWPROVIDER_H + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/inc/previewmsg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/inc/previewmsg.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,46 @@ +/* +* ============================================================================== +* Name : %name: previewmsg.h % +* Part of : Hg fast swap preview provider plugin +* Description : Message types for preview plugin +* Version : %version: sa1spcx1#2 % +* +* Copyright (c) 2008 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 PREVIEWMSG_H +#define PREVIEWMSG_H + +namespace NPreviewMsg + { + /** + * Messages that are sent between PreviewProviderClient and PreviewProvider + * ECOM plugin via window server. + */ + enum + { + // From PreviewProviderClient to PreviewProvider ECOM plugin. + ENone, + ERegister, + EUnregister, + EChangeScreen, + ESetPreviewParam, + ETakePreview, + + // From PreviewProvider ECOM plugin to PreviewProviderClient. + EPreviewReady, + EAckPreviewReady, + EUnregisterReady + }; + } + +#endif // PREVIEWMSG_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/inc/previewproviderlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/inc/previewproviderlogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,33 @@ +/* +* ============================================================================ +* Name : %name: previewproviderlogging.h % +* Part of : Hg fast swap preview provider plugin +* Description : Header file used for logging +* Version : %version: 1 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* +*/ + +#ifndef PREVIEWPROVIDERLOGGING_H +#define PREVIEWPROVIDERLOGGING_H + +_LIT( KHgLogFile, "hgpreviewprovider.txt" ); +_LIT( KHgLogPath, "hgpreviewprovider" ); +#define _HGLOG_LOG_COMPONENT_ID 6715359 +//#define _HGLOG_RDEBUG + +#include <e32debug.h> +#include "hglogging.h" + +#endif // PREVIEWPROVIDERLOGGING_H + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/rom/hgfastswappreviewprovider.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/rom/hgfastswappreviewprovider.iby Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,29 @@ +/* +* ============================================================================== +* Name : %name: hgfastswappreviewprovider.iby % +* Part of : Hg fast swap previer provider plugin +* Description : IBY file +* Version : %version: sa1spcx1#2 % +* +* Copyright (c) 2008 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 HGFASTSWAPPREVIEWPROVIDER_IBY +#define HGFASTSWAPPREVIEWPROVIDER_IBY + +#include <data_caging_paths_for_iby.hrh> + +// fsw preview +ECOM_PLUGIN( 20016BEC.DLL, 20016BEC.rsc ) +file=ABI_DIR/BUILD_DIR/hgpreviewprovider.dll SHARED_LIB_DIR/hgpreviewprovider.dll + +#endif // HGFASTSWAPPREVIEWPROVIDER_IBY diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/src/previewprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/src/previewprovider.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,586 @@ +/* +* ============================================================================== +* Name : %name: previewprovider.cpp % +* Part of : Hg fast swap preview provider plugin +* Description : Preview provider API +* Version : %version: sa1spcx1#3 % +* +* Copyright (c) 2008 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. +* ============================================================================== +*/ + +#include "hgpreviewprovider.h" +#include "hgpreviewobserver.h" +#include "previewmsg.h" +#include "previewproviderlogging.h" +#include <w32std.h> +#include <s32mem.h> +#include <e32property.h> + +#define SZ( x ) ( sizeof( x ) / sizeof( TInt ) ) + +// CONSTANTS + +// Publish & subscribe UID (akncapserver.exe SID so that it can define the keys) +const TUid KPSUidPreviewProvider = { 0x10207218 }; + +// P&S keys +const TUint32 KPSKeyWgId = 0x20016BE1; +const TUint32 KPSKeyFbsBitmapId = 0x20016BE2; +const TUint32 KPSKeyOperation = 0x20016BE3; + +/** + * Operation which will be done after P&S keys have changed. + */ +enum TPreviewOperation + { + EOperationNone, + EOperationUnregister, + EOperationBitmapUpdated + }; + +/** + * CPropertyListener + */ +NONSHARABLE_CLASS( CPropertyListener ) : public CActive + { +public: + static CPropertyListener* NewL( MHgFastSwapPreviewObserver& aObs ); + virtual ~CPropertyListener(); + +protected: + CPropertyListener( MHgFastSwapPreviewObserver& aObs ); + void ConstructL(); + +private: // From CActive + void RunL(); + void DoCancel(); + +private: + void ReadPropertiesL(); + void DefinePropertyL( TInt aPSKey ); + void Subscribe(); + +private: + MHgFastSwapPreviewObserver& iObs; + RProperty iProperty; + + TInt iWgId; + TInt iFbsBitmapId; + + TPreviewOperation iOperation; + }; + +// -------------------------------------------------------------------------- +// CPropertyListener::~CPropertyListener +// -------------------------------------------------------------------------- +// +CPropertyListener::~CPropertyListener() + { + Cancel(); + iProperty.Close(); + } + +// -------------------------------------------------------------------------- +// CPropertyListener::CPropertyListener +// -------------------------------------------------------------------------- +// +CPropertyListener::CPropertyListener( MHgFastSwapPreviewObserver& aObs ) : + CActive( CActive::EPriorityHigh ), iObs( aObs ) + { + } + +// -------------------------------------------------------------------------- +// CPropertyListener::NewL +// -------------------------------------------------------------------------- +// +CPropertyListener* CPropertyListener::NewL( MHgFastSwapPreviewObserver& aObs ) + { + CPropertyListener* self = new ( ELeave ) CPropertyListener( aObs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CPropertyListener::RunL +// -------------------------------------------------------------------------- +// +void CPropertyListener::RunL() + { + // Resubscribe before processing new value to prevent missing updates + Subscribe(); + + // Read all properties to member variables + ReadPropertiesL(); + + // Do the callback + switch( iOperation ) + { + case EOperationUnregister: + { + iObs.HandleFswPpApplicationUnregistered( iWgId ); + break; + } + case EOperationBitmapUpdated: + { + iObs.HandleFswPpApplicationChange( iWgId, iFbsBitmapId ); + break; + } + default: + break; + } + } + +// -------------------------------------------------------------------------- +// CPropertyListener::DoCancel +// -------------------------------------------------------------------------- +// +void CPropertyListener::DoCancel() + { + iProperty.Cancel(); + } + +// -------------------------------------------------------------------------- +// CPropertyListener::ReadProperties +// -------------------------------------------------------------------------- +// +void CPropertyListener::ReadPropertiesL() + { + // Read all properties + User::LeaveIfError( iProperty.Get( KPSUidPreviewProvider, KPSKeyWgId, iWgId ) ); + User::LeaveIfError( iProperty.Get( KPSUidPreviewProvider, KPSKeyFbsBitmapId, iFbsBitmapId ) ); + TInt operation( 0 ); + User::LeaveIfError( iProperty.Get( KPSUidPreviewProvider, KPSKeyOperation, operation ) ); + iOperation = static_cast<TPreviewOperation>( operation ); + } + +// -------------------------------------------------------------------------- +// CPropertyListener::DefinePropertyL +// -------------------------------------------------------------------------- +// +void CPropertyListener::DefinePropertyL( TInt aPSKey ) + { + TInt err = RProperty::Define( KPSUidPreviewProvider, aPSKey, RProperty::EInt ); + // Don't mind the already exists error + if ( err != KErrAlreadyExists && err != KErrPermissionDenied ) + { + User::LeaveIfError( err ); + } + } + +// -------------------------------------------------------------------------- +// CPropertyListener::Subscribe +// -------------------------------------------------------------------------- +// +void CPropertyListener::Subscribe() + { + iProperty.Subscribe( iStatus ); + SetActive(); + } + +// -------------------------------------------------------------------------- +// CPropertyListener::ConstructL +// -------------------------------------------------------------------------- +// +void CPropertyListener::ConstructL() + { + HGLOG_CONTEXT( ConstructL, HGLOG_LOCAL ); + HGLOG_IN(); + + DefinePropertyL( KPSKeyWgId ); + DefinePropertyL( KPSKeyFbsBitmapId ); + DefinePropertyL( KPSKeyOperation ); + + User::LeaveIfError( iProperty.Attach( KPSUidPreviewProvider, KPSKeyWgId ) ); + CActiveScheduler::Add( this ); + + // initial subscription + Subscribe(); + + HGLOG_OUT(); + } + +/** + * CHgFastSwapPreviewProviderClient + */ +NONSHARABLE_CLASS( CHgFastSwapPreviewProviderClient ) : public CWsGraphic + { +public: + CHgFastSwapPreviewProviderClient( MHgFastSwapPreviewObserver& aObs ); + void ConstructL(); + void Register( TInt aWgId ); + void Unregister( TInt aWgId ); + void ChangeScreen( TInt aScreenNo ); + void SetPreviewParam( const TSize& aSize, TDisplayMode aMode ); + void TakePreview(); + void AckPreview( TInt aPreviewId ); + virtual ~CHgFastSwapPreviewProviderClient(); +private: + void HandleMessage( const TDesC8& aData ); + void OnReplace(); +private: + void DoHandleMessageL( const TDesC8& aData ); + void SetProperties( TInt aHandle, TInt aWgId, TInt aOp ); +private: + MHgFastSwapPreviewObserver& iObs; + CPropertyListener* iListener; + }; + + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::CHgFastSwapPreviewProviderClient +// -------------------------------------------------------------------------- +// +CHgFastSwapPreviewProviderClient::CHgFastSwapPreviewProviderClient( + MHgFastSwapPreviewObserver& aObs ) : iObs( aObs ) + { + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::~CHgFastSwapPreviewProviderClient +// -------------------------------------------------------------------------- +// +CHgFastSwapPreviewProviderClient::~CHgFastSwapPreviewProviderClient() + { + delete iListener; + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::ConstructL +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::ConstructL() + { + HGLOG_CONTEXT( ConstructL, HGLOG_LOCAL ); + HGLOG_IN(); + + const TUid id = { 0x20016BEC }; + BaseConstructL( id, KNullDesC8 ); + iListener = CPropertyListener::NewL( iObs ); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::Register +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::Register( TInt aWgId ) + { + HGLOG_CONTEXT( Register, HGLOG_LOCAL ); + HGLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::ERegister, + aWgId + }; + TPckgC<TInt[SZ(msg)]> buf(msg); + SendMessage(buf); + Flush(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::Unregister +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::Unregister( TInt aWgId ) + { + HGLOG_CONTEXT( Unregister, HGLOG_LOCAL ); + HGLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::EUnregister, + aWgId + }; + TPckgC<TInt[SZ(msg)]> buf(msg); + SendMessage(buf); + Flush(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::ChangeScreen +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::ChangeScreen( TInt aScreenNo ) + { + HGLOG_CONTEXT( ChangeScreen, HGLOG_LOCAL ); + HGLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::EChangeScreen, + aScreenNo + }; + TPckgC<TInt[SZ(msg)]> buf(msg); + SendMessage(buf); + Flush(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::SetPreviewParam +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::SetPreviewParam(const TSize& aSize, + TDisplayMode aMode) + { + HGLOG_CONTEXT( SetPreviewParam, HGLOG_LOCAL ); + HGLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::ESetPreviewParam, + aSize.iWidth, + aSize.iHeight, + static_cast<TInt>(aMode) + }; + TPckgC<TInt[SZ(msg)]> buf(msg); + SendMessage(buf); + Flush(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::TakePreview +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::TakePreview() + { + HGLOG_CONTEXT( TakePreview, HGLOG_LOCAL ); + HGLOG_IN(); + + TPckgC<TInt> buf(NPreviewMsg::ETakePreview); + SendMessage(buf); + Flush(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::AckPreview +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::AckPreview( TInt aPreviwId ) + { + HGLOG_CONTEXT( TakePreview, HGLOG_LOCAL ); + HGLOG_IN(); + + const TInt msg[] = { NPreviewMsg::EAckPreviewReady, + aPreviwId }; + TPckgC<TInt[SZ(msg)]> buf(msg); + SendMessage(buf); + Flush(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::HandleMessage +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::HandleMessage( const TDesC8& aData ) + { + TRAP_IGNORE(DoHandleMessageL(aData)); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::DoHandleMessageL +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::DoHandleMessageL( const TDesC8& aData ) + { + HGLOG_CONTEXT( DoHandleMessageL, HGLOG_LOCAL ); + HGLOG_IN(); + + RDesReadStream in( aData ); + TInt message = in.ReadInt32L(); + switch ( message ) + { + case NPreviewMsg::EPreviewReady: + { + const TInt id = in.ReadInt32L(); + const TInt handle = in.ReadInt32L(); + SetProperties( handle, id, EOperationBitmapUpdated ); + } + break; + case NPreviewMsg::EUnregisterReady: + { + const TInt id = in.ReadInt32L(); + const TInt handle = in.ReadInt32L(); + SetProperties( handle, id, EOperationUnregister ); + } + break; + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::SetProperties +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::SetProperties(TInt aHandle, TInt aWgId, + TInt aOp) + { + // Notify CPropertyListener via P&S + RProperty::Set( KPSUidPreviewProvider, KPSKeyFbsBitmapId, aHandle ); + RProperty::Set( KPSUidPreviewProvider, KPSKeyOperation, aOp ); + // KPSKeyWgId should be notified first since that is being listened + // by CPropertyListener + RProperty::Set( KPSUidPreviewProvider, KPSKeyWgId, aWgId ); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProviderClient::OnReplace +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProviderClient::OnReplace() + { + } + +///////////////////////////////////////////////////////////////////////////// + + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CHgFastSwapPreviewProvider* CHgFastSwapPreviewProvider::NewL( + MHgFastSwapPreviewObserver& aObs) + { + CHgFastSwapPreviewProvider* p = new (ELeave) CHgFastSwapPreviewProvider(); + CleanupStack::PushL( p ); + p->ConstructL( aObs ); + CleanupStack::Pop( p ); + return p; + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::~CHgFastSwapPreviewProvider +// -------------------------------------------------------------------------- +// +EXPORT_C CHgFastSwapPreviewProvider::~CHgFastSwapPreviewProvider() + { + if ( iClient ) + { + iClient->Destroy(); + } + delete iClient; + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::Register +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFastSwapPreviewProvider::Register( TInt aWgId ) + { + iClient->Register( aWgId ); + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::Unregister +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFastSwapPreviewProvider::Unregister( TInt aWgId ) + { + iClient->Unregister( aWgId ); + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::ChangeScreen +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFastSwapPreviewProvider::ChangeScreen( TInt aScreenId ) + { + iClient->ChangeScreen( aScreenId ); + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::SetPreviewParam +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFastSwapPreviewProvider::SetPreviewParam(const TSize& aSize, + TDisplayMode aMode) + { + HGLOG_CONTEXT( SetPreviewParam, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt error( KErrNone ); + + if ( aMode == ENone || aMode == EColor64K ) + { + iClient->SetPreviewParam( aSize, aMode ); + } + else + { + error = KErrNotSupported; + } + + HGLOG_OUT(); + return error; + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::TakePreview +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFastSwapPreviewProvider::TakePreview() + { + // Reset timer for screensaver (dismiss screensaver) + User::ResetInactivityTime(); + + iClient->TakePreview(); + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::AckPreview +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFastSwapPreviewProvider::AckPreview( TInt aPreviewId ) + { + iClient->AckPreview( aPreviewId ); + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::CHgFastSwapPreviewProvider +// -------------------------------------------------------------------------- +// +CHgFastSwapPreviewProvider::CHgFastSwapPreviewProvider() + { + } + +// -------------------------------------------------------------------------- +// CHgFastSwapPreviewProvider::ConstructL +// -------------------------------------------------------------------------- +// +void CHgFastSwapPreviewProvider::ConstructL( MHgFastSwapPreviewObserver& aObs ) + { + HGLOG_CONTEXT( ConstructL, HGLOG_LOCAL ); + HGLOG_IN(); + + iClient = new ( ELeave ) CHgFastSwapPreviewProviderClient( aObs ); + iClient->ConstructL(); + + HGLOG_OUT(); + } + +// End of file + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,26 @@ +/* +* ============================================================================== +* Name : %name: bld.inf % +* Part of : Hg fast swap preview provider plugin +* Description : bld.inf +* Version : %version: 1 % +* +* Copyright (c) 2008 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. +* ============================================================================== +*/ + +#include <platform_paths.hrh> + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +previewprovidercrp.mmp diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/group/previewprovidercrp.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/group/previewprovidercrp.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,47 @@ +/* +* ============================================================================== +* Name : %name: previewprovidercrp.mmp % +* Part of : Hg fast swap preview provider plugin +* Description : MMP file for preview provider ECOM plugin +* Version : %version: sa1spcx1#4 % +* +* Copyright (c) 2008 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. +* ============================================================================== +*/ +#include <platform_paths.hrh> +#include <defaultcaps.hrh> + +TARGET 20016BEC.DLL +TARGETTYPE PLUGIN +UID 0x10009D8D 0x20016BEC +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +OPTION_REPLACE ARMCC --arm -O3 --cpu 6 + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../trace + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE previewprovidercrp.cpp + +RESOURCE 20016BEC.rss + +LIBRARY ecom.lib +LIBRARY euser.lib +LIBRARY wsgraphicdrawer.lib +LIBRARY fbscli.lib +LIBRARY estor.lib +LIBRARY gdi.lib +DEBUGLIBRARY flogger.lib diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/inc/previewprovidercrp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/inc/previewprovidercrp.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,179 @@ +/* +* ============================================================================== +* Name : %name: previewprovidercrp.h % +* Part of : Hg fast swap preview provider plugin +* Description : Preview provider ECOM plugin +* Version : %version: sa1spcx1#3 % +* +* Copyright (c) 2008 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 PREVIEWPROVIDERCRP_H +#define PREVIEWPROVIDERCRP_H + +// INCLUDES +#include <w32std.h> +#include <graphics/wsgraphicdrawerinterface.h> +#include <graphics/wsgraphicdrawer.h> + +// Number of screenshots used at the same time, +// each window group change will cause a screenshot +// to one of these, the index for the current one is +// switched after each screenshot capture. (this is needed +// to prevent overwriting screenshots before the client could +// make a copy of them) +const TInt KMaxShots = 4; + +/** + * Preview provider window server ECOM plugin class. + */ +NONSHARABLE_CLASS( CPreviewProviderCRP ) : public CWsGraphicDrawer, + public MWsEventHandler + { +public: + + /** + * Creates a new instance of the plguin. + * + * @return Created instance. + */ + static CWsGraphicDrawer* CreateL(); + + /** + * Destructor + */ + ~CPreviewProviderCRP(); + +private: + + /** + * From CWsGraphicDrawer. + * + * @param aGc + * @param aRect + * @param aData + */ + void DoDraw( MWsGc& aGc, const TRect& aRect, const TDesC8& aData ) const; + + /** + * Handles message from PreviewProviderClient. + * + * @param aData Message data. + */ + void HandleMessage( const TDesC8& aData ); + + /** + * 2nd phase constructor. + * + * @param aEnv + * @param aId + * @param aOwner + * @param aData + */ + void ConstructL( MWsGraphicDrawerEnvironment& aEnv, + const TGraphicDrawerId& aId, + MWsClient& aOwner, + const TDesC8& aData ); + + /** + * From MWsEventHandler. + * + * Observer for TWservCrEvent::EWindowGroupChanged to take the screenshot + * when application changes. + * + * @param aEvent + */ + void DoHandleEvent( const TWservCrEvent& aEvent ); + +private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * Handles application registration. + * + * @param aWgId Window group id. + */ + void Register( TInt aWgId ); + + /** + * Handler application unregistration. + * + * @param aWgId Window group id. + */ + void Unregister( TInt aWgId ); + + /* + * Allocate resources and take screenshot + */ + void ScreenshotL(); + + /** + * Takes the screenshot. + */ + void ScreenshotL( CFbsBitmap& aBitmap ); + + /** + * Remove bitmap reference fom list + */ + void RemoveScreenshot( TInt aBitmapHandle ); + + /** + * Remove all bitmaps overflow + */ + void CheckOverflow(); + + /** + * Handles message from PreviewProviderClient. + * + * @param aData Message data. + */ + void DoHandleMessageL( const TDesC8& aData ); + + /** + * Notifies the PreviewProviderClient when screenshot is ready for copying. + */ + void ScaleCompleteL(const CFbsBitmap& aBitmap); + + /** + * Notifies the PreviewProviderClient when an application has been exited. + */ + void UnregisterComplete( TInt aWgId ); + + /** + * Uses window server front buffer to create a screenshot. + * @param aFront preallocated destination bitmap + * @param aFront Front buffer. + * @param aSrcSize Size of the source front buffer in pixels. + * @param aSrcStride Source stride. + */ + void FrontBufferScreenShot( + CFbsBitmap& aBitmap, + MWsFrontBuffer& aFront, const TSize& aSrcSize, TInt aSrcStride ); + +private: + TInt iScreen; + TInt iPrevId; + TInt iPrevReg; // to work around the problem with wgid not set when app brought + // to foreground first time + RPointerArray<CFbsBitmap> iScreenshots; + TSize iScreenshotSize; + TDisplayMode iScreenshotMode; + RArray<TInt> iWgIds; + }; + +#endif // PREVIEWPROVIDERCRP_H + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/inc/previewprovidercrplogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/inc/previewprovidercrplogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,33 @@ +/* +* ============================================================================ +* Name : %name: previewprovidercrplogging.h % +* Part of : Hg fast swap preview provider plugin +* Description : Header file used for logging +* Version : %version: 1 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* +*/ + +#ifndef PREVIEWPROVIDERCRPLOGGING_H +#define PREVIEWPROVIDERCRPLOGGING_H + +_LIT( KHgLogFile, "hgpreviewprovidercrp.txt" ); +_LIT( KHgLogPath, "hgpreviewprovider" ); +#define _HGLOG_LOG_COMPONENT_ID 6715358 +//#define _HGLOG_RDEBUG + +#include <e32debug.h> +#include "hglogging.h" + +#endif // PREVIEWPROVIDERCRPLOGGING_H + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/src/20016BEC.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/src/20016BEC.rss Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,43 @@ +/* +* ============================================================================== +* Name : %name: 20016BEC.rss % +* Part of : Hg fast swap previer provider plugin +* Description : ECOM registration file +* Version : %version: sa1spcx1#2 % +* +* Copyright (c) 2008 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. +* ============================================================================== +*/ + +#include <ecom/registryinfo.rh> + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x20016BEC; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10281924; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x20016BEC; + version_no = 1; + display_name = "previewprovider"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; + } diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,437 @@ +/* +* ============================================================================== +* Name : %name: previewprovidercrp.cpp % +* Part of : Hg fast swap preview provider plugin +* Description : Preview provider ECOM plugin +* Version : %version: sa1spcx1#8 % +* +* Copyright (c) 2008 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. +* ============================================================================== +*/ + +#include <bldvariant.hrh> +#ifdef SYMBIAN_BUILD_GCE +#define NGA +#endif + +#include "previewprovidercrp.h" +#include "previewmsg.h" +#include "previewprovidercrplogging.h" +#include <ecom/implementationproxy.h> +#include <s32mem.h> //RDesReadStream + +#ifdef NGA +#include <graphics/wsscreendevice.h> +#endif + +// CONSTANTS +const TInt KImpId( 0x20016BEC ); + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::CreateL +// -------------------------------------------------------------------------- +// +CWsGraphicDrawer* CPreviewProviderCRP::CreateL() + { + CPreviewProviderCRP* crp = new (ELeave) CPreviewProviderCRP(); + CleanupStack::PushL( crp ); + crp->ConstructL(); + CleanupStack::Pop( crp ); + return crp; + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::ConstructL +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::ConstructL() + { + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::~CPreviewProviderCRP +// -------------------------------------------------------------------------- +// +CPreviewProviderCRP::~CPreviewProviderCRP() + { + Env().UnregisterEventHandler( this ); + iScreenshots.ResetAndDestroy(); + iWgIds.Close(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::DoDraw +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::DoDraw( MWsGc& /*aGc*/, const TRect& /*aRect*/, + const TDesC8& /*aData*/) const + { + //draws nothing + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::HandleMessage +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::HandleMessage( const TDesC8& aData ) + { + TRAP_IGNORE( DoHandleMessageL( aData ) ); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::DoHandleMessageL +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::DoHandleMessageL( const TDesC8& aData ) + { + HGLOG_CONTEXT( DoHandleMessageL, HGLOG_LOCAL ); + HGLOG_IN(); + + RDesReadStream in( aData ); + switch( in.ReadInt32L() ) + { + case NPreviewMsg::ERegister: + { + const TInt id = in.ReadInt32L(); + Register( id ); + } + break; + case NPreviewMsg::EUnregister: + { + const TInt id = in.ReadInt32L(); + Unregister( id ); + } + break; + case NPreviewMsg::EChangeScreen: + { + const TInt screen = in.ReadInt32L(); + if ( Env().ScreenCount() ) + { + iScreen = screen; + } + } + break; + case NPreviewMsg::ESetPreviewParam: + iScreenshotSize.iWidth = in.ReadInt32L(); + iScreenshotSize.iHeight = in.ReadInt32L(); + iScreenshotMode = static_cast<TDisplayMode>( in.ReadInt32L() ); + break; + case NPreviewMsg::ETakePreview: + ScreenshotL(); + break; + case NPreviewMsg::EAckPreviewReady: + RemoveScreenshot( in.ReadInt32L() ); + break; + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::ConstructL +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::ConstructL( MWsGraphicDrawerEnvironment& aEnv, + const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& /*aData*/ ) + { + HGLOG_CONTEXT( ConstructL, HGLOG_LOCAL ); + HGLOG_IN(); + + BaseConstructL( aEnv, aId, aOwner ); + aEnv.RegisterEventHandler( this, this, TWservCrEvent::EWindowGroupChanged ); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::DoHandleEvent +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::DoHandleEvent( const TWservCrEvent& aEvent ) + { + HGLOG_CONTEXT( DoHandleEvent, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( aEvent.Type() == TWservCrEvent::EWindowGroupChanged ) + { + const TInt wgId = aEvent.WindowGroupIdentifier(); + if ( iWgIds.FindInOrder( iPrevId ) >= 0 || + ( iPrevId == 0 && iPrevReg != 0 ) ) + { + TRAP_IGNORE( ScreenshotL() ); + iPrevReg = 0; + } + iPrevId = wgId; + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::ScaleComplete +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::ScaleCompleteL( const CFbsBitmap& aBitmap ) + { + HGLOG_CONTEXT( ScaleComplete, HGLOG_LOCAL ); + HGLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::EPreviewReady, + iPrevId?iPrevId:iPrevReg, + aBitmap.Handle() + }; + TPckgC<TInt[sizeof(msg) / sizeof(TInt)]> buf(msg); + User::LeaveIfError( SendMessage( buf ) ); + HGLOG3( HGLOG_INFO, "size = %dx%d handle = %d", + aBitmap.SizeInPixels().iWidth, + aBitmap.SizeInPixels().iHeight, + aBitmap.Handle() ); + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::UnregisterComplete +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::UnregisterComplete( TInt aWgId ) + { + HGLOG_CONTEXT( UnregisterComplete, HGLOG_LOCAL ); + HGLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::EUnregisterReady, + aWgId, + 0 + }; + TPckgC<TInt[sizeof(msg) / sizeof(TInt)]> buf(msg); + SendMessage(buf); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::Register +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::Register( TInt aWgId ) + { + HGLOG_CONTEXT( Register, HGLOG_LOCAL ); + HGLOG_IN(); + + iPrevReg = aWgId; + iWgIds.InsertInOrder( aWgId ); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::Unregister +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::Unregister( TInt aWgId ) + { + HGLOG_CONTEXT( Unregister, HGLOG_LOCAL ); + HGLOG_IN(); + + const TInt index = iWgIds.FindInOrder( aWgId ); + if ( index >= 0 ) + { + iWgIds.Remove( index ); + } + + UnregisterComplete( aWgId ); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::ScreenShotL +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::ScreenshotL() + { + CFbsBitmap* screenshot = new (ELeave)CFbsBitmap(); + CleanupStack::PushL( screenshot ); + ScreenshotL( *screenshot ); + ScaleCompleteL( *screenshot ); + iScreenshots.InsertL( screenshot, iScreenshots.Count() ); + CleanupStack::Pop( screenshot ); + CheckOverflow(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::ScreenShotL +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::ScreenshotL(CFbsBitmap& aBitmap) + { + HGLOG_CONTEXT( ScreenShot, HGLOG_LOCAL ); + HGLOG_IN(); + + if( 0 > iScreen || Env().ScreenCount() <= iScreen ) + { + //screen offset out of range. skip request + User::Leave(KErrArgument); + } + // Find the screen resolution + MWsScreenConfig* screenConfig = + Env().Screen( iScreen )->ObjectInterface<MWsScreenConfig>(); + + const TSize sz = screenConfig->ScreenModeSizeInPixels(); + + // Get the screen buffer (containing screenshot data) + MWsFrontBuffer* screenFront = + Env().Screen( iScreen )->ObjectInterface<MWsFrontBuffer>(); + + // With NGA we do not support downscaling of the screenshots. + // So use the size of the screen if no screenshot size has been explicitly + // set or if the old method for taking screenshots is not available. + if ( iScreenshotSize.iWidth == 0 || + iScreenshotSize.iHeight == 0 || + !screenFront ) + { + iScreenshotSize = sz; + } + // Use the the same DisplayMode as for the source image + // so override the display mode, ignoring any requests. + iScreenshotMode = screenConfig->DisplayMode(); + + HGLOG3( HGLOG_INFO, "iShotSize: %dx%d mode: %d", + iScreenshotSize.iWidth, iScreenshotSize.iHeight, iScreenshotMode ); + + aBitmap.Reset(); + User::LeaveIfError( aBitmap.Create( iScreenshotSize, iScreenshotMode ) ); + + // Check if front buffer is available. + // Will always be NULL with NGA. + if ( screenFront ) + { + HGLOG0( HGLOG_INFO, "non-NGA, using front buffer" ); + FrontBufferScreenShot( aBitmap, *screenFront, sz, screenConfig->Stride() ); + } +#ifdef NGA + else + { + HGLOG0( HGLOG_INFO, "NGA, using CopyScreenToBitmapL" ); + MWsScreenDevice* screenDevice = static_cast<MWsScreenDevice*>( + Env().Screen( iScreen )->ResolveObjectInterface( + MWsScreenDevice::EWsObjectInterfaceId ) ); + User::LeaveIfNull( screenDevice ); + screenDevice->CopyScreenToBitmapL( &aBitmap, iScreenshotSize ); + } +#endif + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::RemoveShot +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::RemoveScreenshot( TInt aBitmapHandle ) + { + for( int iter(0); iter < iScreenshots.Count(); ++iter ) + { + if( iScreenshots[iter]->Handle() == aBitmapHandle ) + { + delete iScreenshots[iter]; + iScreenshots.Remove(iter); + break; + } + } + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::CheckOverflow +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::CheckOverflow() + { + TInt overflow( iScreenshots.Count() - KMaxShots); + while( 0 < overflow-- ) + { + delete iScreenshots[0]; + iScreenshots.Remove(0); + } + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::FrontBufferScreenShot +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::FrontBufferScreenShot( CFbsBitmap& aBitmap, + MWsFrontBuffer& aFront, + const TSize& aSrcSize, + TInt aSrcStride ) + { + HGLOG_CONTEXT( CPreviewProviderCRP::FrontBufferScreenShot, HGLOG_LOCAL ); + HGLOG_IN(); + + const TUint8* src = static_cast<const TUint8*> ( aFront.GetBits() ); + HGLOG1( HGLOG_INFO, "src address = [%d]", src ); + + TInt srcstride( aSrcStride ); + TInt srcwidth( aSrcSize.iWidth ); + TInt srcheight( aSrcSize.iHeight ); + TInt dststride( aBitmap.DataStride() ); + TInt dstheight( iScreenshotSize.iHeight ); + TInt dstwidth( iScreenshotSize.iWidth ); + TInt stepdst( dststride / dstwidth ); + TInt stepsrc( srcstride / srcwidth ); + // scale must be TInt type + TInt scaleX( aSrcSize.iWidth / iScreenshotSize.iWidth ); + TInt scaleY( aSrcSize.iHeight / iScreenshotSize.iHeight ); + + aBitmap.LockHeap(); + + TUint8* dst = ( TUint8* ) aBitmap.DataAddress(); + + TInt minWidth = Min( srcwidth, dstwidth ); + TInt minHeight = Min( srcheight, dstheight ); + TInt minStep = Min( stepsrc, stepdst ); + + for ( TInt y = minHeight; y > 0; y-- ) + { + for ( TInt x = minWidth; x > 0; x-- ) + { + Mem::Copy( dst, src, minStep ); + dst += stepdst; + src += scaleX*stepdst; + } + src += srcstride - scaleX * stepdst * minWidth; + src += ( scaleY - 1 ) * srcstride; + } + + aBitmap.UnlockHeap(); + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// KImplementationTable +// -------------------------------------------------------------------------- +// +LOCAL_C const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KImpId, CPreviewProviderCRP::CreateL) + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = (sizeof(KImplementationTable) / sizeof(TImplementationProxy)); + return KImplementationTable; + } + + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/bwins/hgfswclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/bwins/hgfswclientu.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + ?NewL@CHgFswClient@@SAPAV1@XZ @ 1 NONAME ; class CHgFswClient * CHgFswClient::NewL(void) + ?CancelSubscribe@CHgFswClient@@QAEXXZ @ 2 NONAME ; void CHgFswClient::CancelSubscribe(void) + ?SwitchToApp@CHgFswClient@@QAEXH@Z @ 3 NONAME ; void CHgFswClient::SwitchToApp(int) + ?NewLC@CHgFswClient@@SAPAV1@XZ @ 4 NONAME ; class CHgFswClient * CHgFswClient::NewLC(void) + ?ForegroundAppUid@CHgFswClient@@QAE?AVTUid@@W4THgFswFgAppType@1@@Z @ 5 NONAME ; class TUid CHgFswClient::ForegroundAppUid(enum CHgFswClient::THgFswFgAppType) + ?Subscribe@CHgFswClient@@QAEXAAVMHgFswObserver@@@Z @ 6 NONAME ; void CHgFswClient::Subscribe(class MHgFswObserver &) + ?GetContentL@CHgFswClient@@QAEXAAV?$RPointerArray@VCHgFswEntry@@@@@Z @ 7 NONAME ; void CHgFswClient::GetContentL(class RPointerArray<class CHgFswEntry> &) + ?CloseApp@CHgFswClient@@QAEXH@Z @ 8 NONAME ; void CHgFswClient::CloseApp(int) + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/eabi/hgfswclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/eabi/hgfswclientu.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + _ZN12CHgFswClient11GetContentLER13RPointerArrayI11CHgFswEntryE @ 1 NONAME + _ZN12CHgFswClient11SwitchToAppEi @ 2 NONAME + _ZN12CHgFswClient15CancelSubscribeEv @ 3 NONAME + _ZN12CHgFswClient16ForegroundAppUidENS_15THgFswFgAppTypeE @ 4 NONAME + _ZN12CHgFswClient4NewLEv @ 5 NONAME + _ZN12CHgFswClient5NewLCEv @ 6 NONAME + _ZN12CHgFswClient8CloseAppEi @ 7 NONAME + _ZN12CHgFswClient9SubscribeER14MHgFswObserver @ 8 NONAME + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,25 @@ +/* + * =========================================================================== + * Name : bld.inf + * Part of : Huriganes / Fast Swap Server + * Description : build info file for client dll + * Version : %version: 5 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +PRJ_EXPORTS +../inc/hgfswclient.h |../../../inc/hgfswclient.h +../inc/hgfswclientobserver.h |../../../inc/hgfswclientobserver.h + +PRJ_MMPFILES +hgfswclient.mmp diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/group/hgfswclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/group/hgfswclient.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,42 @@ +/* + * =========================================================================== + * Name : hgfswclient.mmp + * Part of : Huriganes / Fast Swap Server + * Description : client dll + * Version : %version: 7 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include <platform_paths.hrh> + +TARGET hgfswclient.dll +TARGETTYPE DLL +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE hgfswclient.cpp +SOURCE hgfswclientimpl.cpp + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../trace + +LIBRARY euser.lib +LIBRARY estor.lib + +LIBRARY hgfswutils.lib + +DEBUGLIBRARY flogger.lib diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/inc/clientlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/inc/clientlogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,26 @@ +/* +* ============================================================================ +* Name : clientlogging.h +* Part of : Classic UI / Teleport +* Description : Defines logs for client +* Version : %version: sa1spcx1#3 % +* +* Copyright (c) 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1.1 +*/ + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KHgLogFile, "hgfswclient.txt" ); +_LIT( KHgLogPath, "teleport" ); +#define _HGLOG_LOG_COMPONENT_ID 0x0000000 +#endif + +#include "hglogging.h" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/inc/hgfswclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/inc/hgfswclient.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,132 @@ +/* + * =========================================================================== + * Name : hgfswclient.h + * Part of : Huriganes / Fast Swap Server + * Description : Client API + * Version : %version: 6 % + * + * Copyright © 2008 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 __HGFSWCLIENT_H +#define __HGFSWCLIENT_H + +#include <e32std.h> +#include "hgfswentry.h" + +class MHgFswObserver; +class CHgFswClientImpl; + +/** + * Client API for the Huriganes Fast Swap Server. + */ +NONSHARABLE_CLASS( CHgFswClient ) : public CBase + { +public: + /** + * Possible values for aType argument of ForegroundAppUid(). + */ + enum THgFswFgAppType + { + /** + * Means that even when the foreground app has another app embedded + * into it the uid of the container application will be returned. + */ + EUseStandaloneUid, + /** + * Means that if the foreground app has another app embedded + * into it then the returned uid will be the uid of the embedded + * app. + */ + EUseEmbeddedUid + }; + + /** + * Creates a new instance. + * @capability LocalServices + */ + IMPORT_C static CHgFswClient* NewL(); + + /** + * Creates a new instance. + * @capability LocalServices + */ + IMPORT_C static CHgFswClient* NewLC(); + + /** + * Destructor. + */ + ~CHgFswClient(); + + /** + * Queries the fast swap content from the server and + * copies it into the given array. + * Previous content of the array is removed (by using ResetAndDestroy). + * @param aDst array to which data is stored + * @capability LocalServices + */ + IMPORT_C void GetContentL( RHgFswArray& aDst ); + + /** + * Subscribes for continuous notifications about changes in the + * fast swap content. + * The notifications are generated until CancelSubscribe is called + * or the instance is destroyed. + * @capability LocalServices + */ + IMPORT_C void Subscribe( MHgFswObserver& aObserver ); + + /** + * Cancels the subscription for change notifications. + * @capability LocalServices + */ + IMPORT_C void CancelSubscribe(); + + /** + * Tries to close the application with the given id. + * @capability LocalServices + */ + IMPORT_C void CloseApp( TInt aWgId ); + + /** + * Brings the application with the given id into foreground. + * @capability LocalServices + */ + IMPORT_C void SwitchToApp( TInt aWgId ); + + /** + * Returns the uid of the foreground app or KNullUid if something goes wrong. + * + * Will never return hidden apps, only those which can also be seen in the + * array returned by GetContentL. + * + * However the handling of embedded applications might be different: + * (as opposed to GetContentL) + * If aType == EUseEmbeddedUid: + * This function will always return the embedded application's uid, unlike + * GetContentL which will always refer to the container app (except for the + * screenshot of course). This means that the returned uid is simply the + * uid belonging to the first (non-hidden, etc.) window group from the window group list. + * If aType == EUseStandaloneUid: + * Embedded applications are ignored and the returned uid is the app uid belonging + * to the first parentless window group. + */ + IMPORT_C TUid ForegroundAppUid( THgFswFgAppType aType ); + +private: + CHgFswClient(); + void ConstructL(); + + CHgFswClientImpl* iImpl; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/inc/hgfswclientimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/inc/hgfswclientimpl.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,69 @@ +/* + * =========================================================================== + * Name : hgfswclientimpl.h + * Part of : Huriganes / Fast Swap Server + * Description : Client API, private implementation + * Version : %version: 5 % + * + * Copyright © 2008 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 __HGFSWCLIENTIMPL_H +#define __HGFSWCLIENTIMPL_H + +#include <e32std.h> +#include "hgfswentry.h" + +class MHgFswObserver; + +NONSHARABLE_CLASS( CHgFswClientImpl ) : public CActive + { +public: + static CHgFswClientImpl* NewL(); + static CHgFswClientImpl* NewLC(); + ~CHgFswClientImpl(); + + void GetContentL( RHgFswArray& aDst ); + + void Subscribe( MHgFswObserver& aObserver ); + void CancelSubscribe(); + + void CloseApp( TInt aWgId ); + void SwitchToApp( TInt aWgId ); + + TUid ForegroundAppUid( TInt aType ); + +private: + void RunL(); + void DoCancel(); + +private: + CHgFswClientImpl(); + void ConstructL(); + + NONSHARABLE_CLASS( RHgFswClient ) : public RSessionBase + { + public: + TInt Connect(); + void Subscribe( TRequestStatus& aStatus ); + void CancelSubscribe(); + void GetContentL( RHgFswArray& aDst ); + void CloseApp( TInt aWgId ); + void SwitchToApp( TInt aWgId ); + TUid ForegroundAppUid( TInt aType ); + }; + RHgFswClient iClient; + + MHgFswObserver* iObserver; // not own + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/inc/hgfswclientobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/inc/hgfswclientobserver.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,38 @@ +/* + * =========================================================================== + * Name : hgfswclientobserver.h + * Part of : Huriganes / Fast Swap Server + * Description : Client API + * Version : %version: sa1spcx1#2 % + * + * Copyright © 2008 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 __HGFSWCLIENTOBSERVER_H +#define __HGFSWCLIENTOBSERVER_H + +#include <e32base.h> + +/** + * Observer interface for getting notifications about fast swap content changes. + */ +class MHgFswObserver + { +public: + /** + * Called when there is a change in the fast swap content. + * The data can be queried via CHgFswClient::GetContentL + */ + virtual void HandleFswContentChanged() = 0; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/src/hgfswclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/src/hgfswclient.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,83 @@ +/* + * =========================================================================== + * Name : hgfswclient.cpp + * Part of : Huriganes / Fast Swap Server + * Description : Client API + * Version : %version: 3 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include "hgfswclient.h" +#include "hgfswclientimpl.h" + +EXPORT_C CHgFswClient* CHgFswClient::NewL() + { + CHgFswClient* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +EXPORT_C CHgFswClient* CHgFswClient::NewLC() + { + CHgFswClient* self = new ( ELeave ) CHgFswClient; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +CHgFswClient::CHgFswClient() + { + } + +CHgFswClient::~CHgFswClient() + { + delete iImpl; + } + +void CHgFswClient::ConstructL() + { + iImpl = CHgFswClientImpl::NewL(); + } + +EXPORT_C void CHgFswClient::GetContentL( RHgFswArray& aDst ) + { + iImpl->GetContentL( aDst ); + } + +EXPORT_C void CHgFswClient::Subscribe( MHgFswObserver& aObserver ) + { + iImpl->Subscribe( aObserver ); + } + +EXPORT_C void CHgFswClient::CancelSubscribe() + { + iImpl->CancelSubscribe(); + } + +EXPORT_C void CHgFswClient::CloseApp( TInt aWgId ) + { + iImpl->CloseApp( aWgId ); + } + +EXPORT_C void CHgFswClient::SwitchToApp( TInt aWgId ) + { + iImpl->SwitchToApp( aWgId ); + } + +EXPORT_C TUid CHgFswClient::ForegroundAppUid( THgFswFgAppType aType ) + { + return iImpl->ForegroundAppUid( aType ); + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/client/src/hgfswclientimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/client/src/hgfswclientimpl.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,232 @@ +/* + * =========================================================================== + * Name : hgfswclientimpl.cpp + * Part of : Huriganes / Fast Swap Server + * Description : Client API, private implementation + * Version : %version: sa1spcx1#10 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include "hgfswclientimpl.h" +#include "hgfswclientobserver.h" +#include "hgfswcommon.h" +#include <s32mem.h> + +#include "clientlogging.h" + +static TInt StartServer() + { + RProcess server; + const TUidType uid( KNullUid, KNullUid, KHgFswServerUid ); + TInt err = server.Create( KHgFswServerImg, KNullDesC, uid ); + if ( err != KErrNone ) + { + return err; + } + TRequestStatus stat; + server.Rendezvous( stat ); + if ( stat != KRequestPending ) + { + server.Kill( 0 ); + } + else + { + server.Resume(); + } + User::WaitForRequest( stat ); + err = server.ExitType() == EExitPanic ? KErrGeneral : stat.Int(); + server.Close(); + return err; + } + +TInt CHgFswClientImpl::RHgFswClient::Connect() + { + const TInt KAsyncMessageSlots = 4; + const TInt KMaxRetry = 4; + + TInt retry = KMaxRetry; + for ( ; ; ) + { + TInt err = CreateSession( KHgFswServerName, TVersion( 0, 0, 0 ), KAsyncMessageSlots ); + if ( err != KErrNotFound && err != KErrServerTerminated ) + { + return err; + } + if ( !--retry ) + { + return err; + } + err = StartServer(); + if ( err != KErrNone && err != KErrAlreadyExists ) + { + return err; + } + } + } + +void CHgFswClientImpl::RHgFswClient::Subscribe( TRequestStatus& aStatus ) + { + SendReceive( EHgFswSubscribe, aStatus ); + } + +void CHgFswClientImpl::RHgFswClient::CancelSubscribe() + { + SendReceive( EHgFswCancel ); + } + +void CHgFswClientImpl::RHgFswClient::GetContentL( RHgFswArray& aDst ) + { + HGLOG_CONTEXT( GetContentL, HGLOG_LOCAL ); + HGLOG_IN(); + + for ( ; ; ) + { + TPckgBuf<TInt> bufSize; + User::LeaveIfError( SendReceive( EHgFswGetBufferSize, + TIpcArgs( &bufSize ) ) ); + HBufC8* buf = HBufC8::NewLC( bufSize() ); + TPtr8 p( buf->Des() ); + TInt err = SendReceive( EHgFswGetBuffer, + TIpcArgs( &p, bufSize() ) ); + if ( err == KErrNone ) + { + RDesReadStream strm( p ); + CleanupClosePushL( strm ); + CHgFswEntry::InternalizeArrayL( strm, aDst ); + CleanupStack::PopAndDestroy( &strm ); + } + else if ( err != KErrArgument ) + { + User::Leave( err ); + } + CleanupStack::PopAndDestroy( buf ); + if ( err == KErrNone ) + { + break; + } + // If result was KErrArgument then the size received from GetBufferSize is + // not valid anymore so restart the whole procedure. + } + + HGLOG_OUT(); + } + +void CHgFswClientImpl::RHgFswClient::CloseApp( TInt aWgId ) + { + SendReceive( EHgFswCloseApp, TIpcArgs( aWgId ) ); + } + +void CHgFswClientImpl::RHgFswClient::SwitchToApp( TInt aWgId ) + { + SendReceive( EHgFswSwitchToApp, TIpcArgs( aWgId ) ); + } + +TUid CHgFswClientImpl::RHgFswClient::ForegroundAppUid( TInt aType ) + { + TUid result = KNullUid; + TPckgBuf<TInt> uidBuf; + if ( SendReceive( EHgFswForegroundAppUid, + TIpcArgs( &uidBuf, &aType ) ) == KErrNone ) + { + result = TUid::Uid( uidBuf() ); + } + return result; + } + +CHgFswClientImpl* CHgFswClientImpl::NewL() + { + CHgFswClientImpl* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +CHgFswClientImpl* CHgFswClientImpl::NewLC() + { + CHgFswClientImpl* self = new ( ELeave ) CHgFswClientImpl; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +CHgFswClientImpl::CHgFswClientImpl() + : CActive( CActive::EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +CHgFswClientImpl::~CHgFswClientImpl() + { + Cancel(); + iClient.Close(); + } + +void CHgFswClientImpl::ConstructL() + { + User::LeaveIfError( iClient.Connect() ); + } + +void CHgFswClientImpl::GetContentL( RHgFswArray& aDst ) + { + iClient.GetContentL( aDst ); + } + +void CHgFswClientImpl::Subscribe( MHgFswObserver& aObserver ) + { + Cancel(); + iObserver = &aObserver; + iClient.Subscribe( iStatus ); + SetActive(); + } + +void CHgFswClientImpl::CancelSubscribe() + { + Cancel(); + } + +void CHgFswClientImpl::CloseApp( TInt aWgId ) + { + iClient.CloseApp( aWgId ); + } + +void CHgFswClientImpl::SwitchToApp( TInt aWgId ) + { + iClient.SwitchToApp( aWgId ); + } + +TUid CHgFswClientImpl::ForegroundAppUid( TInt aType ) + { + return iClient.ForegroundAppUid( aType ); + } + +void CHgFswClientImpl::RunL() + { + HGLOG_CONTEXT( RunL, HGLOG_LOCAL ); + HGLOG1_IN( "%d", iStatus.Int() ); + + if ( iStatus == KErrNone && iObserver ) + { + iClient.Subscribe( iStatus ); + SetActive(); + iObserver->HandleFswContentChanged(); + } + + HGLOG_OUT(); + } + +void CHgFswClientImpl::DoCancel() + { + iClient.CancelSubscribe(); + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/bwins/hgfswengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/bwins/hgfswengineu.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,8 @@ +EXPORTS + ?FswDataL@CHgFswEngine@@QAEABV?$RPointerArray@VCHgFswEntry@@@@XZ @ 1 NONAME ; class RPointerArray<class CHgFswEntry> const & CHgFswEngine::FswDataL(void) + ?ForegroundAppUidL@CHgFswEngine@@QAE?AVTUid@@H@Z @ 2 NONAME ; class TUid CHgFswEngine::ForegroundAppUidL(int) + ?SwitchToAppL@CHgFswEngine@@QAEXH@Z @ 3 NONAME ; void CHgFswEngine::SwitchToAppL(int) + ?NewL@CHgFswEngine@@SAPAV1@AAVMHgFswEngineObserver@@@Z @ 4 NONAME ; class CHgFswEngine * CHgFswEngine::NewL(class MHgFswEngineObserver &) + ?CloseAppL@CHgFswEngine@@QAEXH@Z @ 5 NONAME ; void CHgFswEngine::CloseAppL(int) + ?NewLC@CHgFswEngine@@SAPAV1@AAVMHgFswEngineObserver@@@Z @ 6 NONAME ; class CHgFswEngine * CHgFswEngine::NewLC(class MHgFswEngineObserver &) + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/eabi/hgfswengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/eabi/hgfswengineu.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,8 @@ +EXPORTS + _ZN12CHgFswEngine12SwitchToAppLEi @ 1 NONAME + _ZN12CHgFswEngine17ForegroundAppUidLEi @ 2 NONAME + _ZN12CHgFswEngine4NewLER20MHgFswEngineObserver @ 3 NONAME + _ZN12CHgFswEngine5NewLCER20MHgFswEngineObserver @ 4 NONAME + _ZN12CHgFswEngine8FswDataLEv @ 5 NONAME + _ZN12CHgFswEngine9CloseAppLEi @ 6 NONAME + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,25 @@ +/* + * =========================================================================== + * Name : bld.inf + * Part of : Huriganes / Fast Swap Server + * Description : build info file for engine component + * Version : %version: 5 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +PRJ_EXPORTS +../inc/hgfswengine.h |../../../inc/hgfswengine.h +../inc/hgfswobservers.h |../../../inc/hgfswobservers.h + +PRJ_MMPFILES +hgfswengine.mmp diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/group/hgfswengine.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/group/hgfswengine.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,59 @@ +/* + * =========================================================================== + * Name : hgfswengine.mmp + * Part of : Huriganes / Fast Swap Server + * Description : engine component + * Version : %version: sa1spcx1#17 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include <platform_paths.hrh> + +TARGET hgfswengine.dll +TARGETTYPE DLL +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE hgfswengine.cpp +SOURCE hgfshiddenapplist.cpp +SOURCE hgfsalwaysshownapplist.cpp +SOURCE hgfswidgetlist.cpp +SOURCE hgfswiconcache.cpp + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../trace + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY apparc.lib +LIBRARY ws32.lib +LIBRARY apgrfx.lib +LIBRARY fbscli.lib +LIBRARY bitgdi.lib +LIBRARY aknicon.lib +LIBRARY aknskins.lib +LIBRARY egul.lib +LIBRARY widgetregistryclient.lib +LIBRARY featmgr.lib + +LIBRARY hgpreviewprovider.lib +LIBRARY hgfswutils.lib + +DEBUGLIBRARY flogger.lib + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/inc/enginelogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/inc/enginelogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,26 @@ +/* +* ============================================================================ +* Name : enginelogging.h +* Part of : Classic UI / Teleport +* Description : Defines logs for engine +* Version : %version: sa1spcx1#3 % +* +* Copyright (c) 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1.1 +*/ + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KHgLogFile, "hgfswengine.txt" ); +_LIT( KHgLogPath, "teleport" ); +#define _HGLOG_LOG_COMPONENT_ID 0x0000000 +#endif + +#include "hglogging.h" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/inc/hgfsalwaysshownapplist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/inc/hgfsalwaysshownapplist.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,75 @@ +/* + * ============================================================================ + * Name : hgfsalwaysshownapplist.h + * Part of : Hg Teleport + * Description : Non-closeable app list class + * Version : %version: sa1spcx1#2 % + * + * Copyright 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + */ + +#ifndef HGFSALWAYSSHOWNAPPLIST_H +#define HGFSALWAYSSHOWNAPPLIST_H + +#include <e32base.h> +#include <apgcli.h> + +/** + * List of always shown applications. + */ +NONSHARABLE_CLASS( CHgFsAlwaysShownAppList ) : public CBase + { +public: + /** + * Two-phased constructor. + * + * @param aParent + */ + static CHgFsAlwaysShownAppList* NewL(); + + /* + * Default C++ constructor + */ + CHgFsAlwaysShownAppList(); + + /* + * Destructor + */ + ~CHgFsAlwaysShownAppList(); + + /** + * Initializes the list that stores applications that are always + * shown in the fast swap provided they have been installed + * in the phone rom + * @return - + */ + void InitializeAlwaysShownListL(); + + /** + * If application uid exists in the always shown application list + * @return ETrue application uid exists in the list + * EFalse application uid doesn't exist in the list + * @param TUid aAppUid the application uid + */ + TBool IsAlwaysShownApp( TUid aAppUid ); + + /** + * Returning reference to iAppList + */ + RArray<TUid>& AppList() { return iAppList; } + +private: + void ConstructL(); + RArray<TUid> iAppList; + RApaLsSession iAppArcSession; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/inc/hgfshiddenapplist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/inc/hgfshiddenapplist.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,107 @@ +/* +* ============================================================================ +* Name : hgfshiddenapplist.h +* Part of : Hg Teleport / Fast Swap module +* Description : Class that checks if chosen applications should be hidden +* from the task swap. +* Version : %version: 1 % +* +* Copyright 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#ifndef HGFSHIDDENAPPLIST_H_ +#define HGFSHIDDENAPPLIST_H_ + +#include <e32base.h> // For CActive, link against: euser.lib +#include <e32std.h> // For RTimer, link against: euser.lib +#include <e32property.h>// For RProperty +#include "hgfswobservers.h" + +//FORWARD DECLARATIONS +class RWsSession; + +/** + * This class is handling the application which are hidden + * from fast swap feature. + */ +NONSHARABLE_CLASS( CHgFsHiddenAppList ) : public CActive + { +public: + + /** + * Symbian based two phased constructor. + */ + static CHgFsHiddenAppList* NewL( MHgFsHiddenAppListObserver& aObserver ); + + /** + * Symbian based two phased constructor. + */ + static CHgFsHiddenAppList* NewLC( MHgFsHiddenAppListObserver& aObserver ); + + /** + * Destructor + */ + ~CHgFsHiddenAppList(); + + /** + * Whether application is hidden from FSW. + */ + TBool IsHiddenL( TUid aAppUid, const RWsSession& aWsSession, TInt aWgId ); + + /** + * Updating application list + */ + void UpdateListL(); + +protected: + /** + * Default constructor. + */ + CHgFsHiddenAppList( MHgFsHiddenAppListObserver& aObserver ); + + /** + * Second phase construction + */ + void ConstructL(); + + /** + * Reset application array list. + */ + void ResetArray(); + + /** + * Derived from CActive + */ + virtual void DoCancel(); + + /** + * Derived from CActive + */ + virtual void RunL(); + +private: + /** + * Property reader for reading Hiden app list from FSW + */ + RProperty iProperty; + + /** + * Hidden App list + */ + CArrayFixFlat<TInt>* iHiddenAppList; + + /** + * hidden apps list observer + */ + MHgFsHiddenAppListObserver& iObserver; + }; + +#endif /*HGFSHIDDENAPPLIST_H_*/ diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/inc/hgfswengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/inc/hgfswengine.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,329 @@ +/* + * =========================================================================== + * Name : hgfswengine.h + * Part of : Huriganes / Fast Swap Server + * Description : Task monitor engine + * Version : %version: sa1spcx1#22 % + * + * Copyright © 2008 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 __HGFSWENGINE_H +#define __HGFSWENGINE_H + +#include <e32base.h> +#include <e32cmn.h> +#include <s32strm.h> +#include <fbs.h> +#include <eikenv.h> +#include <w32std.h> +#include <e32hashtab.h> +#include <apgcli.h> +#include <e32property.h> +#include "hgpreviewobserver.h" +#include "hgfswentry.h" +#include "hgfswobservers.h" + +class CHgFsAlwaysShownAppList; +class CHgFsHiddenAppList; +class CHgFsWidgetList; +class MHgFswEngineObserver; +class CHgFswIconCache; +class CHgFastSwapPreviewProvider; +class CApaWindowGroupName; +//class CHgContextUtility; + +// descriptor big enough to store hex repr of 32-bit integer plus 0x prefix +typedef TBuf<10> TAppUidHexString; + +/** + * Engine for fast swap server. + * Performs task monitoring, notifications about wg changes are + * received from the appui. + */ +NONSHARABLE_CLASS( CHgFswEngine ) : public CActive, + public MHgFswTaskListObserver, + public MHgFswResourceObserver, + public MHgFsHiddenAppListObserver, + public MHgFastSwapPreviewObserver + { +public: + /** + * Creates a new instance. + * @param aObserver ref to observer + */ + IMPORT_C static CHgFswEngine* NewL( MHgFswEngineObserver& aObserver ); + + /** + * @copydoc NewL + */ + IMPORT_C static CHgFswEngine* NewLC( MHgFswEngineObserver& aObserver ); + + /** + * Destructor. + */ + ~CHgFswEngine(); + + /** + * Returns a reference to the current content. + * Also performs sanity checks, e.g. associates application icons + * when no screenshot has been received. + * @return ref to content array + */ + IMPORT_C const RHgFswArray& FswDataL(); + + /** + * Tries to close the given app. + * @param aWgId value given by WgId() for an entry in iData + */ + IMPORT_C void CloseAppL( TInt aWgId ); + + /** + * Brings the given app to foreground. + * @param aWgId value given by WgId() for an entry in iData + */ + IMPORT_C void SwitchToAppL( TInt aWgId ); + + /** + * Returns the uid of the foreground app or KNullUid. + * Will never return hidden apps, only those which can + * also be seen in the array returned by FswDataL. + * + * In case of embedded apps the behaviour is controlled + * by aType: it will return either the uid of the embedded + * application or the container app. + * + * @param aType @see CHgFswClient::THgFswFgAppType + */ + IMPORT_C TUid ForegroundAppUidL( TInt aType ); + +private: + // from CActive + void RunL(); + TInt RunError( TInt aError ); + void DoCancel(); + + // from MHgFswTaskListObserver + void UpdateTaskList(); + + // from MHgFswResourceObserver + void HandleResourceChange( TInt aType ); + + // from MHgFsHiddenAppListObserver + void HiddenAppListUpdated(); + + // from MHgFastSwapPreviewObserver + void HandleFswPpApplicationChange( TInt aWgId, TInt aFbsHandle ); + void HandleFswPpApplicationUnregistered( TInt aWgId ); + +private: + /** + * Constructor. + */ + CHgFswEngine( MHgFswEngineObserver& aObserver ); + + /** + * Performs 2nd phase construction. + */ + void ConstructL(); + + /** + * Gets the window group list and reconstructs the fsw content. + * @return TBool ETrue if the list has been modified + */ + TBool CollectTasksL(); + + /** + * Called from CollectTasksL for each entry in the task list. + * @param aWgId window group id + * @param aAppUid application uid + * @param aWgName window group name or NULL + * @param aNewList list to add to + * @param aIsWidget true if the entry corresponds to a web widget + * @return TBool ETrue if it was really a new entry in the list + */ + TBool AddEntryL( TInt aWgId, const TUid& aAppUid, + CApaWindowGroupName* aWgName, RHgFswArray& aNewList, + TBool aIsWidget ); + + /** + * Checks if there is an entry for same app in the content list. + * If yes then it takes some of the data for the entry that + * will correspond to the same app in the refreshed content list. + * @param aEntry new entry in content list + * @param aAppUid application uid + * @param aChanged ref to change-flag, set to ETrue if it is sure + * that the new content list will be different from the previous one + * @param aNewList ref to new content list + * @return ETrue if app was found + */ + TBool CheckIfExistsL( CHgFswEntry& aEntry, + const TUid& aAppUid, + TBool& aChanged, + RHgFswArray& aNewList ); + + /** + * Adds running widgets to the list. + * @param aNewList array to add to + */ + void CheckWidgetsL( RHgFswArray& aNewList ); + + /** + * Finds out the app uid for the given window group id. + * @param aWgId a valid window group id + * @return application uid + */ + TUid AppUidForWgIdL( TInt aWgId ); + + /** + * Returns the parent's wg id or KErrNotFound. + * @param aWgId a valid window group id + * @return parent wg id or KErrNotFound if there is no parent + */ + TInt FindParentWgId( TInt aWgId ); + + /** + * Finds out the application name. + * @param aWindowName window group name or NULL + * @param aAppUId application uid + * @param aWgId window group id + * @return application name, ownership transferred to caller + */ + HBufC* FindAppNameLC( CApaWindowGroupName* aWindowName, + const TUid& aAppUid, TInt aWgId ); + + /** + * Makes a copy of the bitmap with the given handle. + * @param aFbsHandle bitmap handle + * @param aKeepAspectRatio if true then aspect ratio is kept + * @return CFbsBitmap* the copy, ownership transferred to caller + */ + CFbsBitmap* CopyBitmapL( TInt aFbsHandle, TBool aKeepAspectRatio ); + + /** + * Checks if the app to which the screenshot belongs is in the task list + * and updates the entry when found. Also triggers change notification + * to observer when data is modified. + * @param aWgIdForScreenshot wgid for the screenshot + * @param aBitmapHandle handle for screenshot bitmap + */ + void AssignScreenshotHandle( TInt aWgIdForScreenshot, TInt aBitmapHandle ); + + /** + * Returns the bitmap handle for the screenshot belonging to the given app + * or 0 if not (yet) found. + * @param aWgIdForApp a window group id (from the window group list) + * @return bitmap handle or 0 + */ + TInt LookupScreenshotHandle( TInt aWgIdForApp ); + + /** + * Callback for the iUpdateStarter timer. + * Calls CollectTasksL and notifies the observer if the task list + * has really been modified. + */ + static TInt UpdateStarterCallback( TAny* aParam ); + + /** + * Brings the given web widget to foreground. + * @param aWidgetIndex index in the list of running widgets + */ + void SwitchToWidgetL( TInt aWidgetIndex ); + + /** + * Configues the preview provider with current screen size. + */ + void SetPreviewParams(); + + /** + * Registers and unregisters window groups to iPreviewProvider + * if the window group list has been changed. + */ + void UpdatePreviewContent(); + + /** + * Gets and publishes the foreground app uid to CFW. + */ + void PublishFgAppUidL(); + + /** + * Helper function to publish something to CFW. + * @param aType context type + * @param aValue value to publish + */ + //void PublishContextL( const TDesC& aType, const TDesC& aValue ); + +private: // data + MHgFswEngineObserver& iObserver; + RHgFswArray iData; // current fsw content, i.e. the task list + CEikonEnv* iEnv; // not own + + // always shown app list, own + CHgFsAlwaysShownAppList* iAlwaysShownAppList; + + // hidden app list, own + CHgFsHiddenAppList* iHiddenAppList; + + // web widget list, own + CHgFsWidgetList* iWidgetList; + + // window server session + RWsSession iWsSession; + + // apparc session + RApaLsSession iAppArcSession; + + /** + * Hash table storing the screenshots. + * Key: window group id for the screenshot + * (the one received in ApplicationChange) + * Value: CFbsBitmap*, pointers owned + */ + RHashMap<TInt, CFbsBitmap*> iScreenshots; + + // preview provider instance, own + CHgFastSwapPreviewProvider* iPreviewProvider; + + // timer to defer content refresh + CPeriodic* iUpdateStarter; + + // app icon provider/container instance, own + CHgFswIconCache* iAppIcons; + + // true if web widgets are supported by the system + TBool iWidgetsSupported; + // wgid of widget appui is saved here + TInt iWidgetAppUiWgId; + + // PS property to listen for swi status changes + RProperty iSwiProp; + // when true CollectTasksL will call GetAllApps etc. + // which is slow and need not be done normally, except + // during startup and perhaps when new applications are installed + TBool iAppDataRefreshNeeded; + + // window group ids returned by last WindowGroupList call + RArray<TInt> iWgIds; + + // Dirty flag, indicates that iData is not up-to-date because + // there were no subscribed clients during a previous possible + // change of the task list. + TBool iTaskListDirty; + + // For publishing the foreground app uid to Context Framework + //CHgContextUtility* iContextUtility; + TAppUidHexString iFgAppUidStr; + TUid iFgAppUid; + + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/inc/hgfswiconcache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/inc/hgfswiconcache.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,100 @@ +/* +* ============================================================================ +* Name : hgfswiconcache.h +* Part of : Hg Teleport / Fast Swap module +* Description : Icon cache +* Version : %version: 2 % +* +* Copyright 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#ifndef HGFSWICONCACHE_H_ +#define HGFSWICONCACHE_H_ + +#include <e32base.h> +#include <e32hashtab.h> + +class CFbsBitmap; +class CGulIcon; + +/** + * App icon cache. + */ +NONSHARABLE_CLASS( CHgFswIconCache ) : public CBase + { +public: + + /** + * Two phased constructor. + */ + static CHgFswIconCache* NewL(); + + /** + * Two phased constructor. + */ + static CHgFswIconCache* NewLC(); + + /** + * Destructor + */ + ~CHgFswIconCache(); + + /** + * Gets the bitmaps associated with the given app from the cache. + * If not found then creates the app icon, stores it to the cache, + * and returns that. + * @param aAppUid application uid + * @param aBitmap bitmap ptr, ownership NOT transferred to caller, or NULL + * @param aMask mask ptr, ownership NOT transferred to caller, or NULL + */ + void GetIconL( const TUid& aAppUid, + CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ); + + /** + * Sets the ptrs to the default icon. + * Ownership not transferred to caller. + */ + void DefaultIcon( CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ); + +private: + /** + * Default constructor. + */ + CHgFswIconCache(); + + /** + * Second phase construction + */ + void ConstructL(); + + /** + * Retrieves the bitmap/mask for the icon of the given app. + * @param aAppUid application uid + * @param aBitmap bitmap ptr, ownership transferred to caller, or NULL + * @param aMask mask ptr, ownership transferred to caller, or NULL + */ + void GetAppIconL( const TUid& aAppUid, + CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ); + +private: + struct SHgBitmapPair + { + SHgBitmapPair( CFbsBitmap* aBitmap, CFbsBitmap* aMask ) + : iBitmap( aBitmap ), iMask( aMask ) { } + CFbsBitmap* iBitmap; + CFbsBitmap* iMask; + }; + RHashMap<TInt, SHgBitmapPair> iAppIcons; + + CGulIcon* iDefaultIcon; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/inc/hgfswidgetlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/inc/hgfswidgetlist.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,62 @@ +/* + * ============================================================================ + * Name : hgfswidgetlist.h + * Part of : Hg Teleport + * Description : web widget list + * Version : %version: sa1spcx1#5 % + * + * Copyright 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + */ + +#ifndef HGFSWIDGETLIST_H_ +#define HGFSWIDGETLIST_H_ + +#include <e32base.h> +#include <widgetregistryclient.h> + +const TUint32 KWidgetAppUidValue = 0x10282822; + +/** + * class handling the list of running wrt widgets + */ +NONSHARABLE_CLASS(CHgFsWidgetList) : public CBase + { +public: + static CHgFsWidgetList* NewL(); + + /** Destructor */ + ~CHgFsWidgetList(); + + /** + * Initializes the list that stores widgets. + * @return - + */ + void InitializeWidgetListL(); + + /** + * Returns a ref to the list of running widgets. + */ + const RWidgetInfoArray& RunningWidgets() const { return iRunningWidgets; } + +private: + /** Constructor */ + CHgFsWidgetList(); + void ResetArrayOfWidgetInfo( RWidgetInfoArray& aWidgetInfoArr ); + + static void CleanupConnect( TAny* aThis ); + +private: + /** Contains list of widgets that are currently running */ + RWidgetInfoArray iRunningWidgets; + RWidgetRegistryClientSession iWidgetRegistryClientSession; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/inc/hgfswobservers.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/inc/hgfswobservers.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,81 @@ +/* + * =========================================================================== + * Name : hgfswobservers.h + * Part of : Huriganes / Fast Swap Server + * Description : Observer interfaces to get notifications from appui and from engine + * Version : %version: sa1spcx1#4 % + * + * Copyright © 2008 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 __HGFSWOBSERVERS_H +#define __HGFSWOBSERVERS_H + +/** + * Interface to get notifications from appui when window groups + * have changed. + */ +class MHgFswTaskListObserver + { +public: + /** + * Function called by AppUi to notify about possible + * changes in task list + */ + virtual void UpdateTaskList() = 0; + }; + +/** + * Interface to get notifications from appui's HandleResourceChangeL. + */ +class MHgFswResourceObserver + { +public: + /** + * Function called by AppUi to notify about resource changes. + */ + virtual void HandleResourceChange( TInt aType ) = 0; + }; + +/** + * Observer interface to get notifications from engine + * when fsw content has changed. + */ +class MHgFswEngineObserver + { +public: + /** + * Called when there is a change in the task list. + */ + virtual void FswDataChanged() = 0; + + /** + * Called to find out how many clients are subscribed + * for fsw content change notifications. + */ + virtual TInt FswDataListenerCount() = 0; + }; + +/** + * This class is interface for CHgFsHiddenAppList + * to notify about list change + */ +class MHgFsHiddenAppListObserver + { +public: + /** + * This function is called by CHgFsHiddenAppList when list is changed. + */ + virtual void HiddenAppListUpdated() = 0; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/src/hgfsalwaysshownapplist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/src/hgfsalwaysshownapplist.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,119 @@ +/* + * ============================================================================ + * Name : hgfsalwaysshownapplist.cpp + * Part of : Hg Teleport + * Description : File containing application list classes + * Version : %version: 4 % + * + * Copyright 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + */ + +//INCLUDES: +#include <apaid.h> +#include "hgfsalwaysshownapplist.h" + +//CONSTANTS: +/* Array for all application uid that need to be always displayed (if they are running). + Also, there will be no Close option for such apps. */ +const TUint32 KHgFsUidArray[] = + { + 0x102750F0 // Idle App Uid + ,0x0EFC346A //Search App Uid +/* never show menu app */ //,0x101F4CD2 // Menu App Uid + }; + +// ================= MEMBER FUNCTIONS ======================= + +// -------------------------------------------------------------------------- +// CHgFsAlwaysShownAppList::NewL +// -------------------------------------------------------------------------- +// +CHgFsAlwaysShownAppList* CHgFsAlwaysShownAppList::NewL() + { + CHgFsAlwaysShownAppList* self = + new (ELeave) CHgFsAlwaysShownAppList; + CleanupStack::PushL (self ); + self->ConstructL ( ); + CleanupStack::Pop ( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CHgFsAlwaysShownAppList::CHgFsAlwaysShownAppList +// -------------------------------------------------------------------------- +// +CHgFsAlwaysShownAppList::CHgFsAlwaysShownAppList() + { + } + +// -------------------------------------------------------------------------- +// CHgFsAlwaysShownAppList::~CHgFsAlwaysShownAppList +// -------------------------------------------------------------------------- +// +CHgFsAlwaysShownAppList::~CHgFsAlwaysShownAppList( ) + { + iAppList.Close(); + iAppArcSession.Close(); + } + +// -------------------------------------------------------------------------- +// CHgFsAlwaysShownAppList::ConstructL +// -------------------------------------------------------------------------- +// +void CHgFsAlwaysShownAppList::ConstructL( ) + { + User::LeaveIfError( iAppArcSession.Connect() ); + } + +// -------------------------------------------------------------------------- +// CHgFsAlwaysShownAppList::InitializeAlwaysShownListL +// Applications that are always shown in fast swap are stored +// in different their own list whether they exist +// in the phone rom or not +// -------------------------------------------------------------------------- +// +void CHgFsAlwaysShownAppList::InitializeAlwaysShownListL( ) + { + iAppList.Reset(); + // order of always shown applications + TApaAppInfo applicationInfo; + for (TInt index = 0, + sizeOfArray = ( sizeof(KHgFsUidArray) / sizeof( TUint32 ) ); + index < sizeOfArray; index++ ) + { + // if exists in phone rom + if ( iAppArcSession.GetAppInfo( applicationInfo, + TUid::Uid( KHgFsUidArray[index] ) )!= KErrNotFound ) + { + iAppList.AppendL( TUid::Uid( KHgFsUidArray[index] ) ); + } + } + } + +// -------------------------------------------------------------------------- +// CHgFsAlwaysShownAppList::IsAlwaysShownApp +// If application uid exists in the always shown application list +// -------------------------------------------------------------------------- +// +TBool CHgFsAlwaysShownAppList::IsAlwaysShownApp( TUid aAppUid ) + { + for ( TInt index = 0, count = iAppList.Count ( ); index < count; index++ ) + { + if ( iAppList[index] == aAppUid ) + { + return ETrue; + } + } + return EFalse; + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/src/hgfshiddenapplist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/src/hgfshiddenapplist.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,226 @@ +/* +* ============================================================================ +* Name : hgfshiddenapplist.cpp +* Part of : Hg Teleport / Fast Swap module +* Description : Class that checks if chosen applications should be hidden +* from the task swap. +* Version : %version: sa1spcx1#3 % +* +* Copyright 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +// INCLUDES +#include "hgfshiddenapplist.h" +#include <apgwgnam.h> + +#include <eikenv.h> + +// the maximum size of array (25 32-bit UIDs equal 100 bytes) +const TInt KMaxHiddenApps = 25; + +/** + * Category id for the hidden application list. + */ +const TUid KPSUidUikon = { 0x101F8773 }; +const TUint32 KUikAppHiddenList = 0x00000010; + +/** + * Apps that are always hidden, no matter what settings the system reports. + */ +const TUint32 KHgFsAlwaysHiddenUidArray[] = + { + 0x100056CF // screensaver + }; + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::NewL +// ----------------------------------------------------------------------------- +// +CHgFsHiddenAppList* CHgFsHiddenAppList::NewL( + MHgFsHiddenAppListObserver& aObserver ) + { + CHgFsHiddenAppList* self = + new ( ELeave ) CHgFsHiddenAppList( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::NewLC +// ----------------------------------------------------------------------------- +// +CHgFsHiddenAppList* CHgFsHiddenAppList::NewLC( + MHgFsHiddenAppListObserver& aObserver ) + { + CHgFsHiddenAppList* self = CHgFsHiddenAppList::NewL( aObserver ); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::~CHgFsHiddenAppList +// ----------------------------------------------------------------------------- +// +CHgFsHiddenAppList::~CHgFsHiddenAppList() + { + Cancel(); + + ResetArray(); + delete iHiddenAppList; + + iProperty.Close(); + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::IsHiddenL +// ----------------------------------------------------------------------------- +// +TBool CHgFsHiddenAppList::IsHiddenL( TUid aAppUid, + const RWsSession& aWsSession, + TInt aWgId ) + { + TBool ret = EFalse; + + CApaWindowGroupName* windowName = + CApaWindowGroupName::NewLC( aWsSession, aWgId ); + + if ( windowName->Hidden() ) + { + ret = ETrue; + } + else + { + for ( TInt i = 0, ie = iHiddenAppList->Count(); i != ie; ++i ) + { + if ( aAppUid.iUid == iHiddenAppList->At( i ) ) + { + ret = ETrue; + break; + } + } + if ( !ret ) + { + for ( TInt i = 0, + arrCnt = sizeof( KHgFsAlwaysHiddenUidArray ) / sizeof( TUint32 ); + i != arrCnt; ++i ) + { + if ( KHgFsAlwaysHiddenUidArray[i] == aAppUid.iUid ) + { + ret = ETrue; + break; + } + } + } + } + + CleanupStack::PopAndDestroy( windowName ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::CHgFsHiddenAppList +// ----------------------------------------------------------------------------- +// +CHgFsHiddenAppList::CHgFsHiddenAppList( + MHgFsHiddenAppListObserver& aObserver ) + :CActive( CActive::EPriorityHigh ), iObserver( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgFsHiddenAppList::ConstructL() + { + const TInt KMaxGranularity = 4; + CActiveScheduler::Add( this ); + + iHiddenAppList = new (ELeave) CArrayFixFlat<TInt>( KMaxGranularity ); + User::LeaveIfError( iProperty.Attach( KPSUidUikon, KUikAppHiddenList, EOwnerThread ) ); + + // must not call RunL directly from here as things are not fully initialized yet + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::ResetArray +// ----------------------------------------------------------------------------- +// +void CHgFsHiddenAppList::ResetArray() + { + if ( iHiddenAppList ) + { + iHiddenAppList->Reset(); + } + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::UpdateListL +// ----------------------------------------------------------------------------- +// +void CHgFsHiddenAppList::UpdateListL() + { + ResetArray(); + + // hidden list array + TBuf16 <2*KMaxHiddenApps> hiddenList; + iProperty.Get( hiddenList ); + + for ( TInt i = 0; i < hiddenList.Length(); i = i + 2 ) + { + TUint32 uid = 0x00000000; + uid = hiddenList[i]; + uid = uid << 16; // codescanner::magicnumbers + uid |= hiddenList[i+1]; + + if ( uid != 0 ) + { + iHiddenAppList->AppendL( uid ); + } + else + { + break; + } + } + + iObserver.HiddenAppListUpdated(); + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::DoCancel +// ----------------------------------------------------------------------------- +// +void CHgFsHiddenAppList::DoCancel() + { + iProperty.Cancel(); + } + +// ----------------------------------------------------------------------------- +// CHgFsHiddenAppList::RunL +// ----------------------------------------------------------------------------- +// +void CHgFsHiddenAppList::RunL() + { + if ( !IsActive() ) + { + iProperty.Subscribe( iStatus ); + SetActive(); + } + UpdateListL(); + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/src/hgfswengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/src/hgfswengine.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,1062 @@ +/* + * =========================================================================== + * Name : hgfswengine.cpp + * Part of : Huriganes / Fast Swap Server + * Description : Task monitor engine + * Version : %version: sa1spcx1#37 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include "hgfswengine.h" +#include "hgfsalwaysshownapplist.h" +#include "hgfshiddenapplist.h" +#include "hgfswidgetlist.h" +#include "hgfswiconcache.h" +#include "hgpreviewprovider.h" +#include "hgfswclient.h" +#include <apgtask.h> +#include <AknDef.h> +#include <apgwgnam.h> +#include <mmf/common/mmfcontrollerpluginresolver.h> // for CleanupResetAndDestroyPushL +#include <featmgr.h> +#include <swi/swispubsubdefs.h> + +#include "enginelogging.h" + +// time to wait before refreshing content +const TInt KContentRefreshDelay = 500000; // 0.5 sec + +// for screenshots, they are scaled down to (screensize/this_factor). +const TInt KScreenSizeFactor = 2; + +// format to get a lowercase hex string prefixed with 0x +_LIT( KHexFmt, "0x%x" ); + +// -------------------------------------------------------------------------- +// CHgFswEngine::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CHgFswEngine* CHgFswEngine::NewL( MHgFswEngineObserver& aObserver ) + { + CHgFswEngine* self = NewLC( aObserver ); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::NewLC +// -------------------------------------------------------------------------- +// +EXPORT_C CHgFswEngine* CHgFswEngine::NewLC( MHgFswEngineObserver& aObserver ) + { + CHgFswEngine* self = new ( ELeave ) CHgFswEngine( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::CHgFswEngine +// -------------------------------------------------------------------------- +// +CHgFswEngine::CHgFswEngine( MHgFswEngineObserver& aObserver ) + : CActive( EPriorityStandard ), iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::ConstructL +// -------------------------------------------------------------------------- +// +void CHgFswEngine::ConstructL() + { + iEnv = CEikonEnv::Static(); + + User::LeaveIfError( iWsSession.Connect() ); + User::LeaveIfError( iAppArcSession.Connect() ); + + iHiddenAppList = CHgFsHiddenAppList::NewL( *this ); + iAlwaysShownAppList = CHgFsAlwaysShownAppList::NewL(); + + iWidgetsSupported = FeatureManager::FeatureSupported( KFeatureIdWebWidgets ); + if ( iWidgetsSupported ) + { + iWidgetList = CHgFsWidgetList::NewL(); + } + + // create app icon retriever instance + iAppIcons = CHgFswIconCache::NewL(); + + // get an initial list of tasks + iAppDataRefreshNeeded = ETrue; + CollectTasksL(); + + // listen for app screenshots + iPreviewProvider = CHgFastSwapPreviewProvider::NewL( *this ); + SetPreviewParams(); + UpdatePreviewContent(); + + iUpdateStarter = CPeriodic::NewL( CActive::EPriorityStandard ); + + // start listening for swi ps property + if ( iSwiProp.Attach( KUidSystemCategory, + Swi::KUidSoftwareInstallKey ) == KErrNone ) + { + iSwiProp.Subscribe( iStatus ); + SetActive(); + } + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::~CHgFswEngine +// -------------------------------------------------------------------------- +// +CHgFswEngine::~CHgFswEngine() + { + Cancel(); + iSwiProp.Close(); + + delete iUpdateStarter; + delete iPreviewProvider; + + // delete the bitmaps as the hash map cannot do that + THashMapIter<TInt, CFbsBitmap*> iter( iScreenshots ); + while ( const TInt* key = iter.NextKey() ) + { + CFbsBitmap** value = iter.CurrentValue(); + delete *value; + } + iScreenshots.Close(); + delete iAppIcons; + + iData.ResetAndDestroy(); + iWgIds.Close(); + + delete iHiddenAppList; + delete iAlwaysShownAppList; + delete iWidgetList; + iAppArcSession.Close(); + iWsSession.Close(); + +// delete iContextUtility; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::FswDataL +// -------------------------------------------------------------------------- +// +EXPORT_C const RHgFswArray& CHgFswEngine::FswDataL() + { + HGLOG_CONTEXT( FswDataL, HGLOG_LOCAL ); + HGLOG1_IN( "dirty flag = %d", iTaskListDirty ); + + // check the dirty flag and refresh if needed + if ( iTaskListDirty ) + { + CollectTasksL(); + // dirty flag is cleared in the above call + } + + // Get app icon for entries without screenshot, + // do this only here as the app icon is not needed in case a screenshot + // is already available. + for ( TInt i = 0, ie = iData.Count(); i != ie; ++i ) + { + if ( !iData[i]->ScreenshotHandle() ) + { + CFbsBitmap* bmp; + CFbsBitmap* mask; + TUid appUid = iData[i]->AppUid(); + // this will leave with -46 in case of widgets if we do not have AllFiles cap + TRAPD( err, iAppIcons->GetIconL( appUid, bmp, mask ) ); + if ( err == KErrNone && bmp ) + { + iData[i]->SetAppIconHandles( bmp->Handle(), + mask ? mask->Handle() : 0 ); + } + else + { + iAppIcons->DefaultIcon( bmp, mask ); + iData[i]->SetAppIconHandles( bmp->Handle(), + mask ? mask->Handle() : 0 ); + } + } + } + + HGLOG_OUT(); + return iData; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::CloseAppL +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEngine::CloseAppL( TInt aWgId ) + { + HGLOG_CONTEXT( CloseAppL, HGLOG_LOCAL ); + HGLOG1_IN( "aWgId = %d", aWgId ); + + if ( iWidgetsSupported && aWgId < 0 && iWidgetAppUiWgId ) + { + // for widgets clients see a wgid that is -1*(index+1) + const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() ); + // convert aWgId to an index in the list of running widgets + TInt idx = -aWgId - 1; + // if index is valid then handle the widget specially + if ( idx >= 0 && idx < arr.Count() ) + { + TWsEvent event; + event.SetType( EEventUser ); + TUint8* eventData = event.EventData(); + // Fill bits 0-31 with widget application uid. + reinterpret_cast<TUint32&>( *eventData ) = KWidgetAppUidValue; + eventData += sizeof( TUint32 ); + // Fill bits 32-63 with uid of the widget that should be closed. + reinterpret_cast<TUint32&>( *eventData ) = arr[idx]->iUid.iUid; + // Send the event to Widget AppUi. + iEnv->WsSession().SendEventToWindowGroup( + iWidgetAppUiWgId, event ); + // closing a widget may not cause a window group change so trigger + // the update manually + UpdateTaskList(); + HGLOG0_OUT( "widget processing finished" ); + return; + } + } + + TUid appUid = AppUidForWgIdL( aWgId ); + if ( !iAlwaysShownAppList->IsAlwaysShownApp( appUid ) ) + { + // send window group event to kill the app + TWsEvent event; + event.SetTimeNow(); + event.SetType( KAknShutOrHideApp ); + iEnv->WsSession().SendEventToWindowGroup( aWgId, event ); + HGLOG0( HGLOG_INFO, "event sent to wg" ); + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::SwitchToAppL +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEngine::SwitchToAppL( TInt aWgId ) + { + HGLOG_CONTEXT( SwitchToAppL, HGLOG_LOCAL ); + HGLOG1_IN( "aWgId = %d", aWgId ); + + if ( iWidgetsSupported && aWgId < 0 ) + { + // for widgets clients see a wgid that is -1*(index+1) + const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() ); + // convert aWgId to an index in the list of running widgets + TInt idx = -aWgId - 1; + // if index is valid then handle the widget specially + if ( idx >= 0 && idx < arr.Count() ) + { + SwitchToWidgetL( idx ); + HGLOG1_OUT( "switched to widget %d", idx ); + return; + } + } + + TApaTask task( iEnv->WsSession() ); + task.SetWgId( aWgId ); + task.BringToForeground(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::SwitchToWidgetL +// -------------------------------------------------------------------------- +// +void CHgFswEngine::SwitchToWidgetL( TInt aWidgetIndex ) + { + const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() ); + RApaLsSession ls; + User::LeaveIfError( ls.Connect() ); + CleanupClosePushL( ls ); + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetCommandL( EApaCommandRun ); + TApaAppInfo info; + iAppArcSession.GetAppInfo( info, arr[aWidgetIndex]->iUid ); // codescanner::accessArrayElementWithoutCheck2 (aWidgetIndex checked in SwitchToAppL()) + cmdLine->SetExecutableNameL( info.iFullName ); + ls.StartApp( *cmdLine ); + CleanupStack::PopAndDestroy( 2, &ls ); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::UpdateTaskList +// Callback from appui +// -------------------------------------------------------------------------- +// +void CHgFswEngine::UpdateTaskList() + { + HGLOG_CONTEXT( UpdateTaskList, HGLOG_LOCAL ); + HGLOG_IN(); + + // If no clients are subscribed for fsw content change notifications + // then there is no need to waste time with rebuilding the task list, + // just set the dirty flag. + TInt listenerCount = iObserver.FswDataListenerCount(); + HGLOG1( HGLOG_INFO, "listener count = %d", listenerCount ); + if ( listenerCount > 0 ) + { + // There can be many calls in a row, use a timer to prevent degrading + // device performance. + if ( !iUpdateStarter->IsActive() ) + { + iUpdateStarter->Start( KContentRefreshDelay, 0, + TCallBack( UpdateStarterCallback, this ) ); + } + } + else + { + iTaskListDirty = ETrue; + } + + // screenshot taking support - call Register and Unregister when needed + UpdatePreviewContent(); + + // get the foreground app uid and publish it to CFW if different than before + TRAP_IGNORE( PublishFgAppUidL() ); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::ForegroundAppUidL +// -------------------------------------------------------------------------- +// +EXPORT_C TUid CHgFswEngine::ForegroundAppUidL( TInt aType ) + { + // Do not use GetFocusWindowGroup or others. + // We want to see only "real" application uids in FgApp, + // i.e. stuff that would also be shown in the task swapper + // area of Teleport. + + TUid result = KNullUid; + RArray<RWsSession::TWindowGroupChainInfo> allWgIds; + CleanupClosePushL( allWgIds ); + User::LeaveIfError( iWsSession.WindowGroupList( 0, &allWgIds ) ); + TInt count = allWgIds.Count(); + for ( TInt i = 0; i < count; ++i ) + { + // Depending on aType we may not need to bother with iParentId here. + // If aType == EUseEmbeddedUid => embedded apps are treated as others. + // If aType == EUseStandaloneUid => embedded apps must be ignored. + if ( allWgIds[i].iParentId > 0 + && aType == CHgFswClient::EUseStandaloneUid ) + { + continue; + } + + CApaWindowGroupName* wgn = CApaWindowGroupName::NewLC( + iWsSession, allWgIds[i].iId ); + TUid newUid = wgn->AppUid(); + TBool hidden = wgn->Hidden() || iHiddenAppList->IsHiddenL( + newUid, iWsSession, allWgIds[i].iId ); + CleanupStack::PopAndDestroy( wgn ); + + if ( !hidden && newUid.iUid ) + { + result = newUid; + break; + } + } + CleanupStack::PopAndDestroy( &allWgIds ); + + return result; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::PublishFgAppUidL +// -------------------------------------------------------------------------- +// +void CHgFswEngine::PublishFgAppUidL() + { + HGLOG_CONTEXT( PublishFgAppUidL, HGLOG_LOCAL ); + HGLOG_IN(); + + TUid newUid = ForegroundAppUidL( CHgFswClient::EUseEmbeddedUid ); + HGLOG2( HGLOG_INFO, "ws says: %x we have: %x", newUid.iUid, iFgAppUid.iUid ); + if ( iFgAppUid != newUid && newUid.iUid ) + { + iFgAppUid = newUid; + iFgAppUidStr.Format( KHexFmt, iFgAppUid.iUid ); + //PublishContextL( KHgCFTypeFgApp, iFgAppUidStr ); + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::PublishContextL +// -------------------------------------------------------------------------- +// +//void CHgFswEngine::PublishContextL( const TDesC& aType, const TDesC& aValue ) +// { +// HGLOG_CONTEXT( PublishContextL, HGLOG_LOCAL ); +// HGLOG2_IN( "%S: %S", &aType, &aValue ); +// if ( !iContextUtility ) +// { +// iContextUtility = CHgContextUtility::NewL(); +// iContextUtility->AllowPublishFromBackground( ETrue ); +// } +// iContextUtility->PublishContextL( aType, aValue ); +// HGLOG_OUT(); +// } + +// -------------------------------------------------------------------------- +// CHgFswEngine::UpdateStarterCallback +// Callback for the timer +// -------------------------------------------------------------------------- +// +TInt CHgFswEngine::UpdateStarterCallback( TAny* aParam ) + { + CHgFswEngine* self = static_cast<CHgFswEngine*>( aParam ); + self->iUpdateStarter->Cancel(); + // get list of tasks and notify observer if there is a change in the list + TBool changed = EFalse; + TRAPD( err, changed = self->CollectTasksL() ); + if ( err == KErrNone && changed ) + { + self->iObserver.FswDataChanged(); + } + return 0; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::CollectTasksL +// -------------------------------------------------------------------------- +// +TBool CHgFswEngine::CollectTasksL() + { + HGLOG_CONTEXT( CollectTasksL, HGLOG_LOCAL ); + HGLOG_IN(); + + // clear dirty flag + iTaskListDirty = EFalse; + + TBool changed = EFalse; + RHgFswArray newList; + CleanupResetAndDestroyPushL( newList ); + + // update app data if needed + // (usually on startup and when new apps might have been installed) + if ( iAppDataRefreshNeeded ) + { + HGLOG0( HGLOG_INFO, "refreshing app data" ); + iAppArcSession.GetAllApps(); + iAlwaysShownAppList->InitializeAlwaysShownListL(); + iAppDataRefreshNeeded = EFalse; + } + + // get all window groups + RArray<RWsSession::TWindowGroupChainInfo> allWgIds; + CleanupClosePushL( allWgIds ); + User::LeaveIfError( iWsSession.WindowGroupList( 0, &allWgIds ) ); + TInt count = allWgIds.Count(); + + for ( TInt i = 0; i < count; ++i ) + { + // ignore uninteresting entries (e.g. embedded apps) + if ( allWgIds[i].iParentId > 0 ) + { + continue; + } + + // get window group name + TInt wgId = allWgIds[i].iId; + CApaWindowGroupName* windowName = + CApaWindowGroupName::NewLC( iWsSession, wgId ); + TUid appUid = windowName->AppUid(); + + // ignore entries with null uid + if ( !appUid.iUid ) + { + CleanupStack::PopAndDestroy( windowName ); + continue; + } + + // will append the task to our own list only if it is not hidden + TBool onHiddenList = iHiddenAppList->IsHiddenL( + appUid, iWsSession, wgId ); + + // if this is the widget app then save wgid for later use + // and ignore it, but include running widgets instead + if ( iWidgetsSupported && appUid.iUid == KWidgetAppUidValue ) + { + iWidgetAppUiWgId = wgId; + onHiddenList = ETrue; + CheckWidgetsL( newList ); + } + + // get screen number (-1=console, 0=main screen, 1=cover ui) + TInt appScreen = 0; + TInt scrNumErr = iAppArcSession.GetDefaultScreenNumber( appScreen, appUid ); + + // check if it is on always-shown list + TBool mustShow = iAlwaysShownAppList->IsAlwaysShownApp( appUid ); + +#ifdef _DEBUG + const TDesC& captionDbg( windowName->Caption() ); + HGLOG4( HGLOG_INFO, "[%d] wgid=%d appuid=%x (%S)", i, wgId, + appUid.iUid, &captionDbg ); + HGLOG4( HGLOG_INFO, "hidden=%d onhiddenlist=%d mustshow=%d scrno=%d", + windowName->Hidden(), onHiddenList, mustShow, appScreen ); +#endif + + // add item to task list if it is always-shown OR it is not hidden + // and it is not on cover ui + if ( mustShow + || ( !onHiddenList + && !windowName->Hidden() + && ( appScreen == 0 || appScreen == -1 ) + && scrNumErr == KErrNone ) ) + { + if ( AddEntryL( wgId, appUid, windowName, newList, EFalse ) ) + { + changed = ETrue; + } + } + CleanupStack::PopAndDestroy( windowName ); + } + CleanupStack::PopAndDestroy( &allWgIds ); + + // if counts for old and new lists do not match then there is a change for sure, + // probably an app has been closed + if ( iData.Count() != newList.Count() ) + { + changed = ETrue; + } + + // move pointers from the temporary list into the real one + iData.ResetAndDestroy(); + TInt newListCount = newList.Count(); + HGLOG1( HGLOG_INFO, "new list count = %d", newListCount ); + for ( TInt i = 0; i < newListCount; ++i ) + { + HGLOG3( HGLOG_INFO, "[%d] %S wgid=%d", + i, &newList[i]->AppName(), newList[i]->WgId() ); + iData.AppendL( newList[i] ); + newList[i] = 0; + } + CleanupStack::PopAndDestroy( &newList ); + + HGLOG1_OUT( "change flag = %d", changed ); + return changed; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::AddEntryL +// -------------------------------------------------------------------------- +// +TBool CHgFswEngine::AddEntryL( TInt aWgId, const TUid& aAppUid, + CApaWindowGroupName* aWgName, RHgFswArray& aNewList, + TBool aIsWidget ) + { + TBool changed = EFalse; + CHgFswEntry* entry = CHgFswEntry::NewLC(); + entry->SetWgId( aWgId ); + entry->SetAppUid( aAppUid ); + entry->SetWidget( aIsWidget ); + + // check if present in old list and if yes then take some of the old data + TBool found = CheckIfExistsL( *entry, aAppUid, changed, aNewList ); + + // if not present previously then find out app name + // and check if screenshot is already available + if ( !found ) + { + // when adding a new entry to the list it is changed for sure + changed = ETrue; + HBufC* name = FindAppNameLC( aWgName, aAppUid, aWgId ); + if ( name ) + { + entry->SetAppNameL( *name ); + } + CleanupStack::PopAndDestroy( name ); + TInt h = LookupScreenshotHandle( aWgId ); + if ( h ) + { + entry->SetScreenshotHandle( h ); + } + entry->SetAlwaysShown( iAlwaysShownAppList->IsAlwaysShownApp( aAppUid ) ); + if ( aWgName ) + { + entry->SetSystemApp( aWgName->IsSystem() ); + } + } + + // add to new list, ownership is transferred + aNewList.AppendL( entry ); + CleanupStack::Pop( entry ); + return changed; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::CheckIfExistsL +// -------------------------------------------------------------------------- +// +TBool CHgFswEngine::CheckIfExistsL( CHgFswEntry& aEntry, + const TUid& aAppUid, + TBool& aChanged, + RHgFswArray& aNewList ) + { + for ( TInt entryIdx = 0, oldCount = iData.Count(); + entryIdx < oldCount; ++entryIdx ) + { + // Enough to check appuid, no need to bother with wgid as the + // screenshot handle is up-to-date or will be updated later anyway. + if ( iData[entryIdx]->AppUid() == aAppUid ) + { + // if positions do not match then the list is different than before + if ( entryIdx != aNewList.Count() ) + { + aChanged = ETrue; + } + CHgFswEntry* oldEntry = iData[entryIdx]; + aEntry.SetAppNameL( oldEntry->AppName() ); + aEntry.SetScreenshotHandle( oldEntry->ScreenshotHandle() ); + aEntry.SetAlwaysShown( oldEntry->AlwaysShown() ); + aEntry.SetSystemApp( oldEntry->SystemApp() ); + return ETrue; + } + } + return EFalse; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::CheckWidgetsL +// -------------------------------------------------------------------------- +// +void CHgFswEngine::CheckWidgetsL( RHgFswArray& aNewList ) + { + if ( iWidgetsSupported ) + { + iWidgetList->InitializeWidgetListL(); + const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() ); + for ( TInt i = 0, ie = arr.Count(); i != ie; ++i ) + { + // wgid will be a special negative value + // windowgroupname is not needed here so pass NULL + AddEntryL( -(i+1), arr[i]->iUid, 0, aNewList, ETrue ); + } + } + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::HiddenAppListUpdated +// Callback from the hidden app list watcher +// -------------------------------------------------------------------------- +// +void CHgFswEngine::HiddenAppListUpdated() + { + UpdateTaskList(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::AppUidForWgIdL +// -------------------------------------------------------------------------- +// +TUid CHgFswEngine::AppUidForWgIdL( TInt aWgId ) + { + CApaWindowGroupName* windowName = + CApaWindowGroupName::NewLC( iWsSession, aWgId ); + TUid appUid = windowName->AppUid(); + CleanupStack::PopAndDestroy( windowName ); + return appUid; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::FindParentWgId +// -------------------------------------------------------------------------- +// +TInt CHgFswEngine::FindParentWgId( TInt aWgId ) + { + TInt parent( KErrNotFound ); + RArray<RWsSession::TWindowGroupChainInfo> allWgIds; + // Ask for window group list from RWsSession + TInt error = iWsSession.WindowGroupList( 0, &allWgIds ); + if ( !error ) + { + TInt count( allWgIds.Count() ); + for ( TInt i( 0 ); i < count; i++ ) + { + RWsSession::TWindowGroupChainInfo info = allWgIds[i]; + if ( info.iId == aWgId ) + { + parent = info.iParentId; + break; + } + } + } + allWgIds.Close(); + return parent; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::FindAppNameLC +// -------------------------------------------------------------------------- +// +HBufC* CHgFswEngine::FindAppNameLC( CApaWindowGroupName* aWindowName, + const TUid& aAppUid, + TInt aWgId ) + { + //Retrieve the app name + TApaAppInfo info; + iAppArcSession.GetAppInfo( info, aAppUid ); + TPtrC caption = info.iShortCaption; + + HBufC* tempName = 0; + if ( !caption.Length() && aWindowName ) // if not set - use thread name instead + { + if ( aWindowName->Caption().Length() ) + { + tempName = aWindowName->Caption().AllocL(); + //put on cleanupstack after the if + } + else + { + TThreadId threadId; + TInt err = iWsSession.GetWindowGroupClientThreadId( + aWgId, threadId ); + if ( err == KErrNone ) + { + RThread thread; + CleanupClosePushL( thread ); + err = thread.Open ( threadId ); + if ( err==KErrNone ) + { + tempName = thread.Name().AllocL(); // codescanner::forgottoputptroncleanupstack + // tempName put on cleanupstack after the if + } + CleanupStack::PopAndDestroy( &thread ); + } + } + } + else + { + tempName = caption.AllocL(); + //put on cleanupstack after the if + } + CleanupStack::PushL( tempName ); + return tempName; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::CopyBitmapL +// -------------------------------------------------------------------------- +// +CFbsBitmap* CHgFswEngine::CopyBitmapL( TInt aFbsHandle, TBool aKeepAspectRatio ) + { + CFbsBitmap* ret = new (ELeave) CFbsBitmap; + CleanupStack::PushL( ret ); + CFbsBitmap* bmp = new (ELeave) CFbsBitmap; + CleanupStack::PushL( bmp ); + User::LeaveIfError( bmp->Duplicate( aFbsHandle ) ); + + //Make bitmap width and height equal so that it will look better in FSW control. + TSize size = bmp->SizeInPixels(); + + if ( !aKeepAspectRatio ) + { + if ( size.iHeight > size.iWidth ) + { + size.iHeight = size.iWidth; + } + else + { + size.iWidth = size.iHeight; + } + } + + // preserve size and mode + User::LeaveIfError( ret->Create( size, EColor64K ) ); + + CFbsBitmapDevice* doubleBufferDev = CFbsBitmapDevice::NewL( ret ); + CleanupStack::PushL( doubleBufferDev ); + + CFbsBitGc* doubleBufferGc = 0; + User::LeaveIfError( doubleBufferDev->CreateContext( doubleBufferGc ) ); + CleanupStack::PushL( doubleBufferGc ); + + // preserve size + doubleBufferGc->BitBlt( TPoint( 0, 0 ), bmp, TRect(size) ); + + CleanupStack::PopAndDestroy( doubleBufferGc ); + CleanupStack::PopAndDestroy( doubleBufferDev ); + CleanupStack::PopAndDestroy( bmp ); + CleanupStack::Pop( ret ); + + return ret; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::UpdatePreviewContent +// -------------------------------------------------------------------------- +// +void CHgFswEngine::UpdatePreviewContent() + { + HGLOG_CONTEXT( UpdatePreviewContent, HGLOG_LOCAL ); + HGLOG_IN(); + + RArray<RWsSession::TWindowGroupChainInfo> allWgIds; + if ( iWsSession.WindowGroupList( 0, &allWgIds ) == KErrNone ) + { + // check window groups that do not exist anymore + for ( TInt i = 0, ie = iWgIds.Count(); i != ie; ++i ) + { + TInt wgid = iWgIds[i]; + TBool present = EFalse; + for ( TInt j = 0, je = allWgIds.Count(); j != je; ++j ) + { + if ( allWgIds[j].iId == wgid ) + { + present = ETrue; + break; + } + } + if ( !present ) + { + HGLOG1( HGLOG_INFO, "unregister: %d", wgid ); + iPreviewProvider->Unregister( wgid ); + } + } + // check topmost window group + if ( allWgIds.Count() ) + { + if ( !iWgIds.Count() || allWgIds[0].iId != iWgIds[0] ) + { + TInt wgid = allWgIds[0].iId; + HGLOG1( HGLOG_INFO, "registering %d", wgid ); + iPreviewProvider->Register( wgid ); + } + } + // store the new list + iWgIds.Reset(); + for ( TInt i = 0, ie = allWgIds.Count(); i != ie; ++i ) + { + iWgIds.Append( allWgIds[i].iId ); + } + } + allWgIds.Close(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::HandleFswPpApplicationChange +// Callback from CHgFastSwapPreviewProvider +// Note: aWgId is for the window group for which the screenshot is taken, +// it may not be the same as the application's wgid (in case of embedded apps) +// -------------------------------------------------------------------------- +// +void CHgFswEngine::HandleFswPpApplicationChange( TInt aWgId, TInt aFbsHandle ) + { + HGLOG_CONTEXT( HandleFswPpApplicationChange, HGLOG_LOCAL ); + HGLOG2_IN( "aWgId = %d aFbsHandle = %d", aWgId, aFbsHandle ); + + CFbsBitmap* bmp = 0; + TRAPD( err, bmp = CopyBitmapL( aFbsHandle, EFalse ) ); + iPreviewProvider->AckPreview(aFbsHandle); + if ( err == KErrNone ) + { + CFbsBitmap** oldbmp = iScreenshots.Find( aWgId ); + if ( oldbmp ) + { + delete *oldbmp; + } + if ( iScreenshots.Insert( aWgId, bmp ) != KErrNone ) + { + delete bmp; + iScreenshots.Remove( aWgId ); + } + else + { + AssignScreenshotHandle( aWgId, bmp->Handle() ); + } + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::HandleFswPpApplicationUnregistered +// Callback from CHgFastSwapPreviewProvider +// -------------------------------------------------------------------------- +// +void CHgFswEngine::HandleFswPpApplicationUnregistered( TInt aWgId ) + { + HGLOG_CONTEXT( HandleFswPpApplicationUnregistered, HGLOG_LOCAL ); + HGLOG1_IN( "aWgId = %d", aWgId ); + + CFbsBitmap** bmp = iScreenshots.Find( aWgId ); + if ( bmp ) + { + delete *bmp; + iScreenshots.Remove( aWgId ); + AssignScreenshotHandle( aWgId, 0 ); + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::AssignScreenshotHandle +// Called when a screenshot arrives to check if there is a corresponding +// application in the task list. +// -------------------------------------------------------------------------- +// +void CHgFswEngine::AssignScreenshotHandle( TInt aWgIdForScreenshot, + TInt aBitmapHandle ) + { + TBool changed = EFalse; + TInt parentWgId = FindParentWgId( aWgIdForScreenshot ); + // now parentWgId is a valid wgid or KErrNotFound (-1) + for ( TInt i = 0, ie = iData.Count(); i != ie; ++i ) + { + if ( iData[i]->Widget() ) + { + // Do not do anything for now => no screenshot for widgets. + continue; + } + TInt appWgId = iData[i]->WgId(); + if ( appWgId == aWgIdForScreenshot || appWgId == parentWgId ) + { + iData[i]->SetScreenshotHandle( aBitmapHandle ); + changed = ETrue; + break; + } + } + if ( changed ) + { + iObserver.FswDataChanged(); + } + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::LookupScreenshotHandle +// Called to check if there is a screenshot already stored for the given +// app. (or a screenshot with a wgid for which aWgIdForApp is the parent) +// -------------------------------------------------------------------------- +// +TInt CHgFswEngine::LookupScreenshotHandle( TInt aWgIdForApp ) + { + CFbsBitmap** bmp = iScreenshots.Find( aWgIdForApp ); + if ( bmp ) + { + // there is a screenshot stored for this wgid + return (*bmp)->Handle(); + } + else if ( aWgIdForApp > 0 ) + { + // must check if there is a screenshot for which aWgIdForApp is the parent + THashMapIter<TInt, CFbsBitmap*> iter( iScreenshots ); + while ( const TInt* wgid = iter.NextKey() ) + { + if ( FindParentWgId( *wgid ) == aWgIdForApp ) + { + CFbsBitmap** bmp = iter.CurrentValue(); + return (*bmp)->Handle(); + } + } + } + else if ( aWgIdForApp < 0 ) + { + // Must be a widget, wgid is useless in this case. + // Do not do anything for now => no screenshot for widgets. + } + return 0; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::RunL +// -------------------------------------------------------------------------- +// +void CHgFswEngine::RunL() + { + if ( iStatus != KErrCancel ) // when cancelling the subscribe it completes with KErrCancel + { + TInt value = 0; + if ( iSwiProp.Get( value ) == KErrNone ) + { + TInt operationStatus( value & Swi::KSwisOperationStatusMask ); + // When an (un)installation has finished change the flag to + // refresh the app list during the next task list update. + if ( operationStatus == Swi::ESwisStatusSuccess ) + { + iAppDataRefreshNeeded = ETrue; + } + } + iSwiProp.Subscribe( iStatus ); + SetActive(); + } + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::DoCancel +// -------------------------------------------------------------------------- +// +void CHgFswEngine::DoCancel() + { + iSwiProp.Cancel(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::RunError +// -------------------------------------------------------------------------- +// +TInt CHgFswEngine::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::HandleResourceChange +// callback from appui's HandleResourceChangeL +// -------------------------------------------------------------------------- +// +void CHgFswEngine::HandleResourceChange( TInt aType ) + { + HGLOG_CONTEXT( HandleResourceChange, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( iPreviewProvider && aType == KEikDynamicLayoutVariantSwitch ) + { + SetPreviewParams(); + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgFswEngine::SetPreviewParams +// -------------------------------------------------------------------------- +// +void CHgFswEngine::SetPreviewParams() + { + TSize screenSize = iEnv->ScreenDevice()->SizeInPixels(); + iPreviewProvider->SetPreviewParam( + TSize( screenSize.iWidth / KScreenSizeFactor, + screenSize.iHeight / KScreenSizeFactor ), + EColor64K ); // displaymode is ignored + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/src/hgfswiconcache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/src/hgfswiconcache.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,141 @@ +/* + * ============================================================================ + * Name : hgfswiconcache.cpp + * Part of : Hg Teleport + * Description : Icon cache + * Version : %version: sa1spcx1#5 % + * + * Copyright 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + */ + +#include "hgfswiconcache.h" +#include <fbs.h> +#include <AknsUtils.h> +#include <gulicon.h> +#include <avkon.mbg> + +// size for the created app icons +const TInt KAppIconWidth = 96; +const TInt KAppIconHeight = 96; + +// -------------------------------------------------------------------------- +// CHgFswIconCache::NewL +// -------------------------------------------------------------------------- +// +CHgFswIconCache* CHgFswIconCache::NewL() + { + CHgFswIconCache* self = new (ELeave) CHgFswIconCache; + CleanupStack::PushL (self ); + self->ConstructL ( ); + CleanupStack::Pop ( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CHgFswIconCache::CHgFswIconCache +// -------------------------------------------------------------------------- +// +CHgFswIconCache::CHgFswIconCache() + { + } + +// -------------------------------------------------------------------------- +// CHgFswIconCache::~CHgFswIconCache +// -------------------------------------------------------------------------- +// +CHgFswIconCache::~CHgFswIconCache( ) + { + THashMapIter<TInt, SHgBitmapPair> iter( iAppIcons ); + while ( const TInt* key = iter.NextKey() ) + { + SHgBitmapPair* value = iter.CurrentValue(); + delete value->iBitmap; + delete value->iMask; + } + iAppIcons.Close(); + delete iDefaultIcon; + } + +// -------------------------------------------------------------------------- +// CHgFswIconCache::ConstructL +// -------------------------------------------------------------------------- +// +void CHgFswIconCache::ConstructL() + { + iDefaultIcon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnMenuUnknownCxt, + AknIconUtils::AvkonIconFileName(), + EMbmAvkonQgn_menu_unknown_cxt, + EMbmAvkonQgn_menu_unknown_cxt_mask ); + TSize sz( KAppIconWidth, KAppIconHeight ); + AknIconUtils::SetSize( iDefaultIcon->Bitmap(), sz ); + AknIconUtils::SetSize( iDefaultIcon->Mask(), sz ); + } + +// -------------------------------------------------------------------------- +// CHgFswIconCache::GetAppIconL +// -------------------------------------------------------------------------- +// +void CHgFswIconCache::GetAppIconL( const TUid& aAppUid, + CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ) + { + aBitmap = aMask = 0; + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + if ( skinInstance ) + { + AknsUtils::CreateAppIconLC( skinInstance, aAppUid, EAknsAppIconTypeList, + aBitmap, aMask ); + // The CreateAppIconLC method leaves both the bitmaps in the cleanup stack. + // The order in which they are pushed into the stack and types of + // the items in the stack are both undefined. + CleanupStack::Pop( 2 ); // codescanner::cleanup + TSize sz( KAppIconWidth, KAppIconHeight ); + AknIconUtils::SetSize( aBitmap, sz ); + AknIconUtils::SetSize( aMask, sz ); + } + } + +// -------------------------------------------------------------------------- +// CHgFswIconCache::GetIconL +// -------------------------------------------------------------------------- +// +void CHgFswIconCache::GetIconL( const TUid& aAppUid, + CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ) + { + aBitmap = aMask = 0; + SHgBitmapPair* bp = iAppIcons.Find( aAppUid.iUid ); + if ( bp ) + { + // ownership stays with the hash table + aBitmap = bp->iBitmap; + aMask = bp->iMask; + } + else + { + GetAppIconL( aAppUid, aBitmap, aMask ); // ownership of the bitmap is ours + // insert to hash table and pass ownership + iAppIcons.InsertL( aAppUid.iUid, SHgBitmapPair( aBitmap, aMask ) ); + } + } + +// -------------------------------------------------------------------------- +// CHgFswIconCache::DefaultIcon +// -------------------------------------------------------------------------- +// +void CHgFswIconCache::DefaultIcon( CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ) + { + aBitmap = iDefaultIcon->Bitmap(); + aMask = iDefaultIcon->Mask(); + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/engine/src/hgfswidgetlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/engine/src/hgfswidgetlist.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,89 @@ +/* + * ============================================================================ + * Name : hgfswidgetlist.cpp + * Part of : Hg Teleport + * Description : web widget list + * Version : %version: sa1spcx1#5 % + * + * Copyright 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + */ + +#include "hgfswidgetlist.h" +#include <widgetregistrydata.h> + +// -------------------------------------------------------------------------- +// CHgFsWidgetList::NewL +// -------------------------------------------------------------------------- +// +CHgFsWidgetList* CHgFsWidgetList::NewL() + { + return new (ELeave) CHgFsWidgetList; + } + +// -------------------------------------------------------------------------- +// CHgFsWidgetList::CHgFsWidgetList +// -------------------------------------------------------------------------- +// +CHgFsWidgetList::CHgFsWidgetList() + { + } + +// -------------------------------------------------------------------------- +// CHgFsWidgetList::~CHgFsWidgetList +// -------------------------------------------------------------------------- +// +CHgFsWidgetList::~CHgFsWidgetList() + { + ResetArrayOfWidgetInfo( iRunningWidgets ); + iRunningWidgets.Reset(); + } + +// -------------------------------------------------------------------------- +// CHgFsWidgetList::CleanupConnect +// -------------------------------------------------------------------------- +// +void CHgFsWidgetList::CleanupConnect( TAny* aThis ) + { + CHgFsWidgetList* self = static_cast<CHgFsWidgetList*>( aThis ); + self->iWidgetRegistryClientSession.Disconnect(); + } + +// -------------------------------------------------------------------------- +// CHgFsWidgetList::InitializeWidgetListL +// -------------------------------------------------------------------------- +// +void CHgFsWidgetList::InitializeWidgetListL() + { + ResetArrayOfWidgetInfo( iRunningWidgets ); + iRunningWidgets.Reset(); + User::LeaveIfError( iWidgetRegistryClientSession.Connect() ); + CleanupStack::PushL( TCleanupItem( CleanupConnect, this) ); + iWidgetRegistryClientSession.RunningWidgetsL(iRunningWidgets); + CleanupStack::Pop(); // clean WidgetRegistryClientSession item + iWidgetRegistryClientSession.Disconnect(); + } + +// -------------------------------------------------------------------------- +// CHgFsWidgetList::ResetArrayOfWidgetInfo +// -------------------------------------------------------------------------- +// +void CHgFsWidgetList::ResetArrayOfWidgetInfo( + RWidgetInfoArray& aWidgetInfoArr ) + { + for ( TInt i = 0; i < aWidgetInfoArr.Count(); i++ ) + { + CWidgetInfo *item = aWidgetInfoArr[i]; + delete item; + } + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,29 @@ +/* + * =========================================================================== + * Name : bld.inf + * Part of : Huriganes / Fast Swap Server + * Description : main build info file + * Version : %version: 7 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include <platform_paths.hrh> + +PRJ_EXPORTS +../rom/hgfswserver.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hgfswserver.iby) + +#include "../utils/group/bld.inf" +#include "../engine/group/bld.inf" +#include "../server/group/bld.inf" +#include "../client/group/bld.inf" + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/inc/hgfswcommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/inc/hgfswcommon.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,41 @@ +/* + * =========================================================================== + * Name : hgfswcommon.h + * Part of : Huriganes / Fast Swap Server + * Description : common constants + * Version : %version: sa1spcx1#5 % + * + * Copyright © 2008 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 __HGFSWCOMMON_H +#define __HGFSWCOMMON_H + +#include <e32std.h> + +_LIT( KHgFswServerName, "hgfswserver" ); +_LIT( KHgFswServerImg, "hgfswserver" ); + +const TUid KHgFswServerUid = { 0x2001CBE1 }; + +enum THgFswServerMessages + { + EHgFswSubscribe, + EHgFswCancel, + EHgFswGetBufferSize, + EHgFswGetBuffer, // there must be a GetBufferSize request before GetBuffer + EHgFswCloseApp, + EHgFswSwitchToApp, + EHgFswForegroundAppUid + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/rom/hgfswserver.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/rom/hgfswserver.iby Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,27 @@ +/* +* ============================================================================ +* Name : hgfswserver.iby +* Part of : Huriganes +* Description : Iby file for fast swap server +* Version : %version: sa1spcx1#2 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#ifndef __HGFSWSERVER_IBY__ +#define __HGFSWSERVER_IBY__ + +file=ABI_DIR/BUILD_DIR/hgfswclient.dll SHARED_LIB_DIR/hgfswclient.dll +file=ABI_DIR/BUILD_DIR/hgfswutils.dll SHARED_LIB_DIR/hgfswutils.dll +file=ABI_DIR/BUILD_DIR/hgfswengine.dll SHARED_LIB_DIR/hgfswengine.dll +file=ABI_DIR/BUILD_DIR/hgfswserver.exe SHARED_LIB_DIR/hgfswserver.exe + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,21 @@ +/* + * =========================================================================== + * Name : bld.inf + * Part of : Huriganes / Fast Swap Server + * Description : server component build info file + * Version : %version: 4 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +PRJ_MMPFILES +hgfswserver.mmp diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/group/hgfswserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/group/hgfswserver.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,50 @@ +/* + * =========================================================================== + * Name : hgfswserver.mmp + * Part of : Huriganes / Fast Swap Server + * Description : server component + * Version : %version: 9 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include <platform_paths.hrh> + +TARGET hgfswserver.exe +TARGETTYPE EXE +UID 0x0 0x2001CBE1 +// AllFiles cap needed to get icon for wrt widgets +CAPABILITY CAP_SERVER AllFiles + +SOURCEPATH ../src +SOURCE hgfswserver.cpp +SOURCE hgfswsession.cpp +SOURCE hgfswappui.cpp + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDe ../../../inc + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY ws32.lib +LIBRARY apgrfx.lib +LIBRARY fbscli.lib +LIBRARY avkon.lib + +LIBRARY hgfswengine.lib +LIBRARY hgfswutils.lib + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/inc/hgfswappui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/inc/hgfswappui.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,64 @@ +/* + * =========================================================================== + * Name : hgfswappui.h + * Part of : Huriganes / Fast Swap Server + * Description : appui for server + * Version : %version: 5 % + * + * Copyright © 2008 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 __HGFSWAPPUI_H +#define __HGFSWAPPUI_H + +#include <aknappui.h> + +class MHgFswTaskListObserver; +class MHgFswResourceObserver; + +/** + * Appui for the fsw server. + * Reimplements HandleWsEventL from base class to get notifications about + * window group changes. + */ +class CHgFswAppUi : public CAknAppUi + { +public: + ~CHgFswAppUi(); + void ConstructL(); + + /** + * Setter function. + * + * @param aTaskListObserver Observer to be notified if task list + * has changed + */ + void SetTaskListObserver( MHgFswTaskListObserver& aTaskListObserver ); + + /** + * Setter function. + * + * @param aResourceObserver Observer to be notified when resources are changed. + */ + void SetResourceObserver( MHgFswResourceObserver& aResourceObserver ); + +private: + // from CEikAppUi + void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); + void HandleResourceChangeL( TInt aType ); + +private: + MHgFswTaskListObserver* iTaskListObserver; // not own + MHgFswResourceObserver* iResourceObserver; // not own + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/inc/hgfswserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/inc/hgfswserver.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,79 @@ +/* + * =========================================================================== + * Name : hgfswserver.h + * Part of : Huriganes / Fast Swap Server + * Description : server class + * Version : %version: 6 % + * + * Copyright © 2008 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 __HGFSWSERVER_H +#define __HGFSWSERVER_H + +#include <e32base.h> +#include "hgfswcommon.h" +#include "hgfswobservers.h" + +/** + * Possible panic reasons. + */ +enum THgFswPanic + { + EPanicBadDescriptor, + EPanicIllegalFunction, + EPanicAccessDenied + }; + +/** + * Panic name. + */ +_LIT( KHgFswPanicName, "hgfsw" ); + +class CHgFswEngine; +class CHgFswAppUi; + +/** + * Hg FastSwap Server. + */ +class CHgFswServer : public CServer2, public MHgFswEngineObserver + { +public: + static CHgFswServer* NewLC( CHgFswAppUi& aAppUi ); + ~CHgFswServer(); + void AddSession(); + void DropSession(); + + void SerializeAndGetBufferSizeL( const RMessage2& aMessage ); + void GetBufferL( const RMessage2& aMessage ); + void CloseAppL( TInt aWgId ); + void SwitchToAppL( TInt aWgId ); + void ForegroundAppUidL( const RMessage2& aMessage ); + +private: + CHgFswServer( TInt aPriority, CHgFswAppUi& aAppUi ); + void ConstructL(); + CSession2* NewSessionL( const TVersion& aVersion, + const RMessage2& aMessage ) const; + + // from MHgFswEngineObserver + void FswDataChanged(); + TInt FswDataListenerCount(); + +private: + TInt iSessionCount; + CHgFswEngine* iEngine; + CBufFlat* iBuffer; + CHgFswAppUi& iAppUi; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/inc/hgfswsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/inc/hgfswsession.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,55 @@ +/* + * =========================================================================== + * Name : hgfswsession.h + * Part of : Huriganes / Fast Swap Server + * Description : session class for server + * Version : %version: 4 % + * + * Copyright © 2008 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 __HGFSWSESSION_H +#define __HGFSWSESSION_H + +#include "hgfswserver.h" +#include "hgfswentry.h" + +/** + * Session class. + */ +class CHgFswSession : public CSession2 + { +public: + CHgFswSession(); + void CreateL(); + + /** + * Called from the server when fsw content has changed. + */ + void FswDataChanged(); + + /** + * Returns true if there is a pending subscribe request to this session. + */ + TBool IsListening(); + +private: + ~CHgFswSession(); + CHgFswServer& Server(); + void ServiceL( const RMessage2& aMessage ); + void ServiceError( const RMessage2& aMessage, TInt aError ); + void CompleteSubscribe( TInt aError ); + + RArray<RMessage2> iSubscribeRequests; // non-completed EHgFswSubscribe messages + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/inc/serverlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/inc/serverlogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,26 @@ +/* +* ============================================================================ +* Name : serverlogging.h +* Part of : Classic UI / Teleport +* Description : Defines logs for server +* Version : %version: sa1spcx1#3 % +* +* Copyright (c) 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1.1 +*/ + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KHgLogFile, "hgfswserver.txt" ); +_LIT( KHgLogPath, "teleport" ); +#define _HGLOG_LOG_COMPONENT_ID 0x2001CBE1 + +#endif +#include "hglogging.h" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/src/hgfswappui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/src/hgfswappui.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,95 @@ +/* + * =========================================================================== + * Name : hgfswappui.cpp + * Part of : Huriganes / Fast Swap Server + * Description : appui implementation + * Version : %version: sa1spcx1#6 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include "hgfswappui.h" +#include "hgfswobservers.h" + +// -------------------------------------------------------------------------- +// CHgFswAppUi::~CHgFswAppUi +// -------------------------------------------------------------------------- +// +CHgFswAppUi::~CHgFswAppUi() + { + // empty + } + +// -------------------------------------------------------------------------- +// CHgFswAppUi::ConstructL +// -------------------------------------------------------------------------- +// +void CHgFswAppUi::ConstructL() + { + CAknAppUi::BaseConstructL( ENoAppResourceFile | EAknEnableSkin ); + RWindowGroup& windowGroup = CCoeEnv::Static()->RootWin(); + windowGroup.EnableFocusChangeEvents(); + windowGroup.EnableGroupListChangeEvents(); + } + +// -------------------------------------------------------------------------- +// CHgFswAppUi::SetTaskListObserver +// -------------------------------------------------------------------------- +// +void CHgFswAppUi::SetTaskListObserver( MHgFswTaskListObserver& aTaskListObserver ) + { + iTaskListObserver = &aTaskListObserver; + } + +// -------------------------------------------------------------------------- +// CHgFswAppUi::SetResourceObserver +// -------------------------------------------------------------------------- +// +void CHgFswAppUi::SetResourceObserver( MHgFswResourceObserver& aResourceObserver ) + { + iResourceObserver = &aResourceObserver; + } + +// -------------------------------------------------------------------------- +// CHgFswAppUi::HandleWsEventL +// -------------------------------------------------------------------------- +// +void CHgFswAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ) + { + TInt eventType = aEvent.Type(); + + if ( eventType == EEventFocusGroupChanged + || eventType == EEventWindowGroupListChanged ) + { + if ( iTaskListObserver ) + { + iTaskListObserver->UpdateTaskList(); + } + } + + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + } + +// -------------------------------------------------------------------------- +// CHgFswAppUi::HandleResourceChangeL +// -------------------------------------------------------------------------- +// +void CHgFswAppUi::HandleResourceChangeL( TInt aType ) // codescanner::LFunctionCantLeave (virtual) + { + if ( iResourceObserver ) + { + iResourceObserver->HandleResourceChange( aType ); + } + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/src/hgfswserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/src/hgfswserver.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,283 @@ +/* + * =========================================================================== + * Name : hgfswserver.cpp + * Part of : Huriganes / Fast Swap Server + * Description : server implementation + * Version : %version: sa1spcx1#14 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include "hgfswserver.h" +#include "hgfswsession.h" +#include "hgfswappui.h" +#include "hgfswengine.h" + +#include <s32mem.h> +#include <eikenv.h> +#include <apgwgnam.h> + +// -------------------------------------------------------------------------- +// CHgFswServer::CHgFswServer +// -------------------------------------------------------------------------- +// +CHgFswServer::CHgFswServer( TInt aPriority, CHgFswAppUi& aAppUi ) + : CServer2( aPriority ), iAppUi( aAppUi ) + { + } + +// -------------------------------------------------------------------------- +// CHgFswServer::NewLC +// -------------------------------------------------------------------------- +// +CHgFswServer* CHgFswServer::NewLC( CHgFswAppUi& aAppUi ) + { + CHgFswServer* self = new ( ELeave ) CHgFswServer( + EPriorityNormal, aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// -------------------------------------------------------------------------- +// CHgFswServer::ConstructL +// -------------------------------------------------------------------------- +// +void CHgFswServer::ConstructL() + { + StartL( KHgFswServerName ); + iEngine = CHgFswEngine::NewL( *this ); + iAppUi.SetTaskListObserver( *iEngine ); + iAppUi.SetResourceObserver( *iEngine ); + } + +// -------------------------------------------------------------------------- +// CHgFswServer::~CHgFswServer +// -------------------------------------------------------------------------- +// +CHgFswServer::~CHgFswServer() + { + delete iBuffer; + delete iEngine; + } + +// -------------------------------------------------------------------------- +// CHgFswServer::NewSessionL +// -------------------------------------------------------------------------- +// +CSession2* CHgFswServer::NewSessionL( const TVersion&, + const RMessage2& ) const + { + return new ( ELeave ) CHgFswSession; + } + +// -------------------------------------------------------------------------- +// CHgFswServer::AddSession +// -------------------------------------------------------------------------- +// +void CHgFswServer::AddSession() + { + ++iSessionCount; + } + +// -------------------------------------------------------------------------- +// CHgFswServer::DropSession +// -------------------------------------------------------------------------- +// +void CHgFswServer::DropSession() + { + --iSessionCount; + } + +// -------------------------------------------------------------------------- +// CHgFswServer::SerializeAndGetBufferSizeL +// -------------------------------------------------------------------------- +// +void CHgFswServer::SerializeAndGetBufferSizeL( const RMessage2& aMessage ) + { + const TInt KBufferExpandSize = 128; + const RHgFswArray& array( iEngine->FswDataL() ); + delete iBuffer; iBuffer = NULL; + iBuffer = CBufFlat::NewL( KBufferExpandSize ); + RBufWriteStream ws; + CleanupClosePushL( ws ); + ws.Open( *iBuffer ); + CHgFswEntry::ExternalizeArrayL( ws, array ); + CleanupStack::PopAndDestroy( &ws ); + TPtr8 p( iBuffer->Ptr( 0 ) ); + TPckg<TInt> size( p.Length() ); + aMessage.WriteL( 0, size ); + aMessage.Complete( KErrNone ); + } + +// -------------------------------------------------------------------------- +// CHgFswServer::GetBufferL +// -------------------------------------------------------------------------- +// +void CHgFswServer::GetBufferL( const RMessage2& aMessage ) + { + if ( !iBuffer ) + { + User::Leave( KErrGeneral ); + } + TPtr8 p( iBuffer->Ptr( 0 ) ); + // If the size expected by the client does not match indicate it with a leave + // so the client can recognize it by checking the return value of SendReceive + // and can request the buffer size again. + if ( p.Length() != aMessage.Int1() ) + { + User::Leave( KErrArgument ); + } + aMessage.WriteL( 0, p ); + aMessage.Complete( KErrNone ); + } + +// -------------------------------------------------------------------------- +// CHgFswServer::CloseAppL +// -------------------------------------------------------------------------- +// +void CHgFswServer::CloseAppL( TInt aWgId ) + { + iEngine->CloseAppL( aWgId ); + } + +// -------------------------------------------------------------------------- +// CHgFswServer::SwitchToAppL +// -------------------------------------------------------------------------- +// +void CHgFswServer::SwitchToAppL( TInt aWgId ) + { + iEngine->SwitchToAppL( aWgId ); + } + +// -------------------------------------------------------------------------- +// CHgFswServer::ForegroundAppUidL +// -------------------------------------------------------------------------- +// +void CHgFswServer::ForegroundAppUidL( const RMessage2& aMessage ) + { + TUid uid = iEngine->ForegroundAppUidL( aMessage.Int1() ); + TPckg<TInt> uidPckg( uid.iUid ); + aMessage.WriteL( 0, uidPckg ); + } + +// -------------------------------------------------------------------------- +// CHgFswServer::FswDataChanged +// callback from engine +// -------------------------------------------------------------------------- +// +void CHgFswServer::FswDataChanged() + { + // notify all sessions about the change + iSessionIter.SetToFirst(); + while ( CHgFswSession* session = static_cast<CHgFswSession*>( iSessionIter++ ) ) + { + if ( session->IsListening() ) + { + session->FswDataChanged(); + } + } + } + +// -------------------------------------------------------------------------- +// CHgFswServer::FswDataListenersCount +// callback from engine +// -------------------------------------------------------------------------- +// +TInt CHgFswServer::FswDataListenerCount() + { + TInt n = 0; + iSessionIter.SetToFirst(); + while ( CHgFswSession* session = static_cast<CHgFswSession*>( iSessionIter++ ) ) + { + if ( session->IsListening() ) + { + ++n; + } + } + return n; + } + +// -------------------------------------------------------------------------- +// RunServerL +// -------------------------------------------------------------------------- +// +static void RunServerL( CHgFswAppUi& aAppUi, CEikonEnv& aEnv ) + { + // change thread name + User::LeaveIfError( RThread::RenameMe( KHgFswServerName ) ); + + // set app as hidden + CApaWindowGroupName* wgName = + CApaWindowGroupName::NewL( aEnv.WsSession(), + aEnv.RootWin().Identifier() ); + wgName->SetHidden( ETrue ); + wgName->SetWindowGroupName( aEnv.RootWin() ); + delete wgName; + + // start server + CHgFswServer* server = CHgFswServer::NewLC( aAppUi ); + RProcess::Rendezvous( KErrNone ); + CActiveScheduler::Start(); + CleanupStack::PopAndDestroy( server ); + } + +// -------------------------------------------------------------------------- +// E32Main +// -------------------------------------------------------------------------- +// +TInt E32Main() + { + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + TInt err = KErrNoMemory; + if ( cleanup ) + { + CEikonEnv* env = new CEikonEnv; + if ( env ) + { + TRAP( err, env->ConstructL() ); + if ( err == KErrNone ) + { + env->DisableExitChecks( ETrue ); + CHgFswAppUi* ui = new CHgFswAppUi; + if ( ui ) + { + TRAP( err, ui->ConstructL() ); + if ( err == KErrNone ) + { + // hide from tasklist and prevent from coming foreground + env->RootWin().SetOrdinalPosition( 0, + ECoeWinPriorityNeverAtFront ); + // set as system app so will not be closed when memory is low + env->SetSystem( ETrue ); + + RFbsSession::Connect(); + + TRAP( err, RunServerL( *ui, *env ) ); + + RFbsSession::Disconnect(); + + ui->PrepareToExit(); + } + } + } + env->DestroyEnvironment(); + } + delete cleanup; + } + __UHEAP_MARKEND; + return err; + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/server/src/hgfswsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/server/src/hgfswsession.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,159 @@ +/* + * =========================================================================== + * Name : hgfswsession.cpp + * Part of : Huriganes / Fast Swap Server + * Description : session implementation + * Version : %version: sa1spcx1#8 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include "hgfswsession.h" + +// -------------------------------------------------------------------------- +// CHgFswSession::CHgFswSession +// -------------------------------------------------------------------------- +// +CHgFswSession::CHgFswSession() + { + } + +// -------------------------------------------------------------------------- +// CHgFswSession::Server +// -------------------------------------------------------------------------- +// +CHgFswServer& CHgFswSession::Server() + { + return *static_cast<CHgFswServer*>( + const_cast<CServer2*>( CSession2::Server() ) ); + } + +// -------------------------------------------------------------------------- +// CHgFswSession::CreateL +// -------------------------------------------------------------------------- +// +void CHgFswSession::CreateL() // codescanner::LFunctionCantLeave (virtual) + { + Server().AddSession(); + } + +// -------------------------------------------------------------------------- +// CHgFswSession::~CHgFswSession +// -------------------------------------------------------------------------- +// +CHgFswSession::~CHgFswSession() + { + CompleteSubscribe( KErrCancel ); + iSubscribeRequests.Close(); + Server().DropSession(); + } + +// -------------------------------------------------------------------------- +// CHgFswSession::CompleteSubscribe +// -------------------------------------------------------------------------- +// +void CHgFswSession::CompleteSubscribe( TInt aError ) + { + for ( TInt i = 0, ie = iSubscribeRequests.Count(); i != ie; ++i ) + { + iSubscribeRequests[i].Complete( aError ); + } + iSubscribeRequests.Reset(); + } + +// -------------------------------------------------------------------------- +// CHgFswSession::ServiceL +// -------------------------------------------------------------------------- +// +void CHgFswSession::ServiceL( const RMessage2& aMessage ) + { + if ( !aMessage.HasCapability( ECapabilityLocalServices ) ) + { + aMessage.Panic( KHgFswPanicName, EPanicAccessDenied ); + return; + } + + switch ( aMessage.Function() ) + { + case EHgFswSubscribe: + iSubscribeRequests.AppendL( aMessage ); + break; + + case EHgFswCancel: + CompleteSubscribe( KErrCancel ); + aMessage.Complete( KErrNone ); + break; + + case EHgFswGetBufferSize: + Server().SerializeAndGetBufferSizeL( aMessage ); + break; + + case EHgFswGetBuffer: + Server().GetBufferL( aMessage ); + break; + + case EHgFswCloseApp: + Server().CloseAppL( aMessage.Int0() ); + aMessage.Complete( KErrNone ); + break; + + case EHgFswSwitchToApp: + Server().SwitchToAppL( aMessage.Int0() ); + aMessage.Complete( KErrNone ); + break; + + case EHgFswForegroundAppUid: + Server().ForegroundAppUidL( aMessage ); + aMessage.Complete( KErrNone ); + break; + + default: + aMessage.Panic( KHgFswPanicName, EPanicIllegalFunction ); + break; + } + } + +// -------------------------------------------------------------------------- +// CHgFswSession::ServiceError +// -------------------------------------------------------------------------- +// +void CHgFswSession::ServiceError( const RMessage2& aMessage, + TInt aError ) + { + if ( aError == KErrBadDescriptor ) + { + aMessage.Panic( KHgFswPanicName, EPanicBadDescriptor ); + } + CSession2::ServiceError( aMessage, aError ); + } + +// -------------------------------------------------------------------------- +// CHgFswSession::FswDataChanged +// called by server when notification is received from engine +// -------------------------------------------------------------------------- +// +void CHgFswSession::FswDataChanged() + { + CompleteSubscribe( KErrNone ); + } + +// -------------------------------------------------------------------------- +// CHgFswSession::IsListening +// -------------------------------------------------------------------------- +// +TBool CHgFswSession::IsListening() + { + return iSubscribeRequests.Count() > 0; + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/utils/bwins/hgfswutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/utils/bwins/hgfswutilsu.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,25 @@ +EXPORTS + ?AppName@CHgFswEntry@@QBEABVTDesC16@@XZ @ 1 NONAME ; class TDesC16 const & CHgFswEntry::AppName(void) const + ?AppUid@CHgFswEntry@@QBE?AVTUid@@XZ @ 2 NONAME ; class TUid CHgFswEntry::AppUid(void) const + ?ExternalizeArrayL@CHgFswEntry@@SAXAAVRWriteStream@@ABV?$RPointerArray@VCHgFswEntry@@@@@Z @ 3 NONAME ; void CHgFswEntry::ExternalizeArrayL(class RWriteStream &, class RPointerArray<class CHgFswEntry> const &) + ?ExternalizeL@CHgFswEntry@@QAEXAAVRWriteStream@@@Z @ 4 NONAME ; void CHgFswEntry::ExternalizeL(class RWriteStream &) + ?InternalizeArrayL@CHgFswEntry@@SAXAAVRReadStream@@AAV?$RPointerArray@VCHgFswEntry@@@@@Z @ 5 NONAME ; void CHgFswEntry::InternalizeArrayL(class RReadStream &, class RPointerArray<class CHgFswEntry> &) + ?InternalizeL@CHgFswEntry@@QAEXAAVRReadStream@@@Z @ 6 NONAME ; void CHgFswEntry::InternalizeL(class RReadStream &) + ?NewL@CHgFswEntry@@SAPAV1@XZ @ 7 NONAME ; class CHgFswEntry * CHgFswEntry::NewL(void) + ?NewLC@CHgFswEntry@@SAPAV1@XZ @ 8 NONAME ; class CHgFswEntry * CHgFswEntry::NewLC(void) + ?ScreenshotHandle@CHgFswEntry@@QBEHXZ @ 9 NONAME ; int CHgFswEntry::ScreenshotHandle(void) const + ?SetAppNameL@CHgFswEntry@@QAEXABVTDesC16@@@Z @ 10 NONAME ; void CHgFswEntry::SetAppNameL(class TDesC16 const &) + ?SetAppUid@CHgFswEntry@@QAEXABVTUid@@@Z @ 11 NONAME ; void CHgFswEntry::SetAppUid(class TUid const &) + ?SetScreenshotHandle@CHgFswEntry@@QAEXH@Z @ 12 NONAME ; void CHgFswEntry::SetScreenshotHandle(int) + ?SetWgId@CHgFswEntry@@QAEXH@Z @ 13 NONAME ; void CHgFswEntry::SetWgId(int) + ?WgId@CHgFswEntry@@QBEHXZ @ 14 NONAME ; int CHgFswEntry::WgId(void) const + ?AlwaysShown@CHgFswEntry@@QBEHXZ @ 15 NONAME ; int CHgFswEntry::AlwaysShown(void) const + ?SetAlwaysShown@CHgFswEntry@@QAEXH@Z @ 16 NONAME ; void CHgFswEntry::SetAlwaysShown(int) + ?AppIconBitmapHandle@CHgFswEntry@@QBEHXZ @ 17 NONAME ; int CHgFswEntry::AppIconBitmapHandle(void) const + ?AppIconMaskHandle@CHgFswEntry@@QBEHXZ @ 18 NONAME ; int CHgFswEntry::AppIconMaskHandle(void) const + ?SetAppIconHandles@CHgFswEntry@@QAEXHH@Z @ 19 NONAME ; void CHgFswEntry::SetAppIconHandles(int, int) + ?SetWidget@CHgFswEntry@@QAEXH@Z @ 20 NONAME ; void CHgFswEntry::SetWidget(int) + ?Widget@CHgFswEntry@@QBEHXZ @ 21 NONAME ; int CHgFswEntry::Widget(void) const + ?SetSystemApp@CHgFswEntry@@QAEXH@Z @ 22 NONAME ; void CHgFswEntry::SetSystemApp(int) + ?SystemApp@CHgFswEntry@@QBEHXZ @ 23 NONAME ; int CHgFswEntry::SystemApp(void) const + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/utils/eabi/hgfswutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/utils/eabi/hgfswutilsu.def Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,25 @@ +EXPORTS + _ZN11CHgFswEntry11SetAppNameLERK7TDesC16 @ 1 NONAME + _ZN11CHgFswEntry12ExternalizeLER12RWriteStream @ 2 NONAME + _ZN11CHgFswEntry12InternalizeLER11RReadStream @ 3 NONAME + _ZN11CHgFswEntry17ExternalizeArrayLER12RWriteStreamRK13RPointerArrayIS_E @ 4 NONAME + _ZN11CHgFswEntry17InternalizeArrayLER11RReadStreamR13RPointerArrayIS_E @ 5 NONAME + _ZN11CHgFswEntry19SetScreenshotHandleEi @ 6 NONAME + _ZN11CHgFswEntry4NewLEv @ 7 NONAME + _ZN11CHgFswEntry5NewLCEv @ 8 NONAME + _ZN11CHgFswEntry7SetWgIdEi @ 9 NONAME + _ZN11CHgFswEntry9SetAppUidERK4TUid @ 10 NONAME + _ZNK11CHgFswEntry16ScreenshotHandleEv @ 11 NONAME + _ZNK11CHgFswEntry4WgIdEv @ 12 NONAME + _ZNK11CHgFswEntry6AppUidEv @ 13 NONAME + _ZNK11CHgFswEntry7AppNameEv @ 14 NONAME + _ZN11CHgFswEntry14SetAlwaysShownEi @ 15 NONAME + _ZNK11CHgFswEntry11AlwaysShownEv @ 16 NONAME + _ZN11CHgFswEntry17SetAppIconHandlesEii @ 17 NONAME + _ZNK11CHgFswEntry17AppIconMaskHandleEv @ 18 NONAME + _ZNK11CHgFswEntry19AppIconBitmapHandleEv @ 19 NONAME + _ZN11CHgFswEntry9SetWidgetEi @ 20 NONAME + _ZNK11CHgFswEntry6WidgetEv @ 21 NONAME + _ZN11CHgFswEntry12SetSystemAppEi @ 22 NONAME + _ZNK11CHgFswEntry9SystemAppEv @ 23 NONAME + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/utils/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/utils/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,24 @@ +/* + * =========================================================================== + * Name : bld.inf + * Part of : Huriganes / Fast Swap Server + * Description : build info file for utility component + * Version : %version: 5 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +PRJ_EXPORTS +../inc/hgfswentry.h |../../../inc/hgfswentry.h + +PRJ_MMPFILES +hgfswutils.mmp diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/utils/group/hgfswutils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/utils/group/hgfswutils.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,34 @@ +/* + * =========================================================================== + * Name : hgfswutils.mmp + * Part of : Huriganes / Fast Swap Server + * Description : utility component + * Version : %version: 5 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include <platform_paths.hrh> + +TARGET hgfswutils.dll +TARGETTYPE DLL +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE hgfswentry.cpp + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc + +LIBRARY euser.lib +LIBRARY estor.lib diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/utils/inc/hgfswentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/utils/inc/hgfswentry.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,130 @@ +/* + * =========================================================================== + * Name : hgfswentry.h + * Part of : Huriganes / Fast Swap Server + * Description : Task list entry + * Version : %version: 7 % + * + * Copyright © 2008 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 __HGFSWENTRY_H +#define __HGFSWENTRY_H + +#include <e32base.h> +#include <e32cmn.h> + +class CHgFswEntry; +class RReadStream; +class RWriteStream; + +typedef RPointerArray<CHgFswEntry> RHgFswArray; + +/** + * An entry in the task list. + */ +NONSHARABLE_CLASS( CHgFswEntry ) : public CBase + { +public: + IMPORT_C static CHgFswEntry* NewL(); + IMPORT_C static CHgFswEntry* NewLC(); + ~CHgFswEntry(); + + /** + * Window group id. + * In case of wrt widgets this is negative and is not a valid window group id. + * Use this when calling CloseApp or SwitchToApp. (these work with widgets too) + */ + IMPORT_C TInt WgId() const; + + /** + * Application uid. + */ + IMPORT_C TUid AppUid() const; + + /** + * Application name. + */ + IMPORT_C const TDesC& AppName() const; + + /** + * Bitmap handle to the screenshot or 0 if not available. + */ + IMPORT_C TInt ScreenshotHandle() const; + + /** + * ETrue if the application is always shown in the fast swapper. + * (no use to call CloseApp for such an application) + */ + IMPORT_C TBool AlwaysShown() const; + + /** + * ETrue if the application is a system application. + * (no use to call CloseApp for such an application) + */ + IMPORT_C TBool SystemApp() const; + + /** + * ETrue if this is a wrt widget. + */ + IMPORT_C TBool Widget() const; + + /** + * Application icon bitmap handle or 0. + * If may not be set if the screenshot is available, i.e. it is + * only guaranteed to be non-zero when ScreenshotHandle() returns 0. + */ + IMPORT_C TInt AppIconBitmapHandle() const; + + /** + * Application icon mask handle. + * @see AppIconBitmapHandle + * The mask handle may be 0 even when the bitmap handle is non-zero. + */ + IMPORT_C TInt AppIconMaskHandle() const; + + + IMPORT_C void SetWgId( TInt aWgId ); + IMPORT_C void SetAppUid( const TUid& aUid ); + IMPORT_C void SetAppNameL( const TDesC& aAppName ); + IMPORT_C void SetScreenshotHandle( TInt aHandle ); + IMPORT_C void SetAlwaysShown( TBool aValue ); + IMPORT_C void SetSystemApp( TBool aValue ); + IMPORT_C void SetWidget( TBool aValue ); + IMPORT_C void SetAppIconHandles( TInt aBitmapHandle, TInt aMaskHandle ); + + IMPORT_C void ExternalizeL( RWriteStream& aStream ); + IMPORT_C void InternalizeL( RReadStream& aStream ); + + IMPORT_C static void ExternalizeArrayL( RWriteStream& aStream, + const RHgFswArray& aArray ); + IMPORT_C static void InternalizeArrayL( RReadStream& aStream, + RHgFswArray& aArray ); + +private: + TInt iWgId; + TUid iAppUid; + HBufC* iAppName; + TInt iScreenshotHandle; + TBool iAlwaysShown; + TBool iSystemApp; + TBool iWidget; + TInt iAppIconBitmapHandle; + TInt iAppIconMaskHandle; + + TInt iReserved0; + TInt iReserved1; + TInt iReserved2; + TInt iReserved3; + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/utils/inc/utilslogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/utils/inc/utilslogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,26 @@ +/* +* ============================================================================ +* Name : utilslogging.h +* Part of : Classic UI / Teleport +* Description : Defines logs for utils +* Version : %version: sa1spcx1#3 % +* +* Copyright (c) 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1.1 +*/ + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KHgLogFile, "hgfswutils.txt" ); +_LIT( KHgLogPath, "teleport" ); +#define _HGLOG_LOG_COMPONENT_ID 0x0000000 + +#endif +#include "hglogging.h" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/hgfswserver/utils/src/hgfswentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/hgfswserver/utils/src/hgfswentry.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,278 @@ +/* + * =========================================================================== + * Name : hgfswentry.cpp + * Part of : Huriganes / Fast Swap Server + * Description : Task list entry + * Version : %version: 7 % + * + * Copyright © 2008 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. + * =========================================================================== + */ + +#include "hgfswentry.h" +#include <s32strm.h> + +// -------------------------------------------------------------------------- +// CHgFswEntry::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CHgFswEntry* CHgFswEntry::NewL() + { + CHgFswEntry* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::NewLC +// -------------------------------------------------------------------------- +// +EXPORT_C CHgFswEntry* CHgFswEntry::NewLC() + { + CHgFswEntry* self = new ( ELeave ) CHgFswEntry; + CleanupStack::PushL( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::~CHgFswEntry +// -------------------------------------------------------------------------- +// +CHgFswEntry::~CHgFswEntry() + { + delete iAppName; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SetWgId +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::SetWgId( TInt aWgId ) + { + iWgId = aWgId; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SetAppUid +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::SetAppUid( const TUid& aUid ) + { + iAppUid = aUid; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SetAppNameL +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::SetAppNameL( const TDesC& aAppName ) + { + delete iAppName; iAppName = 0; + iAppName = aAppName.AllocL(); + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SetScreenshotHandle +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::SetScreenshotHandle( TInt aHandle ) + { + iScreenshotHandle = aHandle; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SetAlwaysShown +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::SetAlwaysShown( TBool aValue ) + { + iAlwaysShown = aValue; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SetSystemApp +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::SetSystemApp( TBool aValue ) + { + iSystemApp = aValue; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SetWidget +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::SetWidget( TBool aValue ) + { + iWidget = aValue; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SetAppIconHandles +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::SetAppIconHandles( TInt aBitmapHandle, TInt aMaskHandle ) + { + iAppIconBitmapHandle = aBitmapHandle; + iAppIconMaskHandle = aMaskHandle; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::WgId +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFswEntry::WgId() const + { + return iWgId; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::AppUid +// -------------------------------------------------------------------------- +// +EXPORT_C TUid CHgFswEntry::AppUid() const + { + return iAppUid; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::AppName +// -------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHgFswEntry::AppName() const + { + return iAppName ? *iAppName : KNullDesC(); + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::ScreenshotHandle +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFswEntry::ScreenshotHandle() const + { + return iScreenshotHandle; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::AlwaysShown +// -------------------------------------------------------------------------- +// +EXPORT_C TBool CHgFswEntry::AlwaysShown() const + { + return iAlwaysShown; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::SystemApp +// -------------------------------------------------------------------------- +// +EXPORT_C TBool CHgFswEntry::SystemApp() const + { + return iSystemApp; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::Widget +// -------------------------------------------------------------------------- +// +EXPORT_C TBool CHgFswEntry::Widget() const + { + return iWidget; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::AppIconBitmapHandle +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFswEntry::AppIconBitmapHandle() const + { + return iAppIconBitmapHandle; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::AppIconMaskHandle +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CHgFswEntry::AppIconMaskHandle() const + { + return iAppIconMaskHandle; + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::ExternalizeL +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::ExternalizeL( RWriteStream& aStream ) + { + aStream.WriteInt32L( iWgId ); + aStream.WriteInt32L( iAppUid.iUid ); + aStream << AppName(); + aStream.WriteInt32L( iScreenshotHandle ); + aStream.WriteInt32L( iAlwaysShown ); + aStream.WriteInt32L( iSystemApp ); + aStream.WriteInt32L( iWidget ); + aStream.WriteInt32L( iAppIconBitmapHandle ); + aStream.WriteInt32L( iAppIconMaskHandle ); + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::InternalizeL +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::InternalizeL( RReadStream& aStream ) + { + iWgId = aStream.ReadInt32L(); + iAppUid = TUid::Uid( aStream.ReadInt32L() ); + delete iAppName; iAppName = 0; + iAppName = HBufC::NewL( aStream, KMaxTInt ); + iScreenshotHandle = aStream.ReadInt32L(); + iAlwaysShown = aStream.ReadInt32L(); + iSystemApp = aStream.ReadInt32L(); + iWidget = aStream.ReadInt32L(); + iAppIconBitmapHandle = aStream.ReadInt32L(); + iAppIconMaskHandle = aStream.ReadInt32L(); + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::ExternalizeArrayL +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::ExternalizeArrayL( RWriteStream& aStream, + const RHgFswArray& aArray ) + { + TInt count = aArray.Count(); + aStream.WriteInt32L( count ); + for ( TInt i = 0; i < count; ++i ) + { + aArray[i]->ExternalizeL( aStream ); + } + } + +// -------------------------------------------------------------------------- +// CHgFswEntry::InternalizeArrayL +// -------------------------------------------------------------------------- +// +EXPORT_C void CHgFswEntry::InternalizeArrayL( RReadStream& aStream, + RHgFswArray& aArray ) + { + aArray.ResetAndDestroy(); + TInt count = aStream.ReadInt32L(); + for ( TInt i = 0; i < count; ++i ) + { + CHgFswEntry* entry = CHgFswEntry::NewLC(); + entry->InternalizeL( aStream ); + aArray.AppendL( entry ); + CleanupStack::Pop( entry ); + } + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/rom/hgcontextservices.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/rom/hgcontextservices.iby Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,30 @@ +/* +* ============================================================================ +* Name : hgcontextservices.iby +* Part of : Huriganes / context Services +* Description : Iby file for Context Services +* Version : %version: sa1spcx1#62 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ +#ifndef HGCONTEXTSERVICES_IBY +#define HGCONTEXTSERVICES_IBY + +// Context Services binaries +file=ABI_DIR/BUILD_DIR/hgcontextservicesutils.dll SHARED_LIB_DIR/hgcontextservicesutils.dll + +// backup registration +data=DATAZ_/private/20011417/backup_registration.xml private/20011417/backup_registration.xml + +// stub sis +data=ZSYSTEM/install/hgctxsrv_stub.sis system/install/hgctxsrv_stub.sis + +#endif // HGCONTEXTSERVICES diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/sis/stubs/createstubs.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/sis/stubs/createstubs.bat Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,1 @@ +for %%f in (*.pkg) do makesis -s %%f diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/sis/stubs/hgctxsrv_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/sis/stubs/hgctxsrv_stub.pkg Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,20 @@ +; ------------------------------------------------------------------------------ +; HG Context Services stub SIS package file. +; Used to enable HG Context Services to be updated from ROM with a SIS package. +; When you add new files into this stub, please remember to update +; SIS stub with "makesis -s" command. +; ------------------------------------------------------------------------------ +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"hgctxutils"},(0x20019569),1,0,0,TYPE=SA + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +""-"Z:\sys\bin\hgcontextservicesutils.dll" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/sis/stubs/hgctxsrv_stub.sis Binary file taskswitcher/contextengine/sis/stubs/hgctxsrv_stub.sis has changed diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/trace/hglogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/trace/hglogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,219 @@ +/* +* ============================================================================== +* Name : hglogging.h +* Part of : Teleport / Context Services +* Description : Defines all available logging macros. +* Version : %version: 2 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia. All rights are reserved. Copying, including +* reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia. +* ============================================================================== +*/ + +#ifndef HGLOGLOGUTILS_H +#define HGLOGLOGUTILS_H + +/** + * @file + * + * TAKING LOGGING INTO USE: + * + * This step is needed to do once per component. + * + * For each component that uses these common logging macros should specify + * their own logging configuration file, which includes this file. In that + * configuration file, following constants and macros must be defined. + * For example: + * @code + * + * _LIT( KHgLogFile, "text_file_for_logging.txt" ); + * _LIT( KHgLogPath, "folder_for_text_file" ); + * #define _HGLOG_LOG_COMPONENT_ID <some unique number here> + * + * #include "hglogging.h" + * + * @/code + * + * KHgLogFile : This is the name of the file, where all the logs for + * this components are being written. + * + * KHgLogPath : This is the folder name under c:\logs, where the file + * is to be stored. For example, if KHgLogPath is "test", + * log file is created into folder c:\logs\test. + * + * _HGLOG_LOG_COMPONENT_ID : Unique number id of the component. This is + * for filtering purposes. + * + * _HGLOG_RDEBUG : When defined tracing instead of file logging. + * Default is for file logging. + * + * -------------------------------------------------------------------------- + * + * USING LOGGING: + * + * Basically the use is simple, register function use with HGLOG_CONTEXT, + * then log function enter by any HGLOG_IN -macro, then possibly use HGLOG + * -macros for function logging and finally HGLOG_OUT -macros for returning + * from the function. + * + * @code + * TInt CGood::Example( TInt aSomething ) + * { + * // Create log context class, which is maintained for lifetime of the + * // method. + * HGLOG_CONTEXT( Example, HGLOG_LOCAL ); + * + * // Indicate we are entering the function. + * HGLOG_IN1( "aSomething contains value %d", aSomething ); + * + * // Your buggy code... + * + * // Before leaving, indicate function execution has ended. + * HGLOG_OUT(); + * + * return 0; + * } + * @/code + */ + +#include <e32def.h> +#include <e32std.h> + +#include "hglogutils.h" + +#define HGLOG_API 0 +#define HGLOG_LOCAL 1 + +#define HGLOG_INFO 0 +#define HGLOG_WARNING 1 +#define HGLOG_ERROR 2 + +#define HGLOG_ASSERT(_assertion) __HGLOG_ASSERT_DBG(_assertion) +#define HGLOG_TRACE_ASSERT(_assertion) __ASSERT_DEBUG((_assertion), User::Invariant() ) + +#ifdef _DEBUG + +/***************************************************************************** + LOGGING MACROS - LOGGING ON +*****************************************************************************/ + + /** + * Context initialization + * NOTE: HGLOG_STATIC_CONTEXT is meant for static methods. + * + * @param _fn Name of the function. + * @param _vis Visibility for the client, use values HGLOG_API or HGLOG_LOCAL + * @param _thdId For static functions, thread id can be given here. + */ + #define HGLOG_CONTEXT(_fn, _vis ) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, (TUint)this, RProcess().SecureId().iId ) + #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, _thdId, RProcess().SecureId().iId ) + + /** + * Entering function + * + * @param string Custom text. Example: HGLOG_IN0( "Yeah!!!" ); + * @param p1 - p5 For multiple variables in same string. + */ + #define HGLOG_IN() do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0) + #define HGLOG0_IN(string) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0) + #define HGLOG1_IN(string, p1) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_ENTRY(); } while(0) + #define HGLOG2_IN(string, p1, p2) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_ENTRY(); } while(0) + #define HGLOG3_IN(string, p1, p2, p3) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_ENTRY(); } while(0) + #define HGLOG4_IN(string, p1, p2, p3, p4) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_ENTRY(); } while(0) + #define HGLOG5_IN(string, p1, p2, p3, p4, p5) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_ENTRY(); } while(0) + + /** Leaving function */ + #define HGLOG_OUT() do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0) + #define HGLOG0_OUT(string) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0) + #define HGLOG1_OUT(string, p1) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_EXIT(); } while(0) + #define HGLOG2_OUT(string, p1, p2) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_EXIT(); } while(0) + #define HGLOG3_OUT(string, p1, p2, p3) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_EXIT(); } while(0) + #define HGLOG4_OUT(string, p1, p2, p3, p4) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_EXIT(); } while(0) + #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0) + + /** Leaving function with return value */ + #define HGLOG0_RET(val, fmtstr) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG1_RET(val, fmtstr, p1) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG2_RET(val, fmtstr, p1, p2) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG3_RET(val, fmtstr, p1, p2, p3) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0); return val;} while(0) + + /** + * General log lines + * + * @param level This can be used as internal information + * field, such as info, error, warning etc. + * @param string Custom string + * @param p1 - p5 For multiple variables in same string. + */ + #define HGLOG0(level, string) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); } while(0) + #define HGLOG1(level, string, p1) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); } while(0) + #define HGLOG2(level, string, p1, p2) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); } while(0) + #define HGLOG3(level, string, p1, p2, p3) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); } while(0) + #define HGLOG4(level, string, p1, p2, p3, p4) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); } while(0) + #define HGLOG5(level, string, p1, p2, p3, p4, p5) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); } while(0) + + /** Error logging */ + #define __HGLOG_ASSERT_DBG( _assertion ) do { if( _assertion ) { break; } TFileName file; file.Copy( _L8( __FILE__ ) ); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s Assert:%S:%d:" L ## #_assertion) , _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, &file, __LINE__ ); User::Invariant(); } while( 0 ) + #define __HGLOG_TRACE_ASSERT_DBG(_assertion, _textToPrint, _panicCode) do { if (_assertion) { break; } _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s ASSERTION FAILED!!! %s file: %s, line: %s"), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, _textToPrint, __FILE__, __LINE__); User::Panic(_L("AssertionFailed"), _panicCode} while(0) + #define HGLOG_TRAPHANDLER() _THgLogTrapHandler _traceTrapHandler; _traceTrapHandler.oldHandler = User::SetTrapHandler(&_traceTrapHandler) + +/***************************************************************************** + LOGGING MACROS - NO LOGGING +*****************************************************************************/ +#else // _DEBUG + + #define HGLOG_CONTEXT(_fn, _vis ) + #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) + + #define HGLOG_IN() + #define HGLOG0_IN(string) + #define HGLOG1_IN(string, p1) + #define HGLOG2_IN(string, p1, p2) + #define HGLOG3_IN(string, p1, p2, p3) + #define HGLOG4_IN(string, p1, p2, p3, p4) + #define HGLOG5_IN(string, p1, p2, p3, p4, p5) + + #define HGLOG_OUT() + #define HGLOG0_OUT(string) + #define HGLOG1_OUT(string, p1) + #define HGLOG2_OUT(string, p1, p2) + #define HGLOG3_OUT(string, p1, p2, p3) + #define HGLOG4_OUT(string, p1, p2, p3, p4) + #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) + + #define HGLOG0_RET(val, fmtstr) return val + #define HGLOG1_RET(val, fmtstr, p1) return val + #define HGLOG2_RET(val, fmtstr, p1, p2) return val + #define HGLOG3_RET(val, fmtstr, p1, p2, p3) return val + #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) return val + #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) return val + + #define HGLOG0(level, string) + #define HGLOG1(level, string, p1) + #define HGLOG2(level, string, p1, p2) + #define HGLOG3(level, string, p1, p2, p3) + #define HGLOG4(level, string, p1, p2, p3, p4) + #define HGLOG5(level, string, p1, p2, p3, p4, p5) + + #define BIND_TRACE_TRAPHANDLER() + #define TRACE_DECL() TInt _iTraceThreadId + #define TRACE_FAST_CREATE(_thdId) _thdId++; + #define TRACE_CREATE() + + #define __HGLOG_ASSERT_DBG(_assertion) + #define __TRACE_ASSERT_DBG(_assertion, _message, _panicCode ) + +#endif // _DEBUG + +#endif // HGLOGLOGUTILS_H + +// End of File diff -r 5315654608de -r 08c6ee43b396 taskswitcher/contextengine/trace/hglogutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/trace/hglogutils.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,212 @@ +/* +* ============================================================================== +* Name : hglogutils.h +* Part of : Teleport / Context Services +* Description : Logging behavior +* Version : %version: 3 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia. All rights are reserved. Copying, including +* reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia. +* ============================================================================== +*/ + +#ifndef HGLOGUTILS_H +#define HGLOGUTILS_H + +/** + * NOTE: This file contains the logic related to logging. Change only if you + * know what you're doing. + */ + + + + + + + + + + +#ifdef _DEBUG + +#include <e32debug.h> +#include <e32std.h> + +static const TUint HGLOGERR = 2; /**< Used to create an error message */ + +// These macros are real macros, that should be used. For temporary purposes, these +// are left out and the logging is done by simple entry logging +#define _HGLOG_UNCONTROLLED_INPUT_MSG L"%s%d[%x:%x:%x]>%s UNCONTROLLED ENTRY!" +#define _HGLOG_MULTIPLE_ENTRY_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL ENTRY!" +#define _HGLOG_UNCONTROLLER_EXIT_MSG L"%s%d[%x:%x:%x]<%s UNCONTROLLED EXIT!" +#define _HGLOG_MULTIPLE_EXIT_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL EXIT!" +#define _HGLOG_TRAP_HARNESS_ENTRY L"_D%d[%x:%x:%x]TraceFramework: Entering trap harness" +#define _HGLOG_TRAP_HARNESS_EXIT L"_D%d[%x:%x:%x]TraceFramework: Exiting trap harness" +#define _HGLOG_TRAP_HARNESS_LEAVE L"_D%d[%x:%x:%x]TraceFramework: ---------- LEAVE OCCURRED !!! ---------- " +#define _HGLOG_API_PREFIX L"_A" +#define _HGLOG_LOCAL_PREFIX L"_L" + +/** +* @file +* trace_utils.h contains definitions needed for advanced tracing features. +* Tracing can be customized using the following compile time flags: +* - <b>_DEBUG</b> +* - With this flag undefined, all traces are disabled +* - <b>__KERNEL_MODE__</b> +* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) +* - <b>DISABLE_SYNTAX_CHECK</b> +* - If this flag is defined, runtime syntax checking features are disabled from traces +*/ +#ifndef DISABLE_SYNTAX_CHECK + #define _MARK_ENTRY() _dc.inOk=ETrue + #define _DOINCHK() _dc.DoInChk() + #define _CHK_MULTIIN() _dc.ChkMultiIn() + #define _CHK_MULTIOUT() _dc.ChkMultiOut() + #define _MARK_EXIT() _dc.outOk=ETrue +#else + #define _MARK_ENTRY() + #define _DOINCHK() + #define _CHK_MULTIIN() + #define _CHK_MULTIOUT() + #define _MARK_EXIT() +#endif // DISABLE_SYNTAX_CHECK + +/** For tracing */ +#ifdef _HGLOG_RDEBUG + #define _IT(a) (TPtrC((const TText *)(a))) + #define _HGLOGPRINTER RDebug::Print + +/** For filedebug */ +#else // _HGLOG_RDEBUG + + /** Includes */ + #include <e32base.h> + #include <e32std.h> + #include <e32def.h> + #include <e32svr.h> + +// both of headers defines KLogBufferSize +#ifndef __COMMSDEBUGUTILITY_H__ + #include <flogger.h> +#endif + + #define _IT(a) KHgLogPath, KHgLogFile, EFileLoggingModeAppend, (TPtrC((const TText *)(a))) + #define _HGLOGPRINTER RFileLogger::WriteFormat +#endif // _HGLOG_RDEBUG + +class _THgLogContext + { + public: + _THgLogContext( + const TText* _fn, + const TUint _id, + const TUint _vis, + const TUint _addr, + const TUint _thdId, + const TUint _category=0 ) + : + iFn(_fn), + iId(_id), + iApi((TBool)_vis), + iAddr(_addr), + iThdId(_thdId), + iVis((_vis == 0 ? (TText*)_HGLOG_API_PREFIX : (TText*)_HGLOG_LOCAL_PREFIX)), + iCategory(_category) + #ifndef DISABLE_SYNTAX_CHECK + ,outOk(EFalse), inOk(EFalse) + #endif + { + } + ~_THgLogContext() + { + #ifndef DISABLE_SYNTAX_CHECK + do + { + DoInChk(); + if (!outOk) + { + _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLER_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } while (0); + #endif // DISABLE_SYNTAX_CHECK + } + + const TText* iFn; + const TUint iId; + const TText* iVis; + const TUint iAddr; + const TInt iThdId; + const TBool iApi; + const TUint iCategory; + + #ifndef DISABLE_SYNTAX_CHECK + inline void DoInChk() + { + if (!inOk) + { + _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLED_INPUT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + inOk = ETrue; + } + } + + inline void ChkMultiIn() + { + if (inOk) + { + _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_ENTRY_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + inline void ChkMultiOut() + { + if (outOk) + { + _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + TBool inOk; + TBool outOk; + #endif // DISABLE_SYNTAX_CHECK + }; + +class _THgLogTrapHandler: public TTrapHandler + { + public: + + _THgLogTrapHandler(_THgLogContext& _context) : _dc( _context ) + { + RThread me; + iThdId = (TInt)me.Id(); + } + void Trap() + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_ENTRY), 0, HGLOGERR, iThdId, this); + oldHandler->Trap(); + } + void UnTrap() + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_EXIT), 0, HGLOGERR, iThdId, this); + oldHandler->UnTrap(); + } + void Leave(TInt aValue) + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_LEAVE), 0, HGLOGERR, iThdId, this); + oldHandler->Leave(aValue); + } + TTrapHandler* oldHandler; + private: + _THgLogContext& _dc; + TInt iThdId; + }; + +#endif // _DEBUG + +#endif // HGLOGUTILS_H \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,21 @@ +/* +* ============================================================================ +* Name : bld.inf +* Part of : Huriganes / Teleport +* Description : Build info file for Teleport +* Version : %version: sa1spcx1#33 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#include "../contextengine/group/bld.inf" +#include "../teleportui/group/bld.inf" + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,33 @@ +/* +* ============================================================================ +* Name : bld.inf +* Part of : Huriganes / Teleport UI +* Description : Build info file +* Version : %version: sa1spcx1#51 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#include <platform_paths.hrh> + +PRJ_EXPORTS +// iby file +../rom/hgteleport.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hgteleport.iby) +../rom/hgteleportresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(hgteleportresources.iby) + +// stub sis +../sis/stubs/teleport_stub.sis /epoc32/data/z/system/install/teleport_stub.sis +../sis/stubs/teleport_stub.sis /epoc32/release/winscw/udeb/z/system/install/teleport_stub.sis + +#include "../hgteleportappecom/group/bld.inf" +#include "../hgteleportapp/group/bld.inf" + +PRJ_MMPFILES diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/data/hgteleport.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/data/hgteleport.rss Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,283 @@ +/* +* ============================================================================ +* Name : hgteleport.rss +* Part of : Hg Teleport +* Description : Resource files for teleport app +* Version : %version: sa1spcx1#27 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* +*/ + +NAME HGTL + +#include <eikon.rh> +#include <eikon.rsg> +#include <avkon.rh> +#include <avkon.rsg> +#include <appinfo.rh> + +#include <avkon.loc> +#include <taskswitcher.loc> + +#include "hgteleportcommands.hrh" + +// --------------------------------------------------------- +// +// Define the resource file signature +// This resource should be empty. +// +// --------------------------------------------------------- +// +RESOURCE RSS_SIGNATURE { } + +// --------------------------------------------------------- +// +// Default Document Name +// +// --------------------------------------------------------- +// +RESOURCE TBUF r_default_document_name { buf=""; } + +// --------------------------------------------------------- +// +// Define default menu and CBA key. +// +// --------------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + menubar = r_hgteleport_menubar; + cba = r_hgteleport_cba_nontouch; + } + +// --------------------------------------------------------- +// +// CBA for non-touch. +// +// --------------------------------------------------------- +// +RESOURCE CBA r_hgteleport_cba_nontouch + { + flags = 0; + buttons = + { + CBA_BUTTON {id=EAknSoftkeySelect; txt=text_softkey_select;}, // left softkey + CBA_BUTTON {id=EAknSoftkeyBack; txt=text_softkey_back;}, // right softkey + CBA_BUTTON {id=EAknSoftkeySelect; txt=text_softkey_select;} // middle softkey, same as lsk, label is not shown in touch + }; + } + +// --------------------------------------------------------- +// +// CBA for touch. +// +// --------------------------------------------------------- +// +RESOURCE CBA r_hgteleport_cba_touch + { + flags = 0; + buttons = + { + CBA_BUTTON {id=EAknSoftkeySelect; txt=text_softkey_empty;}, // left softkey, no label + CBA_BUTTON {id=EAknSoftkeyBack; txt=text_softkey_back;}, // right softkey + CBA_BUTTON {id=EAknSoftkeySelect; txt=text_softkey_select;} // middle softkey, same as lsk, label is not shown in touch + }; + } + + +// --------------------------------------------------------- +// +// r_hgteleport_menubar +// Menubar for hgteleport +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_hgteleport_menubar + { + titles = + { + MENU_TITLE {menu_pane = r_hgteleport_menu;} + }; + } + + +// --------------------------------------------------------- +// +// r_hgteleport_menu +// Menu for "Options" +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_hgteleport_menu + { + items = + { + MENU_ITEM { command = EHgTeleportCmdHelp; txt = qtn_options_help; }, + MENU_ITEM { command = EAknSoftkeyExit; txt = text_softkey_exit; } + }; + } + +// --------------------------------------------------------- +// +// r_hg_panel_teleport_name +// teleport panel name +// +// --------------------------------------------------------- +// +RESOURCE TBUF r_hg_panel_teleport_name + { + buf="Task Switcher"; + } + +// --------------------------------------------------------- +// +// r_hg_teleport_message_dialog_okcancel +// message dialog with ok and cancel softkeys labels +// +// --------------------------------------------------------- +// +RESOURCE DIALOG r_hg_teleport_message_dialog_okcancel + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items = + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + control = AVKON_HEADING + { + headinglayout = 0; + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY { }; + } + }; + } + +// --------------------------------------------------------- +// +// r_hg_teleport_message_dialog_yesno +// message dialog with yes and no softkeys labels +// +// --------------------------------------------------------- +// +RESOURCE DIALOG r_hg_teleport_message_dialog_yesno + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + control = AVKON_HEADING + { + headinglayout = 0; + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY { }; + } + }; + } + +// --------------------------------------------------------- +// +// r_hg_teleport_message_dialog_ok +// message dialog with ok softkey label +// +// --------------------------------------------------------- +// +RESOURCE DIALOG r_hg_teleport_message_dialog_ok + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + control = AVKON_HEADING + { + headinglayout = 0; + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY { }; + } + }; + } + +// --------------------------------------------------------- +// +// r_hg_teleport_fsw_confirm_close_query +// shown when Clear key is pressed in FSW +// +// --------------------------------------------------------- +// +RESOURCE DIALOG r_hg_teleport_fsw_confirm_close_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + }; + } + }; + } + + + +RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info + { + short_caption = "Task Switcher"; + caption_and_icon = + { + CAPTION_AND_ICON_INFO + { + caption="Task Switcher"; + } + }; + } + + +RESOURCE TBUF r_teleport_title { buf = "Task Switcher"; } + +RESOURCE TBUF r_teleport_fsw_activate { buf = qtn_task_switcher_popup_open_app; } +RESOURCE TBUF r_teleport_fsw_close { buf = qtn_task_switcher_popup_close_app; } +RESOURCE TBUF r_teleport_fsw_close_all { buf = qtn_task_switcher_popup_close_all; } +RESOURCE TBUF r_teleport_fsw_confirm_close { buf = qtn_memlo_confirm_close; } + +RESOURCE TBUF r_task_switcher_heading_applications { buf = qtn_task_switcher_heading_applications; } + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/data/hgteleport_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/data/hgteleport_reg.rss Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,31 @@ +/* +* ============================================================================ +* Name : hgteleport_reg.rss +* Part of : Hg Teleport +* Description : hgteleport application's registration resource file +* Version : %version: 3 % +* +* Copyright © 2008-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1.1 +*/ + +#include <appinfo.rh> +#include <hgteleport.rsg> + +UID2 KUidAppRegistrationResourceFile +UID3 0x20016BF0 + +RESOURCE APP_REGISTRATION_INFO + { + app_file="hgteleport"; + localisable_resource_file="\\resource\\apps\\hgteleport"; + localisable_resource_id = R_LOCALISABLE_APP_INFO; + } diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/group/backup_registration.xml Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,20 @@ +<?xml version="1.0" standalone="yes"?> +<backup_registration version="1.0"> + + <passive_backup> + <!-- backup all private data --> + <include_directory name = "\" /> + </passive_backup> + + <!-- backup executables and resources from SIS files --> + <system_backup /> + + <!-- backup cenrep data --> + <proxy_data_manager sid = "0x10202BE9" /> + + <!-- backup sqlite data --> + <proxy_data_manager sid = "0x10281E17" /> + + <restore requires_reboot = "no"/> + +</backup_registration> diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,31 @@ +/* +* ============================================================================ +* Name : bld.inf +* Part of : Hg Teleport +* Description : Build information file for hgteleport +* Version : %version: sa1spcx1#32 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* +*/ + +#include <platform_paths.hrh> + +PRJ_EXPORTS +../loc/taskswitcher.loc MW_LAYER_LOC_EXPORT_PATH(taskswitcher.loc) +backup_registration.xml /epoc32/data/z/private/20016BF0/backup_registration.xml +backup_registration.xml /epoc32/release/winscw/udeb/z/private/20016BF0/backup_registration.xml +../inc/hgteleportuid.hrh |../../inc/hgteleportuid.hrh + +PRJ_MMPFILES +hgteleportapp.mmp + +PRJ_TESTMMPFILES diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/group/hgteleportapp.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/group/hgteleportapp.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,106 @@ +/* +* ============================================================================ +* Name : hgteleportapp.mmp +* Part of : Hg Teleport +* Description : mmp file for teleport application +* Version : %version: sa1spcx1#24 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* +*/ + +#include <data_caging_paths.hrh> +#include <platform_paths.hrh> +#include "../inc/hgteleportuid.hrh" + +EPOCHEAPSIZE 0x100000 0xa00000 // 1 Mb - 10 Mb +EPOCSTACKSIZE 0x5000 // 20KB + +TARGET hgteleport.exe +TARGETTYPE exe +UID 0x100039CE KHgTeleportAppUidValue +CAPABILITY CAP_APPLICATION NetworkControl PowerMgmt +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE hgteleportappui.cpp +SOURCE hgteleportapplication.cpp +SOURCE hgteleportdocument.cpp +SOURCE hgteleport.cpp +SOURCE hgteleportappview.cpp +SOURCE hgteleportfastswaparea.cpp +SOURCE hgteleportfastswapgrid.cpp +SOURCE hgteleportdevicestate.cpp +SOURCE hgteleporteventcontroler.cpp +SOURCE hgteleportphysicsengine.cpp +SOURCE hgteleportphysics.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../trace +USERINCLUDE ../../../contextengine/inc + +APP_LAYER_SYSTEMINCLUDE + + + +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY avkon.lib +LIBRARY apgrfx.lib +LIBRARY ws32.lib +LIBRARY aknskins.lib +LIBRARY egul.lib +LIBRARY eikcoctl.lib +LIBRARY fbscli.lib +LIBRARY aknskinsrv.lib +LIBRARY commonengine.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY aknnotify.lib +LIBRARY hlplch.lib +LIBRARY aknicon.lib +LIBRARY bitgdi.lib +LIBRARY gdi.lib +LIBRARY cdlengine.lib +LIBRARY aknlayout2.lib +LIBRARY aknlayout2scalable.lib +LIBRARY oommonitor.lib +LIBRARY hal.lib +LIBRARY gfxtrans.lib +LIBRARY akntransitionutils.lib +LIBRARY bafl.lib +LIBRARY akntouchgesturefw.lib +LIBRARY aknphysics.lib +LIBRARY touchfeedback.lib + + +DEBUGLIBRARY flogger.lib + + +LIBRARY hgcontextservicesutils.lib +LIBRARY hgfswclient.lib +LIBRARY hgfswutils.lib + +SOURCEPATH ../data +START RESOURCE hgteleport.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END + +SOURCEPATH ../data +START RESOURCE hgteleport_reg.rss +DEPENDS hgteleport.rsg +TARGETPATH /private/10003a3f/apps +END diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportapplication.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,49 @@ +/* + * ============================================================================ + * Name : hgteleportapplication.h + * Part of : Hg Teleport + * Description : Application class + * Version : %version: 4 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * Template version: 4.2 + */ + +#ifndef HGTELEPORTAPPLICATION_H +#define HGTELEPORTAPPLICATION_H + +#include <e32base.h> +#include <aknapp.h> + +class CHgTeleportApplication : public CAknApplication + { +public: + // from CAknApplication + /** + * Returns the application DLL UID value + * + * @since S60 v5.0 + * @return the UID of this Application/Dll + */ + TUid AppDllUid( ) const; + +protected: + // from CAknApplication + /** + * Create a CApaDocument object and return a pointer to it + * + * @since S60 v5.0 + * a pointer to the created document + */ + CApaDocument* CreateDocumentL( ); + }; + +#endif // HGTELEPORTAPPLICATION_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportapplogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportapplogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,27 @@ +/* +* ============================================================================ +* Name : hgteleportapplogging.h +* Part of : Classic UI / Teleport +* Description : Defines logs for hgteleportapp +* Version : %version: 1 % +* +* Copyright (c) 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1.1 +*/ + +#ifdef _DEBUG +#include "../inc/hgteleportuid.hrh" +_LIT( KHgLogFile, "hgteleportapp.txt" ); +_LIT( KHgLogPath, "teleport" ); +#define _HGLOG_LOG_COMPONENT_ID KHgTeleportAppUidValue + +#endif +#include "hglogging.h" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportappui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportappui.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,165 @@ +/* + * ============================================================================ + * Name : hgteleportappui.h + * Part of : Hg Teleport + * Description : appui + * Version : %version: sa1spcx1#26 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTAPPUI_H +#define HGTELEPORTAPPUI_H + +#include <e32base.h> +#include <aknappui.h> + +#include <gfxtranseffect/gfxtranseffect.h> +#include <akntransitionutils.h> + +#include "hgproplistener.h" +#include "hgcenreplistener.h" + +// FORWARD DECLARATIONS +class CHgTeleportAppView; +class CHgActionUtility; +class CHgTeleportDeviceState; + +/** + * CHgTeleportAppUi + * Appui for hg teleport app + */ +class CHgTeleportAppUi : public CAknAppUi, + public MHgPropertyChangeObserver, + public MHgCenrepChangeObserver, + public MGfxTransEffectObserver + { + +public: + /** + * Perform the second phase construction of a CHgTeleportAppUi object + * this needs to be public due to the way the framework constructs the AppUi + */ + void ConstructL(); + + /** + * Perform the first phase of two phase construction. + * This needs to be public due to the way the framework constructs the AppUi + */ + CHgTeleportAppUi(); + + /** + * Destroy the object and release all memory objects + */ + ~CHgTeleportAppUi(); + +public: //effects + /** + * @return value of theme effects enabled flag + */ + TBool EffectsEnabled() const; + + /** + * Function start transition + */ + void StartTransion( TUint aTransitionType ); + + /** + * from MGfxTransEffectObserver + */ + void TransitionFinished(const CCoeControl* aControl, TUint aAction); + + void MoveAppToForeground( TUint aTransitionType ); + void MoveAppToBackground( TUint aTransitionType ); + +public: + /** + * From MHgCenrepChangeObserver + */ + void CenrepChanged( TUint32 aKey, TInt aNewValue ); + + +private: + + // From MHgPropertyChangeObserver + void PropertyChanged( TUid aCategory, TUint aKey ); + + // From CEikAppUi + void HandleResourceChangeL( TInt aType ); + void HandleForegroundEventL( TBool aForeground ); + void HandleCommandL( TInt aCommand ); + + void StartTransition( TUint aTranstionId, + TBool aVisibility, + TBool aLayers, + TUint aSubCom ); + +private: // New functions + + /** + * Called from HandleForegroundEventL if the app came to foreground. + */ + void HandleSwitchToForegroundEvent(); + + /** + * Called from HandleForegroundEventL if the app went to background. + */ + void HandleSwitchToBackgroundEvent(); + + /** + * Sets P&S property which is used to monitor and set Teleport to + * background/foreground and short/long app key press. + * + * @param aValue Property value. + */ + void SetTeleportStateProperty( TInt aValue ); + + /** + * Sends request for close some + * other apps to free memory for + * teleport app + */ + void FreeMemoryRequest(); + + static TInt GoToBackgroundTimerCallback( TAny* aParam ); + +private: + + // Teleport application view, owned + CHgTeleportAppView* iAppView; + + // Listener for app key long press P&S, owned + CHgPropertyListener* iPropListener; + + // Tells if Teleport is in foreground or in background + TBool iForeground; + + // Application arch task which refers to our own app + TApaTask iApplicationTask; + + // Device state + CHgTeleportDeviceState* iDeviceState; + + // Buffer to keeping some memory allocation while being in background. + TUint8* iMemAllocBuf; + + CPeriodic* iGoToBackgroundTimer; + + TBool iEffectsEnabled; + + /** + * Cenrep listener for the tfxserver enabled/disabled key. + */ + CHgCenrepListener* iThemeEffectsEnabledWatcher; + }; + +#endif // HGTELEPORTAPPUI_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportappview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportappview.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,250 @@ +/* + * ============================================================================ + * Name : hgteleportappview.h + * Part of : Hg Teleport + * Description : appui + * Version : %version: sa1spcx1#32 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTAPPVIEW_H +#define HGTELEPORTAPPVIEW_H + +#include <e32base.h> +#include <coecntrl.h> +#include <AknPopupFader.h> +#include "hgteleportdevicestate.h" +#include "hgteleportdatachangeobserver.h" +#include "hgteleporteventcontrolerobserver.h" + +// FORWARD DECLARATIONS +class CAknsFrameBackgroundControlContext; +class CHgTeleportFastSwapArea; +class CHgTeleportDialog; +class CAknPopupHeadingPane; +class CHgTeleportEventControler; + +/** + * Teleport applicatio view class. + */ +class CHgTeleportAppView : public CCoeControl, public MCoeControlObserver, + public MHgDeviceStateObserver, + public MAknFadedComponent, + public MHgTeleportDataChangeObserver, + public MHgTeleportEventControlerObserver + { +public: + + /** + * Two-phase constructor. + * + * @param aRect Area where view should draw itself. + */ + static CHgTeleportAppView* NewL(const TRect& aRect, + CHgTeleportDeviceState& aDeviceState); + + /** + * @copydoc NewL + */ + static CHgTeleportAppView* NewLC(const TRect& aRect, + CHgTeleportDeviceState& aDeviceState); + + /** + * Destructor. + */ + ~CHgTeleportAppView(); + + /** + * Called from appui if the app came to foreground. + */ + void HandleSwitchToForegroundEvent(); + + /** + * Called from appui if the app went to background. + */ + void HandleSwitchToBackgroundEvent(); + + /** + * From CCoeControl Method handling the pointer events while the fsw is used. + * + * @param aPointerEvent Information about the event. + */ + void HandlePointerEventL( const TPointerEvent &aPointerEvent ); + +public: + // from CCoeControl + void Draw( const TRect& aRect ) const; + TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + TInt CountComponentControls() const; + CCoeControl* ComponentControl(TInt aIndex) const; + void SizeChanged(); + + //Own + /* + * Forward app key handling to fasswaparea control. + */ + void HandleAppKey(TInt aType); + +protected: + // from MCoeControlObserver + void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); + + // from MHgDeviceStateObserver + void HandleDeviceStateChanged( TChangeType aChangeType ); + +protected: // from MAknFadedComponent + TInt CountFadedComponents(); + CCoeControl* FadedComponent( TInt aIndex ); + +protected: // from MHgCenrepChangeObserver + void CenrepChanged( TUint32 aKey, TInt aNewValue ); + +protected: // from MHgTeleportDataChangeObserver + void DataChanged( CCoeControl* aWhere, TInt aNewCount ); + +private: + + /** + * @copydoc NewL + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ constructor. + */ + CHgTeleportAppView( CHgTeleportDeviceState& aDeviceState ); + + /** + * Updates the internal state for currently focused control. + * @param aNewFocusedControl ptr to new focused control, ownership not taken + */ + void ChangeFocus( CCoeControl* aNewFocusedControl ); + + /** + * Creates components. + */ + void CreateControlsL(); + + /** + * Appends component rects to the given array. + * @param aRects array + */ + void GetRects( RArray<TRect>& aRects ); + + /** + * Adds the ptr to the list of dialog pointers. + * @param aDlg dialog ptr, ownership not taken + */ + void AddDlgSelfPtrL( CHgTeleportDialog* aDlg ); + + /** + * Handles key event according to the portrait-style (vertical) layout. + */ + TKeyResponse OfferKeyEventPortraitStyleL( const TKeyEvent& aKeyEvent, TEventCode aType); + + /** + * Calculates and returns the following: + * - the rectangle for main_tport_pane + * - the outer rectangle for the frame + * - the inner rectangle for the frame + */ + void UpdatePopupRects( ); + + /** + * Updates the text in the applications and suggestions heading panes. + */ + void UpdateHeadingsL(); + + /** + * Disables transition animations for teleport app. + * (the automatic effects that are applied when coming/leaving foreground) + */ + void DisableAppSwitchEffects(); + + +public://From MHgTeleportEventControlerObserver + /** + * Declare drag gesture handling. + * @param aOffset - drag distance + */ + virtual void MoveOffset(const TPoint& aOffset); + + /** + * Declare tap gesture handling. + * @param aPoint - tap position + */ + virtual void TapL(const TPoint& aPoint); + + /** + * Declare long tap gesture handling. + * @param aPoint - tap position + */ + virtual void LongTapL(const TPoint& aPoint); + + /** + * + */ + virtual void Drag( + const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); + + /** + * Declare animation stop handling + */ + virtual void Stop(); + + /** + * Declare getter for view position + */ + virtual TPoint ViewPos() const; + +private: // Data + + // Ref to container for commonly used instances + CHgTeleportDeviceState& iDeviceState; + + // Background context, owned + CAknsFrameBackgroundControlContext* iBgContext; + + // Fast Swap area, owned + CHgTeleportFastSwapArea* iFastSwapArea; + + /** + * Heading pane, own + */ + CAknPopupHeadingPane* iAppsHeading; + + /** + * Currently focused control, not own + */ + CCoeControl* iFocused; + + /** + * Rectangle of the control. + */ + TRect iViewRect; + + /** + * Popup fader instance. + */ + TAknPopupFader iPopupFader; + + /** + * Pointer for background image, owned + */ + TRect iBgContextOuterRect; + TRect iBgContextInnerRect; + CHgTeleportEventControler* iEvtHandler; //own + }; + +#endif // HGTELEPORTAPPVIEW_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportcommands.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportcommands.hrh Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,29 @@ +/* +* ============================================================================== +* Name : hgteleportcommands.hrh +* Part of : Teleport +* Description : command ids +* Version : %version: 1 % +* +* Copyright (c) 2007 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 __TELEPORTCOMMANDS_HRH__ +#define __TELEPORTCOMMANDS_HRH__ + +enum + { + EHgTeleportCmdBase = 20000, + EHgTeleportCmdHelp + }; + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportdatachangeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportdatachangeobserver.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,36 @@ +/* + * ============================================================================ + * Name : hgteleportdatachangeinterface.h + * Part of : Hg Teleport engine + * Description : + * Version : %version: 1 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTDATACHANGEINTERFACE_H +#define HGTELEPORTDATACHANGEINTERFACE_H + +#include <e32base.h> + +class CCoeControl; + +/** + * Callback mixin class to move the whole app to background or foreground. + */ +class MHgTeleportDataChangeObserver + { +public: + virtual void DataChanged( CCoeControl* aWhere, TInt aNewCount ) = 0; + }; + +#endif // HGTELEPORTDATACHANGEINTERFACE_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportdevicestate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportdevicestate.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,228 @@ +/* + * ============================================================================ + * Name : hgteleportdevicestate.h + * Part of : Hg Teleport + * Description : Device state (touch mode, screen orientation) handler + * Version : %version: sa1spcx1#11 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * Template version: 4.2 + */ + +#ifndef HGTELEPORTDEVICESTATE_H_ +#define HGTELEPORTDEVICESTATE_H_ + +#include <e32base.h> +#include "hgteleportappui.h" +#include "hgproplistener.h" + +/** + * Interface for getting notifications about screen orientation + * and/or touch state etc. changes. + */ +class MHgDeviceStateObserver + { +public: + /** + * Type of change. + */ + enum TChangeType + { + // screen orientation (portrait <=> landscape) has changed + EOrientation = 0x01, + // touch enabled/disabled status has changed + ETouchState = 0x02, + // skin has changed + ESkin = 0x04, + // input device mode change + EDeviceType = 0x08, + // all of the above + EAny = 0xFF + }; + + /** + * Called when a change, to which the observer is registered, + * has happened. + */ + virtual void HandleDeviceStateChanged( TChangeType aChangeType ) = 0; + }; + +/** + * Class for keeping track of screen orientation and touch enabled/disabled changes. + */ +class CHgTeleportDeviceState : + public CBase, + public MHgPropertyChangeObserver + { +public: + /** + * Enumeration for TouchState(). + */ + enum TTouchState + { + ETouchEnabled, + ETouchDisabled + }; + + /** + * Enumeration for Orientation(). + */ + enum TOrientation + { + EPortrait, + ELandscape + }; + + /** + * Enumeration for DeviceType(). + */ + enum TDeviceType + { + EHybrid = 0, + EFullTouch = 1 + }; + + /** + * Creates a new instance. + */ + static CHgTeleportDeviceState* NewL(); + + /** + * Destructor. + */ + ~CHgTeleportDeviceState(); + + /** + * Returns the current state of touch awareness. + */ + TTouchState TouchState() const; + + /** + * Returns the current screen orientation. + */ + TOrientation Orientation() const; + + /** + * Returns the current device input type. + */ + TDeviceType DeviceType() const; + + /** + * Registers an observer. + * @param aObserver ref to observer + * (same observer can be added several times with different mask if needed) + * @param aMask bitmask composed from TChangeType values + * (when to notify the observer) + */ + void AddObserverL( MHgDeviceStateObserver& aObserver, TInt aMask ); + + /** + * Deregisters the given observer. + * @param aObserver ref to observer + */ + void RemoveObserver( MHgDeviceStateObserver& aObserver ); + + /** + * Called from appui. + */ + void HandleResourceChange( TInt aType ); + + //From MHgPropertyChangeObserver +public: + /** + * Observer interface for getting notifications about a P&S property change. + */ + virtual void PropertyChanged( TUid aCategory, TUint aKey ); +private: + /** + * Constructor. + */ + CHgTeleportDeviceState(); + + /** + * Performs 2nd phase construction. + */ + void ConstructL(); + + /** + * Checks if touch is enabled or not and performs + * appropriate actions. + */ + void CheckTouchState(); + + /** + * Checks the screen orientation and performs + * appropriate actions. + */ + void CheckOrientation(); + + /** + * Checks the device input type. + */ + void CheckDeviceType(); + + /** + * Notifies all observers that are registered for the given type. + */ + void NotifyObservers( MHgDeviceStateObserver::TChangeType aType ); + + class SObserver; + + /** + * Identity function to perform comparison between observer array items. + */ + static TBool ObserverIdentity( const SObserver& aA, const SObserver& aB ); + +private: + /** + * Current touch enabled/disabled state. + */ + TTouchState iTouchState; + + /** + * Current screen orientation. + */ + TOrientation iOrientation; + + /** + * Current the device input type. + */ + TDeviceType iDeviceType; + + /** + * Observer array entry struct. + */ + struct SObserver + { + TInt iMask; + MHgDeviceStateObserver* iObserver; // not owned + SObserver( TInt aMask, MHgDeviceStateObserver* aObserver ) + : iMask( aMask ), iObserver( aObserver ) { } + }; + + /** + * Observer array. + */ + RArray<SObserver> iObservers; + + /** + * Counter to indicate that we have not yet returned + * from a previous HandleResourceChange. + */ + TInt iResChangeActiveCount; + + /** + * Flip status change observer. + */ + CHgPropertyListener* iFlipStatusObserver; + }; + +#endif // HGTELEPORTDEVICESTATE_H_ diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportdocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportdocument.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,91 @@ +/* + * ============================================================================ + * Name : hgteleportdocument.h + * Part of : Hg Teleport + * Description : Document class + * Version : %version: sa1spcx1#6 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTDOCUMENT_H +#define HGTELEPORTDOCUMENT_H + +#include <e32base.h> +#include <AknDoc.h> + +class CHgTeleportDocument : public CAknDocument + { +public: + /** + * Construct a CHgTeleportDocument for the AVKON application aApp + * using two phase construction, and return a pointer to the created object + * aApp application creating this document + * + * @since S60 v5.0 + * @return a pointer to the created instance of CHgTeleportDocument + */ + static CHgTeleportDocument* NewL( CEikApplication& aApp ); + + /** + * Construct a CHgTeleportDocument for the AVKON application aApp + * using two phase construction, and return a pointer to the created object + * + * @since S60 v5.0 + * @param aApp application creating this document + * @return a pointer to the created instance of CHgTeleportDocument + */ + static CHgTeleportDocument* NewLC( CEikApplication& aApp ); + + /** + * Destroy the object and release all memory objects + * + * @since S60 v5.0 + */ + ~CHgTeleportDocument( ); + + /** + * Makes Startup-application hidden in menu shell and fastswap window + * + * @since S60 v5.0 + * @param aWgName application windows group name + */ + void UpdateTaskNameL( CApaWindowGroupName* aWgName ); + +public: + // from CAknDocument + /** + * Create a ChgteleportAppUi object and return a pointer to it + * + * @since S60 v5.0 + * @return a pointer to the created instance of the AppUi created + */ + CEikAppUi* CreateAppUiL( ); + +private: + /** + * Perform the second phase construction of a CHgTeleportDocument object + * + * @since S60 v5.0 + */ + void ConstructL( ); + + /** + * Perform the first phase of two phase construction + * + * @since S60 v5.0 + * @param aApp application creating this document + */ + CHgTeleportDocument( CEikApplication& aApp ); + }; + +#endif // HGTELEPORTDOCUMENT_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleporteventcontroler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleporteventcontroler.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,177 @@ +/* + * ============================================================================ + * Name : hgteleporteventcontroler.h + * Part of : Hg Teleport + * Description : Gesture and physics helper declaration + * Version : %version: 3 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTEVENTCONTROLER_H +#define HGTELEPORTEVENTCONTROLER_H + +#include "hgteleporteventcontrolerobserver.h" +#include <akntouchgesturefw.h> +#include <aknphysicsobserveriface.h> + +class CHgTeleportPhysicsEngine; +using namespace AknTouchGestureFw; +/** + * CHgTeleportEventControler + * Input events handler. Class analyse pointer events and translate it to gesture. Procerss animations physics + */ +NONSHARABLE_CLASS(CHgTeleportEventControler): + public CBase, + public MAknTouchGestureFwObserver, + public MAknPhysicsObserver + { +public: + /** + * Two phase constructor. Instance is pushed on cleanup stack. + * @param aObs - reference to controler observer + * @param aEventSrc - reference to control which provide pointer events + * @return address of controler instance + */ + static CHgTeleportEventControler* NewLC(MHgTeleportEventControlerObserver& aObs, + CCoeControl& aEventSrc); + + /** + * Two phase constructor. + * @param aObs - reference to control observer + * @param aEventSrc - reference to control which provide pointer events + * @return address of controler instance + */ + static CHgTeleportEventControler* NewL(MHgTeleportEventControlerObserver& aObs, + CCoeControl& aEventSrc); + + /** + * Destructor + */ + ~CHgTeleportEventControler(); + +private: + /** + * First phase construction + */ + CHgTeleportEventControler(MHgTeleportEventControlerObserver& aObserver); + + /** + * Second phase construction + * @param aEventSrc - control that provides pointer ivents to handler + */ + void ConstructL(CCoeControl& aEventSrc); + + /** + * Implements gesture handling + * @param aEvent - gesture event + * @see MAknTouchGestureFwObserver + */ + void HandleTouchGestureL(MAknTouchGestureFwEvent& aEvent); + + /** + * Implements tap gesture handling ( short tap, double tap, long tap ) + * @param aEvent - tap event + */ + void HandleTapEventL(MAknTouchGestureFwTapEvent& aEvent); + + /** + * Implements drag gesture handling + * @param aEvent - drag event + */ + void HandleDragEventL(MAknTouchGestureFwDragEvent& aEvent); + + /** + * Implements flick gesture handling + * @param aEvent - drag event + */ + void HandleFlickEventL(MAknTouchGestureFwFlickEvent& aEvent); + + //From MAknPhysicsObserver +public: + /** + * Physics emulation has moved the view. + * + * When this method is called client should update its visual and logical + * states to reflect the changes caused by view move. Note that if the + * parameter @c aDrawNow is @c EFalse client is not allowed to redraw the + * display but should only update its logical state. + * Physics engine will ensure that the last frame is always drawn. + * + * @since S60 v5.0 + * + * @param aNewPosition The new position of the view. + * @param aDrawNow @c ETrue if client should redraw the screen, + * otherwise @c EFalse. + * @param aFlags Additional flags, not used currently. + */ + virtual void ViewPositionChanged( const TPoint& aNewPosition, + TBool aDrawNow, + TUint aFlags ); + + /** + * Physics emulation has stopped moving the view + * + * @since S60 v5.0 + */ + virtual void PhysicEmulationEnded(); + + /** + * Returns the observer's view position. + * + * @since S60 v5.0 + * + * @return Physics observer's view position. + */ + virtual TPoint ViewPosition() const; + +public: + + /** + * Initialize animation between current position and destination point + * @param aPoint - destination point + */ + void Animate(const TPoint& aPoint); + + /** + * + * @param aWorldSize Physics world size. + * @param aViewSize Physics (visible) view size. + * @param aLandscape ETrue if physics should work in landscape. + **/ + void ReInitPhysicsL(const TSize& aWorldSize, + const TSize& aViewSize, + TBool aLandscape); + + /** + * Stops currently ongoing animation + */ + void StopAnimation(); + +private: + /** + * Controler observer. Not own + */ + MHgTeleportEventControlerObserver& iObserver; + + /** + * Gesture recognition helper. Own + */ + CAknTouchGestureFw* iGestureHelper; + + /** + * Physics helper. Own + */ + CHgTeleportPhysicsEngine* iPhysicsHelper; + }; + +#endif // HGTELEPORTEVENTCONTROLER_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleporteventcontrolerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleporteventcontrolerobserver.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,68 @@ +/* + * ============================================================================ + * Name : hgteleportgestureobserver.h + * Part of : Hg Teleport + * Description : Define gesture observer interface + * Version : %version: 3 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTGESTUREOBSERVER_H +#define HGTELEPORTGESTUREOBSERVER_H + +#include <e32base.h> +#include <akntouchgesturefw.h> + +/** + * MHgTeleportGestureObserver + * Define gesture observer interface + */ +NONSHARABLE_CLASS(MHgTeleportEventControlerObserver) + { +public: + /** + * Declare drag gesture handling. + * @param aOffset - drag distance + */ + virtual void MoveOffset(const TPoint& aOffset)=0; + + /** + * Declare tap gesture handling. + * @param aPoint - tap position + */ + virtual void TapL(const TPoint& aPoint)=0; + + /** + * Declare long tap gesture handling. + * @param aPoint - tap position + */ + virtual void LongTapL(const TPoint& aPoint)=0; + + /** + * Declare drag gesture handling. + * @param aEvent - drag event + */ + virtual void Drag(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent) =0; + + /** + * Declare animation stop handling + */ + virtual void Stop()=0; + + /** + * Declare getter for view position + */ + virtual TPoint ViewPos() const =0; + }; + +#endif // HGTELEPORTGESTUREOBSERVER_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportfastswaparea.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportfastswaparea.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,459 @@ +/* + * ============================================================================ + * Name : hgteleportfastswaparea.h + * Part of : Hg Teleport + * Description : Teleport Fast Swap area UI + * Version : %version: sa1spcx1#45 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +//macro TASKSWITCHER_USE_CUSTOM_LAYOUT +#if !defined ( TASKSWITCHER_USE_CUSTOM_LAYOUT ) + //#define TASKSWITCHER_USE_CUSTOM_LAYOUT 1 +#endif + + +#ifndef HGTELEPORTFASTSWAPAREA_H +#define HGTELEPORTFASTSWAPAREA_H + +#include <e32base.h> +#include <eikmobs.h> +#include "hgteleportdevicestate.h" +#include "hgfswclientobserver.h" +#include "hgteleportfastswapgrid.h" +#include "hgteleporteventcontrolerobserver.h" + + +// FORWARD DECLARATIONS +class CHgFswClient; +class CHgFswEntry; +class CAknStylusPopUpMenu; +class CAknQueryDialog; +class CHgTeleportEventControler; +class MHgTeleportDataChangeObserver; + +#ifdef TASKSWITCHER_USE_CUSTOM_LAYOUT +const TInt KFswItemHeight = 250; +const TInt KFswItemWidth = 240; +const TInt KFswImageSize = 200; +const TInt KFswTextHeight = 20; +const TInt KFswBorderSize = 10; +const TInt KFswHeadingHeight = 50; +#endif + +/** + * Teleport Fast Swap area UI. + */ +class CHgTeleportFastSwapArea: public CCoeControl, + public MEikMenuObserver, + public MHgFswObserver, + public MEikListBoxObserver, + public MHgTeleportFastSwapGridObserver, + private MHgTeleportEventControlerObserver, + public MHgDeviceStateObserver, + public MHgTeleportFastSwapTimerObserver + { +public: + /** + * Two-phase constructor. + * + * @param aRect Area where fast swap info & list should draw itself. + * @param aParent Parent CoeControl. + */ + static CHgTeleportFastSwapArea* NewL( const TRect& aRect, + CCoeControl& aParent, CHgTeleportDeviceState& aDeviceState, + CHgTeleportEventControler& aEventHandler); + + /** + * @copydoc NewL + */ + static CHgTeleportFastSwapArea* NewLC( const TRect& aRect, + CCoeControl& aParent, CHgTeleportDeviceState& aDeviceState, + CHgTeleportEventControler& aEventHandler); + + /** + * Destructor. + */ + ~CHgTeleportFastSwapArea(); + + /** + * Called from appview when coming to foreground. + */ + void HandleSwitchToForegroundEvent(); + + /** + * Called from appview when going to background. + */ + void HandleSwitchToBackgroundEvent(); + + /** + * Called after construction to set up additional properties, + * like the control observer. + */ + void Setup( MCoeControlObserver& aControlObserver ); + + /** + * Saves the index of the currently selected (highlighted) item. + */ + void SaveSelectedIndex(); + + /** + * Restores the selection (highlight) position. + */ + void RestoreSelectedIndex(); + + // Functions to perform activate, close, close others operations. + // They are public so same functionality can be implemented in the + // Options menu (appui) for example. + + /** + * Index of highlighted item or KErrNotFound. + */ + TInt SelectedIndex() const; + + /** + * Brings the app corresponding to the item at given index into foreground. + */ + void SwitchToApp( TInt aIndex ); + + /** + * Sends close msg to given app. + * @param aIndex index + * @param aSuppressRendering content is not refreshed if ETrue + */ + void TryCloseAppL( TInt aIndex, TBool aSuppressRendering = EFalse ); + + /** + * Sends close msg to given app if user confirms the query. + */ + void TryCloseAppWithQueryL( TInt aIndex ); + + /** + * Tries to Close all applications that cn be closed + */ + void TryCloseAllL(); + + /** + * True if it is allowed to ask the given app to close. + * @param aIndex index + */ + TBool CanClose( TInt aIndex ) const; + + /** + * @param aSelectedItem item for which pop up is shown + * + * @return ETrue, when number of closable apps is >= 2 or there is at least + * one closable item and non closable item is selected. + * @return EFalse, when number of closable apps is < 2. + */ + TBool CanCloseAll( TInt aSelectedItem ) const; + + /** + * Returns the number of items in the list. + */ + TInt Count() const; + + /** + * Returns the underlying Ganes control pointer. + */ + CCoeControl* GetChildControl() { return iGrid; } + + /** + * Sets the data-changed observer. + */ + void SetDataChangeObserver( MHgTeleportDataChangeObserver* aDcObserver ); + + /* + * Handling short/long app key. + */ + void HandleAppKey(TInt aType); + +private: + + /** + * @copydoc NewL + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ constructor. + */ + CHgTeleportFastSwapArea(CCoeControl& aParent, + CHgTeleportDeviceState& aDeviceState, + CHgTeleportEventControler& aEventHandler); + + // From MEikListBoxObserver + void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); + +public: + /** + * Implements drag gesture handling + * @see MHgTeleportEventControlerObserver + */ + void MoveOffset(const TPoint&); + + /** + * Implements tap gesture handling + * @see MHgTeleportEventControlerObserver + */ + void TapL(const TPoint&); + + /** + * Implements long tap gesture handling + * @see MHgTeleportEventControlerObserver + */ + void LongTapL(const TPoint&); + + /** + * Implements drag gesture handling + * @see MHgTeleportEventControlerObserver + */ + void Drag(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); + + /** + * Implements animation stop handling + * @see MHgTeleportEventControlerObserver + */ + void Stop(); + + /** + * Implements view position getter. Returns point in the middle of the + * grid view window. + * + * @see MHgTeleportEventControlerObserver + */ + TPoint ViewPos()const; + +public: + // from CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl(TInt aIndex) const; + void FocusChanged( TDrawNow aDrawNow ); + void SizeChanged(); + void Draw( const TRect& aRect ) const; + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + +private: + // From MHgFswObserver + void HandleFswContentChanged(); + + // From MEikMenuObserver + void ProcessCommandL( TInt aCommandId ); + void SetEmphasis( CCoeControl*, TBool ) { } + + // From MHgTeleportFastSwapGridObserver + void HandleCloseEventL(TInt aItemIdx); + + // From MHgDeviceStateObserver + void HandleDeviceStateChanged( TChangeType aChangeType ); + + // From MHgTeleportFastSwapTimerObserver + void TimerCompletedL( CHgTeleportFastSwapTimer* aSource ); + +// new functions + + /** + * Makes a copy of the given bitmap. + * Also scaled to the given size, but maintains aspect ratio, + * so the size of the returned bitmap may be less then aSize. + */ + CFbsBitmap* CopyBitmapL( TInt aFbsHandle, TSize aSize ); + + /** + * Called from HandleFswContentChanged. + */ + void HandleFswContentChangedL(); + + /** + * Shows the content from iArray on the screen. + */ + void RenderContentL(); + + /** + * Creates the ganes grid control. + */ + void ReCreateGridL(); + + /** + * Returns rectangles for fast swap area controls + */ + void GetFastSwapAreaRects( RArray<TAknLayoutRect>& aRects ); + + /** + * Creates a stylus popup instance (iPopup) if not yet done. + */ + void PreCreatePopupL(); + + /** + * Shows the stylus popup menu if not yet visible. + * @param aIndex index of item in the grid + * @param aPoint position for the popup + */ + TBool ShowPopupL( TInt aIndex, const TPoint& aPoint ); + + /** + * Shows the app close confirmation query. + * @param aIndex index of item in the grid + * @return ETrue if accepted EFalse if canceled + */ + TBool ConfirmCloseL( TInt aIndex ); + + /** + * Sends the data-changed notification. + */ + void NotifyChange(); + + /** + * Chage application order. + * move Homescreen to first left position. + */ + void SwapApplicationOrder( RPointerArray<CHgFswEntry>& aArray ); + + /** + * Retrieves and returns size for image graphics. + */ + TSize PreferredImageSize(); + + /** + * Retrieves number of items in grid + */ + TInt GridItemCount(); + + /** + * Calculates the correct size if aspect ratio needs to be preserved. + */ + TSize CalculateSizePreserveRatio(const TSize& aTargetAreaSize, + const TSize& aSourceSize); + + /** + * Selects next item in grid + */ + void SelectNextItem(); + + /** + * Highlight current grid'd item and redraw + */ + void ShowHighlight(); + + /** + * Centralise most centered item so it was most exposed on the view. + * Centered element is being selected by grid. + * Animation to the centered element is made after aRedrawDelay time. + * + * @param aRedrawDelay - animation delay. + */ + void CenterItem( TInt aRedrawDelay); + + /** + * Returns full grid view size. + */ + TSize GridWorldSize(); + + /** + * Updates grid, called for manual grid scroll update + * + * @param aForceRedraw if set to ETrue - redraw will be forced + * @param aAnimate set to ETrue to enable animation + */ + void UpdateGrid( TBool aForceRedraw = EFalse, + TBool aAnimate = ETrue ); + + /** + * Returns grid view size + */ + TSize ViewSize(); + + /** + * Returns the position of the given item inside grid world rect. + * Returns point in the middle of the view rectangle. + * + * @param aItemIdx index of the item for which calculation will be done + */ + TPoint ItemViewPosition( TInt aItemIdx ); + + /** + * Returns index of the shown item, based on the logical + * position of the grids view. Item that is closest to the + * middle of screen is returned. + * + * @param aViewPos grids view position. This must be point in + * the middle of the view rectangle + * @return index of the item + */ + TInt ViewToVisibleItem( const TPoint aViewPos ); + + /** + * Launches increasing pop-up feedback. + */ + void LaunchPopupFeedback(); + +private: // Data + + // parent control + CCoeControl& iParent; + + // device state + // not own + CHgTeleportDeviceState& iDeviceState; + + // grid, own + CHgTeleportFastSwapGrid* iGrid; + + // fsw client, own + CHgFswClient* iFSClient; + // fsw content, ptrs owned + RPointerArray<CHgFswEntry> iArray; + + // index of selected (highlighted) item in the grid + // when the fsw was last focused + TInt iSavedSelectedIndex; + + // fsw popup (activate, close, etc.), own + CAknStylusPopUpMenu* iPopup; + // the aIndex argument of ShowPopupL is stored here + TInt iAppIndexForPopup; + + // query shown when pressing Clear key in fsw, own + CAknQueryDialog* iConfirmCloseQuery; + + // Timestamp of the last application close operation + TTime iTimeOfLastClose; + + // Observer ptr, may be NULL, not owned + MHgTeleportDataChangeObserver* iDcObserver; + + //Input events handler + CHgTeleportEventControler& iEvtHandler; + + TInt iMaxItemsOnScreen; + TInt iPreviousNoOfItems; + + // Tap event + TPointerEvent iTapEvent; + CHgTeleportFastSwapTimer* iHighlightTimer; + TBool iLongTap; + + // Grid scrolling + TInt iGridItemWidth; + + CHgTeleportFastSwapTimer* iRedrawTimer; // owned + + CHgTeleportFastSwapTimer* iUpdateGridTimer;//owned + + // Key event handling + TBool iConsumeEvent; + TBool iKeyEvent; + }; + +#endif // HGTELEPORTFASTSWAPAREA_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportfastswapgrid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportfastswapgrid.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,274 @@ +/* + * ============================================================================ + * Name : hgteleportfastswapgrid.h + * Part of : Hg Teleport + * Description : Teleport Fast Swap area UI + * Version : %version: 12 % + * + * Copyright © 2009 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTFASTSWAPGRID_H_ +#define HGTELEPORTFASTSWAPGRID_H_ + +#include <AknGrid.h> +#include <aknconsts.h> +#include "hgteleportdevicestate.h" + +class CAknsFrameBackgroundControlContext; +class CHgTeleportFastSwapTimer; + +/** + * Observer for handling fast swap grid events + */ +class MHgTeleportFastSwapGridObserver + { +public: + /** + * Called when close icon is tapped on the grid item. + * + * @param aItemIdx index of the the item for which close icon + * has been tapped + */ + virtual void HandleCloseEventL( TInt aItemIdx ) = 0; + }; + + +class MHgTeleportFastSwapTimerObserver + { +public: + /** + * Called when timer is completed + */ + virtual void TimerCompletedL( CHgTeleportFastSwapTimer* aSource ) = 0; + }; + + +/** + * Avkon grid implementing custom item drawer + */ +class CHgTeleportFastSwapGrid: + public CAknGrid, + public MHgDeviceStateObserver + { +public: // enums + enum TFastSwapGridBehaviour + { + // Highlight always visible + EHybrid, + + // Touch only highlight handling + ETouchOnly + }; + +public: // Constructor and destructor + CHgTeleportFastSwapGrid(); + ~CHgTeleportFastSwapGrid(); + void ConstructL( const CCoeControl* aParent ); + +public: // From CCoeControl + void HandlePointerEventL( const TPointerEvent &aPointerEvent ); + TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + void HandleResourceChange( TInt aType ); + void SizeChanged(); + +public: //From MHgDeviceStateObserver + /** + * Called when a change, to which the observer is registered, + * has happened. + */ + virtual void HandleDeviceStateChanged( TChangeType aChangeType ); + +public: // New functions + + /** + * Sets fast swap grid observer + */ + void SetFastSwapGridObserver( MHgTeleportFastSwapGridObserver* aObserver ); + + /** + * Set indexes of items which can be closed. + * Copies item index array. + */ + void SetCloseItemsL( RArray<TInt>& aItemIndex ); + + /** + * Checks if the item of given index is closable + */ + TBool CanCloseItem( TInt aItemIndex ); + + /** + * Checks if the given item's close icon has been tapped. + */ + TBool IsItemCloseHit( TInt aItemIndex ); + + /** + * Resets index of the item that has been close icon hit + */ + void ResetCloseHit(); + + /** + * Sets grid behaviour + * + * @param aBehaviour behaviour to be set + */ + void SetGridBehaviour( TFastSwapGridBehaviour aBehaviour ); + + /** + * Getter for grid behaviour + * + * @return girds behaviour + */ + TFastSwapGridBehaviour GridBehaviour(); + + /** + * Shows highlight. In touch only behaviour highlight + * will be shown only for ammount of time. + */ + void ShowHighlight(); + + /** + * Hides highlight. + */ + void HideHighlight(); + + /** + * Checks if the highlight is currently visible. + * + * @return ETrue if highlight is visible + * EFalse if highlight is not visible + */ + TBool IsHighlightVisible(); + + /** + * Sets visible view, items outside of view will not be drawn + */ + void SetVisibleViewRect( const TRect aRect ); + + /** + * Returns visible view. Items outside of visible rectangle are not drawn. + */ + TRect VisibleViewRect(); + +private: // From CAknGrid + virtual void CreateItemDrawerL(); + +private: // New functions + + /** + * Loads close icon bitmap and mask + */ + void LoadCloseIcon(); + + /** + * Redraws grid and parent controls + */ + void Redraw(); + +private: // Data + // Background context for grid + CAknsFrameBackgroundControlContext* iBgContext; + + // Close icon handling + RArray<TInt> iCloseItems; + TInt iCloseIconHitIdx; + MHgTeleportFastSwapGridObserver* iFastSwapGridObserver; + + // Highlight handling + TFastSwapGridBehaviour iBehaviour; + TBool iHighlightVisible; + + // Visible view rectangle (horizontal scrolling support) + TRect iVisibleViewRect; + }; + + + +/** + * Custom item drawer for drawing grid items + */ +class CHgTeleportGridItemDrawer: public CFormattedCellListBoxItemDrawer + { + +public: // Constructor and destructor + CHgTeleportGridItemDrawer( CHgTeleportFastSwapGrid* aGrid, + CFormattedCellListBoxData* aData ); + ~CHgTeleportGridItemDrawer(); + +public: // New functions + + /** + * Sets close icon drawn for items that can be closed. + * Ownership transferred. + */ + void SetCloseIcon( CFbsBitmap* aBmp, CFbsBitmap* aMask ); + + /** + * Returns close icon coordinates for the given item rectangle + */ + TRect GetCloseIconRect( const TRect& aItemRect ) const; + + /** + * Sets screen offset for the item drawer to not draw items on the + * grid edges + */ + void SetEdgeOffset( TInt aLeftOffset, TInt aRightOffset ); + +private: // From CFormattedCellListBoxItemDrawer + void DrawActualItem( TInt aItemIndex, const TRect& aActualItemRect, + TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aViewIsDimmed, TBool aItemIsSelected ) const; +private: // New functions + /** + * Checks if the item rectangle is visible in the view. + * + * @param aItemRect rectangle of the item to be checked + * @return ETrue if rectangle is fully or partially visible + * EFalse if rectangle is not visible + */ + TBool IsItemRectVisible( const TRect& aItemRect ) const; + +private: // Data + // Not owned + CHgTeleportFastSwapGrid* iGrid; + // Owned + CFbsBitmap* iCloseIcon; + CFbsBitmap* iCloseIconMask; + + TRect iScreenRect; + TInt iLeftOffset; + TInt iRightOffset; + }; + + + +/** + * Timer class for handling highlight bevaiour + */ +class CHgTeleportFastSwapTimer : public CTimer + { +public: + // Constructor + CHgTeleportFastSwapTimer( MHgTeleportFastSwapTimerObserver& aObserver ); + // Destructor + ~CHgTeleportFastSwapTimer(); + // 2nd phase constructor + void ConstructL(); + +private: // From CTimer + void RunL(); + +private: // Data + MHgTeleportFastSwapTimerObserver* iObserver; // not own + }; + +#endif /* HGTELEPORTFASTSWAPGRID_H_ */ diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysics.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysics.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,141 @@ +/* + * ============================================================================ + * Name : hgteleportphysics.h + * Part of : Hg Teleport + * Description : Application class + * Version : %version: % + * + * Copyright © 2009 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTPHYSICS_H +#define HGTELEPORTPHYSICS_H + +#include <e32base.h> +#include <e32std.h> + +class MAknPhysicsObserver; + +/** + * Simple physics for grid animation + */ +class CHgTeleportPhysics : public CActive + { +public: + /* + * Destructor + */ + ~CHgTeleportPhysics(); + + /** + * Two-phased constructor. + */ + static CHgTeleportPhysics* NewL( MAknPhysicsObserver& aObserver ); + + /** + * Two-phased constructor. + */ + static CHgTeleportPhysics* NewLC( MAknPhysicsObserver& aObserver ); + +public: // New functions + + /** + * Starts animation + * + * @param aDrag next drag point + * @param aStartTime when animation should be started + */ + void StartPhysics( const TPoint& aTarget ); + + /** + * Stops animation + */ + void StopPhysics(); + +private: + + /** + * C++ constructor + */ + CHgTeleportPhysics( MAknPhysicsObserver& aObserver ); + + /** + * Second-phase constructor + */ + void ConstructL(); + +private: // From CActive + + /** + * Handles completion + */ + void RunL(); + + /** + * Called when cancelled + */ + void DoCancel(); + + /** + * Hanldes error + */ + TInt RunError( TInt aError ); + +private: // New functions + + /** + * Calculates animation steps + */ + TInt CalculateAnimationSteps( const TPoint& aTarget ); + +private: + + enum TPhysicsStatus + { + EStopped, + ERunning, + EFinished + }; + + /** + * Observer + */ + MAknPhysicsObserver& iObserver; + + /** + * Animation timer + */ + RTimer iTimer; + + /** + * Animation state + */ + TPhysicsStatus iPhysicsState; + + /** + * Controls animation refresh rate + */ + TTimeIntervalMicroSeconds32 iAnimationTickTime; + + /** + * Animation ticks counter + */ + TInt iAnimationTicks; + + /** + * Offset of how much view should be moved + */ + RArray<TPoint> iAnimationSteps; + + }; + +#endif // HGTELEPORTPHYSICS_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysicsengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysicsengine.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,117 @@ +/* + * ============================================================================ + * Name : hgteleportphysicsengine.h + * Part of : Hg Teleport + * Description : Teleport physic engine + * Version : %version: 3 % + * + * Copyright © 2009 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTPHYSICSENGINE_H_ +#define HGTELEPORTPHYSICSENGINE_H_ + +#include <e32base.h> +#include <akntouchgesturefw.h> +// CLASS DECLARATION +class CAknPhysics; +class CHgTeleportPhysics; +/** + * Teleport physic engine implementation + */ +class CHgTeleportPhysicsEngine: public CBase + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CHgTeleportPhysicsEngine(); + + /** + * Two-phased constructor. + */ + static CHgTeleportPhysicsEngine* NewL(MAknPhysicsObserver& aPhysicObserver, + CCoeControl& aViewControl); + + /** + * Two-phased constructor. + */ + static CHgTeleportPhysicsEngine* NewLC(MAknPhysicsObserver& aPhysicObserver, + CCoeControl& aViewControl); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CHgTeleportPhysicsEngine(); + + /** + * EPOC default constructor for performing 2nd stage construction + */ + void ConstructL(MAknPhysicsObserver& aPhysicObserver, + CCoeControl& aViewControl); + + +public: + /** + * Implements drag gesture handling + * @param aEvent - drag event + */ + void HandleDragEvent(AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); + + /** + */ + TBool IsRunning() const; + + /** + */ + void Stop(); + + /** + * Initialize animation between current position and destination point + * @param aPoint - destination point + */ + void AnimateToTarget(const TPoint& aPoint); + + /** + * + * @param aWorldSize Physics world size. + * @param aViewSize Physics (visible) view size. + * @param aLandscape ETrue if physics should work in landscape. + **/ + void ReInitPhysicsL(const TSize& aWorldSize, + const TSize& aViewSize, + TBool aLandscape); + +private: + /** + * Physics. + * Own. + */ + CAknPhysics* iPhysics; + + /** + * Drag start time + */ + TTime iStartTime; + + /** + * Teleport physics for item switch animation + */ + CHgTeleportPhysics* iTeleportPhysics; + + }; + +#endif /* HGTELEPORTPHYSICSENGINE_H_*/ diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/inc/hgteleportuid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/inc/hgteleportuid.hrh Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,25 @@ +/* + * ============================================================================ + * Name : hgteleportappuid.hrh + * Part of : Hg Teleport + * Description : Teleport application's UID3 + * Version : %version: 5 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#ifndef HGTELEPORTAPPUID_HRH +#define HGTELEPORTAPPUID_HRH + +#define KHgTeleportAppUidValue 0x20016BF0 + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/loc/taskswitcher.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/loc/taskswitcher.loc Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,51 @@ +/* +* ============================================================================ +* Name : taskswitcher.loc +* Part of : Task Switcher +* Description : Task Switcher application's localization texts +* Version : %version: 2 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* +*/ + +//d:Popup menu item text +//d:Activate selected application +//l:list_single_touch_menu_pane_t1 +//r:5.0 +// +#define qtn_task_switcher_popup_open_app "Activate" + +//d:Popup menu item text +//d:Close selected application +//l:list_single_touch_menu_pane_t1 +//r:5.0 +// +#define qtn_task_switcher_popup_close_app "Close" + +//d:Popup menu item text +//d:Close all application +//l:list_single_touch_menu_pane_t1 +//r:5.0 +// +#define qtn_task_switcher_popup_close_all "Close all" + +//d:Text for heading pane above the task swapper +//l:heading_pane_t1 +//r:5.0 +// +#define qtn_task_switcher_heading_applications "Open applications" + +//d:Text for appliactions that has no name +//l:none +//r:5.0 +// +#define qtn_task_switcher_default_task_name "No name" \ No newline at end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleport.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleport.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,45 @@ +/* + * ============================================================================ + * Name : hgteleport.cpp + * Part of : Hg Teleport + * Description : Main cpp of application. Definition of start function + * Version : %version: 5 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#include <eikstart.h> + +#include "hgteleportapplication.h" + +// ----------------------------------------------------------------------------- +// NewApplication +// Create main class of application +// ----------------------------------------------------------------------------- +// +CApaApplication* NewApplication( ) + { + return new CHgTeleportApplication; + } + +// ----------------------------------------------------------------------------- +// E32Main +// Application enty point. +// ----------------------------------------------------------------------------- +// +TInt E32Main( ) + { + return EikStart::RunApplication( NewApplication ); + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportapplication.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,51 @@ +/* + * ============================================================================ + * Name : hgteleportapplication.cpp + * Part of : Hg Teleport + * Description : Application class + * Version : %version: 5 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#include "hgteleportdocument.h" +#include "hgteleportapplication.h" +#include "hgteleportuid.hrh" + +// UID for the application, this should correspond +// to the uid defined in the mmp file +static const TUid KUidHgTeleportApp = { KHgTeleportAppUidValue }; + +// ----------------------------------------------------------------------------- +// CHgTeleportApplication::CreateDocumentL( ) +// Create a CApaDocument object and return a pointer to it +// ----------------------------------------------------------------------------- +// +CApaDocument* CHgTeleportApplication::CreateDocumentL( ) + { + CApaDocument* document = CHgTeleportDocument::NewL( *this ); + return document; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportApplication::AppDllUid( ) +// Returns the application DLL UID value +// ----------------------------------------------------------------------------- +// +TUid CHgTeleportApplication::AppDllUid( ) const + { + // Return the UID for the hgteleport application + return KUidHgTeleportApp; + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportappui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportappui.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,582 @@ +/* + * ============================================================================ + * Name : hgteleportappui.cpp + * Part of : Hg Teleport + * Description : AppUi class + * Version : %version: sa1spcx1#55 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#include "hgteleportappui.h" +#include "hgteleportappview.h" +#include "hgteleportapplogging.h" +#include "hgteleportdevicestate.h" +#include "hgteleportuid.hrh" +#include "hgteleportcommands.hrh" +#include <akntitle.h> +#include <hlplch.h> +#include <avkon.rsg> +#include <bautils.h> +#include <AknUtils.h> +#include <hgteleport.rsg> +#include <pslninternalcrkeys.h> +#include <oommonitorsession.h> +#include <hal.h> +#include <hal_data.h> +#include <akntranseffect.h> + + +// AknCapServer UID, used for P&S category +const TUid KTeleportStateCategory = { 0x10207218 }; + +// Teleport UI, used as P&S key +const TInt KTeleportStateKey = KHgTeleportAppUidValue; + +// Values for Teleport launching P&S +const TInt KTeleportBackgroundValue = 1; +const TInt KTeleportForegroundValue = KTeleportBackgroundValue << 1; +const TInt KTeleportShortAppKeyPressed = KTeleportForegroundValue << 1; +const TInt KTeleportLongAppKeyPressed = KTeleportShortAppKeyPressed << 1; + +//short/long App key values +const TInt KAppKeyTypeShort = 1; +const TInt KAppKeyTypeLong = 2; + +//values for checking the OOM +const TInt KMemoryRequestAmountInBytes = 524288; +const TInt KMinMemoryAmountInBytes = 524288; +const TInt KMemoryToBeReservedInBytes = 524288; // 512 KB + +// time to wait before sending the task to background +// (must give time to animation) +const TInt KWaitBeforeGoingToBackground = 100000; + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::ConstructL() +// ConstructL is called by the application framework +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::ConstructL() + { + HGLOG_CONTEXT( CHgTeleportAppUi::ConstructL, HGLOG_LOCAL ); + HGLOG_IN(); + +#ifdef _DEBUG + // create log folder + _LIT( KLogPath, "c:\\logs\\teleport\\" ); + RFs fs; + if ( fs.Connect() == KErrNone ) + { + fs.MkDirAll( KLogPath ); + fs.Close(); + } +#endif + + // Initialise app UI with standard value. + BaseConstructL( CAknAppUi::EAknEnableSkin | CAknAppUi::EAknEnableMSK ); + +#ifndef _DEBUG + // set as system application (in release build) so we never get closed + iEikonEnv->SetSystem( ETrue ); +#endif + + //Initialize effects change observation + iThemeEffectsEnabledWatcher = + CHgCenrepListener::NewL( KCRUidThemes, KThemesTransitionEffects, *this ); + CenrepChanged( KThemesTransitionEffects, iThemeEffectsEnabledWatcher->Value() ); + + // Hide status pane + StatusPane()->MakeVisible( EFalse ); + + // Change CBA if needed, default is non-touch in rss + if ( AknLayoutUtils::PenEnabled() ) + { + Cba()->SetCommandSetL( R_HGTELEPORT_CBA_TOUCH ); + } + Cba()->MakeVisible(EFalse); + + // Create timer + iGoToBackgroundTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + + // Create commonly used instances (device state only?) + iDeviceState = CHgTeleportDeviceState::NewL(); + + // Create UI + iAppView = CHgTeleportAppView::NewL( ApplicationRect(), *iDeviceState ); + AddToStackL( iAppView ); + + //Enable effects + GfxTransEffect::Enable(); + GfxTransEffect::Register(iAppView,TUid::Uid(KHgTeleportAppUidValue)); + GfxTransEffect::SetTransitionObserver(this); + + // Listen for change in the value of the teleport state property. + iPropListener = new ( ELeave ) CHgPropertyListener( + KTeleportStateCategory, KTeleportStateKey, *this ); + + // Initialise the application task object with the window group id of + // our application ( so that it represent our app ) + iApplicationTask.SetWgId( iCoeEnv->RootWin().Identifier() ); + + // And finally, go to background. + MoveAppToBackground( AknTransEffect::ENone ); + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::CHgTeleportAppUi() +// Perform the first phase of two phase construction +// ----------------------------------------------------------------------------- +// +CHgTeleportAppUi::CHgTeleportAppUi(): iForeground( ETrue ), + iApplicationTask( iCoeEnv->WsSession() ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::~CHgTeleportAppUi() +// Destructor +// ----------------------------------------------------------------------------- +// +CHgTeleportAppUi::~CHgTeleportAppUi() + { + if( GfxTransEffect::IsRegistered( iAppView ) ) + { + GfxTransEffect::Deregister(iAppView); + + } + GfxTransEffect::SetTransitionObserver(0); + + delete iGoToBackgroundTimer; + delete iPropListener; + + // destroy UI first + if ( iAppView ) + { + RemoveFromStack( iAppView ); + delete iAppView; + } + + delete iDeviceState; + delete iMemAllocBuf; + delete iThemeEffectsEnabledWatcher; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::EffectsEnabled +// ----------------------------------------------------------------------------- +// +TBool CHgTeleportAppUi::EffectsEnabled() const + { + return iEffectsEnabled; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::StartTransion +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::StartTransion( TUint aTransitionType ) + { + if( !EffectsEnabled() ) + { + return; + } + switch(aTransitionType) + { + case AknTransEffect::EApplicationStart: + StartTransition( aTransitionType, + ETrue, + EFalse, + CAknTransitionUtils::EForceVisible); + break; + case AknTransEffect::EApplicationExit: + StartTransition( aTransitionType, + EFalse, + EFalse, + CAknTransitionUtils::EForceInvisible ); + break; + case AknTransEffect::EApplicationStartRect: + StartTransition( aTransitionType, + EFalse, + ETrue, + CAknTransitionUtils::EForceInvisible ); + break; + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::StartTransition +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::StartTransition( TUint aTranstionId, + TBool aVisibility, + TBool aLayers, + TUint aSubCom ) + { + const TDesC8* ptr = reinterpret_cast<const TDesC8*>(iAppView); + GfxTransEffect::Abort(iAppView); + GfxTransEffect::Begin( iAppView, aTranstionId ); + GfxTransEffect::SetDemarcation( iAppView, iAppView->Rect() ); + GfxTransEffect::NotifyExternalState( ECaptureComponentsBegin, ptr ); + iAppView->MakeVisible( aVisibility ); + CAknTransitionUtils::MakeVisibleSubComponents( + iAppView, + static_cast<CAknTransitionUtils::TMakeVisibleSubComponentsInfo>(aSubCom) ); + GfxTransEffect::NotifyExternalState( ECaptureComponentsEnd, ptr ); + GfxTransEffect::End( iAppView ); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::TransitionFinished +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::TransitionFinished(const CCoeControl* aControl, + TUint aAction) + { + /*if( aControl == iAppView ) + { + @TODO IMPLEMENT + }*/ + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::HandleCommandL() +// Takes care of command handling. +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EAknCmdExit: + case EEikCmdExit: + Exit(); + break; + + case EAknSoftkeyExit: + case EAknSoftkeyBack: + // RSK => just hide + MoveAppToBackground( AknTransEffect::EApplicationExit ); + break; + + case EHgTeleportCmdHelp: + { + MoveAppToBackground( AknTransEffect::EApplicationExit ); + CArrayFix<TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL(); + HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), buf ); + } + break; + + case EAknSoftkeySelect: + { + // select is generated by lsk and msk (see the resource file) + // Simulate a middle key press to the controls. + // Note that SimulateKeyEventL must not be used here or else it + // will end up in an infinite loop. + TKeyEvent keyEvent; + keyEvent.iCode = EKeyOK; + keyEvent.iScanCode = EStdKeyDevice3; + keyEvent.iModifiers = keyEvent.iRepeats = 0; + iAppView->OfferKeyEventL( keyEvent, EEventKeyDown ); + iAppView->OfferKeyEventL( keyEvent, EEventKey ); + iAppView->OfferKeyEventL( keyEvent, EEventKeyUp ); + } + break; + + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::HandleForegroundEventL +// Called by the system when the app is moved to foreground or background. +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::HandleForegroundEventL( TBool aForeground ) + { + HGLOG_CONTEXT( HandleForegroundEventL, HGLOG_LOCAL ); + HGLOG1_IN( "aForeground = %d", aForeground ); + + // These calls may be redundant but the functions will do nothing if the + // state has already been changed. + // Both this function and the 'manual' MoveAppTo functions must fire the events + // because in some cases only one of them will run (e.g. when bringing to foreground + // not with the hw key but by other means etc.) + if ( aForeground ) + { + HandleSwitchToForegroundEvent(); + } + else + { + HandleSwitchToBackgroundEvent(); + } + + // Call Base class method + CAknAppUi::HandleForegroundEventL( aForeground ); + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::PropertyChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::PropertyChanged( TUid aCategory, TUint aKey ) + { + HGLOG_CONTEXT( PropertyChanged, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt value( 0 ); + + if ( RProperty::Get( aCategory, aKey, value ) == KErrNone ) + { + if ( iForeground && (value & KTeleportBackgroundValue) ) + { + MoveAppToBackground( AknTransEffect::EApplicationExit ); + } + else if ( !iForeground && (value & KTeleportForegroundValue) ) + { + MoveAppToForeground( AknTransEffect::EApplicationStart ); + } + else if( value & KTeleportLongAppKeyPressed ) + { + if(!iForeground) + { + MoveAppToBackground( AknTransEffect::EApplicationExit ); + } + else + { + iAppView->HandleAppKey(KAppKeyTypeLong); + } + } + else if( value & KTeleportShortAppKeyPressed ) + { + iAppView->HandleAppKey(KAppKeyTypeShort); + } + } + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::HandleResourceChangeL +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::HandleResourceChangeL( TInt aType ) + { + // Must call base class implementation first, + // sizes from LayoutMetricsRect etc. will only be correct after this. + CAknAppUi::HandleResourceChangeL( aType ); + if( aType == KEikDynamicLayoutVariantSwitch && iAppView ) + { + iAppView->SetRect( ApplicationRect() ); + } + // forward event + iDeviceState->HandleResourceChange( aType ); + iAppView->HandleResourceChange( aType ); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::MoveAppToBackground() +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::MoveAppToBackground( TUint aTransitionType ) + { + HGLOG_CONTEXT( MoveAppToBackground, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( AknTransEffect::ENone == aTransitionType || !EffectsEnabled() ) + { + GoToBackgroundTimerCallback( this ); + } + else + { + StartTransion(AknTransEffect::EApplicationExit); + iGoToBackgroundTimer->Cancel(); + iGoToBackgroundTimer->Start( + KWaitBeforeGoingToBackground, + 0, + TCallBack( GoToBackgroundTimerCallback, this ) ); + } + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::CenrepChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::CenrepChanged( TUint32 aKey, TInt aNewValue ) + { + iEffectsEnabled = !(aNewValue & AknTransEffect::EFullScreenTransitionsOff); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::GoToBackgroundTimerCallback +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportAppUi::GoToBackgroundTimerCallback( TAny* aParam ) + { + CHgTeleportAppUi* self = static_cast<CHgTeleportAppUi*>( aParam ); + if ( self->iGoToBackgroundTimer ) + { + self->iGoToBackgroundTimer->Cancel(); + } + + // Request window server to bring our application + // to background + self->iApplicationTask.SendToBackground(); + + // Notify + self->HandleSwitchToBackgroundEvent(); + + return 0; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::MoveAppToForeground() +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::MoveAppToForeground( TUint /*aTransitionType*/ ) + { + HGLOG_CONTEXT( MoveAppToForeground, HGLOG_LOCAL ); + HGLOG_IN(); + + // Request window server to bring our application + // to foreground + iApplicationTask.BringToForeground(); + + // Notify + HandleSwitchToForegroundEvent(); + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::HandleSwitchToBackgroundEvent +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::HandleSwitchToBackgroundEvent() + { + HGLOG_CONTEXT( HandleSwitchToBackgroundEvent, HGLOG_LOCAL ); + HGLOG_IN(); + + // must not do anything if iForeground is already up-to-date + // exclude cases with dialogs like power menu, memory card + if( iForeground && !IsFaded() ) + { + iForeground = EFalse; + SetTeleportStateProperty( KTeleportBackgroundValue ); + + //allocating extra memory space + if ( !iMemAllocBuf ) + { + iMemAllocBuf = + (TUint8*) User::Alloc( KMemoryToBeReservedInBytes ); + } + + // notify view + iAppView->HandleSwitchToBackgroundEvent(); + } + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::HandleSwitchToForegroundEvent +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::HandleSwitchToForegroundEvent() + { + HGLOG_CONTEXT( HandleSwitchToForegroundEvent, HGLOG_LOCAL ); + HGLOG_IN(); + + // must not do anything if iForeground is already up-to-date + if ( !iForeground ) + { + //freeing extra memory space + delete iMemAllocBuf; + iMemAllocBuf = NULL; + + TInt freeRamMemory; + HAL::Get( HALData::EMemoryRAMFree, freeRamMemory ); + if ( freeRamMemory <= KMinMemoryAmountInBytes ) + { + FreeMemoryRequest(); + } + + iForeground = ETrue; + SetTeleportStateProperty( KTeleportForegroundValue ); + + // notify view + iAppView->HandleSwitchToForegroundEvent(); + } + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::SetTeleportShowProperty +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::SetTeleportStateProperty( TInt aValue ) + { + HGLOG_CONTEXT( CHgTeleportAppUi::SetTeleportShowProperty, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( RProperty::Set( + KTeleportStateCategory, KTeleportStateKey, aValue ) != KErrNone ) + { + TInt error = RProperty::Define( + KTeleportStateCategory, KTeleportStateKey, RProperty::EInt ); + if ( error != KErrNone ) + { + HGLOG1( HGLOG_INFO, "RProperty::Define Error: %d", error ); + } + + error = RProperty::Set( KTeleportStateCategory, KTeleportStateKey, aValue ); + if ( error != KErrNone ) + { + HGLOG1( HGLOG_INFO, "RProperty::Set Error: %d", error ); + } + } + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppUi::FreeMemoryRequest +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppUi::FreeMemoryRequest() + { + HGLOG_CONTEXT( CHgTeleportAppUi::FreeMemoryRequest, HGLOG_LOCAL ); + HGLOG_IN(); + ROomMonitorSession oomMs; + TInt error = oomMs.Connect(); + if ( error != KErrNone) + { + HGLOG1( HGLOG_INFO, "Could not connect to ROomMonitorSession, %d", error ); + } + else + { + oomMs.RequestFreeMemory( KMemoryRequestAmountInBytes ); + oomMs.Close(); + } + HGLOG_OUT(); + } + + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportappview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportappview.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,734 @@ + /* + * ============================================================================ + * Name : hgteleportappview.cpp + * Part of : Hg Teleport + * Description : Teleport view class + * Version : %version: sa1spcx1#54 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#include <AknUtils.h> +#include <AknsUtils.h> +#include <aknlayoutscalable_apps.cdl.h> +#include <aknlayoutscalable_avkon.cdl.h> +#include <layoutmetadata.cdl.h> +#include <AknsFrameBackgroundControlContext.h> +#include <AknsDrawUtils.h> +#include <eikmenub.h> +#include <gfxtranseffect/gfxtranseffect.h> +#include <akntransitionutils.h> +#include <akntranseffect.h> +#include <aknPopupHeadingPane.h> +#include <StringLoader.h> +#include <hgteleport.rsg> +#include <touchfeedback.h> + +#include "hgteleportappview.h" +#include "hgteleportappui.h" +#include "hgteleportapplogging.h" +#include "hgteleportfastswaparea.h" +#include "hgteleporteventcontroler.h" +#include "hgteleportuid.hrh" + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::NewL +// ----------------------------------------------------------------------------- +// +CHgTeleportAppView* CHgTeleportAppView::NewL( const TRect& aRect, + CHgTeleportDeviceState& aDeviceState ) + { + CHgTeleportAppView* self = CHgTeleportAppView::NewLC( aRect, aDeviceState ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::NewLC +// ----------------------------------------------------------------------------- +// +CHgTeleportAppView* CHgTeleportAppView::NewLC( const TRect& aRect, + CHgTeleportDeviceState& aDeviceState ) + { + CHgTeleportAppView* self = new (ELeave) CHgTeleportAppView( aDeviceState ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::CHgTeleportAppView +// ----------------------------------------------------------------------------- +// +CHgTeleportAppView::CHgTeleportAppView(CHgTeleportDeviceState& aDeviceState) + : iDeviceState( aDeviceState ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// InvalidateWindows +// ----------------------------------------------------------------------------- +// +static void InvalidateWindows( CCoeControl* aControl ) + { + if ( aControl ) + { + if ( aControl->OwnsWindow() ) + { + static_cast<RWindow*>( aControl->DrawableWindow() )->ClearRedrawStore(); + } + + for ( TInt i = aControl->CountComponentControls() - 1; i >= 0; --i ) + { + InvalidateWindows( aControl->ComponentControl( i ) ); + } + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::~CHgTeleportAppView +// ----------------------------------------------------------------------------- +// +CHgTeleportAppView::~CHgTeleportAppView() + { + GfxTransEffect::SetTransitionObserver( 0 ); + if ( GfxTransEffect::IsRegistered( this ) ) + { + MakeVisible( EFalse ); + CAknTransitionUtils::MakeVisibleSubComponents( this, + CAknTransitionUtils::EForceInvisible ); + GfxTransEffect::Deregister( this ); + } + delete iBgContext; + delete iFastSwapArea; + delete iAppsHeading; + + delete iEvtHandler; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::ConstructL( const TRect& aRect ) + { + HGLOG_CONTEXT( CHgTeleportAppView::ConstructL, HGLOG_LOCAL ); + HGLOG_IN(); + + // Create a window for this application view + CreateWindowL(); + + // Store rect + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + TAknLayoutRect mainView; + mainView.LayoutRect( aRect, + AknLayoutScalable_Apps::main_tport_pane( variety ) ); + iViewRect = mainView.Rect(); + + // Background control context is for a frame + UpdatePopupRects(); + iBgContext = CAknsFrameBackgroundControlContext::NewL( + KAknsIIDQsnFrPopup, + iBgContextOuterRect, + iBgContextInnerRect, + ETrue ); + iBgContext->SetFrameRects(iBgContextOuterRect, iBgContextInnerRect); + iBgContext->SetCenter( KAknsIIDQsnFrPopupCenter ); + + HGLOG4( HGLOG_INFO, "view rect = %d %d %d %d", + iViewRect.iTl.iX, iViewRect.iTl.iY, + iViewRect.iBr.iX, iViewRect.iBr.iY ); + + // Create components + CreateControlsL(); + + // Hide 'active applications' item in Options menu + CEikMenuBar* menub = iEikonEnv->AppUiFactory()->MenuBar(); + if ( menub ) + { + menub->SetMenuType( CEikMenuBar::EMenuOptionsNoTaskSwapper ); + } + + // Register for notifications about orientation etc. changes + iDeviceState.AddObserverL( *this, MHgDeviceStateObserver::EAny ); + SetRect( iViewRect ); + //SetExtentToWholeScreen(); + iViewRect = Rect(); + // try to enable window transparency + if( CAknEnv::Static()->TransparencyEnabled() ) + { + Window().SetRequiredDisplayMode( EColor16MA ); + if ( Window().SetTransparencyAlphaChannel() == KErrNone ) + { + Window().SetBackgroundColor( ~0 ); + } + } + + DrawableWindow()->EnableBackup(EWindowBackupFullScreen); + Window().SetOrdinalPosition( 0, ECoeWinPriorityNormal ); + SetComponentsToInheritVisibility(ETrue); + MakeVisible(ETrue); + // Ready to be drawn + ActivateL(); + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::DisableAppSwitchEffects +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::DisableAppSwitchEffects() + { + TInt flags = AknTransEffect::TParameter::ENoEffects; + GfxTransEffect::BeginFullScreen( + AknTransEffect::ENone, + TRect(0,0,0,0), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( TUid::Uid(KHgTeleportAppUidValue), flags ) ); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::GetPopupRects +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::UpdatePopupRects( ) + { + HGLOG_CONTEXT( UpdatePopupRects, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + + TAknLayoutRect bgTport; + bgTport.LayoutRect( iViewRect, + AknLayoutScalable_Apps::bg_popup_window_pane_cp01( variety ) ); + iBgContextOuterRect = bgTport.Rect(); + bgTport.LayoutRect( iBgContextOuterRect, + AknLayoutScalable_Avkon::aid_inside_area_window_primary( variety ) ); + iBgContextInnerRect = bgTport.Rect(); + HGLOG4( HGLOG_INFO, "outer rect for popup = %d %d %d %d", + iBgContextOuterRect.iTl.iX, iBgContextOuterRect.iTl.iY, + iBgContextOuterRect.iBr.iX, iBgContextOuterRect.iBr.iY ); + HGLOG4( HGLOG_INFO, "inner rect for popup = %d %d %d %d", + iBgContextInnerRect.iTl.iX, iBgContextInnerRect.iTl.iY, + iBgContextInnerRect.iBr.iX, iBgContextInnerRect.iBr.iY ); + +#ifdef TASKSWITCHER_USE_CUSTOM_LAYOUT + if ( iFastSwapArea ) + { + iBgContextOuterRect = iFastSwapArea->Rect(); + iBgContextInnerRect = iFastSwapArea->Rect(); + } +#endif + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::CreateControlsL +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::CreateControlsL() + { + RArray<TRect> rects; + CleanupClosePushL( rects ); + rects.ReserveL( 2 ); // so appending in GetRects cannot fail + GetRects( rects ); + + iEvtHandler = CHgTeleportEventControler::NewL(*this, *this); + iFastSwapArea = CHgTeleportFastSwapArea::NewL(rects[1], *this, + iDeviceState, *iEvtHandler); + iAppsHeading = new ( ELeave ) CAknPopupHeadingPane; + + iFastSwapArea->SetMopParent( this ); + iFastSwapArea->SetFocusing( ETrue ); + iFastSwapArea->Setup( *this ); + iFastSwapArea->SetDataChangeObserver( this ); + + iAppsHeading->SetContainerWindowL( *this ); + iAppsHeading->ConstructL( KNullDesC() ); + iAppsHeading->SetLayout( CAknPopupHeadingPane::EListHeadingPane ); + + //TODO: check why we need to set rect (set already in contructL) + iFastSwapArea->SetRect( rects[1] ); // cannot be before iAppsHeading constructL + iAppsHeading->SetRect( rects[0] ); + + CleanupStack::PopAndDestroy( &rects ); + + UpdateHeadingsL(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::GetRects +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::GetRects( RArray<TRect>& aRects ) + { + HGLOG_CONTEXT( CHgTeleportAppView::GetRects, HGLOG_LOCAL ); + HGLOG_IN(); + +#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + + TAknLayoutRect appsLabel; + TAknLayoutRect fastSwapAreaPane; + + appsLabel.LayoutRect( iViewRect, + AknLayoutScalable_Apps::heading_pane_cp07( variety ) ); + HGLOG4( HGLOG_INFO, "apps heading rect = %d %d %d %d", + appsLabel.Rect().iTl.iX, appsLabel.Rect().iTl.iY, + appsLabel.Rect().iBr.iX, appsLabel.Rect().iBr.iY ); + + + fastSwapAreaPane.LayoutRect( iViewRect, + AknLayoutScalable_Apps::tport_appsw_pane( variety ) ); + HGLOG4( HGLOG_INFO, "fsw rect = %d %d %d %d", + fastSwapAreaPane.Rect().iTl.iX, fastSwapAreaPane.Rect().iTl.iY, + fastSwapAreaPane.Rect().iBr.iX, fastSwapAreaPane.Rect().iBr.iY ); + + aRects.Append( appsLabel.Rect() ); + aRects.Append( fastSwapAreaPane.Rect() ); +#else + TRect tempRect; + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, tempRect); + tempRect.iTl = TPoint(0,0); + TRect fastSwapRect, headingRect; + fastSwapRect.iTl = TPoint(KFswBorderSize, (tempRect.Height() - KFswItemHeight - KFswHeadingHeight) / 2 + KFswHeadingHeight); + fastSwapRect.iBr = TPoint(tempRect.iBr.iX - KFswBorderSize, fastSwapRect.iTl.iY + KFswItemHeight); + headingRect.iTl = TPoint(KFswBorderSize, fastSwapRect.iTl.iY - KFswHeadingHeight); + headingRect.iBr = TPoint(fastSwapRect.iBr.iX, fastSwapRect.iTl.iY); + aRects.Append( headingRect ); + aRects.Append( fastSwapRect ); +#endif + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::SizeChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::SizeChanged() + { + HGLOG_CONTEXT( CHgTeleportAppView::SizeChanged, HGLOG_LOCAL ); + HGLOG_IN(); + UpdatePopupRects(); + iBgContext->SetFrameRects(iBgContextOuterRect, iBgContextInnerRect); + if ( iFastSwapArea && iAppsHeading ) + { + RArray<TRect> rects; + // make sure that appending in GetRect cannot fail + if ( rects.Reserve( 2 ) == KErrNone ) + { + GetRects( rects ); + iAppsHeading->SetRect( rects[0] ); + iFastSwapArea->SetRect( rects[1] ); + + DrawDeferred(); + } + rects.Close(); + + // Focus jumps back to fsw + ChangeFocus( iFastSwapArea ); + } + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::Draw +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::Draw( const TRect& aRect ) const + { + if ( aRect == Rect() ) + { + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::DrawFrame( skin, + gc, + iBgContextOuterRect, + iBgContextInnerRect, + KAknsIIDQsnFrPopup, + KAknsIIDQsnFrPopupCenter ); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::MopSupplyObject +// ----------------------------------------------------------------------------- +// +TTypeUid::Ptr CHgTeleportAppView::MopSupplyObject( TTypeUid aId ) + { + if ( aId.iUid == MAknsControlContext::ETypeId ) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CCoeControl::MopSupplyObject( aId ); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CHgTeleportAppView::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + HGLOG_CONTEXT( OfferKeyEventL, HGLOG_LOCAL ); + HGLOG2_IN( "iCode = %d type = %d", aKeyEvent.iCode, aType ); + + TKeyResponse result = EKeyWasNotConsumed; + + // Always use the portrait version, the layout in landscape is now + // similar to portrait. + result = OfferKeyEventPortraitStyleL( aKeyEvent, aType ); + + // handle some other keys + if ( result == EKeyWasNotConsumed && aType == EEventKey ) + { + switch ( aKeyEvent.iCode ) + { + case EKeyYes: // send (green) key + result = EKeyWasConsumed; + break; + } + } + + // forward to focused control if not yet handled + if ( result == EKeyWasNotConsumed && iFocused ) + { + result = iFocused->OfferKeyEventL( aKeyEvent, aType ); + } + + HGLOG1_OUT( "response = %d", result ); + return result; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::OfferKeyEventPortraitStyleL +// ----------------------------------------------------------------------------- +// +TKeyResponse CHgTeleportAppView::OfferKeyEventPortraitStyleL( + const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/) + { + TKeyResponse result = EKeyWasNotConsumed; + return result; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::CountComponentControls +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportAppView::CountComponentControls() const + { + return 2; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::ComponentControl +// ----------------------------------------------------------------------------- +// +CCoeControl* CHgTeleportAppView::ComponentControl( TInt aIndex ) const + { + switch ( aIndex ) + { + case 0: + return iFastSwapArea; + case 1: + return iAppsHeading; + default: + return NULL; + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::HandleSwitchToBackgroundEvent +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::HandleSwitchToBackgroundEvent() + { + // Stop animation and unfade + GfxTransEffect::Abort(); + iPopupFader.FadeBehindPopup( this, NULL, EFalse ); + + GfxTransEffect::Begin( this, 5); + // Forward event to interested controls + iFastSwapArea->HandleSwitchToBackgroundEvent(); + + // Hide + MakeVisible( EFalse ); + //GfxTransEffect::NotifyExternalState( ENotifyGlobalAbort ); + CAknTransitionUtils::MakeVisibleSubComponents( this, + CAknTransitionUtils::EForceInvisible ); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::HandleSwitchToForegroundEvent +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::HandleSwitchToForegroundEvent() + { + Window().Invalidate(Rect()); + + // Fade behind the pop-up + iPopupFader.FadeBehindPopup( this, NULL, ETrue ); + + DrawDeferred(); // otherwise some parts may not be drawn properly + + // Focus jumps back to fsw + ChangeFocus( iFastSwapArea ); + + // Forward event to interested controls + iFastSwapArea->HandleSwitchToForegroundEvent(); + + // Start animation + CHgTeleportAppUi* appui = + static_cast<CHgTeleportAppUi*>( iEikonEnv->AppUi() ); + if ( appui->EffectsEnabled() ) + { + InvalidateWindows( this ); + appui->StartTransion(AknTransEffect::EApplicationStart); + } + else + { + CAknTransitionUtils::MakeVisibleSubComponents( this, + CAknTransitionUtils::EForceVisible ); + MakeVisible( ETrue ); + } + + DrawDeferred(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::ChangeFocus +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::ChangeFocus( CCoeControl* aNewFocusedControl ) + { + if ( iFocused != aNewFocusedControl ) + { + if ( iFocused ) + { + iFocused->SetFocus( EFalse, EDrawNow ); + } + iFocused = aNewFocusedControl; + if ( iFocused ) + { + iFocused->SetFocus( ETrue, EDrawNow ); + } + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::HandleControlEventL +// EEventRequestFocus must be handled to have proper focus change also with +// pointer events. +// Observed controls are the ganes list and grid. +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + switch ( aEventType ) + { + case EEventRequestFocus: + // must use the parent because aControl is the ganes control + ChangeFocus( aControl->Parent() ); + break; + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::HandleDeviceStateChanged +// Called when screen orientation, touch awareness, or the skin has been changed. +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::HandleDeviceStateChanged( TChangeType /*aChangeType*/ ) + { + HGLOG_CONTEXT( HandleDeviceStateChanged, HGLOG_LOCAL ); + HGLOG_IN(); + + // Just set all the sizes, even when there is a skin change, because this will + // guarantee proper redraw also with the ganes controls. + + iViewRect = Rect(); + HGLOG4( HGLOG_INFO, "setting rect %d %d %d %d", + iViewRect.iTl.iX, iViewRect.iTl.iY, + iViewRect.iBr.iX, iViewRect.iBr.iY ); + SetRect( iViewRect ); + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::CountFadedComponents +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportAppView::CountFadedComponents() + { + return 3; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::FadedComponent +// ----------------------------------------------------------------------------- +// +CCoeControl* CHgTeleportAppView::FadedComponent( TInt aIndex ) + { + // well, these are in fact the components that will _not_ be faded... + // Must return the bottom-level controls here, e.g. the ganes controls, not the wrappers over them. + switch ( aIndex ) + { + case 0: + return this; + case 1: + return iFastSwapArea->GetChildControl(); + case 2: + return iAppsHeading; +// case 3: +// return iEikonEnv->AppUiFactory()->Cba(); + default: + return NULL; + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::HandlePointerEventL( const TPointerEvent &aPointerEvent ) + { + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if(0 != feedback && + (TPointerEvent::EButton1Down == aPointerEvent.iType || + TPointerEvent::EButton1Up == aPointerEvent.iType)) + { + feedback->InstantFeedback(this, + ETouchFeedbackBasic, + ETouchFeedbackVibra, + aPointerEvent); + } + iFastSwapArea->HandlePointerEventL(aPointerEvent); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::DataChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::DataChanged( CCoeControl* /*aWhere*/, TInt /*aNewCount*/ ) + { + TRAP_IGNORE( UpdateHeadingsL() ); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::UpdateHeadingsL +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::UpdateHeadingsL() + { +#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT + HBufC* text = StringLoader::LoadLC( + R_TASK_SWITCHER_HEADING_APPLICATIONS ); +#else + _LIT( KTitle, "Task switcher" ); + HBufC* text = KTitle().AllocLC(); +#endif + iAppsHeading->SetTextL( *text ); + iAppsHeading->DrawDeferred(); + CleanupStack::PopAndDestroy( text ); + + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::HandleAppKey +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::HandleAppKey(TInt aType) + { + iFastSwapArea->HandleAppKey(aType); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::MoveOffset +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::MoveOffset(const TPoint& aOffset) + { + iFastSwapArea->MoveOffset(aOffset); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::TapL +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::TapL(const TPoint& aPoint) + { + if(iFastSwapArea->Rect().Contains(aPoint)) + { + iFastSwapArea->TapL(aPoint); + } + else if( !iAppsHeading->Rect().Contains(aPoint)) + { + //move task switcher to background + iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::LongTapL +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::LongTapL(const TPoint& aPoint) + { + if(iFastSwapArea->Rect().Contains(aPoint)) + { + iFastSwapArea->LongTapL(aPoint); + } + else if( !iAppsHeading->Rect().Contains(aPoint)) + { + //move task switcher to background + iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::Drag() +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::Drag(const MAknTouchGestureFwDragEvent& aEvent) + { + iFastSwapArea->Drag(aEvent); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::Stop +// ----------------------------------------------------------------------------- +// +void CHgTeleportAppView::Stop() + { + iFastSwapArea->Stop(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportAppView::ViewPos +// ----------------------------------------------------------------------------- +// +TPoint CHgTeleportAppView::ViewPos() const + { + return iFastSwapArea->ViewPos(); + } + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportdevicestate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportdevicestate.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,274 @@ +/* + * ============================================================================ + * Name : hgteleportdevicestate.cpp + * Part of : Hg Teleport + * Description : Device state (touch mode, screen orientation) handler + * Version : %version: sa1spcx1#14 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * Template version: 4.2 + */ + +#include "hgteleportdevicestate.h" +#include <AknUtils.h> +#include <hwrmdomainpskeys.h> + +#include "hgteleportapplogging.h" + + +// ----------------------------------------------------------------------------- +// CHgTeleportDeviceState::NewL +// ----------------------------------------------------------------------------- +// +CHgTeleportDeviceState* CHgTeleportDeviceState::NewL() + { + CHgTeleportDeviceState* self = new ( ELeave ) CHgTeleportDeviceState; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDeviceState::CHgTeleportDeviceState +// ----------------------------------------------------------------------------- +// +CHgTeleportDeviceState::CHgTeleportDeviceState() + { + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDeviceState::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::ConstructL() + { + iFlipStatusObserver = new ( ELeave ) CHgPropertyListener(KPSUidHWRM, + KHWRMFlipStatus, *this); + // check if touch is enabled or not + CheckTouchState(); + // are we in portrait or landscape + CheckOrientation(); + // checks the qwerty input mode. + CheckDeviceType(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDeviceState::~CHgTeleportDeviceState +// ----------------------------------------------------------------------------- +// +CHgTeleportDeviceState::~CHgTeleportDeviceState() + { + iObservers.Close(); + delete iFlipStatusObserver; + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::HandleResourceChange +// -------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::HandleResourceChange( TInt aType ) + { + HGLOG_CONTEXT( HandleResourceChange, HGLOG_LOCAL ); + HGLOG2_IN( "aType = %d (active count = %d)", aType, iResChangeActiveCount ); + + // increase function entrance count + ++iResChangeActiveCount; + // if we are still in a previous call then do nothing else + if ( iResChangeActiveCount == 1 ) + { + // the active count may increase during execution of the body of the loop + // (if some observers have active scheduler waits, for example) + while ( iResChangeActiveCount > 0 ) + { + if ( aType == KEikDynamicLayoutVariantSwitch ) + { + HGLOG0( HGLOG_INFO, "dyn layout var switch" ); + // This might be a screen orientation or touch-nontouch switch, + // so let's check the situation and notify observers if needed. + CheckTouchState(); + CheckOrientation(); + } + else if ( aType == KAknsMessageSkinChange ) + { + HGLOG0( HGLOG_INFO, "skin change" ); + NotifyObservers( MHgDeviceStateObserver::ESkin ); + } + --iResChangeActiveCount; + } + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::PropertyChanged +// -------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::PropertyChanged(TUid aCategory, TUint aKey) + { + HGLOG_CONTEXT( PropertyChanged, HGLOG_LOCAL ); + HGLOG2_IN( "aKey = %d aNewValue = %d", aCategory, aKey ); + CheckDeviceType(); + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::CheckTouchState +// -------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::CheckTouchState() + { + HGLOG_CONTEXT( CheckTouchState, HGLOG_LOCAL ); + HGLOG_IN(); + + TTouchState oldValue = iTouchState; + iTouchState = AknLayoutUtils::PenEnabled() ? ETouchEnabled : ETouchDisabled; + if ( iTouchState != oldValue ) + { + NotifyObservers( MHgDeviceStateObserver::ETouchState ); + } + + HGLOG1_OUT( "new value for iTouchState: %d", iTouchState ); + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::CheckOrientation +// -------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::CheckOrientation() + { + HGLOG_CONTEXT( CheckOrientation, HGLOG_LOCAL ); + HGLOG_IN(); + + TRect rect; + AknLayoutUtils::LayoutMetricsRect ( AknLayoutUtils::EScreen, rect ); + TOrientation oldValue = iOrientation; + iOrientation = rect.Width() > rect.Height() ? ELandscape : EPortrait; + if ( iOrientation != oldValue ) + { + NotifyObservers( MHgDeviceStateObserver::EOrientation ); + } + + HGLOG1_OUT( "new value for iOrientation: %d", iOrientation ); + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::DeviceType +// -------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::CheckDeviceType() + { + HGLOG_CONTEXT( CheckQwerty, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt oldDeviceType = iDeviceType; + TInt value( 0 ); + if( RProperty::Get( KPSUidHWRM, KHWRMFlipStatus, value ) == KErrNone ) + { + iDeviceType = (value == EPSHWRMFlipOpen ? EHybrid : EFullTouch); + } + + if( iDeviceType != oldDeviceType ) + { + NotifyObservers( MHgDeviceStateObserver::EDeviceType); + } + + HGLOG1_OUT( "new value for iDeviceType: %d", iDeviceType ); + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::TouchState +// -------------------------------------------------------------------------- +// +CHgTeleportDeviceState::TTouchState CHgTeleportDeviceState::TouchState() const + { + return iTouchState; + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::Orientation +// -------------------------------------------------------------------------- +// +CHgTeleportDeviceState::TOrientation CHgTeleportDeviceState::Orientation() const + { + return iOrientation; + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::Qwerty +// -------------------------------------------------------------------------- +// +CHgTeleportDeviceState::TDeviceType CHgTeleportDeviceState::DeviceType() const + { + return iDeviceType; + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::ObserverIdentity +// -------------------------------------------------------------------------- +// +TBool CHgTeleportDeviceState::ObserverIdentity( const SObserver& aA, + const SObserver& aB ) + { + return aA.iObserver == aB.iObserver; + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::AddDeviceStateObserverL +// -------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::AddObserverL( MHgDeviceStateObserver& aObserver, + TInt aMask ) + { + iObservers.AppendL( SObserver( aMask, &aObserver ) ); + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::RemoveObserver +// -------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::RemoveObserver( MHgDeviceStateObserver& aObserver ) + { + for ( ; ; ) + { + TInt pos = iObservers.Find( SObserver( MHgDeviceStateObserver::EAny, + &aObserver ), ObserverIdentity ); + if ( pos >= 0 ) + { + iObservers.Remove( pos ); + } + else + { + break; + } + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportDeviceState::NotifyObservers +// -------------------------------------------------------------------------- +// +void CHgTeleportDeviceState::NotifyObservers( + MHgDeviceStateObserver::TChangeType aType ) + { + for ( TInt i = 0, ie = iObservers.Count(); i != ie; ++i ) + { + const SObserver& obs( iObservers[i] ); + if ( obs.iMask & aType ) + { + obs.iObserver->HandleDeviceStateChanged( aType ); + } + } + } + + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportdocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportdocument.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,106 @@ +/* + * ============================================================================ + * Name : hgteleportdocument.cpp + * Part of : Hg Teleport + * Description : Document class + * Version : %version: 4 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#include <apgwgnam.h> + +#include "hgteleportappui.h" +#include "hgteleportdocument.h" + +// ----------------------------------------------------------------------------- +// CHgTeleportDocument::NewLC( ) +// Create a CHgTeleportDocument object and return a pointer to it +// ----------------------------------------------------------------------------- +// +CHgTeleportDocument* CHgTeleportDocument::NewL( CEikApplication& aApp ) + { + CHgTeleportDocument* self = NewLC ( aApp ); + CleanupStack::Pop ( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDocument::NewLC( ) +// Create a CHgTeleportDocument object and return a pointer to it +// ----------------------------------------------------------------------------- +// +CHgTeleportDocument* CHgTeleportDocument::NewLC( CEikApplication& aApp ) + { + CHgTeleportDocument* self = new ( ELeave ) CHgTeleportDocument( aApp ); + CleanupStack::PushL ( self ); + self->ConstructL ( ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDocument::ConstructL( ) +// Second phase constructor +// ----------------------------------------------------------------------------- +// +void CHgTeleportDocument::ConstructL( ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDocument::~CHgTeleportDocument( ) +// First phase constructor +// ----------------------------------------------------------------------------- +// +CHgTeleportDocument::CHgTeleportDocument( CEikApplication& aApp ) : + CAknDocument( aApp ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDocument::~CHgTeleportDocument( ) +// Destructor +// ----------------------------------------------------------------------------- +// +CHgTeleportDocument::~CHgTeleportDocument( ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDocument::CreateAppUiL( ) +// Create a CHgTeleportAppUi object and return a pointer to it +// ----------------------------------------------------------------------------- +// +CEikAppUi* CHgTeleportDocument::CreateAppUiL( ) + { + // Create the application user interface, and return a pointer to it, + // the framework takes ownership of this object + CEikAppUi* appUi = new ( ELeave ) CHgTeleportAppUi; + return appUi; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportDocument::UpdateTaskNameL( ) +// Makes app hidden in fastswap window +// ----------------------------------------------------------------------------- +// +void CHgTeleportDocument::UpdateTaskNameL( CApaWindowGroupName* aWgName ) + { + CEikDocument::UpdateTaskNameL ( aWgName ); + aWgName->SetHidden ( ETrue ); + } + + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleporteventcontroler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleporteventcontroler.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,195 @@ +/* + * ============================================================================ + * Name : hgteleporteventcontroler.cpp + * Part of : Hg Teleport + * Description : Gesture and physics helper declaration + * Version : %version: 5 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ +#include "hgteleporteventcontroler.h" +#include "hgteleportphysicsengine.h" + +// ----------------------------------------------------------------------------- +// NewLC +// ----------------------------------------------------------------------------- +// +CHgTeleportEventControler* CHgTeleportEventControler::NewLC( + MHgTeleportEventControlerObserver& aObserver, + CCoeControl& aEventSrc) + { + CHgTeleportEventControler* self = + new(ELeave)CHgTeleportEventControler(aObserver); + CleanupStack::PushL(self); + self->ConstructL(aEventSrc); + return self; + } + +// ----------------------------------------------------------------------------- +// NewL +// ----------------------------------------------------------------------------- +// +CHgTeleportEventControler* CHgTeleportEventControler::NewL( + MHgTeleportEventControlerObserver& aObserver, + CCoeControl& aEventSrc) + { + CHgTeleportEventControler* self = + CHgTeleportEventControler::NewLC(aObserver, aEventSrc); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// ~CHgTeleportPointerHandler +// ----------------------------------------------------------------------------- +// +CHgTeleportEventControler::~CHgTeleportEventControler() + { + delete iGestureHelper; + delete iPhysicsHelper; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPointerHandler +// ----------------------------------------------------------------------------- +// +CHgTeleportEventControler::CHgTeleportEventControler( + MHgTeleportEventControlerObserver& aObserver) + : + CBase(), + iObserver(aObserver) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::ConstructL(CCoeControl& aEventSrc) + { + iGestureHelper = + AknTouchGestureFw::CAknTouchGestureFw::NewL(*this, aEventSrc); + iGestureHelper->SetGestureInterestL(EAknTouchGestureFwAll); + iPhysicsHelper = CHgTeleportPhysicsEngine::NewL(*this, aEventSrc); + } + +// ----------------------------------------------------------------------------- +// HandleTouchGestureL +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::HandleTouchGestureL( + AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent) + { + if (AknTouchGestureFwEventDrag(aEvent)) + { + HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent)); + } + else if (AknTouchGestureFwEventTap(aEvent)) + { + HandleTapEventL(*AknTouchGestureFwEventTap(aEvent)); + } + //ignore flick and pinch events + } + +// ----------------------------------------------------------------------------- +// HandleTapEventL +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::HandleTapEventL( + MAknTouchGestureFwTapEvent& aEvent) + { + if(EAknTouchGestureFwLongTap == aEvent.Type()) + { + iObserver.LongTapL(aEvent.Position()); + } + else if(EAknTouchGestureFwTap == aEvent.Type()) + { + if( iPhysicsHelper->IsRunning()) + { + iPhysicsHelper->Stop(); + } + else + { + iObserver.TapL(aEvent.Position()); + } + } + } + +// ----------------------------------------------------------------------------- +// HandleDragEventL +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::HandleDragEventL( + MAknTouchGestureFwDragEvent& aEvent) + { + iObserver.Drag(aEvent); + iPhysicsHelper->HandleDragEvent(aEvent); + } + +// ----------------------------------------------------------------------------- +// PhysicEmulationEnded +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::ViewPositionChanged(const TPoint& aNewPosition, + TBool /*aDrawNow*/, + TUint /*aFlags*/) + { + iObserver.MoveOffset(aNewPosition); + } + +// ----------------------------------------------------------------------------- +// PhysicEmulationEnded +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::PhysicEmulationEnded() + { + iObserver.Stop(); + } + +// ----------------------------------------------------------------------------- +// ViewPosition +// ----------------------------------------------------------------------------- +// +TPoint CHgTeleportEventControler::ViewPosition() const + { + return iObserver.ViewPos(); + } + +// ----------------------------------------------------------------------------- +// Animate +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::Animate(const TPoint& aPoint) + { + iPhysicsHelper->AnimateToTarget(aPoint); + } + +// ----------------------------------------------------------------------------- +// ReInitPhysicL +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::ReInitPhysicsL(const TSize& aWorldSize, + const TSize& aViewSize, TBool aLandscape) + { + iPhysicsHelper->ReInitPhysicsL( aWorldSize, aViewSize, aLandscape); + } + +// ----------------------------------------------------------------------------- +// StopAnimation +// ----------------------------------------------------------------------------- +// +void CHgTeleportEventControler::StopAnimation() + { + iPhysicsHelper->Stop(); + } + +// end of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportfastswaparea.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportfastswaparea.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,1642 @@ +/* + * ============================================================================ + * Name : hgteleportfastswaparea.cpp + * Part of : Hg Teleport + * Description : Teleport Fast Swap area UI + * Version : %version: sa1spcx1#74 % + * + * Copyright © 2008 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#include <gulicon.h> +#include <eikenv.h> +#include <AknUtils.h> +#include <AknIconUtils.h> +#include <AknIconArray.h> +#include <aknstyluspopupmenu.h> +#include <AknQueryDialog.h> +#include <StringLoader.h> +#include <hgteleport.rsg> +#include <aknlayoutscalable_apps.cdl.h> +#include <layoutmetadata.cdl.h> +#include <aknlists.h> +#include <touchfeedback.h> +#include <akntransitionutils.h> +#include <akntranseffect.h> + +#include "hgteleportfastswaparea.h" +#include "hgteleportapplogging.h" +#include "hgfswclient.h" +#include "hgteleportappui.h" +#include "hgteleportdatachangeobserver.h" +#include "hgteleporteventcontroler.h" + +/** command ids for the fsw popup */ +enum TPopupCommands + { + EFswCmdClose = 10000, + EFswCmdCloseAll + }; + +/** Number of closable applications, to show "close all" option. */ +const TInt KHgMaxClosableApps = 2; + +/** Interval until which no change in the fsw content is rendered + after starting the closing of an application. */ +const TInt KRefreshDelayAfterClose = 2; // seconds + +/** Uid of Active Idle application. + Used when movind Ai to specified position.*/ +const TUid KAiUid = TUid::Uid( 0x102750F0 ); + +/** Position of Ai in fsw grid.*/ +const TInt KAiPosition = 0; + +/** Default grid item to highlight.*/ +const TInt KItemToHighlight = 3; + +const TInt KAppKeyTypeShort = 1; +const TInt KAppKeyTypeLong = 2; + +const TInt KLayoutItemCount = 3; + +const TInt KRedrawTime = 250000; // 0.25 sec +const TInt KHighlighActivationTime = 100000; // 100 ms +const TInt KUpdateGridTime = 1000000; // 1 s + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::NewL +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapArea* CHgTeleportFastSwapArea::NewL( const TRect& aRect, + CCoeControl& aParent, CHgTeleportDeviceState& aDeviceState, + CHgTeleportEventControler& aEventHandler ) + { + CHgTeleportFastSwapArea* self = CHgTeleportFastSwapArea::NewLC(aRect, + aParent, aDeviceState, aEventHandler); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::NewLC +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapArea* CHgTeleportFastSwapArea::NewLC( const TRect& aRect, + CCoeControl& aParent, CHgTeleportDeviceState& aDeviceState, + CHgTeleportEventControler& aEventHandler) + { + CHgTeleportFastSwapArea* self = new (ELeave) CHgTeleportFastSwapArea( + aParent, aDeviceState, aEventHandler); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::CHgTeleportFastSwapArea +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapArea::CHgTeleportFastSwapArea(CCoeControl& aParent, + CHgTeleportDeviceState& aDeviceState, + CHgTeleportEventControler& aEventHandler) : + iParent(aParent), iDeviceState(aDeviceState), iEvtHandler(aEventHandler), + iPreviousNoOfItems(0) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::~CHgTeleportFastSwapArea +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapArea::~CHgTeleportFastSwapArea() + { + iArray.ResetAndDestroy(); + delete iGrid; + delete iFSClient; + delete iPopup; + delete iConfirmCloseQuery; + delete iHighlightTimer; + delete iRedrawTimer; + delete iUpdateGridTimer; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::ConstructL( const TRect& aRect ) + { + SetContainerWindowL( iParent ); + + SetRect( aRect ); + + // setup ganes grid + ReCreateGridL(); + + // create stylus popup instance + PreCreatePopupL(); + + // connect to fsw server + iFSClient = CHgFswClient::NewL(); + + iEvtHandler.ReInitPhysicsL(GridWorldSize(), ViewSize(), ETrue); + + // add self to device state observer + iDeviceState.AddObserverL( *this, EDeviceType ); + + iHighlightTimer = new (ELeave) CHgTeleportFastSwapTimer( *this ); + iHighlightTimer->ConstructL(); + + iRedrawTimer = new (ELeave) CHgTeleportFastSwapTimer( *this ); + iRedrawTimer->ConstructL(); + + iUpdateGridTimer = new (ELeave) CHgTeleportFastSwapTimer( *this ); + iUpdateGridTimer->ConstructL(); + + ActivateL(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ReCreateGridL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::ReCreateGridL() + { + MCoeControlObserver* obs = NULL; + TBool wasHighlight = iDeviceState.DeviceType() == + CHgTeleportDeviceState::EHybrid ? ETrue : EFalse; + if ( iGrid ) + { + obs = iGrid->Observer(); + iDeviceState.RemoveObserver(*iGrid); + wasHighlight = iGrid->IsHighlightVisible(); + delete iGrid; + iGrid = NULL; + } + + iGrid = new( ELeave ) CHgTeleportFastSwapGrid; + iGrid->ConstructL( this ); + iDeviceState.AddObserverL(*iGrid, MHgDeviceStateObserver::ESkin); + + AknListBoxLayouts::SetupStandardGrid( *iGrid ); + + RArray<TAknLayoutRect> rects; + CleanupClosePushL(rects); + rects.ReserveL(KLayoutItemCount); + GetFastSwapAreaRects(rects); + TAknLayoutRect gridAppPane = rects[0]; + TAknLayoutRect gridItem = rects[1]; + TAknLayoutRect gridImage = rects[2]; + CleanupStack::PopAndDestroy(&rects); + + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + iGrid->SetRect(gridAppPane.Rect()); + iGrid->SetVisibleViewRect(gridAppPane.Rect()); + TAknLayoutScalableParameterLimits gridParams = + AknLayoutScalable_Apps::cell_tport_appsw_pane_ParamLimits( variety ); + TPoint empty( ELayoutEmpty, ELayoutEmpty ); + +#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT + AknListBoxLayouts::SetupFormGfxCell( *iGrid, iGrid->ItemDrawer(), 0, + AknLayoutScalable_Apps::cell_tport_appsw_pane_g1( variety ).LayoutLine(), + empty, empty ); +#else + TRect imageRect; + TRect textRect; + TInt leftMargin = ( KFswItemWidth - KFswImageSize ) / 2; + TInt topMargin = ( KFswItemHeight - KFswImageSize - KFswTextHeight ) / 3; + textRect.iTl = TPoint( leftMargin, topMargin ); + textRect.iBr = TPoint( leftMargin + KFswImageSize, topMargin + KFswTextHeight ); + imageRect.iTl = TPoint( leftMargin, topMargin * 2 + KFswTextHeight ); + imageRect.iBr = TPoint( leftMargin + KFswImageSize, topMargin * 2 + KFswTextHeight + KFswImageSize ); + + AknListBoxLayouts::SetupFormGfxCell( *iGrid, iGrid->ItemDrawer(), 0 /*Column index*/, + imageRect.iTl.iX /*Left pos*/, imageRect.iTl.iY /*Top pos*/, + 0 /*unused*/, 0 /*unused*/, + imageRect.Width() /*Icon width*/, + imageRect.Height() /*Icon height*/, + imageRect.iTl /*Start pos*/, + imageRect.iBr /*End pos*/ ); +#endif + + // Setup text layout + TRgb textColor; + AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG9 ); + + TAknLayoutText textLayout; + textLayout.LayoutText( + Rect(), + AknLayoutScalable_Apps::cell_tport_appsw_pane_t1( variety ).LayoutLine() ); + + // Because textLayout.BaselineOffset() does not work (missing lib entry), + // we need to calculate offset ourselves +#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT + TInt baselineOffset = textLayout.TextRect().iBr.iY - textLayout.TextRect().iTl.iY; + AknListBoxLayouts::SetupFormTextCell( *iGrid, iGrid->ItemDrawer(), 1 /*Column index*/, + textLayout.Font() /*Font type*/, + textColor.Color16() /*color*/, + textLayout.TextRect().iTl.iX /*Left margin*/, 0 /*unused*/, + baselineOffset /*Baseline*/, 0 /*Text width*/, + textLayout.Align() /*Text alignment*/, + TPoint(0,0) /*Start pos*/, + TPoint(0,0) /*End pos*/); +#else + TInt baselineOffset = textRect.iBr.iY - textRect.iTl.iY; + AknListBoxLayouts::SetupFormTextCell( *iGrid, iGrid->ItemDrawer(), 1 /*Column index*/, + textLayout.Font() /*Font type*/, + textColor.Color16() /*color*/, + textRect.iTl.iX /*Left margin*/, 0 /*unused*/, + baselineOffset /*Baseline*/, 0 /*Text width*/, + CGraphicsContext::ECenter /*Text alignment*/, + TPoint(0,0) /*Start pos*/, + TPoint(0,0) /*End pos*/); +#endif + + // Setup grid observers + if ( obs ) + { + iGrid->SetObserver( obs ); + } + iGrid->SetListBoxObserver(this); + iGrid->SetFastSwapGridObserver(this); + iGrid->SetContainerWindowL(*this); + +#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT + iMaxItemsOnScreen = Rect().Width() / gridItem.Rect().Width(); + iGridItemWidth = gridItem.Rect().Width(); +#else + iMaxItemsOnScreen = Rect().Width() / KFswItemWidth; + iGridItemWidth = KFswItemWidth; +#endif + + iGrid->ItemDrawer()->ColumnData()->SetDrawBackground(EFalse); + + // Update state + HandleDeviceStateChanged( EDeviceType ); + if( wasHighlight ) + { + iGrid->ShowHighlight(); + } + else + { + iGrid->HideHighlight(); + } + + // Make sure that there is an ActivateL call even when we are not + // called from ConstructL. (in order to have the grid's parent ptr set properly) + ActivateL(); + } + + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::GetFastSwapAreaRects +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::GetFastSwapAreaRects( RArray<TAknLayoutRect>& aRects ) + { + TAknLayoutRect gridAppPane; + TAknLayoutRect gridItem; + TAknLayoutRect gridImage; + + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + + gridAppPane.LayoutRect( Rect(), + AknLayoutScalable_Apps::tport_appsw_pane( variety ) ); + aRects.Append(gridAppPane); + + gridItem.LayoutRect( gridAppPane.Rect(), + AknLayoutScalable_Apps::cell_tport_appsw_pane( variety, 0, 0 ) ); + aRects.Append(gridItem); + + gridImage.LayoutRect( gridItem.Rect(), + AknLayoutScalable_Apps::cell_tport_appsw_pane_g1( variety ) ); + aRects.Append(gridImage); + } + + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::Setup +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::Setup( MCoeControlObserver& aControlObserver ) + { + iGrid->SetObserver( &aControlObserver ); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::SizeChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::SizeChanged() + { + HGLOG_CONTEXT( CHgTeleportFastSwapArea::SizeChanged, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( iGrid ) + { + // Grid needs to be recreated to proper reinitilize + // data with new layout values + TInt selIdx = SelectedIndex(); + TRAPD(err, + ReCreateGridL(); + iEvtHandler.ReInitPhysicsL(GridWorldSize(), ViewSize(), ETrue);); + if ( err != KErrNone ) + { + HGLOG1( HGLOG_INFO, "ReCreateGridL leaves with %d", err ); + } + HandleFswContentChanged(); + iGrid->SetCurrentDataIndex(selIdx); + UpdateGrid(ETrue, EFalse); + DrawDeferred(); + } + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::Draw +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, + cc, + this, + gc, + Rect() ); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::SwitchToApp +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::SwitchToApp( TInt aIndex ) + { + if ( aIndex >= 0 && aIndex < iArray.Count() ) + { + TInt wgId = iArray[aIndex]->WgId(); + // Move other app to foreground and then move ourselves to background. + // Order is important and cannot be reversed. + iFSClient->SwitchToApp( wgId ); + // We do not want to come back to teleport if the activated app is closed. + // Therefore teleport must be moved to background. + CHgTeleportAppUi* appui = + static_cast<CHgTeleportAppUi*>( iEikonEnv->AppUi() ); + appui->MoveAppToBackground( AknTransEffect::EApplicationStartRect ); + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::TryCloseAppL +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::TryCloseAppL( TInt aIndex, + TBool aSuppressRendering ) + { + HGLOG_CONTEXT( TryCloseAppL, HGLOG_LOCAL ); + HGLOG2_IN( "%d %d", aIndex, aSuppressRendering ); + + if ( aIndex >= 0 && aIndex < iArray.Count() && CanClose( aIndex ) ) + { + TInt wgId = iArray[aIndex]->WgId(); + iFSClient->CloseApp( wgId ); + // The fsw content will change sooner or later + // but the updated content (without the closed app) will not + // come very fast. It looks better to the user if the item + // in the grid is removed right here, right now. + // If the app does not close for some reason then this is + // not fully correct but the app will then reappear on the next + // content-changed notification anyway. + delete iArray[aIndex]; + iArray.Remove( aIndex ); + NotifyChange(); + if ( !aSuppressRendering ) + { + RenderContentL(); + } + // Update item selection on the screen if last item was deleted + TInt newItemCount = GridItemCount(); + if ( aIndex == newItemCount ) + { + newItemCount--; + iGrid->SetCurrentDataIndex(newItemCount); + } + iTimeOfLastClose.HomeTime(); + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::TryCloseAppWithQueryL +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::TryCloseAppWithQueryL( TInt aIndex ) + { + if ( aIndex >= 0 && aIndex < iArray.Count() + && CanClose( aIndex ) + && ConfirmCloseL( aIndex ) ) + { + TryCloseAppL( aIndex ); + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::TryCloseAllL +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::TryCloseAllL() + { + // note the direction of the loop, this is needed because + // TryCloseAppL may modify the array + TBool changed = EFalse; + for ( TInt i = iArray.Count() - 1; i >= 0; --i ) + { + if ( CanClose( i ) ) + { + TryCloseAppL( i, ETrue ); + changed = ETrue; + } + } + if ( changed ) + { + RenderContentL(); + RestoreSelectedIndex(); + iGrid->DrawNow(); + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::CanClose +// -------------------------------------------------------------------------- +// +TBool CHgTeleportFastSwapArea::CanClose( TInt aIndex ) const + { + CHgFswEntry* e = iArray[aIndex]; + return !e->AlwaysShown() && !e->SystemApp(); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::CanCloseOthers +// -------------------------------------------------------------------------- +// +TBool CHgTeleportFastSwapArea::CanCloseAll( TInt aSelectedItem ) const + { + TInt count( 0 ); + + // Count number of closable applications and if number exceeds 2 finish + // counting, because it is already enough to show the option. + for ( TInt i = iArray.Count(); --i >= 0 && count < KHgMaxClosableApps; ) + { + if ( CanClose( i ) ) + { + count++; + } + } + return ( count >= KHgMaxClosableApps ) || + ( count && !CanClose( aSelectedItem ) ); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandleFswContentChanged +// From MHgFswObserver +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandleFswContentChanged() + { + HGLOG_CONTEXT( HandleFswContentChanged, HGLOG_LOCAL ); + HGLOG_IN(); + + TRAPD( err, HandleFswContentChangedL() ); + if ( err != KErrNone ) + { + HGLOG1( HGLOG_INFO, "leave occured: %d", err ); + } + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandleFswContentChangedL +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandleFswContentChangedL() + { + HGLOG_CONTEXT( HandleFswContentChangedL, HGLOG_LOCAL ); + HGLOG_IN(); + + // If there was an app close operation started during the last + // few seconds then stop, to prevent flickering. + TTime now; + now.HomeTime(); + TTimeIntervalSeconds iv; + if ( now.SecondsFrom( iTimeOfLastClose, iv ) == KErrNone + && iv.Int() <= KRefreshDelayAfterClose ) + { + HGLOG1_OUT( "difference since last close is only %d sec, stop", iv.Int() ); + return; + } + + // get current content from fastswap server + iFSClient->GetContentL( iArray ); + SwapApplicationOrder( iArray ); + +#ifdef _DEBUG + for ( TInt i = 0, ie = iArray.Count(); i != ie; ++i ) + { + CHgFswEntry* e = iArray[i]; + const TDesC& name( e->AppName() ); + HGLOG4( HGLOG_INFO, "[%d]: %d %d %S", i, e->WgId(), e->AppUid(), &name ); + } +#endif + + // draw + RenderContentL(); + + // notify observer, if present + NotifyChange(); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::RenderContentL +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::RenderContentL() + { + HGLOG_CONTEXT( RenderContentL, HGLOG_LOCAL ); + HGLOG_IN(); + + _LIT(KSeparator, "\t"); + + CArrayPtr<CGulIcon>* iconArray = new ( ELeave ) CAknIconArray( iArray.Count() ); + CleanupStack::PushL( iconArray ); + CDesCArrayFlat* textArray = new ( ELeave ) CDesCArrayFlat( iArray.Count() ); + CleanupStack::PushL( textArray ); + RArray<TInt> closeItemArray; + CleanupClosePushL(closeItemArray); + + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + RArray<TAknLayoutRect> rects; + CleanupClosePushL(rects); + rects.ReserveL(KLayoutItemCount); + GetFastSwapAreaRects(rects); + TAknLayoutRect gridItem = rects[1]; + CleanupStack::PopAndDestroy(&rects); + if ( AknLayoutUtils::LayoutMirrored() ) + { +#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT + iGrid->SetLayoutL( EFalse, EFalse, ETrue, iArray.Count(), 1, gridItem.Rect().Size() ); +#else + TSize itemSize( KFswItemWidth, KFswItemHeight ); + iGrid->SetLayoutL( EFalse, EFalse, ETrue, iArray.Count(), 1, itemSize ); +#endif + } + else + { +#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT + iGrid->SetLayoutL( EFalse, ETrue, ETrue, iArray.Count(), 1, gridItem.Rect().Size() ); +#else + TSize itemSize( KFswItemWidth, KFswItemHeight ); + iGrid->SetLayoutL( EFalse, ETrue, ETrue, iArray.Count(), 1, itemSize ); +#endif + } + + for ( TInt i = 0, ie = iArray.Count(); i != ie; ++i ) + { + const TDesC& appName( iArray[i]->AppName() ); + const TInt formatLen = 3 + 2; + RBuf formAppName; + CleanupClosePushL(formAppName); + formAppName.CreateL(appName.Length() + formatLen); + formAppName.AppendNum(i); + formAppName.Append(KSeparator); + formAppName.Append(appName); + textArray->AppendL(formAppName); + CleanupStack::PopAndDestroy(&formAppName); + TSize sz = PreferredImageSize(); + + // take the screenshot or appicon+mask and make a copy and scale + CFbsBitmap* bitmap = 0; + TInt h = iArray[i]->ScreenshotHandle(); + HGLOG2( HGLOG_INFO, "'%S' screenshot handle %d", &appName, h ); + TInt maskh = 0; + CFbsBitmap* mask = 0; + if ( !h ) + { + h = iArray[i]->AppIconBitmapHandle(); + maskh = iArray[i]->AppIconMaskHandle(); + HGLOG1( HGLOG_INFO, "using appicon, handle = %d", h ); + } + __ASSERT_DEBUG( h, User::Invariant() ); + bitmap = CopyBitmapL( h, sz ); + CleanupStack::PushL( bitmap ); + if ( maskh ) + { + mask = CopyBitmapL( maskh, sz ); + } + CleanupStack::PushL( mask ); + + CGulIcon* icon = CGulIcon::NewL( bitmap, mask ); + CleanupStack::PushL(icon); + iconArray->AppendL(icon); + CleanupStack::Pop( 3, bitmap ); // mask, bitmap, icon + + // Check if item can be closed + if ( CanClose(i) && AknLayoutUtils::PenEnabled() ) + { + closeItemArray.AppendL(i); + } + } + // Setup grid + iGrid->Model()->SetItemTextArray(textArray); + CArrayPtr<CGulIcon>* oldIconArray = + iGrid->ItemDrawer()->FormattedCellData()->IconArray(); + if(oldIconArray) + { + delete oldIconArray; + oldIconArray = NULL; + } + iGrid->ItemDrawer()->FormattedCellData()->SetIconArrayL(iconArray); + iGrid->SetCloseItemsL(closeItemArray); + + // Cleanup + CleanupStack::PopAndDestroy(&closeItemArray); + CleanupStack::Pop(textArray); + CleanupStack::Pop(iconArray); + + iGrid->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff); + + // refresh the items in the grid + if(iPreviousNoOfItems < iArray.Count()) + { + iGrid->HandleItemAdditionL(); + } + else if(iPreviousNoOfItems > iArray.Count()) + { + iGrid->HandleItemRemovalL(); + } + iPreviousNoOfItems = iArray.Count(); + iEvtHandler.ReInitPhysicsL( GridWorldSize(), ViewSize(), ETrue ); + UpdateGrid( ETrue ); + + HGLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::CopyBitmapL +// Copy and scale. +// -------------------------------------------------------------------------- +// +CFbsBitmap* CHgTeleportFastSwapArea::CopyBitmapL( TInt aFbsHandle, TSize aSize ) + { + CFbsBitmap* ret = new (ELeave) CFbsBitmap(); + CleanupStack::PushL( ret ); + + CFbsBitmap* bmp = new (ELeave) CFbsBitmap(); + CleanupStack::PushL( bmp ); + User::LeaveIfError( bmp->Duplicate( aFbsHandle ) ); + + // do not always use aSize, preserving the aspect ratio is quite + // important when showing app icons instead of screenshots + TSize sz = CalculateSizePreserveRatio( aSize, bmp->SizeInPixels() ); + + User::LeaveIfError( ret->Create( sz, bmp->DisplayMode() ) ); + + AknIconUtils::ScaleBitmapL( sz, ret, bmp ); + + CleanupStack::PopAndDestroy( bmp ); + CleanupStack::Pop( ret ); + + return ret; + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::CountComponentControls +// -------------------------------------------------------------------------- +// +TInt CHgTeleportFastSwapArea::CountComponentControls() const + { + return 1; + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ComponentControl +// -------------------------------------------------------------------------- +// +CCoeControl* CHgTeleportFastSwapArea::ComponentControl( TInt aIndex ) const + { + if ( aIndex == 0 ) + { + return iGrid; + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandleSwitchToBackgroundEvent +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandleSwitchToBackgroundEvent() + { + // stop listening for changes in fsw content + iFSClient->CancelSubscribe(); + // get rid of the close confirmation query if shown + delete iConfirmCloseQuery; // this will cause ExecuteLD to return with 0 + iConfirmCloseQuery = 0; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandleSwitchToForegroundEvent +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandleSwitchToForegroundEvent() + { + HGLOG_CONTEXT( CHgTeleportFastSwapArea::HandleSwitchToForegroundEvent, HGLOG_LOCAL ); + HGLOG_IN(); + + // get the current task list + HandleFswContentChanged(); + // and then start listening for changes + iFSClient->Subscribe( *this ); + + if ( iDeviceState.DeviceType() == CHgTeleportDeviceState::EFullTouch ) + { + iGrid->HideHighlight(); + } + else + { + iGrid->ShowHighlight(); + } + + RestoreSelectedIndex(); + UpdateGrid(ETrue, EFalse); + + iRedrawTimer->Cancel(); + iRedrawTimer->After(KRedrawTime); + + // give feedback + LaunchPopupFeedback(); + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::FocusChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::FocusChanged( TDrawNow /*aDrawNow*/ ) + { + if ( IsFocused() ) + { + // if in non-touch mode then select (highlight) some item + if ( !AknLayoutUtils::PenEnabled() + && SelectedIndex() == KErrNotFound + && GridItemCount() ) + { + RestoreSelectedIndex(); + } + } + else + { + // store the currently selected index if there is one + SaveSelectedIndex(); + } + iGrid->DrawDeferred(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CHgTeleportFastSwapArea::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + iKeyEvent = ETrue; + // handle the 'clear' key + if ( aType == EEventKey && aKeyEvent.iCode == EKeyBackspace ) + { + TInt idx = SelectedIndex(); + if ( idx >= 0 ) + { + TryCloseAppWithQueryL( idx ); + } + return EKeyWasConsumed; + } + + //do not forward the event until item is higlighted + if( aKeyEvent.iScanCode == EStdKeyLeftArrow || + aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + if ( !iGrid->IsHighlightVisible() ) + { + if ( aType == EEventKey ) + { + ShowHighlight(); + iConsumeEvent = ETrue; + } + return EKeyWasConsumed; + } + else if(iConsumeEvent) + { + if (aType == EEventKeyUp) + { + return EKeyWasConsumed; + } + iConsumeEvent = EFalse; + } + } + + // pass the event to grid + // do not pass down and up arrow key events + if ( aKeyEvent.iScanCode != EStdKeyUpArrow && + aKeyEvent.iScanCode != EStdKeyDownArrow ) + { + TBool animate(ETrue); + TBool redraw(EFalse); + TInt prevItem = SelectedIndex(); + TKeyResponse response = iGrid->OfferKeyEventL( aKeyEvent, aType ); + if ( prevItem != SelectedIndex() && // item changed + ( ( prevItem == 0 && + SelectedIndex() == GridItemCount() - 1 && + GridItemCount() > iMaxItemsOnScreen + 1 ) || // loop from first to last item + ( prevItem == GridItemCount() - 1 && + SelectedIndex() == 0 && + GridItemCount() > iMaxItemsOnScreen + 1) // loop from last to first item + ) // loop + ) + { + // Loop occured + animate = EFalse; + } + if ( prevItem != SelectedIndex() ) + { + redraw = ETrue; + iGrid->ShowHighlight(); + } + UpdateGrid( redraw, animate ); + return response; + } + + return EKeyWasNotConsumed; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + iKeyEvent = EFalse; + if(aPointerEvent.iType == TPointerEvent::EButton1Down) + { + iTapEvent = aPointerEvent; + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ConfirmCloseL +// ----------------------------------------------------------------------------- +// +TBool CHgTeleportFastSwapArea::ConfirmCloseL( TInt aIndex ) + { + HBufC* msg = StringLoader::LoadLC( R_TELEPORT_FSW_CONFIRM_CLOSE, + iArray[aIndex]->AppName() ); + iConfirmCloseQuery = CAknQueryDialog::NewL( + CAknQueryDialog::EConfirmationTone ); + iConfirmCloseQuery->SetPromptL( *msg ); + CleanupStack::PopAndDestroy( msg ); + TBool ok = iConfirmCloseQuery->ExecuteLD( + R_HG_TELEPORT_FSW_CONFIRM_CLOSE_QUERY ); + iConfirmCloseQuery = 0; + return ok; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::SelectedIndex +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportFastSwapArea::SelectedIndex() const + { + return iGrid->CurrentDataIndex(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::SaveSelectedIndex +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::SaveSelectedIndex() + { + iSavedSelectedIndex = SelectedIndex(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::RestoreSelectedIndex +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::RestoreSelectedIndex() + { + iSavedSelectedIndex = KErrNotFound; + if ( GridItemCount() ) + { + // highlight second recent item (that has index 2) if possible + TInt highlightItem = 0; + TInt count = GridItemCount(); + while( highlightItem < count + && highlightItem < KItemToHighlight ) + { + ++highlightItem; + } + iSavedSelectedIndex = highlightItem - 1;//count from 0 + iGrid->SetCurrentItemIndex( iSavedSelectedIndex ); + TBool forceRedraw(ETrue); + UpdateGrid(forceRedraw); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ProcessCommandL +// Handle fsw popup commands +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::ProcessCommandL( TInt aCommandId ) + { + switch ( aCommandId ) + { + case EFswCmdClose: + TryCloseAppL( iAppIndexForPopup ); + break; + + case EFswCmdCloseAll: + TryCloseAllL(); + break; + + case KErrCancel: + // popup dismisses automatically when tapping outside or when switching to other app + break; + } + iTapEvent.iType = TPointerEvent::EButton1Up; + iGrid->HandlePointerEventL(iTapEvent); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandleCloseEventL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandleCloseEventL(TInt aItemIdx) + { + if ( !iLongTap ) + { + TryCloseAppWithQueryL( aItemIdx ); + } + // Simulate long tap to prevent item activation + iLongTap = ETrue; + iTapEvent.iType = TPointerEvent::EButton1Up; + iGrid->HandlePointerEventL(iTapEvent); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandleDeviceStateChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandleDeviceStateChanged( TChangeType aChangeType ) + { + if ( aChangeType == EDeviceType ) + { + CHgTeleportDeviceState::TDeviceType state = iDeviceState.DeviceType(); + switch ( state ) + { + case CHgTeleportDeviceState::EHybrid: + { + iGrid->SetGridBehaviour( CHgTeleportFastSwapGrid::EHybrid ); + } + break; + case CHgTeleportDeviceState::EFullTouch: + { + iGrid->SetGridBehaviour( CHgTeleportFastSwapGrid::ETouchOnly ); + } + break; + default: + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::TimerCompletedL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::TimerCompletedL( CHgTeleportFastSwapTimer* aSource ) + { + if(aSource == iHighlightTimer) + { + iTapEvent.iType = TPointerEvent::EButton1Up; + iGrid->HandlePointerEventL(iTapEvent); + } + else if(aSource == iRedrawTimer) + { + DrawNow(); + } + else if( aSource == iUpdateGridTimer ) + { + UpdateGrid(ETrue, ETrue); + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::PreCreatePopupL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::PreCreatePopupL() + { + if ( !iPopup ) + { + iPopup = CAknStylusPopUpMenu::NewL( this, Rect().iTl ); + HBufC* text = StringLoader::LoadLC( R_TELEPORT_FSW_CLOSE ); + iPopup->AddMenuItemL( *text, EFswCmdClose ); + CleanupStack::PopAndDestroy( text ); + text = StringLoader::LoadLC( R_TELEPORT_FSW_CLOSE_ALL ); + iPopup->AddMenuItemL( *text, EFswCmdCloseAll ); + CleanupStack::PopAndDestroy( text ); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ShowPopupL +// ----------------------------------------------------------------------------- +// +TBool CHgTeleportFastSwapArea::ShowPopupL( TInt aIndex, const TPoint& aPoint ) + { + TBool showPopUp(EFalse); + TBool showPopupItem; + // hide 'close' if app cannot be closed + showPopupItem = CanClose( aIndex ); + iPopup->SetItemDimmed( EFswCmdClose, !showPopupItem ); + showPopUp = showPopUp || showPopupItem; + // hide 'close all' if there are no applications to close. + showPopupItem = CanCloseAll( aIndex ); + iPopup->SetItemDimmed( EFswCmdCloseAll, !showPopupItem ); + showPopUp = showPopUp || showPopupItem; + + if(showPopUp) + { + // give feedback + LaunchPopupFeedback(); + // save index for later use & show popup + iAppIndexForPopup = aIndex; + iPopup->SetPosition( aPoint, CAknStylusPopUpMenu::EPositionTypeLeftBottom ); + iPopup->ShowMenu(); + } + return showPopUp; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::Count +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportFastSwapArea::Count() const + { + return iArray.Count(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::SetDataChangeObserver +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::SetDataChangeObserver( + MHgTeleportDataChangeObserver* aDcObserver ) + { + iDcObserver = aDcObserver; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::NotifyChange +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::NotifyChange() + { + if ( iDcObserver ) + { + iDcObserver->DataChanged( this, Count() ); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::SwapApplicationOrder +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::SwapApplicationOrder( + RPointerArray<CHgFswEntry>& aArray ) + { + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + if( aArray[i]->AppUid() == KAiUid ) + { + CHgFswEntry* homescreenEntry(0); + homescreenEntry = aArray[i]; + aArray.Remove(i); + aArray.Insert(homescreenEntry, KAiPosition); + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::PreferredImageSize +// ----------------------------------------------------------------------------- +// +TSize CHgTeleportFastSwapArea::PreferredImageSize() + { +#ifndef TASKSWITCHER_USE_CUSTOM_LAYOUT + TAknLayoutRect gridImage; + TRAP_IGNORE( + RArray<TAknLayoutRect> rects; + CleanupClosePushL(rects); + rects.ReserveL(KLayoutItemCount); + GetFastSwapAreaRects(rects); + gridImage = rects[2]; + CleanupStack::PopAndDestroy(&rects); + ); + return gridImage.Rect().Size(); +#else + return TSize( KFswImageSize, KFswImageSize ); +#endif + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::GridItemCount +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportFastSwapArea::GridItemCount() + { + return iGrid->Model()->ItemTextArray()->MdcaCount(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandleListBoxEventL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType) + { + if ( aListBox == iGrid ) + { + switch ( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemClicked: + { + if (!iLongTap) + { + SwitchToApp(SelectedIndex()); + } + } + break; + case EEventPenDownOnItem: + { + iGrid->HideHighlight(); + iGrid->ShowHighlight(); + if (!iLongTap ) + { + iHighlightTimer->Cancel(); + iHighlightTimer->After(KHighlighActivationTime); + } + } + break; + default: + break; + } + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::CalculateSizePreserveRatio +// -------------------------------------------------------------------------- +// +TSize CHgTeleportFastSwapArea::CalculateSizePreserveRatio( + const TSize& aTargetAreaSize, + const TSize& aSourceSize ) + { + TSize sz; + if ( aSourceSize.iWidth > aSourceSize.iHeight ) + { + sz.iWidth = aTargetAreaSize.iWidth; + TReal ratio = aSourceSize.iWidth / (TReal) aSourceSize.iHeight; + sz.iHeight = sz.iWidth / ratio; + } + else + { + sz.iHeight = aTargetAreaSize.iHeight; + TReal ratio = aSourceSize.iHeight / (TReal) aSourceSize.iWidth; + sz.iWidth = sz.iHeight / ratio; + } + return sz; + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::SelectNextItem +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::SelectNextItem() + { + iKeyEvent = ETrue; + TBool forceRedraw(ETrue); + TBool animate(ETrue); + TInt selectedItem = SelectedIndex(); + selectedItem++; + if ( selectedItem == GridItemCount() ) + { + // Last item is selected, move to first one + selectedItem = 0; + animate = EFalse; + } + iGrid->SetCurrentItemIndex(selectedItem); + UpdateGrid(forceRedraw, animate); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ShowHiglight +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::ShowHighlight() + { + iGrid->ShowHighlight(); + UpdateGrid(ETrue, EFalse); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::CenterItem +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::CenterItem(TInt aRedrawDelay) + { + if( iMaxItemsOnScreen < GridItemCount() ) + { + TInt visibleItem = ViewToVisibleItem( ViewPos() ); + if(iKeyEvent) + { + visibleItem = SelectedIndex(); + } + iGrid->SetCurrentDataIndex( visibleItem ); + } + + iUpdateGridTimer->Cancel(); + iUpdateGridTimer->After(aRedrawDelay); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::GridWorldSize +// -------------------------------------------------------------------------- +// +TSize CHgTeleportFastSwapArea::GridWorldSize() + { + return TSize( GridItemCount() * iGridItemWidth, Rect().Height() ); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::UpdateGrid +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::UpdateGrid( TBool aForceRedraw, TBool aAnimate ) + { + TPoint targetPoint = ItemViewPosition( SelectedIndex() ); + if ( aForceRedraw || targetPoint.iX != ViewPos().iX ) + { + if ( aAnimate ) + { + iEvtHandler.Animate( targetPoint ); + } + else + { + MoveOffset(targetPoint); + iEvtHandler.StopAnimation(); + } + if ( aForceRedraw ) + { + iGrid->DrawNow(); + } + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::HandleAppKey +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::HandleAppKey(TInt aType) + { + if( aType == KAppKeyTypeShort ) + { + if(iGrid->IsHighlightVisible()) + { + SelectNextItem(); + } + else + { + ShowHighlight(); + } + } + else if( aType == KAppKeyTypeLong ) + { + SwitchToApp( SelectedIndex() ); + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::MoveOffset +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::MoveOffset(const TPoint& aPoint) + { + HGLOG_CONTEXT( CHgTeleportFastSwapArea::MoveOffset, HGLOG_LOCAL ); + HGLOG2_IN("Old position x: %d, y:%d", ViewPos().iX, ViewPos().iY); + HGLOG2_IN("New position x: %d, y:%d", aPoint.iX, aPoint.iY); + HGLOG_OUT(); + + TInt currentXPos = aPoint.iX; + currentXPos -= Rect().Width() / 2; + TRect gridViewRect = Rect(); + gridViewRect.iTl.iX = -currentXPos; + // Take edge offset into account + gridViewRect.iTl.iX += Rect().iTl.iX; + if(GridItemCount() <= iMaxItemsOnScreen) + { + // Center view + gridViewRect.iTl.iX += ( Rect().Width() - GridItemCount() * iGridItemWidth ) / 2; + } + iGrid->SetRect( gridViewRect ); + DrawNow(); + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::Tap +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::TapL(const TPoint& aPoint) + { + iLongTap = EFalse; + if(iGrid->Rect().Contains(aPoint)) + { + //provide tap pointer event to grid + iGrid->HandlePointerEventL(iTapEvent); + } + else + { + //move task switcher to background + iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::LongTap +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::LongTapL(const TPoint& aPoint) + { + iLongTap = ETrue; + TInt index(KErrNotFound); + if( iGrid->GridView()->XYPosToItemIndex(aPoint,index) ) + { + if ( AknLayoutUtils::LayoutMirrored() ) + { + // Calculate logical item index + index = GridItemCount() - 1 - index; + } + SaveSelectedIndex(); + iGrid->HandlePointerEventL(iTapEvent); + if ( !ShowPopupL(index, aPoint) ) + { + TapL(aPoint); + } + } + else + { + TapL(aPoint); + } + } + +// -------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::Drag +// -------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::Drag( + const MAknTouchGestureFwDragEvent& /*aEvent*/) + { + iGrid->HideHighlight(); + CenterItem( KUpdateGridTime ); + DrawNow(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ViewSize +// ----------------------------------------------------------------------------- +// +TSize CHgTeleportFastSwapArea::ViewSize() + { + return TSize(Rect().Width(), Rect().Height()); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::Stop +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::Stop() + { + CenterItem( KUpdateGridTime ); + DrawNow(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ViewSize +// ----------------------------------------------------------------------------- +// +TPoint CHgTeleportFastSwapArea::ViewPos() const + { + TPoint retVal; + retVal.iY = iGrid->Rect().iTl.iY + Rect().Height() / 2; + retVal.iX = - (iGrid->Rect().iTl.iX - Rect().iTl.iX) + Rect().Width() / 2 ; + TInt gridItemCount = iGrid->Model()->ItemTextArray()->MdcaCount(); + if( gridItemCount <= iMaxItemsOnScreen) + { + // View centered + retVal.iX += ( Rect().Width() - gridItemCount * iGridItemWidth ) / 2; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ItemPosition +// ----------------------------------------------------------------------------- +// +TPoint CHgTeleportFastSwapArea::ItemViewPosition( TInt aItemIdx ) + { + TPoint retVal = Rect().iTl; + if ( aItemIdx == 0 ) + { + // First item + if( AknLayoutUtils::LayoutMirrored() ) + { + if ( GridItemCount() > iMaxItemsOnScreen ) + { + retVal.iX = GridWorldSize().iWidth - Rect().Width(); + } + else + { + retVal.iX = 0; + } + } + else // normal layout + { + retVal.iX = 0; + } + } + else if ( aItemIdx == GridItemCount() - 1 ) + { + // Last item selected + if( AknLayoutUtils::LayoutMirrored() ) + { + retVal.iX = 0; + } + else // normal layout + { + if ( GridItemCount() > iMaxItemsOnScreen ) + { + retVal.iX = GridWorldSize().iWidth - Rect().Width(); + } + else + { + retVal.iX = 0; + } + } + } + else + { + // Middle item + TInt screenMiddleItemOffset = ( Rect().Width() - iGridItemWidth ) / 2; + if( AknLayoutUtils::LayoutMirrored() ) + { + retVal.iX = iGridItemWidth * ( GridItemCount() - 1 - aItemIdx ) - screenMiddleItemOffset; + } + else // normal layout + { + retVal.iX = iGridItemWidth * aItemIdx - screenMiddleItemOffset; + } + if ( retVal.iX < 0 ) + { + retVal.iX = 0; + } + else if ( retVal.iX + Rect().Width() > GridWorldSize().iWidth ) + { + retVal.iX = GridWorldSize().iWidth - Rect().Width(); + } + } + + // Return middle of the view rectangle + retVal.iX += Rect().Width() / 2; + + return retVal; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::ViewToVisibleItem +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportFastSwapArea::ViewToVisibleItem( const TPoint aViewPos ) + { + TInt retVal(0); + TPoint absViewPos = aViewPos; + absViewPos.iX -= Rect().Width() / 2; + if ( absViewPos.iX < 0 ) + { + if ( AknLayoutUtils::LayoutMirrored() ) + { + // View crossed left border of grid world rect, last item selected + retVal = GridItemCount() - 1; + } + else // normal layout + { + // View crossed left border of grid world rect, first item selected + retVal = 0; + } + } + else if ( absViewPos.iX + Rect().Width() > GridWorldSize().iWidth ) + { + if ( AknLayoutUtils::LayoutMirrored() ) + { + // View crossed right border of grid world rect, first item selected + retVal = 0; + } + else // normal layout + { + // View crossed right border of grid world rect, last item selected + retVal = GridItemCount() - 1; + } + } + else + { + TInt offsetCheck = GridWorldSize().iWidth; + // View inside of grid world rect + for ( TInt i = 0 ; i < GridItemCount(); i++ ) + { + TInt offset = aViewPos.iX - ItemViewPosition( i ).iX; + if ( Abs( offset ) <= offsetCheck ) + { + offsetCheck = Abs( offset ); + retVal = i; + } + else + { + break; + } + } + } + return retVal; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapArea::LaunchPopupFeedback +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapArea::LaunchPopupFeedback() + { + if ( AknLayoutUtils::PenEnabled() ) + { + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if ( feedback ) + { + TTouchLogicalFeedback fbLogicalType = ETouchFeedbackPopUp; + if ( CAknTransitionUtils::TransitionsEnabled( + AknTransEffect::EComponentTransitionsOff ) ) + { + fbLogicalType = ETouchFeedbackIncreasingPopUp; + } + feedback->InstantFeedback( this, + fbLogicalType, + ETouchFeedbackVibra, + TPointerEvent() ); + } + } + } + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportfastswapgrid.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportfastswapgrid.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,625 @@ +/* + * ============================================================================ + * Name : hgteleportfastswapgrid.cpp + * Part of : Hg Teleport + * Description : Teleport Fast Swap area UI + * Version : %version: 19 % + * + * Copyright © 2009 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#include <avkon.mbg> +#include <aknlayoutscalable_apps.cdl.h> +#include <layoutmetadata.cdl.h> +#include <AknsFrameBackgroundControlContext.h> +#include <touchfeedback.h> + +#include "hgteleportfastswapgrid.h" + +// TODO: Layout update +const TInt KCloseIconSize = 30; + + + /* ================================================================================ + * CHgTeleportFastSwapGrid + * ================================================================================ + */ + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::CHgTeleportFastSwapGrid +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapGrid::CHgTeleportFastSwapGrid() +: CAknGrid(), + iCloseIconHitIdx( KErrNotFound ), + iBehaviour( ETouchOnly ), + iHighlightVisible( EFalse ) + { + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::~CHgTeleportFastSwapGrid +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapGrid::~CHgTeleportFastSwapGrid() + { + iCloseItems.Close(); + delete iBgContext; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::ConstructL( const CCoeControl* aParent ) + { + CAknGrid::ConstructL( aParent, EAknListBoxSelectionGrid ); + SetPrimaryScrollingType(CAknGridView::EScrollFollowsItemsAndLoops); + SetSecondaryScrollingType(CAknGridView::EScrollFollowsItemsAndLoops); + iBgContext = CAknsFrameBackgroundControlContext::NewL( + KAknsIIDQsnFrPopup, + TRect(), + TRect(), + ETrue ); + iBgContext->SetCenter( KAknsIIDQsnFrPopupCenter ); + iVisibleViewRect = TRect( 0, 0, 0, 0 ); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::HandlePointerEventL( const TPointerEvent &aPointerEvent ) + { + TBool eventHandled( EFalse ); + if ( aPointerEvent.iType == TPointerEvent::EButton1Up && + iCloseIconHitIdx == KErrNotFound ) + { + // Check if close icon has been hit + // Find hit item + TInt hitItem( KErrNotFound ); + for ( TInt i = 0; i < Model()->NumberOfItems(); i++ ) + { + if ( GridView()->XYPosToItemIndex( aPointerEvent.iParentPosition, i ) ) + { + hitItem = i; + break; + } + } + if ( hitItem != KErrNotFound ) + { + // Item found, check if close icon has been hit + TPoint itemPos = GridView()->ItemPos( hitItem ); + TSize itemSize = GridView()->ItemSize( hitItem ); + TRect itemRect( itemPos, itemSize ); + CHgTeleportGridItemDrawer* itemDrawer = + static_cast<CHgTeleportGridItemDrawer*>( ItemDrawer() ); + TRect closeIconRect = itemDrawer->GetCloseIconRect( itemRect ); + if ( closeIconRect.Contains( aPointerEvent.iParentPosition ) ) + { + // Close icon hit + iCloseIconHitIdx = hitItem; + eventHandled = ETrue; + // Hide highlight to mark close icon + HideHighlight(); + // Update current item and redraw grid + SetCurrentItemIndex( hitItem ); + DrawNow(); + if ( iFastSwapGridObserver ) + { + MTouchFeedback* feedback = MTouchFeedback::Instance(); + feedback->InstantFeedback(this, + ETouchFeedbackBasicButton, + ETouchFeedbackVibra, + aPointerEvent); + iFastSwapGridObserver->HandleCloseEventL( hitItem ); + } + ResetCloseHit(); + if ( GridBehaviour() == EHybrid ) + { + ShowHighlight(); + } + else + { + Redraw(); + } + } + } + } + + if ( !eventHandled ) + { + CAknGrid::HandlePointerEventL( aPointerEvent ); + Redraw(); + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::HandleDeviceStateChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::HandleDeviceStateChanged( TChangeType aChangeType ) + { + if ( aChangeType == ESkin ) + { + LoadCloseIcon(); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::MopSupplyObject +// ----------------------------------------------------------------------------- +// +TTypeUid::Ptr CHgTeleportFastSwapGrid::MopSupplyObject( TTypeUid aId ) + { + if ( aId.iUid == MAknsControlContext::ETypeId ) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CCoeControl::MopSupplyObject( aId ); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::HandleResourceChange( TInt aType ) + { + if ( aType != KEikDynamicLayoutVariantSwitch ) + { + CAknGrid::HandleResourceChange( aType ); + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::SizeChanged +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::SizeChanged() + { + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::SetFastSwapGridObserver +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::SetFastSwapGridObserver( MHgTeleportFastSwapGridObserver* aObserver ) + { + iFastSwapGridObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::CreateItemDrawerL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::CreateItemDrawerL() + { + TRect availableRect; + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, availableRect); + TAknLayoutRect fastSwapAreaPane; + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + fastSwapAreaPane.LayoutRect( availableRect, + AknLayoutScalable_Apps::tport_appsw_pane( variety ) ); + const TInt leftOffset = fastSwapAreaPane.Rect().iTl.iX; + const TInt rightOffset = availableRect.Width() - fastSwapAreaPane.Rect().iBr.iX; + + CFormattedCellGridData* data = CFormattedCellGridData::NewL(); + CleanupStack::PushL( data ); + CHgTeleportGridItemDrawer* itemDrawer = + new ( ELeave ) CHgTeleportGridItemDrawer( this, data ); + CleanupStack::PushL( itemDrawer ); + itemDrawer->SetEdgeOffset( leftOffset, rightOffset ); + iItemDrawer = itemDrawer; + CleanupStack::Pop( itemDrawer ); + CleanupStack::Pop( data ); + LoadCloseIcon(); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::SetCloseItemsL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::SetCloseItemsL( RArray<TInt>& aItemIndex ) + { + iCloseItems.Close(); + for ( TInt i = 0; i < aItemIndex.Count(); i++ ) + { + iCloseItems.AppendL( aItemIndex[i] ); + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::CanCloseItem +// ----------------------------------------------------------------------------- +// +TBool CHgTeleportFastSwapGrid::CanCloseItem( TInt aItemIndex ) + { + return iCloseItems.Find(aItemIndex) != KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::ItemCloseHit +// ----------------------------------------------------------------------------- +// +TBool CHgTeleportFastSwapGrid::IsItemCloseHit( TInt aItemIndex ) + { + return iCloseIconHitIdx == aItemIndex; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::ResetCloseHit +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::ResetCloseHit() + { + iCloseIconHitIdx = KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::SetBehaviour +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::SetGridBehaviour( TFastSwapGridBehaviour aBehaviour ) + { + iBehaviour = aBehaviour; + switch ( iBehaviour ) + { + case ETouchOnly: + { + HideHighlight(); + } + break; + default: + { + ShowHighlight(); + } + break; + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::GridBehaviour +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapGrid::TFastSwapGridBehaviour CHgTeleportFastSwapGrid::GridBehaviour() + { + return iBehaviour; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::ShowHighlight +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::ShowHighlight() + { + if ( !iHighlightVisible ) + { + // Draw highlight + iHighlightVisible = ETrue; + Redraw(); + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::HideHighlight +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::HideHighlight() + { + if ( iHighlightVisible ) + { + iHighlightVisible = EFalse; + Redraw(); + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::IsHighlightVisible +// ----------------------------------------------------------------------------- +// +TBool CHgTeleportFastSwapGrid::IsHighlightVisible() + { + return iHighlightVisible; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::SetVisibleViewRect +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::SetVisibleViewRect( const TRect aRect ) + { + iVisibleViewRect = aRect; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::VisibleViewRect +// ----------------------------------------------------------------------------- +// +TRect CHgTeleportFastSwapGrid::VisibleViewRect() + { + TRect retVal; + TRect emptyRect = TRect( 0, 0, 0, 0 ); + if ( iVisibleViewRect == emptyRect ) + { + retVal = Rect(); + } + else + { + retVal = iVisibleViewRect; + } + return retVal; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::LoadCloseIconL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::LoadCloseIcon() + { + // Load and set close icon + CFbsBitmap* icon = NULL; + CFbsBitmap* mask = NULL; + + TRAP_IGNORE(AknsUtils::CreateIconLC( AknsUtils::SkinInstance(), + KAknsIIDQgnIndiItutListCollapse, + icon, + mask, + KAvkonBitmapFile, + EMbmAvkonQgn_indi_button_preview_close, + EMbmAvkonQgn_indi_button_preview_close_mask + ); + CleanupStack::Pop( 2 ); // codescanner::cleanup + ); + + // TODO: Layout update + AknIconUtils::SetSize( icon, TSize( KCloseIconSize, KCloseIconSize ), EAspectRatioPreserved ); + AknIconUtils::SetSize( mask, TSize( KCloseIconSize, KCloseIconSize ), EAspectRatioPreserved ); + + static_cast<CHgTeleportGridItemDrawer*>(iItemDrawer)->SetCloseIcon( icon, mask ); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportFastSwapGrid::Redraw +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapGrid::Redraw() + { + DrawDeferred(); + CCoeControl* ctrlToRedraw = Parent(); + if ( ctrlToRedraw ) + { + ctrlToRedraw->DrawDeferred(); + ctrlToRedraw = ctrlToRedraw->Parent(); + if ( ctrlToRedraw ) + { + ctrlToRedraw->DrawNow(); + } + } + } + + +/* ================================================================================ + * CHgTeleportGridItemDrawer + * ================================================================================ + */ + +// ----------------------------------------------------------------------------- +// CHgTeleportGridItemDrawer::CHgTeleportGridItemDrawer +// ----------------------------------------------------------------------------- +// +CHgTeleportGridItemDrawer::CHgTeleportGridItemDrawer( + CHgTeleportFastSwapGrid* aGrid, + CFormattedCellListBoxData* aData ) +: CFormattedCellListBoxItemDrawer( aGrid->Model(), + NULL, + aData ), + iGrid( aGrid ) + { + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, iScreenRect); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridItemDrawer::~CHgTeleportGridItemDrawer +// ----------------------------------------------------------------------------- +// +CHgTeleportGridItemDrawer::~CHgTeleportGridItemDrawer() + { + delete iCloseIcon; + delete iCloseIconMask; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridItemDrawer::SetCloseIcon +// ----------------------------------------------------------------------------- +// +void CHgTeleportGridItemDrawer::SetCloseIcon( CFbsBitmap* aBmp, CFbsBitmap* aMask ) + { + delete iCloseIcon; + iCloseIcon = aBmp; + delete iCloseIconMask; + iCloseIconMask = aMask; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridItemDrawer::GetCloseIconRect +// ----------------------------------------------------------------------------- +// +TRect CHgTeleportGridItemDrawer::GetCloseIconRect( const TRect& aItemRect ) const + { + // TODO: layout update + const TInt KRightMargin = 7; + const TInt KTopMargin = 34; + TRect retVal( TPoint(aItemRect.iBr.iX - KCloseIconSize - KRightMargin, + aItemRect.iTl.iY + KTopMargin), + TSize( KCloseIconSize, KCloseIconSize ) ); + return retVal; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridItemDrawer::SetEdgeOffset +// ----------------------------------------------------------------------------- +// +void CHgTeleportGridItemDrawer::SetEdgeOffset( TInt aLeftOffset, TInt aRightOffset ) + { + iLeftOffset = aLeftOffset; + iRightOffset = aRightOffset; + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridItemDrawer::DrawActualItem +// ----------------------------------------------------------------------------- +// + void CHgTeleportGridItemDrawer::DrawActualItem( TInt aItemIndex, const TRect& aActualItemRect, + TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aViewIsDimmed, TBool aItemIsSelected ) const + { + if ( IsItemRectVisible( aActualItemRect ) ) + { + // Calculate offset of the visible rectangle + TRect drawRect = aActualItemRect; + if ( drawRect.iTl.iX < iLeftOffset ) + { + drawRect.iTl.iX = iLeftOffset; + } + if ( iScreenRect.Width() - drawRect.iBr.iX < iRightOffset ) + { + drawRect.iBr.iX = iScreenRect.Width() - iRightOffset; + } + iGc->SetClippingRect(drawRect); + + // Check for item highlight + TBool itemIsCurrent = !iGrid->IsHighlightVisible() ? EFalse : aItemIsCurrent; + + // Draw item + CFormattedCellListBoxItemDrawer::DrawActualItem(aItemIndex, aActualItemRect, + itemIsCurrent, aViewIsEmphasized, aViewIsDimmed, aItemIsSelected ); + + if ( iGrid->CanCloseItem( aItemIndex ) && iCloseIcon && iCloseIconMask ) + { + TRect closeIconRect = GetCloseIconRect( aActualItemRect ); + // Draw frame + // TODO: layout update + const TInt KFrameGrow = 5; + TRect innerRect = closeIconRect; + TRect outerRect = innerRect; + outerRect.Grow(KFrameGrow, KFrameGrow); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + if ( iGrid->IsItemCloseHit( aItemIndex ) ) + { + AknsDrawUtils::DrawFrame(skin, *iGc, outerRect, innerRect, + KAknsIIDQgnFrSctrlButtonPressed, KAknsIIDQgnFrSctrlButtonCenterPressed); + } + else + { + AknsDrawUtils::DrawFrame(skin, *iGc, outerRect, innerRect, + KAknsIIDQgnFrSctrlButton, KAknsIIDQgnFrSctrlButtonCenter); + } + // Draw close icon + TRect sourceRect( TPoint(0,0), iCloseIcon->SizeInPixels() ); + iGc->DrawBitmapMasked( closeIconRect, iCloseIcon, sourceRect, iCloseIconMask, ETrue ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridItemDrawer::DrawActualItem +// ----------------------------------------------------------------------------- +// +TBool CHgTeleportGridItemDrawer::IsItemRectVisible( const TRect& aItemRect ) const + { + TBool retVal( EFalse ); + TRect viewRect = iGrid->VisibleViewRect(); + if ( // left edge of item rectangle on screen + ( aItemRect.iTl.iX >= viewRect.iTl.iX && aItemRect.iTl.iX <= viewRect.iBr.iX ) || + // right edge of item rectangle on screen + ( aItemRect.iBr.iX >= viewRect.iTl.iX && aItemRect.iBr.iX <= viewRect.iBr.iX ) + ) + { + retVal = ETrue; + } + return retVal; + } + + + + /* ================================================================================ + * CHgTeleportGridHighlightTimer + * ================================================================================ + */ + +// ----------------------------------------------------------------------------- +// CHgTeleportGridHighlightTimer::CHgTeleportGridHighlightTimer +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapTimer::CHgTeleportFastSwapTimer( MHgTeleportFastSwapTimerObserver& aObserver ) +: CTimer( EPriorityStandard ), + iObserver( &aObserver ) + { + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridHighlightTimer::CHgTeleportGridHighlightTimer +// ----------------------------------------------------------------------------- +// +CHgTeleportFastSwapTimer::~CHgTeleportFastSwapTimer() + { + Cancel(); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridHighlightTimer::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportGridHighlightTimer::CHgTeleportGridHighlightTimer +// ----------------------------------------------------------------------------- +// +void CHgTeleportFastSwapTimer::RunL() + { + iObserver->TimerCompletedL(this); + } + + // End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportphysics.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportphysics.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,212 @@ +/* + * ============================================================================ + * Name : hgteleportphysics.cpp + * Part of : Hg Teleport + * Description : Application class + * Version : %version: 4 % + * + * Copyright © 2009 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ + +#include <aknphysicsobserveriface.h> + +#include "hgteleportphysics.h" + +const TInt KSingleItemChangeAnimTime = 1000000; // 1 second +const TInt KAnimationFrameCount = 15; // 15 frames per second + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::CHgTeleportPhysics +// ----------------------------------------------------------------------------- +// +CHgTeleportPhysics::CHgTeleportPhysics( MAknPhysicsObserver& aObserver ) : + CActive( EPriorityStandard ), iObserver( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::NewLC +// ----------------------------------------------------------------------------- +// +CHgTeleportPhysics* CHgTeleportPhysics::NewLC( MAknPhysicsObserver& aObserver ) + { + CHgTeleportPhysics* self = new ( ELeave ) CHgTeleportPhysics( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::NewL +// ----------------------------------------------------------------------------- +// +CHgTeleportPhysics* CHgTeleportPhysics::NewL( MAknPhysicsObserver& aObserver ) + { + CHgTeleportPhysics* self = CHgTeleportPhysics::NewLC( aObserver ); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysics::ConstructL() + { + User::LeaveIfError( iTimer.CreateLocal() ); + CActiveScheduler::Add( this ); + // Animation parameters + const TInt KInitValue = 0; + iAnimationTickTime = KSingleItemChangeAnimTime / KSingleItemChangeAnimTime; + iPhysicsState = EStopped; + iAnimationTicks = KInitValue; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::~CHgTeleportPhysics +// ----------------------------------------------------------------------------- +// +CHgTeleportPhysics::~CHgTeleportPhysics() + { + Cancel(); + iTimer.Close(); + iAnimationSteps.Close(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::DoCancel +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysics::DoCancel() + { + iTimer.Cancel(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::StartPhysics +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysics::StartPhysics( const TPoint& aTarget ) + { + Cancel(); + // Setup animation + TPoint currentPoint = iObserver.ViewPosition(); + if ( currentPoint.iX != aTarget.iX ) + { + iAnimationTicks = 0; + if ( CalculateAnimationSteps( aTarget ) == KErrNone ) + { + // Request + iTimer.After( iStatus, 0 ); + SetActive(); + } + else + { + // If calculation failes (no memory) or there is + // only a small step, set view to target + iObserver.ViewPositionChanged( aTarget, ETrue, 0); + iObserver.PhysicEmulationEnded(); + } + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::StopPhysics +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysics::StopPhysics() + { + Cancel(); + if ( iPhysicsState == ERunning || iPhysicsState == EFinished ) + { + iObserver.PhysicEmulationEnded(); + } + iPhysicsState = EStopped; + iAnimationTicks = 0; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::RunL +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysics::RunL() + { + if ( iPhysicsState == EStopped ) + { + // Start animation + iPhysicsState = ERunning; + iTimer.After( iStatus, iAnimationTickTime ); + SetActive(); + } + else if ( iPhysicsState == ERunning ) + { + // Ongoing animation + if ( iAnimationTicks >= 0 && iAnimationTicks < KAnimationFrameCount ) + { + iObserver.ViewPositionChanged( iObserver.ViewPosition()+iAnimationSteps[iAnimationTicks], ETrue, 0 ); + } + iAnimationTicks++; + if ( iAnimationTicks >= KAnimationFrameCount ) + { + iPhysicsState = EFinished; + } + iTimer.After( iStatus, iAnimationTickTime ); + SetActive(); + } + else if ( iPhysicsState == EFinished ) + { + iAnimationTicks = 0; + iPhysicsState = EStopped; + iObserver.PhysicEmulationEnded(); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::RunError +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportPhysics::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysics::CalculateAnimationSteps +// ----------------------------------------------------------------------------- +// +TInt CHgTeleportPhysics::CalculateAnimationSteps( const TPoint& aTarget ) + { + TInt retVal( KErrNone ); + iAnimationSteps.Reset(); + retVal = iAnimationSteps.Reserve( KAnimationFrameCount ); + if ( retVal == KErrNone ) + { + TInt yValue = aTarget.iY; + TPoint currentPos = iObserver.ViewPosition(); + TInt moveLen = aTarget.iX - currentPos.iX; + if ( moveLen > KAnimationFrameCount || moveLen < -KAnimationFrameCount ) + { + TInt singleStep = moveLen / KAnimationFrameCount; + for ( TInt i = 0; i < KAnimationFrameCount - 1; i++ ) + { + iAnimationSteps.Append( TPoint( singleStep, yValue ) ); + } + TInt lastStep = moveLen - ( ( KAnimationFrameCount - 1 ) * singleStep ); + iAnimationSteps.Append( TPoint( lastStep, yValue ) ); + } + else + { + retVal = KErrArgument; + } + } + return retVal; + } diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportapp/src/hgteleportphysicsengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportapp/src/hgteleportphysicsengine.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,143 @@ +/* + * ============================================================================ + * Name : hgteleportphysicsengine.cpp + * Part of : Hg Teleport + * Description : Teleport physics + * Version : %version: 5 % + * + * Copyright © 2009 Nokia. All rights reserved. + * This material, including documentation and any related computer + * programs, is protected by copyright controlled by Nokia. All + * rights are reserved. Copying, including reproducing, storing, + * adapting or translating, any or all of this material requires the + * prior written consent of Nokia. This material also contains + * confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * ============================================================================ + * + */ +#include <aknphysics.h> + +#include "hgteleportphysicsengine.h" +#include "hgteleportphysics.h" + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsHandler::CHgTeleportPhysicsHandler +// ----------------------------------------------------------------------------- +// +CHgTeleportPhysicsEngine::CHgTeleportPhysicsEngine() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::~CHgTeleportPhysicsEngine +// ----------------------------------------------------------------------------- +// +CHgTeleportPhysicsEngine::~CHgTeleportPhysicsEngine() + { + delete iTeleportPhysics; + delete iPhysics; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::NewLC +// ----------------------------------------------------------------------------- +// +CHgTeleportPhysicsEngine* CHgTeleportPhysicsEngine::NewLC( + MAknPhysicsObserver& aPhysicObserver, CCoeControl& aViewControl) + { + CHgTeleportPhysicsEngine* self = new (ELeave) CHgTeleportPhysicsEngine(); + CleanupStack::PushL(self); + self->ConstructL(aPhysicObserver, aViewControl); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::NewL +// ----------------------------------------------------------------------------- +// +CHgTeleportPhysicsEngine* CHgTeleportPhysicsEngine::NewL( + MAknPhysicsObserver& aPhysicObserver, CCoeControl& aViewControl) + { + CHgTeleportPhysicsEngine* self = CHgTeleportPhysicsEngine::NewLC( + aPhysicObserver, aViewControl); + CleanupStack::Pop(); // self; + return self; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysicsEngine::ConstructL(MAknPhysicsObserver& aPhysicObserver, + CCoeControl& aViewControl) + { + iPhysics = CAknPhysics::NewL(aPhysicObserver, &aViewControl);//TODO: + iTeleportPhysics = CHgTeleportPhysics::NewL(aPhysicObserver); + } + + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::IsRunning +// ----------------------------------------------------------------------------- +// +TBool CHgTeleportPhysicsEngine::IsRunning() const + { + return iPhysics->OngoingPhysicsAction() != CAknPhysics::EAknPhysicsActionNone; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::HandleDragEvent +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysicsEngine::HandleDragEvent( + AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent) + { + if (AknTouchGestureFw::EAknTouchGestureFwStart == aEvent.State()) + { + iPhysics->StopPhysics(); + iStartTime.HomeTime(); + } + else if (AknTouchGestureFw::EAknTouchGestureFwOn == aEvent.State()) + { + TPoint deltaPoint(aEvent.PreviousPosition() - aEvent.CurrentPosition()); + iPhysics->RegisterPanningPosition(deltaPoint); + } + else //AknTouchGestureFw::EAknTouchGestureFwStop + { + TPoint drag(aEvent.PreviousPosition() - aEvent.CurrentPosition()); + iPhysics->StartPhysics(drag, iStartTime); + } + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::Stop +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysicsEngine::Stop() + { + iPhysics->StopPhysics(); + iTeleportPhysics->StopPhysics(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::AnimateToTargetL +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysicsEngine::AnimateToTarget(const TPoint& aPoint) + { + iTeleportPhysics->StartPhysics(aPoint); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportPhysicsEngine::ReInitPhysicsL +// ----------------------------------------------------------------------------- +// +void CHgTeleportPhysicsEngine::ReInitPhysicsL(const TSize& aWorldSize, + const TSize& aViewSize, TBool aLandscape) + { + iPhysics->InitPhysicsL(aWorldSize, aViewSize, aLandscape); + } + +//End file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportappecom/data/hgteleportappecom.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportappecom/data/hgteleportappecom.rss Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,49 @@ +/* +* ============================================================================ +* Name : hgteleportappecom.rss +* Part of : Teleport +* Description : Ecom registration file for alternate fast swap plugin +* Version : %version: sa1spcx1#2.1.2 % +* +* Copyright (C) 2009 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. +* +* ============================================================================ +*/ + +#include <ecom/registryinfo.rh> +#include "hgteleportappecomconst.hrh" +#include "akncapserveralternatefspluginconst.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = KHgTeleportAppPluginDllUid; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = KAknCapServerAlternateFsPluginInterfaceUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KHgTeleportAppPluginImplementationUid; + version_no = 1; + display_name = ""; + default_data = ""; + opaque_data = ""; + } + }; + } + }; + } diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportappecom/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportappecom/group/bld.inf Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,29 @@ +/* +* ============================================================================ +* Name : bld.inf +* Part of : Teleport +* Description : Teleport application ecom plugin +* Version : %version: 3 % +* +* Copyright © 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#include <platform_paths.hrh> + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +hgteleportappecom.mmp + +PRJ_TESTMMPFILES diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportappecom/group/hgteleportappecom.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportappecom/group/hgteleportappecom.mmp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,49 @@ +/* +* ============================================================================ +* Name : hgteleportappecom.cpp +* Part of : Teleport +* Description : Teleport application ecom plugin +* Version : %version: 5 % +* +* Copyright © 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#include <platform_paths.hrh> +#include <data_caging_paths.hrh> +#include "../inc/hgteleportappecomconst.hrh" + +TARGET hgteleportappecom.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KHgTeleportAppPluginDllUid +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE proxy.cpp +SOURCE hgteleportappecom.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../trace + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data +START RESOURCE hgteleportappecom.rss +TARGET hgteleportappecom.rsc +TARGETPATH /resource/plugins +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY apgrfx.lib +LIBRARY cone.lib + +DEBUGLIBRARY flogger.lib + diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecom.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecom.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,108 @@ +/* +* ============================================================================ +* Name : hgteleportappecom.h +* Part of : Teleport +* Description : Teleport application ecom plugin +* Version : %version: sa1spcx1#4.1.3 % +* +* Copyright © 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#ifndef HGTELEPORTAPPECOM_H +#define HGTELEPORTAPPECOM_H + +#include <e32base.h> +#include <akncapserveralternatefsplugin.h> + +/** + * Teleport ecom plugin which is loaded by AknCapServer as an alternate Fast + * Swap. Uses P&S to show/dismiss the Teleport application. + */ +class CHgTeleportEcomPlugin : public CAknCapAppServerAlternateFs + { +public: + + /** + * Symbian two phased constructors. + * + * @return CHgTeleportEcomPlugin pointer. + */ + static CHgTeleportEcomPlugin* NewL(); + + /** + * Destructor. + */ + ~CHgTeleportEcomPlugin(); + +public: + + // From CAknCapAppServerAlternateFs + /** + * Shows the alternate fast swap. + */ + virtual void Show(); + + /** + * Dismisses the alternate fast swap. + */ + virtual void Dismiss(); + + /** + * Checks if alternate fast swap is currently visible. + * + * @return ETrue If alternate FS is visible. + */ + virtual TBool IsVisible(); + + /** + * Checks if alternate fast swap is ready to be shown. + * + * @return ETrue If alternate FS is ready. + */ + virtual TBool IsReady(); + + /** + * Forward long app key to the alternate fast swap. + */ + virtual void HandleLongAppKeyPress(); + + /** + * Forward short app key to the alternate fast swap. + */ + virtual void HandleShortAppKeyPress(); + +private: + + /** + * Default constructor, implicitly called by NewL(). + */ + CHgTeleportEcomPlugin(); + + /** + * 2nd phase construction, called by NewL(). + */ + void ConstructL(); + + /** + * Sets the P&S property to given value. + * + * @param aValue Value + */ + void SetTeleportStateProperty( TInt aValue ); + + /** + * Defines the P&S property. + */ + void DefineTeleportStateProperty(); + + }; + +#endif // HGTELEPORTAPPECOM_H diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecomconst.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecomconst.hrh Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,25 @@ +/* +* ============================================================================ +* Name : hgteleportappecomconst.hrh +* Part of : Teleport +* Description : Teleport application ecom plugin UIDs +* Version : %version: 3 % +* +* Copyright © 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ + +#ifndef HGTELEPORTAPPECOMCONST_HRH +#define HGTELEPORTAPPECOMCONST_HRH + +#define KHgTeleportAppPluginDllUid 0x2001FD72 +#define KHgTeleportAppPluginImplementationUid 0x2001FD72 + +#endif // HGTELEPORTAPPECOMCONST_HRH diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecomlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecomlogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,26 @@ +/* +* ============================================================================ +* Name : hgteleportappecomlogging.h +* Part of : Classic UI / Teleport +* Description : Defines logs for hgteleportappecom +* Version : %version: 1 % +* +* Copyright (c) 2009 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1.1 +*/ + +#ifdef _DEBUG +_LIT( KHgLogFile, "hgteleportappecom.txt" ); +_LIT( KHgLogPath, "teleport" ); +#define _HGLOG_LOG_COMPONENT_ID KHgTeleportAppPluginDllUid + +#endif +#include "hglogging.h" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportappecom/src/hgteleportappecom.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportappecom/src/hgteleportappecom.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,253 @@ +/* + * =========================================================================== + * Name : hgteleportappecom.cpp + * Part of : Teleport + * Description : Teleport application ecom plugin + * Version : %version: sa1spcx1#8.1.2 % + * + * Copyright © 2009 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. + * =========================================================================== + */ + +#include <e32property.h> +#include <apgtask.h> +#include <eikenv.h> + +#include "hgteleportappecomconst.hrh" +#include "hgteleportappecom.h" + +#include "hgteleportappecomlogging.h" + +// AknCapServer UID, used for P&S category +const TUid KTeleportStateCategory = { 0x10207218 }; + +// Teleport UI, used as P&S key +const TInt KTeleportStateKey = 0x20016BF0; + +// Values for Teleport launching P&S +const TInt KTeleportBackgroundValue = 1; +const TInt KTeleportForegroundValue = KTeleportBackgroundValue << 1; +const TInt KTeleportShortAppKeyPressed = KTeleportForegroundValue << 1; +const TInt KTeleportLongAppKeyPressed = KTeleportShortAppKeyPressed << 1; + +// Teleport application UID, for checking if teleport is running +const TUid KTeleportAppUidValue = { 0x20016BF0 }; + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::CHgTeleportEcomPlugin() +// Default constructor for first phase construction. +// --------------------------------------------------------------------------- +// +CHgTeleportEcomPlugin::CHgTeleportEcomPlugin() + { + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::NewL() +// Standard NewL. +// --------------------------------------------------------------------------- +// +CHgTeleportEcomPlugin* CHgTeleportEcomPlugin::NewL() + { + CHgTeleportEcomPlugin* self = new ( ELeave ) CHgTeleportEcomPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::ConstructL() +// 2nd phase construction. +// --------------------------------------------------------------------------- +// +void CHgTeleportEcomPlugin::ConstructL() + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::ConstructL, HGLOG_LOCAL ); + HGLOG_IN(); + + DefineTeleportStateProperty(); + + HGLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::~CHgTeleportEcomPlugin() +// Destructor. +// --------------------------------------------------------------------------- +// +CHgTeleportEcomPlugin::~CHgTeleportEcomPlugin() + { + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::Show +// --------------------------------------------------------------------------- +// +void CHgTeleportEcomPlugin::Show() + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::Show, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTeleportStateCategory, KTeleportStateKey, value ); + value &= ~KTeleportBackgroundValue; + value |= KTeleportForegroundValue; + SetTeleportStateProperty( value ); + + HGLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::Dismiss +// --------------------------------------------------------------------------- +// +void CHgTeleportEcomPlugin::Dismiss() + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::Dismiss, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTeleportStateCategory, KTeleportStateKey, value ); + value &= ~KTeleportForegroundValue; + value |= KTeleportBackgroundValue; + SetTeleportStateProperty( value ); + + HGLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::HandleLongAppKeyPress +// --------------------------------------------------------------------------- +// +void CHgTeleportEcomPlugin::HandleLongAppKeyPress() + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::Show, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTeleportStateCategory, KTeleportStateKey, value ); + value &= ~KTeleportShortAppKeyPressed; + value |= KTeleportLongAppKeyPressed; + SetTeleportStateProperty( value ); + + HGLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::HandleShortAppKeyPress +// --------------------------------------------------------------------------- +// +void CHgTeleportEcomPlugin::HandleShortAppKeyPress() + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::Dismiss, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTeleportStateCategory, KTeleportStateKey, value ); + value &= ~KTeleportLongAppKeyPressed; + value |= KTeleportShortAppKeyPressed; + SetTeleportStateProperty( value ); + + HGLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::IsVisible +// --------------------------------------------------------------------------- +// +TBool CHgTeleportEcomPlugin::IsVisible() + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::IsVisible, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTeleportStateCategory, KTeleportStateKey, value ); + if ( value & KTeleportForegroundValue ) + { + HGLOG_OUT(); + return ETrue; + } + HGLOG_OUT(); + return EFalse; + } + +// --------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::IsReady +// --------------------------------------------------------------------------- +// +TBool CHgTeleportEcomPlugin::IsReady() + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::IsReady, HGLOG_LOCAL ); + HGLOG_IN(); + + TBool ret = EFalse; + CEikonEnv* eikonEnv = CEikonEnv::Static(); + + if ( eikonEnv ) + { + TApaTaskList taskList( eikonEnv->WsSession() ); + TApaTask task = taskList.FindApp( KTeleportAppUidValue ); + + if ( task.Exists() ) + { + ret = ETrue; + } + } + + HGLOG1_OUT( "IsReady returns: %d", ret ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::SetTeleportStateProperty +// ----------------------------------------------------------------------------- +// +void CHgTeleportEcomPlugin::SetTeleportStateProperty( TInt aValue ) + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::SetTeleportShowProperty, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( RProperty::Set( + KTeleportStateCategory, KTeleportStateKey, aValue ) != KErrNone ) + { + DefineTeleportStateProperty(); + TInt error = + RProperty::Set( KTeleportStateCategory, KTeleportStateKey, aValue ); + if ( error != KErrNone ) + { + HGLOG1( HGLOG_INFO, "RProperty::Set Error: %d", error ); + } + } + + HGLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CHgTeleportEcomPlugin::DefineTeleportStateProperty +// ----------------------------------------------------------------------------- +// +void CHgTeleportEcomPlugin::DefineTeleportStateProperty() + { + HGLOG_CONTEXT( CHgTeleportEcomPlugin::DefineTeleportShowProperty, HGLOG_LOCAL ); + HGLOG_IN(); + + TInt error = RProperty::Define( + KTeleportStateCategory, KTeleportStateKey, RProperty::EInt ); + if ( error != KErrNone ) + { + HGLOG1( HGLOG_INFO, "RProperty::Define Error: %d", error ); + } + + HGLOG_OUT(); + } + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/hgteleportappecom/src/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/hgteleportappecom/src/proxy.cpp Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,45 @@ +/* +* ============================================================================== +* Name : proxy.cpp +* Part of : Teleport +* Description : Teleport application ecom plugin +* Version : %version: 2 % +* +* Copyright (c) 2008 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 stranslating, 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. +* ============================================================================== +*/ + +// INCLUDE FILES +#include <e32std.h> +#include <ecom/implementationproxy.h> + +#include "hgteleportappecom.h" +#include "hgteleportappecomconst.hrh" + +// Provides a key value pair table, this is used to identify +// the correct construction function for the requested interface. +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( + KHgTeleportAppPluginImplementationUid, + CHgTeleportEcomPlugin::NewL ) + }; + +// Function used to return an instance of the proxy table. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount + = sizeof ( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// End of file diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/inc/hggraphicids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/inc/hggraphicids.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,33 @@ +/* +* ============================================================================== +* Name : hggraphicids.h +* Part of : Hg Graphics Loader +* Description : Header file containing ID list +* Version : %version: 1 % +* +* Copyright (c) 2007 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 __HGGRAPHICIDS_H__ +#define __HGGRAPHICIDS_H__ + +#include <e32base.h> + +/** + * Logical IDs for all icons used in Teleport. + */ +enum THgGraphicId + { + EHgGraphicIdLAST + }; + +#endif // __HGGRAPHICIDS_H__ diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/inc/hggraphictab.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/inc/hggraphictab.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,51 @@ +/* +* ============================================================================== +* Name : hggraphictab.h +* Part of : Hg Graphics Loader +* Description : Header file with filename and skin id tables +* Version : %version: 1 % +* +* Copyright (c) 2007 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 __HGGRAPHICTAB_H__ +#define __HGGRAPHICTAB_H__ + +#include <e32base.h> + +#include <AknUtils.h> +#include <AknsUtils.h> // skinned icons +#include <AknsConstants.h> // skinned icon ids + + +/** + * Name of image file in case icon is not available from the skin. + * Path should not be included. + * Use _S( "" ) if skin id should be used instead. + * Order and count must match THgGraphicId. (except the last-marker) + */ +static const TText* const KHgGraphicFiles[] = + { + _S( "" ) + }; + +/** + * Skin related IDs. Not in use yet. + * Use all zeros if image file should be used instead. + * Order and count must match THgGraphicId. (except the last-marker) + */ +static const TAknsItemID KHgGraphicSkinIds[] = + { + KAknsIIDNone + }; + +#endif // __HGGRAPHICTAB_H__ diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/rom/hgteleport.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/rom/hgteleport.iby Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,33 @@ +/* +* ============================================================================ +* Name : hgteleport.iby +* Part of : Huriganes +* Description : Iby file for teleport +* Version : %version: sa1spcx1#41.1.6 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ +#ifndef __HURIGANESTELEPORT_IBY__ +#define __HURIGANESTELEPORT_IBY__ + +// AknCapServer alternate fast swap plugin +ECOM_PLUGIN( hgteleportappecom.dll, hgteleportappecom.rsc ) + +data=DATAZ_/private/10003a3f/apps/hgteleport_reg.rsc private/10003a3f/import/apps/hgteleport_reg.rsc +file=ABI_DIR/BUILD_DIR/hgteleport.exe PROGRAMS_DIR/hgteleport.exe + +// backup registration +data=DATAZ_/private/20016BF0/backup_registration.xml private/20016BF0/backup_registration.xml + +// stub sis +data=ZSYSTEM/install/teleport_stub.sis system/install/teleport_stub.sis + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/rom/hgteleportresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/rom/hgteleportresources.iby Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,24 @@ +/* +* ============================================================================ +* Name : hgteleportresources.iby +* Part of : Huriganes +* Description : Iby file for teleport resources +* Version : %version: sa1spcx1#14.1.2.1.6 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +*/ +#ifndef __HURIGANESTELEPORTRES_IBY__ +#define __HURIGANESTELEPORTRES_IBY__ + +// resources for teleport app +data=DATAZ_/APP_RESOURCE_DIR/hgteleport.rsc APP_RESOURCE_DIR/hgteleport.rsc + +#endif diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/sis/stubs/createstubs.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/sis/stubs/createstubs.bat Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,1 @@ +for %%f in (*.pkg) do makesis -s %%f diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/sis/stubs/teleport_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/sis/stubs/teleport_stub.pkg Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,25 @@ +; ------------------------------------------------------------------------------ +; HG Teleport stub SIS package file. +; Used to enable HG Teleport to be updated from ROM with a SIS package. +; When you add new files into this stub, please remember to update +; SIS stub with "makesis -s" command. +; ------------------------------------------------------------------------------ +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"teleport"},(0x20016BF0),1,0,0,TYPE=SA + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +""-"Z:\sys\bin\hgteleport.exe" +""-"Z:\resource\apps\hgteleport.r??" +""-"Z:\private\10003a3f\import\apps\hgteleport_reg.rsc" + +""-"Z:\sys\bin\hgteleportappecom.dll" +""-"Z:\resource\plugins\hgteleportappecom.rsc" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/sis/stubs/teleport_stub.sis Binary file taskswitcher/teleportui/sis/stubs/teleport_stub.sis has changed diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/sis/teleport.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/sis/teleport.pkg Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,25 @@ +; ------------------------------------------------------------------------------ +; HG Teleport stub SIS package file. +; Used to enable HG Teleport to be updated from ROM with a SIS package. +; When you add new files into this stub, please remember to update +; SIS stub with "makesis -s" command. +; ------------------------------------------------------------------------------ +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"teleport"},(0x20016BF0),1,0,0,TYPE=SA, RU + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +"/epoc32/release/armv5/urel/hgteleport.exe" - "!:\sys\bin\hgteleport.exe" +"/epoc32/data/z/resource/apps/hgteleport.rsc" - "!:\resource\apps\hgteleport.rsc" +"/epoc32/data/z/private/10003a3f/apps/hgteleport_reg.rsc" - "!:\private\10003a3f\import\apps\hgteleport_reg.rsc" + +"/epoc32/release/armv5/urel/hgteleportappecom.dll" - "!:\sys\bin\hgteleportappecom.dll" +"/epoc32/data/z/resource/plugins/hgteleportappecom.rsc" - "!:\resource\plugins\hgteleportappecom.rsc" diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/trace/hglogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/trace/hglogging.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,219 @@ +/* +* ============================================================================== +* Name : hglogging.h +* Part of : Teleport / Teleport UI +* Description : Defines all available logging macros. +* Version : %version: 2 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia. All rights are reserved. Copying, including +* reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia. +* ============================================================================== +*/ + +#ifndef HGLOGLOGUTILS_H +#define HGLOGLOGUTILS_H + +/** + * @file + * + * TAKING LOGGING INTO USE: + * + * This step is needed to do once per component. + * + * For each component that uses these common logging macros should specify + * their own logging configuration file, which includes this file. In that + * configuration file, following constants and macros must be defined. + * For example: + * @code + * + * _LIT( KHgLogFile, "text_file_for_logging.txt" ); + * _LIT( KHgLogPath, "folder_for_text_file" ); + * #define _HGLOG_LOG_COMPONENT_ID <some unique number here> + * + * #include "hglogging.h" + * + * @/code + * + * KHgLogFile : This is the name of the file, where all the logs for + * this components are being written. + * + * KHgLogPath : This is the folder name under c:\logs, where the file + * is to be stored. For example, if KHgLogPath is "test", + * log file is created into folder c:\logs\test. + * + * _HGLOG_LOG_COMPONENT_ID : Unique number id of the component. This is + * for filtering purposes. + * + * _HGLOG_RDEBUG : When defined tracing instead of file logging. + * Default is for file logging. + * + * -------------------------------------------------------------------------- + * + * USING LOGGING: + * + * Basically the use is simple, register function use with HGLOG_CONTEXT, + * then log function enter by any HGLOG_IN -macro, then possibly use HGLOG + * -macros for function logging and finally HGLOG_OUT -macros for returning + * from the function. + * + * @code + * TInt CGood::Example( TInt aSomething ) + * { + * // Create log context class, which is maintained for lifetime of the + * // method. + * HGLOG_CONTEXT( Example, HGLOG_LOCAL ); + * + * // Indicate we are entering the function. + * HGLOG_IN1( "aSomething contains value %d", aSomething ); + * + * // Your buggy code... + * + * // Before leaving, indicate function execution has ended. + * HGLOG_OUT(); + * + * return 0; + * } + * @/code + */ + +#include <e32def.h> +#include <e32std.h> + +#include "hglogutils.h" + +#define HGLOG_API 0 +#define HGLOG_LOCAL 1 + +#define HGLOG_INFO 0 +#define HGLOG_WARNING 1 +#define HGLOG_ERROR 2 + +#define HGLOG_ASSERT(_assertion) __HGLOG_ASSERT_DBG(_assertion) +#define HGLOG_TRACE_ASSERT(_assertion) __ASSERT_DEBUG((_assertion), User::Invariant() ) + +#ifdef _DEBUG + +/***************************************************************************** + LOGGING MACROS - LOGGING ON +*****************************************************************************/ + + /** + * Context initialization + * NOTE: HGLOG_STATIC_CONTEXT is meant for static methods. + * + * @param _fn Name of the function. + * @param _vis Visibility for the client, use values HGLOG_API or HGLOG_LOCAL + * @param _thdId For static functions, thread id can be given here. + */ + #define HGLOG_CONTEXT(_fn, _vis ) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, (TUint)this, RProcess().SecureId().iId ) + #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, _thdId, RProcess().SecureId().iId ) + + /** + * Entering function + * + * @param string Custom text. Example: HGLOG_IN0( "Yeah!!!" ); + * @param p1 - p5 For multiple variables in same string. + */ + #define HGLOG_IN() do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0) + #define HGLOG0_IN(string) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0) + #define HGLOG1_IN(string, p1) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_ENTRY(); } while(0) + #define HGLOG2_IN(string, p1, p2) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_ENTRY(); } while(0) + #define HGLOG3_IN(string, p1, p2, p3) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_ENTRY(); } while(0) + #define HGLOG4_IN(string, p1, p2, p3, p4) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_ENTRY(); } while(0) + #define HGLOG5_IN(string, p1, p2, p3, p4, p5) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_ENTRY(); } while(0) + + /** Leaving function */ + #define HGLOG_OUT() do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0) + #define HGLOG0_OUT(string) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0) + #define HGLOG1_OUT(string, p1) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_EXIT(); } while(0) + #define HGLOG2_OUT(string, p1, p2) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_EXIT(); } while(0) + #define HGLOG3_OUT(string, p1, p2, p3) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_EXIT(); } while(0) + #define HGLOG4_OUT(string, p1, p2, p3, p4) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_EXIT(); } while(0) + #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0) + + /** Leaving function with return value */ + #define HGLOG0_RET(val, fmtstr) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG1_RET(val, fmtstr, p1) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG2_RET(val, fmtstr, p1, p2) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG3_RET(val, fmtstr, p1, p2, p3) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0); return val;} while(0) + + /** + * General log lines + * + * @param level This can be used as internal information + * field, such as info, error, warning etc. + * @param string Custom string + * @param p1 - p5 For multiple variables in same string. + */ + #define HGLOG0(level, string) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); } while(0) + #define HGLOG1(level, string, p1) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); } while(0) + #define HGLOG2(level, string, p1, p2) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); } while(0) + #define HGLOG3(level, string, p1, p2, p3) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); } while(0) + #define HGLOG4(level, string, p1, p2, p3, p4) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); } while(0) + #define HGLOG5(level, string, p1, p2, p3, p4, p5) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); } while(0) + + /** Error logging */ + #define __HGLOG_ASSERT_DBG( _assertion ) do { if( _assertion ) { break; } TFileName file; file.Copy( _L8( __FILE__ ) ); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s Assert:%S:%d:" L ## #_assertion) , _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, &file, __LINE__ ); User::Invariant(); } while( 0 ) + #define __HGLOG_TRACE_ASSERT_DBG(_assertion, _textToPrint, _panicCode) do { if (_assertion) { break; } _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s ASSERTION FAILED!!! %s file: %s, line: %s"), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, _textToPrint, __FILE__, __LINE__); User::Panic(_L("AssertionFailed"), _panicCode} while(0) + #define HGLOG_TRAPHANDLER() _THgLogTrapHandler _traceTrapHandler; _traceTrapHandler.oldHandler = User::SetTrapHandler(&_traceTrapHandler) + +/***************************************************************************** + LOGGING MACROS - NO LOGGING +*****************************************************************************/ +#else // _DEBUG + + #define HGLOG_CONTEXT(_fn, _vis ) + #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) + + #define HGLOG_IN() + #define HGLOG0_IN(string) + #define HGLOG1_IN(string, p1) + #define HGLOG2_IN(string, p1, p2) + #define HGLOG3_IN(string, p1, p2, p3) + #define HGLOG4_IN(string, p1, p2, p3, p4) + #define HGLOG5_IN(string, p1, p2, p3, p4, p5) + + #define HGLOG_OUT() + #define HGLOG0_OUT(string) + #define HGLOG1_OUT(string, p1) + #define HGLOG2_OUT(string, p1, p2) + #define HGLOG3_OUT(string, p1, p2, p3) + #define HGLOG4_OUT(string, p1, p2, p3, p4) + #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) + + #define HGLOG0_RET(val, fmtstr) return val + #define HGLOG1_RET(val, fmtstr, p1) return val + #define HGLOG2_RET(val, fmtstr, p1, p2) return val + #define HGLOG3_RET(val, fmtstr, p1, p2, p3) return val + #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) return val + #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) return val + + #define HGLOG0(level, string) + #define HGLOG1(level, string, p1) + #define HGLOG2(level, string, p1, p2) + #define HGLOG3(level, string, p1, p2, p3) + #define HGLOG4(level, string, p1, p2, p3, p4) + #define HGLOG5(level, string, p1, p2, p3, p4, p5) + + #define BIND_TRACE_TRAPHANDLER() + #define TRACE_DECL() TInt _iTraceThreadId + #define TRACE_FAST_CREATE(_thdId) _thdId++; + #define TRACE_CREATE() + + #define __HGLOG_ASSERT_DBG(_assertion) + #define __TRACE_ASSERT_DBG(_assertion, _message, _panicCode ) + +#endif // _DEBUG + +#endif // HGLOGLOGUTILS_H + +// End of File diff -r 5315654608de -r 08c6ee43b396 taskswitcher/teleportui/trace/hglogutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/teleportui/trace/hglogutils.h Mon Jan 18 20:10:36 2010 +0200 @@ -0,0 +1,208 @@ +/* +* ============================================================================== +* Name : hglogutils.h +* Part of : Teleport / Teleport UI +* Description : Logging behavior +* Version : %version: 3 % +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia. All rights are reserved. Copying, including +* reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia. +* ============================================================================== +*/ + +#ifndef HGLOGUTILS_H +#define HGLOGUTILS_H + +/** + * NOTE: This file contains the logic related to logging. Change only if you + * know what you're doing. + */ + + + + + + + + + + +#ifdef _DEBUG + +#include <e32std.h> +#include <e32debug.h> + +static const TUint HGLOGERR = 2; /**< Used to create an error message */ + +// These macros are real macros, that should be used. For temporary purposes, these +// are left out and the logging is done by simple entry logging +#define _HGLOG_UNCONTROLLED_INPUT_MSG L"%s%d[%x:%x:%x]>%s UNCONTROLLED ENTRY!" +#define _HGLOG_MULTIPLE_ENTRY_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL ENTRY!" +#define _HGLOG_UNCONTROLLER_EXIT_MSG L"%s%d[%x:%x:%x]<%s UNCONTROLLED EXIT!" +#define _HGLOG_MULTIPLE_EXIT_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL EXIT!" +#define _HGLOG_TRAP_HARNESS_ENTRY L"_D%d[%x:%x:%x]TraceFramework: Entering trap harness" +#define _HGLOG_TRAP_HARNESS_EXIT L"_D%d[%x:%x:%x]TraceFramework: Exiting trap harness" +#define _HGLOG_TRAP_HARNESS_LEAVE L"_D%d[%x:%x:%x]TraceFramework: ---------- LEAVE OCCURRED !!! ---------- " +#define _HGLOG_API_PREFIX L"_A" +#define _HGLOG_LOCAL_PREFIX L"_L" + +/** +* @file +* trace_utils.h contains definitions needed for advanced tracing features. +* Tracing can be customized using the following compile time flags: +* - <b>_DEBUG</b> +* - With this flag undefined, all traces are disabled +* - <b>__KERNEL_MODE__</b> +* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) +* - <b>DISABLE_SYNTAX_CHECK</b> +* - If this flag is defined, runtime syntax checking features are disabled from traces +*/ +#ifndef DISABLE_SYNTAX_CHECK + #define _MARK_ENTRY() _dc.inOk=ETrue + #define _DOINCHK() _dc.DoInChk() + #define _CHK_MULTIIN() _dc.ChkMultiIn() + #define _CHK_MULTIOUT() _dc.ChkMultiOut() + #define _MARK_EXIT() _dc.outOk=ETrue +#else + #define _MARK_ENTRY() + #define _DOINCHK() + #define _CHK_MULTIIN() + #define _CHK_MULTIOUT() + #define _MARK_EXIT() +#endif // DISABLE_SYNTAX_CHECK + +/** For tracing */ +#ifdef _HGLOG_RDEBUG + #define _IT(a) (TPtrC((const TText *)(a))) + #define _HGLOGPRINTER RDebug::Print + +/** For filedebug */ +#else // _HGLOG_RDEBUG + + /** Includes */ + #include <e32base.h> + #include <e32std.h> + #include <e32def.h> + #include <e32svr.h> + #include <flogger.h> + + #define _IT(a) KHgLogPath, KHgLogFile, EFileLoggingModeAppend, (TPtrC((const TText *)(a))) + #define _HGLOGPRINTER RFileLogger::WriteFormat +#endif // _HGLOG_RDEBUG + +class _THgLogContext + { + public: + _THgLogContext( + const TText* _fn, + const TUint _id, + const TUint _vis, + const TUint _addr, + const TUint _thdId, + const TUint _category=0 ) + : + iFn(_fn), + iId(_id), + iApi((TBool)_vis), + iAddr(_addr), + iThdId(_thdId), + iVis((_vis == 0 ? (TText*)_HGLOG_API_PREFIX : (TText*)_HGLOG_LOCAL_PREFIX)), + iCategory(_category) + #ifndef DISABLE_SYNTAX_CHECK + ,outOk(EFalse), inOk(EFalse) + #endif + { + } + ~_THgLogContext() + { + #ifndef DISABLE_SYNTAX_CHECK + do + { + DoInChk(); + if (!outOk) + { + _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLER_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } while (0); + #endif // DISABLE_SYNTAX_CHECK + } + + const TText* iFn; + const TUint iId; + const TText* iVis; + const TUint iAddr; + const TInt iThdId; + const TBool iApi; + const TUint iCategory; + + #ifndef DISABLE_SYNTAX_CHECK + inline void DoInChk() + { + if (!inOk) + { + _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLED_INPUT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + inOk = ETrue; + } + } + + inline void ChkMultiIn() + { + if (inOk) + { + _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_ENTRY_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + inline void ChkMultiOut() + { + if (outOk) + { + _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + TBool inOk; + TBool outOk; + #endif // DISABLE_SYNTAX_CHECK + }; + +class _THgLogTrapHandler: public TTrapHandler + { + public: + + _THgLogTrapHandler(_THgLogContext& _context) : _dc( _context ) + { + RThread me; + iThdId = (TInt)me.Id(); + } + void Trap() + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_ENTRY), 0, HGLOGERR, iThdId, this); + oldHandler->Trap(); + } + void UnTrap() + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_EXIT), 0, HGLOGERR, iThdId, this); + oldHandler->UnTrap(); + } + void Leave(TInt aValue) + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_LEAVE), 0, HGLOGERR, iThdId, this); + oldHandler->Leave(aValue); + } + TTrapHandler* oldHandler; + private: + _THgLogContext& _dc; + TInt iThdId; + }; + +#endif // _DEBUG + +#endif // HGLOGUTILS_H \ No newline at end of file