# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1264499303 -7200 # Node ID 4d54b72983ae615f16c50a36b12954ff7d8e9964 # Parent fb3763350a087f035aa5812acf42f35679432863 Revision: 201001 Kit: 201004 diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/desktopconfiguration.dtd --- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/desktopconfiguration.dtd Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/desktopconfiguration.dtd Tue Jan 26 11:48:23 2010 +0200 @@ -24,9 +24,18 @@ - \ No newline at end of file + + + + diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/manifest.dat Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/manifest.dat Tue Jan 26 11:48:23 2010 +0200 @@ -27,7 +27,7 @@ 2 - RnD description desktop plugin + &qtn_desktop_configuration_desc; skin(270501603 9361):mif(icon.mif 16384 16385) diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc --- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc Tue Jan 26 11:48:23 2010 +0200 @@ -15,8 +15,14 @@ * */ -// d: Shortcuts -// l: list_single_pane_t1_cp2 +// d: Shortcut widget name +// l: listrow_wgtman_pane_t1 // w: // r: TB9.2 #define qtn_desktop_configuration_name "Shortcut" + +// d: Shortcut widget description +// l: listrow_wgtman_pane_t2 +// w: +// r: TB9.2 +#define qtn_desktop_configuration_desc "Provides quick access to your favorite applications from Home Screen." diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/profile_2001cb7c/group/bld.inf --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -23,6 +23,9 @@ //******************************************************** ../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/profile_2001cb7c/hsps/manifest.dat ../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/profile_2001cb7c/hsps/widgetconfiguration.xml +// waiting for localization from platform +//../hsps/00/profileconfiguration.dtd /epoc32/data/Z/resource/homescreen/profile_2001cb7c/hsps/profileconfiguration.dtd + ../xuikon/00/profile.dat /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/profile_2001cb7c.dat ../xuikon/00/profile.css /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/profile.css ../xuikon/00/profile.xml /epoc32/data/Z/resource/homescreen/profile_2001cb7c/xuikon/profile.xml @@ -42,6 +45,8 @@ //***************************** // export localizable loc files (engineering versions) ../loc/profilewidget.loc APP_LAYER_LOC_EXPORT_PATH(profilewidget.loc) +// waiting for localization from platform +//../loc/profileconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(profileconfiguration.loc) // Support for S60 builds //*********************** diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/manifest.dat --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/manifest.dat Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/manifest.dat Tue Jan 26 11:48:23 2010 +0200 @@ -14,16 +14,23 @@ 0x2001cb7c + + - &qtn_hs_profile_edit; + profilename waits loc profile 1.0 widgetconfiguration.xml - RnD description profile plugin - + profiledesc waits localization from platform + skin(270501603 9360):mif(icon.mif 16384 16385) diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/profileconfiguration.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/profileconfiguration.dtd Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,41 @@ + + + + + + + + + + diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profileconfiguration.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profileconfiguration.loc Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,29 @@ +/* +* 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 project Active Idle 3 (hsps) +* +*/ + + +// d: profile widget name +// l: listrow_wgtman_pane_t1 +// w: +// r: TB9.2 +#define qtn_profile_configuration_name "Profile" + +// d: profile widget description +// l: listrow_wgtman_pane_t2 +// w: +// r: TB9.2 +#define qtn_profile_configuration_desc "Provides quick access to calendar, time&date and change profile." \ No newline at end of file diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profilewidget.loc --- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profilewidget.loc Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profilewidget.loc Tue Jan 26 11:48:23 2010 +0200 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Localization strings for project Active Idle 3 +* Description: Localization strings for project Active Idle 3 (xuikon) * */ @@ -20,5 +20,4 @@ // l: list_single_pane_t1_cp2 // w: // r: TB9.1 -#define qtn_hs_profile_edit "Edit active profile" -#define qtn_hs_profile_desc "localized RnD profilewidget description." +#define qtn_hs_profile_edit "Edit active profile" diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/wideimage_2001f489/group/bld.inf --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -30,14 +30,7 @@ ../xuikon/00/wideimage.dat /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/wideimage_2001f489.dat ../xuikon/00/wideimage.css /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/wideimage.css ../xuikon/00/wideimage.xml /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/wideimage.xml -../xuikon/00/wideimage.dtd /epoc32/data/Z/resource/homescreen/wideimage_2001f489/xuikon/wideimage.dtd -// Support for S60 localization -//***************************** -#ifndef __WIDEIMAGE_LOC__ -#define __WIDEIMAGE_LOC__ -../loc/wideimage.loc APP_LAYER_LOC_EXPORT_PATH(wideimage.loc) -#endif // __WIDEIMAGE_LOC__ // Support for S60 builds //*********************** diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/widgetconfiguration.xml --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/widgetconfiguration.xml Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/hsps/00/widgetconfiguration.xml Tue Jan 26 11:48:23 2010 +0200 @@ -9,9 +9,16 @@ - + + + + + + + - + + diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/wideimage_2001f489/loc/wideimage.loc --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/loc/wideimage.loc Fri Jan 22 09:35:14 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 WideImage widget (Xuikon) -* -*/ - -// d: Loading content -// l: ai_gene_pane_1_t1/opt4 -// w: -// r: TB9.2 -#define qtn_ai_loading_content "Loading content..." \ No newline at end of file diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.css --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.css Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.css Tue Jan 26 11:48:23 2010 +0200 @@ -1,22 +1,53 @@ widget#wideimage_template { nav-index: appearance; - background-color: none; + block-progression:rl; } -image#wide_image +box#image_container { /* Will be updated by content policy */ display: none; } +box#default_container +{ + /* Will be updated by content policy */ + block-progression: rl; + direction:ltr; + display: block; +} -text#wide_text +image#default_image +{ + padding-top:9px; + padding-bottom:9px; + padding-left:9px; + padding-right:9px; + height: 64px; + width: 64px; +} + +animation#loading { - padding-left: 5px; - text-align: center; + position: absolute; + top:9px; + left:273px; + right:9px; + width:30px; + height:30px; + /* Will be updated by dataplugin */ + display: none; +} + +text +{ + padding-left:9px; + padding-right:9px; + height : 10u; + font-line-space: 15; + text-align:left; + text-overflow-mode: wrap; font-family: EAknLogicalFontSecondaryFont; - font-size: 23px; + font-size: 4u; color: "SKIN(268458534 13056 74)"; } - - diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dat --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dat Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dat Tue Jan 26 11:48:23 2010 +0200 @@ -8,5 +8,4 @@ 1.0 wideimage.xml wideimage.css - wideimage.dtd \ No newline at end of file diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dtd --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.dtd Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ - - - - - - - - - - - diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.xml --- a/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.xml Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/data/qhd_tch/wideimage_2001f489/xuikon/00/wideimage.xml Tue Jan 26 11:48:23 2010 +0200 @@ -1,11 +1,9 @@ - - @@ -17,22 +15,29 @@ - - + + + + + + + + + + - - - - - + + + + - &qtn_ai_loading_content; - + + diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/help/data/xhtml.zip Binary file idlehomescreen/help/data/xhtml.zip has changed diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/help/inc/hmsc.hlp.hrh --- a/idlehomescreen/help/inc/hmsc.hlp.hrh Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/help/inc/hmsc.hlp.hrh Tue Jan 26 11:48:23 2010 +0200 @@ -24,8 +24,6 @@ _LIT(KSET_HLP_HOME_SCREEN, "SET_HLP_HOME_SCREEN"); // _LIT(KSET_HLP_HOME_SCREEN_EDIT, "SET_HLP_HOME_SCREEN_EDIT"); // -_LIT(KSET_HLP_HOME_SCREEN_SHORTCUTS, "SET_HLP_HOME_SCREEN_SHORTCUTS"); // _LIT(KWM_HLP_WIDGET_COLLECTION, "WM_HLP_WIDGET_COLLECTION"); // -_LIT(KSET_HLP_HOME_SCREEN_NON_TOUCH, "SET_HLP_HOME_SCREEN_NON_TOUCH"); // #endif \ No newline at end of file diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/inc/xnanimation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/inc/xnanimation.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,92 @@ +/* +* 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: Wrapper class for Animation. +* +*/ + + + +#ifndef _XNANIMATION_H +#define _XNANIMATION_H + +// INCLUDES +#include "xncomponent.h" +#include "mxncomponentinterface.h" + +// FORWARD DECLARATIONS +class CFbsBitmap; + +// CLASS DECLARATION + +namespace XnAnimationInterface +{ +_LIT8(KType, "animation"); +class MXnAnimationInterface : public XnComponentInterface::MXnComponentInterface + { + +public: + + static inline const TDesC8& Type() + { + return KType; + } + +// Add New functions if needed + }; + } + +/** +* @ingroup group_xnanimationfactory +* @lib xn3animationfactory.dll +* @since Series 60 9.2 +*/ +class CXnAnimation : public CXnComponent, public XnAnimationInterface::MXnAnimationInterface + { + +public: + + /** + * 2 phase construction. + */ + static CXnAnimation* NewL(); + + /** + * Destructor. + */ + virtual ~CXnAnimation(); + +public: // from CCoeControl + /** + * Create a component interface according to the given type. + * @param aType Type of the interface to create + * @return Created interface or NULL if the provided type is not supported. + */ + virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL(const TDesC8& aType); + + +private: + /** + * Default constructor. + */ + CXnAnimation(); + + /** + * ConstructL + */ + void ConstructL(); + }; + +#endif // _XNANIMATION_H + +// End of File diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/inc/xneditmode.h --- a/idlehomescreen/inc/xneditmode.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/inc/xneditmode.h Tue Jan 26 11:48:23 2010 +0200 @@ -119,7 +119,14 @@ * @since Series 60 5.0 */ void HandleScreenDeviceChangedL(); - + + /** + * Reset the dragging state and update screen + * + * @since Series 60 5.0 + */ + void StopDraggingL(); + private: // new functions diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/nativeuicontroller/inc/nativeuicontroller.h --- a/idlehomescreen/nativeuicontroller/inc/nativeuicontroller.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/inc/nativeuicontroller.h Tue Jan 26 11:48:23 2010 +0200 @@ -135,6 +135,17 @@ TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + TInt SetProperty( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ); + + TInt SetProperty( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType); + // new methods /** diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/nativeuicontroller/src/nativeuicontroller.cpp --- a/idlehomescreen/nativeuicontroller/src/nativeuicontroller.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/nativeuicontroller.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -1040,6 +1040,32 @@ } // ---------------------------------------------------------------------------- +// CNativeUiController::SetProperty() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::SetProperty( MAiPropertyExtension& /*aPlugin*/, + const TDesC8& /*aElementId*/, + const TDesC8& /*aPropertyName*/, + const TDesC8& /*aPropertyValue*/ ) + { + + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CNativeUiController::SetProperty() +// ---------------------------------------------------------------------------- +// +TInt CNativeUiController::SetProperty(MAiPropertyExtension& /*aPlugin*/, + const TDesC8& /*aElementId*/, + const TDesC8& /*aPropertyName*/, + const TDesC8& /*aPropertyValue*/, + MAiContentObserver::TValueType /*aValueType*/) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- // CNativeUiController::NewApplication() // ---------------------------------------------------------------------------- // diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/sapiwrapper/hspswrapper/bwins/hspswrapper.def --- a/idlehomescreen/sapiwrapper/hspswrapper/bwins/hspswrapper.def Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/bwins/hspswrapper.def Tue Jan 26 11:48:23 2010 +0200 @@ -8,93 +8,93 @@ ?ItemName@CItemMap@hspswrapper@@QBEABVTDesC8@@XZ @ 7 NONAME ; class TDesC8 const & hspswrapper::CItemMap::ItemName(void) const ??1CPluginMap@hspswrapper@@UAE@XZ @ 8 NONAME ; hspswrapper::CPluginMap::~CPluginMap(void) ?ActivationState@CPluginMap@hspswrapper@@QBEHXZ @ 9 NONAME ; int hspswrapper::CPluginMap::ActivationState(void) const - ?SetAppConfigurationL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 10 NONAME ; int hspswrapper::CHspsWrapper::SetAppConfigurationL(class TDesC8 const &) - ?Uid@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 11 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Uid(void) const - ?ConfigurationState@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 12 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::ConfigurationState(void) const - ?NameL@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 13 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::NameL(void) const - ?Value@CPropertyMap@hspswrapper@@QBEABVTDesC8@@XZ @ 14 NONAME ; class TDesC8 const & hspswrapper::CPropertyMap::Value(void) const - ?NewL@CPropertyMap@hspswrapper@@SAPAV12@XZ @ 15 NONAME ; class hspswrapper::CPropertyMap * hspswrapper::CPropertyMap::NewL(void) - ??1CPluginInfo@hspswrapper@@UAE@XZ @ 16 NONAME ; hspswrapper::CPluginInfo::~CPluginInfo(void) - ?AddObjectMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCObjectMap@2@@Z @ 17 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddObjectMapL(class hspswrapper::CObjectMap *) - ?PluginId@CPluginMap@hspswrapper@@QBEABVTDesC8@@XZ @ 18 NONAME ; class TDesC8 const & hspswrapper::CPluginMap::PluginId(void) const - ?PluginMaps@CHspsConfiguration@hspswrapper@@QAEAAV?$RPointerArray@VCPluginMap@hspswrapper@@@@XZ @ 19 NONAME ; class RPointerArray & hspswrapper::CHspsConfiguration::PluginMaps(void) - ?NewL@CPluginMap@hspswrapper@@SAPAV12@XZ @ 20 NONAME ; class hspswrapper::CPluginMap * hspswrapper::CPluginMap::NewL(void) - ??1CPropertyMap@hspswrapper@@UAE@XZ @ 21 NONAME ; hspswrapper::CPropertyMap::~CPropertyMap(void) - ?SetNameL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 22 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetNameL(class TDesC8 const &) - ?SetPluginIdL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 23 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetPluginIdL(class TDesC8 const &) - ?SetConfigurationStateL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 24 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetConfigurationStateL(class TDesC8 const &) - ??1CHspsConfiguration@hspswrapper@@UAE@XZ @ 25 NONAME ; hspswrapper::CHspsConfiguration::~CHspsConfiguration(void) - ?Status@CAddPluginResult@hspswrapper@@QBEHXZ @ 26 NONAME ; int hspswrapper::CAddPluginResult::Status(void) const - ?NewLC@CHspsConfiguration@hspswrapper@@SAPAV12@XZ @ 27 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsConfiguration::NewLC(void) - ?Name@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 28 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Name(void) const - ??1CHspsWrapper@hspswrapper@@UAE@XZ @ 29 NONAME ; hspswrapper::CHspsWrapper::~CHspsWrapper(void) - ?SetMultiInstanceL@CPluginInfo@hspswrapper@@QAEAAV12@J@Z @ 30 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetMultiInstanceL(long) - ?MultiInstance@CPluginInfo@hspswrapper@@QBEABJXZ @ 31 NONAME ; long const & hspswrapper::CPluginInfo::MultiInstance(void) const - ?SetStatus@CAddPluginResult@hspswrapper@@QAEXH@Z @ 32 NONAME ; void hspswrapper::CAddPluginResult::SetStatus(int) - ?AddItemMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCItemMap@2@@Z @ 33 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddItemMapL(class hspswrapper::CItemMap *) - ?MovePluginsL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@ABVMDesC8Array@@@Z @ 34 NONAME ; int hspswrapper::CHspsWrapper::MovePluginsL(class TDesC8 const &, class MDesC8Array const &) - ?HspsInterface@CHspsWrapper@hspswrapper@@QBEPAVMLiwInterface@@XZ @ 35 NONAME ; class MLiwInterface * hspswrapper::CHspsWrapper::HspsInterface(void) const - ?PluginInfo@CHspsConfiguration@hspswrapper@@QAEAAVCPluginInfo@2@XZ @ 36 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CHspsConfiguration::PluginInfo(void) - ?NewL@CAddPluginResult@hspswrapper@@SAPAV12@XZ @ 37 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CAddPluginResult::NewL(void) - ?GetPluginConfigurationL@CHspsWrapper@hspswrapper@@QAEPAVCHspsConfiguration@2@ABVTDesC8@@@Z @ 38 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsWrapper::GetPluginConfigurationL(class TDesC8 const &) - ?Properties@CItemMap@hspswrapper@@QBEAAV?$RPointerArray@VCPropertyMap@hspswrapper@@@@XZ @ 39 NONAME ; class RPointerArray & hspswrapper::CItemMap::Properties(void) const - ?Path@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 40 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::Path(void) const - ?NewLC@CHspsWrapper@hspswrapper@@SAPAV12@ABVTDesC8@@PAVMHspsWrapperObserver@2@@Z @ 41 NONAME ; class hspswrapper::CHspsWrapper * hspswrapper::CHspsWrapper::NewLC(class TDesC8 const &, class hspswrapper::MHspsWrapperObserver *) - ?SetNameL@CPropertyMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 42 NONAME ; class hspswrapper::CPropertyMap & hspswrapper::CPropertyMap::SetNameL(class TDesC8 const &) - ?SetConfStateL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@0H@Z @ 43 NONAME ; int hspswrapper::CHspsWrapper::SetConfStateL(class TDesC8 const &, class TDesC8 const &, int) - ?MediaType@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 44 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::MediaType(void) const - ?SetTypeL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 45 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetTypeL(class TDesC8 const &) - ?AddPropertyMapL@CItemMap@hspswrapper@@QAEAAV12@PAVCPropertyMap@2@@Z @ 46 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::AddPropertyMapL(class hspswrapper::CPropertyMap *) - ?NewLC@CObjectMap@hspswrapper@@SAPAV12@XZ @ 47 NONAME ; class hspswrapper::CObjectMap * hspswrapper::CObjectMap::NewLC(void) - ?GetAppConfigurationsL@CHspsWrapper@hspswrapper@@QAEXAAV?$RPointerArray@VCPluginInfo@hspswrapper@@@@@Z @ 48 NONAME ; void hspswrapper::CHspsWrapper::GetAppConfigurationsL(class RPointerArray &) - ?NewL@CPluginInfo@hspswrapper@@SAPAV12@XZ @ 49 NONAME ; class hspswrapper::CPluginInfo * hspswrapper::CPluginInfo::NewL(void) - ?SetItemNameL@CItemMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 50 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::SetItemNameL(class TDesC8 const &) - ?AddPluginL@CHspsWrapper@hspswrapper@@QAEPAVCAddPluginResult@2@ABVTDesC8@@0@Z @ 51 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CHspsWrapper::AddPluginL(class TDesC8 const &, class TDesC8 const &) - ?NewL@CHspsConfiguration@hspswrapper@@SAPAV12@XZ @ 52 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsConfiguration::NewL(void) - ?SetLogoIconL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 53 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetLogoIconL(class TDesC8 const &) - ?SetPluginUidL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 54 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetPluginUidL(class TDesC8 const &) - ?SetValueL@CPropertyMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 55 NONAME ; class hspswrapper::CPropertyMap & hspswrapper::CPropertyMap::SetValueL(class TDesC8 const &) - ??1CObjectMap@hspswrapper@@UAE@XZ @ 56 NONAME ; hspswrapper::CObjectMap::~CObjectMap(void) - ??1CItemMap@hspswrapper@@UAE@XZ @ 57 NONAME ; hspswrapper::CItemMap::~CItemMap(void) - ?Name@CPropertyMap@hspswrapper@@QBEABVTDesC8@@XZ @ 58 NONAME ; class TDesC8 const & hspswrapper::CPropertyMap::Name(void) const - ?SetPluginSettingsL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@ABV?$RPointerArray@VCItemMap@hspswrapper@@@@@Z @ 59 NONAME ; int hspswrapper::CHspsWrapper::SetPluginSettingsL(class TDesC8 const &, class RPointerArray const &) - ?ConfId@CHspsConfiguration@hspswrapper@@QBEABVTDesC8@@XZ @ 60 NONAME ; class TDesC8 const & hspswrapper::CHspsConfiguration::ConfId(void) const - ?GetPluginsL@CHspsWrapper@hspswrapper@@QAEXAAV?$RPointerArray@VCPluginInfo@hspswrapper@@@@ABVTDesC8@@1@Z @ 61 NONAME ; void hspswrapper::CHspsWrapper::GetPluginsL(class RPointerArray &, class TDesC8 const &, class TDesC8 const &) - ?ItemId@CItemMap@hspswrapper@@QBEABVTDesC8@@XZ @ 62 NONAME ; class TDesC8 const & hspswrapper::CItemMap::ItemId(void) const - ?GetAppConfigurationL@CHspsWrapper@hspswrapper@@QAEPAVCHspsConfiguration@2@XZ @ 63 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsWrapper::GetAppConfigurationL(void) - ?NewL@CItemMap@hspswrapper@@SAPAV12@XZ @ 64 NONAME ; class hspswrapper::CItemMap * hspswrapper::CItemMap::NewL(void) - ?SetPathL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 65 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetPathL(class TDesC8 const &) - ?PluginId@CAddPluginResult@hspswrapper@@QBEABVTDesC8@@XZ @ 66 NONAME ; class TDesC8 const & hspswrapper::CAddPluginResult::PluginId(void) const - ??1CAddPluginResult@hspswrapper@@UAE@XZ @ 67 NONAME ; hspswrapper::CAddPluginResult::~CAddPluginResult(void) - ?Description@CPluginInfo@hspswrapper@@QBEABVTDesC16@@XZ @ 68 NONAME ; class TDesC16 const & hspswrapper::CPluginInfo::Description(void) const - ?NewLC@CPluginMap@hspswrapper@@SAPAV12@XZ @ 69 NONAME ; class hspswrapper::CPluginMap * hspswrapper::CPluginMap::NewLC(void) - ?ReplacePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@0@Z @ 70 NONAME ; int hspswrapper::CHspsWrapper::ReplacePluginL(class TDesC8 const &, class TDesC8 const &) - ?Resources@CHspsConfiguration@hspswrapper@@QAEAAV?$RPointerArray@VCObjectMap@hspswrapper@@@@XZ @ 71 NONAME ; class RPointerArray & hspswrapper::CHspsConfiguration::Resources(void) - ?ServiceHandler@CHspsWrapper@hspswrapper@@QBEPAVCLiwServiceHandler@@XZ @ 72 NONAME ; class CLiwServiceHandler * hspswrapper::CHspsWrapper::ServiceHandler(void) const - ?Interface@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 73 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Interface(void) const - ?SetActivePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 74 NONAME ; int hspswrapper::CHspsWrapper::SetActivePluginL(class TDesC8 const &) - ?SetDescriptionL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 75 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetDescriptionL(class TDesC8 const &) - ?AddPluginL@CHspsWrapper@hspswrapper@@QAEPAVCAddPluginResult@2@ABVTDesC8@@0H@Z @ 76 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CHspsWrapper::AddPluginL(class TDesC8 const &, class TDesC8 const &, int) - ?SetPluginIdL@CAddPluginResult@hspswrapper@@QAEXABVTDesC8@@@Z @ 77 NONAME ; void hspswrapper::CAddPluginResult::SetPluginIdL(class TDesC8 const &) - ?SetUidL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 78 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetUidL(class TDesC8 const &) - ?SetTagL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 79 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetTagL(class TDesC8 const &) - ?NewLC@CPluginInfo@hspswrapper@@SAPAV12@XZ @ 80 NONAME ; class hspswrapper::CPluginInfo * hspswrapper::CPluginInfo::NewLC(void) - ?SetNameL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 81 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetNameL(class TDesC8 const &) - ?SetMediaTypeL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 82 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetMediaTypeL(class TDesC8 const &) - ?Tag@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 83 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::Tag(void) const - ?SetItemIdL@CItemMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 84 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::SetItemIdL(class TDesC8 const &) - ?NewLC@CItemMap@hspswrapper@@SAPAV12@XZ @ 85 NONAME ; class hspswrapper::CItemMap * hspswrapper::CItemMap::NewLC(void) - ?SetLogoIconL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC16@@@Z @ 86 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetLogoIconL(class TDesC16 const &) - ?SetInterfaceL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 87 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetInterfaceL(class TDesC8 const &) - ?AddPluginMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCPluginMap@2@@Z @ 88 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddPluginMapL(class hspswrapper::CPluginMap *) - ?RemovePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 89 NONAME ; int hspswrapper::CHspsWrapper::RemovePluginL(class TDesC8 const &) - ?SetActivationStateL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 90 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetActivationStateL(class TDesC8 const &) - ?Type@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 91 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Type(void) const - ?SetConfIdL@CHspsConfiguration@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 92 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::SetConfIdL(class TDesC8 const &) - ?SetDescriptionL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC16@@@Z @ 93 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetDescriptionL(class TDesC16 const &) - ?NewLC@CPropertyMap@hspswrapper@@SAPAV12@XZ @ 94 NONAME ; class hspswrapper::CPropertyMap * hspswrapper::CPropertyMap::NewLC(void) - ??0CAddPluginResult@hspswrapper@@AAE@XZ @ 95 NONAME ; hspswrapper::CAddPluginResult::CAddPluginResult(void) - ?SetMaxChild@CPluginInfo@hspswrapper@@QAEAAV12@J@Z @ 96 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetMaxChild(long) - ?MaxChild@CPluginInfo@hspswrapper@@QBEABJXZ @ 97 NONAME ; long const & hspswrapper::CPluginInfo::MaxChild(void) const - ?SetLockingStatusL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 98 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetLockingStatusL(class TDesC8 const &) - ?LockingStatus@CPluginMap@hspswrapper@@QBEABVTDesC8@@XZ @ 99 NONAME ; class TDesC8 const & hspswrapper::CPluginMap::LockingStatus(void) const + ?SetMaxChild@CPluginInfo@hspswrapper@@QAEAAV12@J@Z @ 10 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetMaxChild(long) + ?SetAppConfigurationL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 11 NONAME ; int hspswrapper::CHspsWrapper::SetAppConfigurationL(class TDesC8 const &) + ?Uid@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 12 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Uid(void) const + ?ConfigurationState@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 13 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::ConfigurationState(void) const + ?NameL@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 14 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::NameL(void) const + ?Value@CPropertyMap@hspswrapper@@QBEABVTDesC8@@XZ @ 15 NONAME ; class TDesC8 const & hspswrapper::CPropertyMap::Value(void) const + ?NewL@CPropertyMap@hspswrapper@@SAPAV12@XZ @ 16 NONAME ; class hspswrapper::CPropertyMap * hspswrapper::CPropertyMap::NewL(void) + ??1CPluginInfo@hspswrapper@@UAE@XZ @ 17 NONAME ; hspswrapper::CPluginInfo::~CPluginInfo(void) + ?AddObjectMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCObjectMap@2@@Z @ 18 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddObjectMapL(class hspswrapper::CObjectMap *) + ?PluginId@CPluginMap@hspswrapper@@QBEABVTDesC8@@XZ @ 19 NONAME ; class TDesC8 const & hspswrapper::CPluginMap::PluginId(void) const + ?Description@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 20 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Description(void) const + ?PluginMaps@CHspsConfiguration@hspswrapper@@QAEAAV?$RPointerArray@VCPluginMap@hspswrapper@@@@XZ @ 21 NONAME ; class RPointerArray & hspswrapper::CHspsConfiguration::PluginMaps(void) + ?NewL@CPluginMap@hspswrapper@@SAPAV12@XZ @ 22 NONAME ; class hspswrapper::CPluginMap * hspswrapper::CPluginMap::NewL(void) + ??1CPropertyMap@hspswrapper@@UAE@XZ @ 23 NONAME ; hspswrapper::CPropertyMap::~CPropertyMap(void) + ?SetNameL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 24 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetNameL(class TDesC8 const &) + ?SetPluginIdL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 25 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetPluginIdL(class TDesC8 const &) + ?SetConfigurationStateL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 26 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetConfigurationStateL(class TDesC8 const &) + ??1CHspsConfiguration@hspswrapper@@UAE@XZ @ 27 NONAME ; hspswrapper::CHspsConfiguration::~CHspsConfiguration(void) + ?Status@CAddPluginResult@hspswrapper@@QBEHXZ @ 28 NONAME ; int hspswrapper::CAddPluginResult::Status(void) const + ?NewLC@CHspsConfiguration@hspswrapper@@SAPAV12@XZ @ 29 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsConfiguration::NewLC(void) + ?Name@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 30 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Name(void) const + ??1CHspsWrapper@hspswrapper@@UAE@XZ @ 31 NONAME ; hspswrapper::CHspsWrapper::~CHspsWrapper(void) + ?SetMultiInstanceL@CPluginInfo@hspswrapper@@QAEAAV12@J@Z @ 32 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetMultiInstanceL(long) + ?MultiInstance@CPluginInfo@hspswrapper@@QBEABJXZ @ 33 NONAME ; long const & hspswrapper::CPluginInfo::MultiInstance(void) const + ?SetStatus@CAddPluginResult@hspswrapper@@QAEXH@Z @ 34 NONAME ; void hspswrapper::CAddPluginResult::SetStatus(int) + ?AddItemMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCItemMap@2@@Z @ 35 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddItemMapL(class hspswrapper::CItemMap *) + ?MovePluginsL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@ABVMDesC8Array@@@Z @ 36 NONAME ; int hspswrapper::CHspsWrapper::MovePluginsL(class TDesC8 const &, class MDesC8Array const &) + ?HspsInterface@CHspsWrapper@hspswrapper@@QBEPAVMLiwInterface@@XZ @ 37 NONAME ; class MLiwInterface * hspswrapper::CHspsWrapper::HspsInterface(void) const + ?PluginInfo@CHspsConfiguration@hspswrapper@@QAEAAVCPluginInfo@2@XZ @ 38 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CHspsConfiguration::PluginInfo(void) + ?NewL@CAddPluginResult@hspswrapper@@SAPAV12@XZ @ 39 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CAddPluginResult::NewL(void) + ?GetPluginConfigurationL@CHspsWrapper@hspswrapper@@QAEPAVCHspsConfiguration@2@ABVTDesC8@@@Z @ 40 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsWrapper::GetPluginConfigurationL(class TDesC8 const &) + ?Properties@CItemMap@hspswrapper@@QBEAAV?$RPointerArray@VCPropertyMap@hspswrapper@@@@XZ @ 41 NONAME ; class RPointerArray & hspswrapper::CItemMap::Properties(void) const + ?Path@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 42 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::Path(void) const + ?NewLC@CHspsWrapper@hspswrapper@@SAPAV12@ABVTDesC8@@PAVMHspsWrapperObserver@2@@Z @ 43 NONAME ; class hspswrapper::CHspsWrapper * hspswrapper::CHspsWrapper::NewLC(class TDesC8 const &, class hspswrapper::MHspsWrapperObserver *) + ?SetNameL@CPropertyMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 44 NONAME ; class hspswrapper::CPropertyMap & hspswrapper::CPropertyMap::SetNameL(class TDesC8 const &) + ?SetConfStateL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@0H@Z @ 45 NONAME ; int hspswrapper::CHspsWrapper::SetConfStateL(class TDesC8 const &, class TDesC8 const &, int) + ?MediaType@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 46 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::MediaType(void) const + ?SetTypeL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 47 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetTypeL(class TDesC8 const &) + ?AddPropertyMapL@CItemMap@hspswrapper@@QAEAAV12@PAVCPropertyMap@2@@Z @ 48 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::AddPropertyMapL(class hspswrapper::CPropertyMap *) + ?NewLC@CObjectMap@hspswrapper@@SAPAV12@XZ @ 49 NONAME ; class hspswrapper::CObjectMap * hspswrapper::CObjectMap::NewLC(void) + ?GetAppConfigurationsL@CHspsWrapper@hspswrapper@@QAEXAAV?$RPointerArray@VCPluginInfo@hspswrapper@@@@@Z @ 50 NONAME ; void hspswrapper::CHspsWrapper::GetAppConfigurationsL(class RPointerArray &) + ?NewL@CPluginInfo@hspswrapper@@SAPAV12@XZ @ 51 NONAME ; class hspswrapper::CPluginInfo * hspswrapper::CPluginInfo::NewL(void) + ?SetItemNameL@CItemMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 52 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::SetItemNameL(class TDesC8 const &) + ?AddPluginL@CHspsWrapper@hspswrapper@@QAEPAVCAddPluginResult@2@ABVTDesC8@@0@Z @ 53 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CHspsWrapper::AddPluginL(class TDesC8 const &, class TDesC8 const &) + ?NewL@CHspsConfiguration@hspswrapper@@SAPAV12@XZ @ 54 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsConfiguration::NewL(void) + ?SetLogoIconL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 55 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetLogoIconL(class TDesC8 const &) + ?SetPluginUidL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 56 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetPluginUidL(class TDesC8 const &) + ?SetValueL@CPropertyMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 57 NONAME ; class hspswrapper::CPropertyMap & hspswrapper::CPropertyMap::SetValueL(class TDesC8 const &) + ??1CObjectMap@hspswrapper@@UAE@XZ @ 58 NONAME ; hspswrapper::CObjectMap::~CObjectMap(void) + ??1CItemMap@hspswrapper@@UAE@XZ @ 59 NONAME ; hspswrapper::CItemMap::~CItemMap(void) + ?Name@CPropertyMap@hspswrapper@@QBEABVTDesC8@@XZ @ 60 NONAME ; class TDesC8 const & hspswrapper::CPropertyMap::Name(void) const + ?SetPluginSettingsL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@ABV?$RPointerArray@VCItemMap@hspswrapper@@@@@Z @ 61 NONAME ; int hspswrapper::CHspsWrapper::SetPluginSettingsL(class TDesC8 const &, class RPointerArray const &) + ?ConfId@CHspsConfiguration@hspswrapper@@QBEABVTDesC8@@XZ @ 62 NONAME ; class TDesC8 const & hspswrapper::CHspsConfiguration::ConfId(void) const + ?GetPluginsL@CHspsWrapper@hspswrapper@@QAEXAAV?$RPointerArray@VCPluginInfo@hspswrapper@@@@ABVTDesC8@@1@Z @ 63 NONAME ; void hspswrapper::CHspsWrapper::GetPluginsL(class RPointerArray &, class TDesC8 const &, class TDesC8 const &) + ?ItemId@CItemMap@hspswrapper@@QBEABVTDesC8@@XZ @ 64 NONAME ; class TDesC8 const & hspswrapper::CItemMap::ItemId(void) const + ?GetAppConfigurationL@CHspsWrapper@hspswrapper@@QAEPAVCHspsConfiguration@2@XZ @ 65 NONAME ; class hspswrapper::CHspsConfiguration * hspswrapper::CHspsWrapper::GetAppConfigurationL(void) + ?NewL@CItemMap@hspswrapper@@SAPAV12@XZ @ 66 NONAME ; class hspswrapper::CItemMap * hspswrapper::CItemMap::NewL(void) + ?SetPathL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 67 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetPathL(class TDesC8 const &) + ?PluginId@CAddPluginResult@hspswrapper@@QBEABVTDesC8@@XZ @ 68 NONAME ; class TDesC8 const & hspswrapper::CAddPluginResult::PluginId(void) const + ??1CAddPluginResult@hspswrapper@@UAE@XZ @ 69 NONAME ; hspswrapper::CAddPluginResult::~CAddPluginResult(void) + ?NewLC@CPluginMap@hspswrapper@@SAPAV12@XZ @ 70 NONAME ; class hspswrapper::CPluginMap * hspswrapper::CPluginMap::NewLC(void) + ?ReplacePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@0@Z @ 71 NONAME ; int hspswrapper::CHspsWrapper::ReplacePluginL(class TDesC8 const &, class TDesC8 const &) + ?Resources@CHspsConfiguration@hspswrapper@@QAEAAV?$RPointerArray@VCObjectMap@hspswrapper@@@@XZ @ 72 NONAME ; class RPointerArray & hspswrapper::CHspsConfiguration::Resources(void) + ?MaxChild@CPluginInfo@hspswrapper@@QBEABJXZ @ 73 NONAME ; long const & hspswrapper::CPluginInfo::MaxChild(void) const + ?SetLockingStatusL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 74 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetLockingStatusL(class TDesC8 const &) + ?ServiceHandler@CHspsWrapper@hspswrapper@@QBEPAVCLiwServiceHandler@@XZ @ 75 NONAME ; class CLiwServiceHandler * hspswrapper::CHspsWrapper::ServiceHandler(void) const + ?Interface@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 76 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Interface(void) const + ?SetActivePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 77 NONAME ; int hspswrapper::CHspsWrapper::SetActivePluginL(class TDesC8 const &) + ?SetDescriptionL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 78 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetDescriptionL(class TDesC8 const &) + ?AddPluginL@CHspsWrapper@hspswrapper@@QAEPAVCAddPluginResult@2@ABVTDesC8@@0H@Z @ 79 NONAME ; class hspswrapper::CAddPluginResult * hspswrapper::CHspsWrapper::AddPluginL(class TDesC8 const &, class TDesC8 const &, int) + ?SetPluginIdL@CAddPluginResult@hspswrapper@@QAEXABVTDesC8@@@Z @ 80 NONAME ; void hspswrapper::CAddPluginResult::SetPluginIdL(class TDesC8 const &) + ?SetUidL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 81 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetUidL(class TDesC8 const &) + ?SetTagL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 82 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetTagL(class TDesC8 const &) + ?NewLC@CPluginInfo@hspswrapper@@SAPAV12@XZ @ 83 NONAME ; class hspswrapper::CPluginInfo * hspswrapper::CPluginInfo::NewLC(void) + ?SetNameL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 84 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetNameL(class TDesC8 const &) + ?SetMediaTypeL@CObjectMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 85 NONAME ; class hspswrapper::CObjectMap & hspswrapper::CObjectMap::SetMediaTypeL(class TDesC8 const &) + ?Tag@CObjectMap@hspswrapper@@QBEABVTDesC8@@XZ @ 86 NONAME ; class TDesC8 const & hspswrapper::CObjectMap::Tag(void) const + ?SetItemIdL@CItemMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 87 NONAME ; class hspswrapper::CItemMap & hspswrapper::CItemMap::SetItemIdL(class TDesC8 const &) + ?NewLC@CItemMap@hspswrapper@@SAPAV12@XZ @ 88 NONAME ; class hspswrapper::CItemMap * hspswrapper::CItemMap::NewLC(void) + ?SetLogoIconL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC16@@@Z @ 89 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetLogoIconL(class TDesC16 const &) + ?SetInterfaceL@CPluginInfo@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 90 NONAME ; class hspswrapper::CPluginInfo & hspswrapper::CPluginInfo::SetInterfaceL(class TDesC8 const &) + ?AddPluginMapL@CHspsConfiguration@hspswrapper@@QAEAAV12@PAVCPluginMap@2@@Z @ 91 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::AddPluginMapL(class hspswrapper::CPluginMap *) + ?RemovePluginL@CHspsWrapper@hspswrapper@@QAEHABVTDesC8@@@Z @ 92 NONAME ; int hspswrapper::CHspsWrapper::RemovePluginL(class TDesC8 const &) + ?LockingStatus@CPluginMap@hspswrapper@@QBEABVTDesC8@@XZ @ 93 NONAME ; class TDesC8 const & hspswrapper::CPluginMap::LockingStatus(void) const + ?SetActivationStateL@CPluginMap@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 94 NONAME ; class hspswrapper::CPluginMap & hspswrapper::CPluginMap::SetActivationStateL(class TDesC8 const &) + ?Type@CPluginInfo@hspswrapper@@QBEABVTDesC8@@XZ @ 95 NONAME ; class TDesC8 const & hspswrapper::CPluginInfo::Type(void) const + ?SetConfIdL@CHspsConfiguration@hspswrapper@@QAEAAV12@ABVTDesC8@@@Z @ 96 NONAME ; class hspswrapper::CHspsConfiguration & hspswrapper::CHspsConfiguration::SetConfIdL(class TDesC8 const &) + ?NewLC@CPropertyMap@hspswrapper@@SAPAV12@XZ @ 97 NONAME ; class hspswrapper::CPropertyMap * hspswrapper::CPropertyMap::NewLC(void) + ??0CAddPluginResult@hspswrapper@@AAE@XZ @ 98 NONAME ; hspswrapper::CAddPluginResult::CAddPluginResult(void) + diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/sapiwrapper/hspswrapper/eabi/hspswrapper.def --- a/idlehomescreen/sapiwrapper/hspswrapper/eabi/hspswrapper.def Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/eabi/hspswrapper.def Tue Jan 26 11:48:23 2010 +0200 @@ -10,125 +10,124 @@ _ZN11hspswrapper10CObjectMapD2Ev @ 9 NONAME _ZN11hspswrapper10CPluginMap12SetPluginIdLERK6TDesC8 @ 10 NONAME _ZN11hspswrapper10CPluginMap13SetPluginUidLERK6TDesC8 @ 11 NONAME - _ZN11hspswrapper10CPluginMap19SetActivationStateLERK6TDesC8 @ 12 NONAME - _ZN11hspswrapper10CPluginMap4NewLEv @ 13 NONAME - _ZN11hspswrapper10CPluginMap5NewLCEv @ 14 NONAME - _ZN11hspswrapper10CPluginMapD0Ev @ 15 NONAME - _ZN11hspswrapper10CPluginMapD1Ev @ 16 NONAME - _ZN11hspswrapper10CPluginMapD2Ev @ 17 NONAME - _ZN11hspswrapper11CPluginInfo12SetLogoIconLERK6TDesC8 @ 18 NONAME - _ZN11hspswrapper11CPluginInfo12SetLogoIconLERK7TDesC16 @ 19 NONAME - _ZN11hspswrapper11CPluginInfo13SetInterfaceLERK6TDesC8 @ 20 NONAME - _ZN11hspswrapper11CPluginInfo15SetDescriptionLERK6TDesC8 @ 21 NONAME - _ZN11hspswrapper11CPluginInfo15SetDescriptionLERK7TDesC16 @ 22 NONAME - _ZN11hspswrapper11CPluginInfo17SetMultiInstanceLEl @ 23 NONAME - _ZN11hspswrapper11CPluginInfo22SetConfigurationStateLERK6TDesC8 @ 24 NONAME - _ZN11hspswrapper11CPluginInfo4NewLEv @ 25 NONAME - _ZN11hspswrapper11CPluginInfo5NewLCEv @ 26 NONAME - _ZN11hspswrapper11CPluginInfo7SetUidLERK6TDesC8 @ 27 NONAME - _ZN11hspswrapper11CPluginInfo8SetNameLERK6TDesC8 @ 28 NONAME - _ZN11hspswrapper11CPluginInfo8SetTypeLERK6TDesC8 @ 29 NONAME - _ZN11hspswrapper11CPluginInfoD0Ev @ 30 NONAME - _ZN11hspswrapper11CPluginInfoD1Ev @ 31 NONAME - _ZN11hspswrapper11CPluginInfoD2Ev @ 32 NONAME - _ZN11hspswrapper12CHspsWrapper10AddPluginLERK6TDesC8S3_ @ 33 NONAME - _ZN11hspswrapper12CHspsWrapper10AddPluginLERK6TDesC8S3_i @ 34 NONAME - _ZN11hspswrapper12CHspsWrapper11GetPluginsLER13RPointerArrayINS_11CPluginInfoEERK6TDesC8S7_ @ 35 NONAME - _ZN11hspswrapper12CHspsWrapper12MovePluginsLERK6TDesC8RK11MDesC8Array @ 36 NONAME - _ZN11hspswrapper12CHspsWrapper13RemovePluginLERK6TDesC8 @ 37 NONAME - _ZN11hspswrapper12CHspsWrapper13SetConfStateLERK6TDesC8S3_i @ 38 NONAME - _ZN11hspswrapper12CHspsWrapper14ReplacePluginLERK6TDesC8S3_ @ 39 NONAME - _ZN11hspswrapper12CHspsWrapper16SetActivePluginLERK6TDesC8 @ 40 NONAME - _ZN11hspswrapper12CHspsWrapper18SetPluginSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEE @ 41 NONAME - _ZN11hspswrapper12CHspsWrapper20GetAppConfigurationLEv @ 42 NONAME - _ZN11hspswrapper12CHspsWrapper20SetAppConfigurationLERK6TDesC8 @ 43 NONAME - _ZN11hspswrapper12CHspsWrapper21GetAppConfigurationsLER13RPointerArrayINS_11CPluginInfoEE @ 44 NONAME - _ZN11hspswrapper12CHspsWrapper23GetPluginConfigurationLERK6TDesC8 @ 45 NONAME - _ZN11hspswrapper12CHspsWrapper4NewLERK6TDesC8PNS_20MHspsWrapperObserverE @ 46 NONAME - _ZN11hspswrapper12CHspsWrapper5NewLCERK6TDesC8PNS_20MHspsWrapperObserverE @ 47 NONAME - _ZN11hspswrapper12CHspsWrapperD0Ev @ 48 NONAME - _ZN11hspswrapper12CHspsWrapperD1Ev @ 49 NONAME - _ZN11hspswrapper12CHspsWrapperD2Ev @ 50 NONAME - _ZN11hspswrapper12CPropertyMap4NewLEv @ 51 NONAME - _ZN11hspswrapper12CPropertyMap5NewLCEv @ 52 NONAME - _ZN11hspswrapper12CPropertyMap8SetNameLERK6TDesC8 @ 53 NONAME - _ZN11hspswrapper12CPropertyMap9SetValueLERK6TDesC8 @ 54 NONAME - _ZN11hspswrapper12CPropertyMapD0Ev @ 55 NONAME - _ZN11hspswrapper12CPropertyMapD1Ev @ 56 NONAME - _ZN11hspswrapper12CPropertyMapD2Ev @ 57 NONAME - _ZN11hspswrapper16CAddPluginResult12SetPluginIdLERK6TDesC8 @ 58 NONAME - _ZN11hspswrapper16CAddPluginResult4NewLEv @ 59 NONAME - _ZN11hspswrapper16CAddPluginResult9SetStatusEi @ 60 NONAME - _ZN11hspswrapper16CAddPluginResultC1Ev @ 61 NONAME - _ZN11hspswrapper16CAddPluginResultC2Ev @ 62 NONAME - _ZN11hspswrapper16CAddPluginResultD0Ev @ 63 NONAME - _ZN11hspswrapper16CAddPluginResultD1Ev @ 64 NONAME - _ZN11hspswrapper16CAddPluginResultD2Ev @ 65 NONAME - _ZN11hspswrapper18CHspsConfiguration10PluginInfoEv @ 66 NONAME - _ZN11hspswrapper18CHspsConfiguration10PluginMapsEv @ 67 NONAME - _ZN11hspswrapper18CHspsConfiguration10SetConfIdLERK6TDesC8 @ 68 NONAME - _ZN11hspswrapper18CHspsConfiguration11AddItemMapLEPNS_8CItemMapE @ 69 NONAME - _ZN11hspswrapper18CHspsConfiguration13AddObjectMapLEPNS_10CObjectMapE @ 70 NONAME - _ZN11hspswrapper18CHspsConfiguration13AddPluginMapLEPNS_10CPluginMapE @ 71 NONAME - _ZN11hspswrapper18CHspsConfiguration4NewLEv @ 72 NONAME - _ZN11hspswrapper18CHspsConfiguration5NewLCEv @ 73 NONAME - _ZN11hspswrapper18CHspsConfiguration8SettingsEv @ 74 NONAME - _ZN11hspswrapper18CHspsConfiguration9ResourcesEv @ 75 NONAME - _ZN11hspswrapper18CHspsConfigurationD0Ev @ 76 NONAME - _ZN11hspswrapper18CHspsConfigurationD1Ev @ 77 NONAME - _ZN11hspswrapper18CHspsConfigurationD2Ev @ 78 NONAME - _ZN11hspswrapper8CItemMap10SetItemIdLERK6TDesC8 @ 79 NONAME - _ZN11hspswrapper8CItemMap12SetItemNameLERK6TDesC8 @ 80 NONAME - _ZN11hspswrapper8CItemMap15AddPropertyMapLEPNS_12CPropertyMapE @ 81 NONAME - _ZN11hspswrapper8CItemMap4NewLEv @ 82 NONAME - _ZN11hspswrapper8CItemMap5NewLCEv @ 83 NONAME - _ZN11hspswrapper8CItemMapD0Ev @ 84 NONAME - _ZN11hspswrapper8CItemMapD1Ev @ 85 NONAME - _ZN11hspswrapper8CItemMapD2Ev @ 86 NONAME - _ZNK11hspswrapper10CObjectMap3TagEv @ 87 NONAME - _ZNK11hspswrapper10CObjectMap4PathEv @ 88 NONAME - _ZNK11hspswrapper10CObjectMap5NameLEv @ 89 NONAME - _ZNK11hspswrapper10CObjectMap9MediaTypeEv @ 90 NONAME - _ZNK11hspswrapper10CPluginMap15ActivationStateEv @ 91 NONAME - _ZNK11hspswrapper10CPluginMap8PluginIdEv @ 92 NONAME - _ZNK11hspswrapper10CPluginMap9PluginUidEv @ 93 NONAME - _ZNK11hspswrapper11CPluginInfo11DescriptionEv @ 94 NONAME - _ZNK11hspswrapper11CPluginInfo13MultiInstanceEv @ 95 NONAME - _ZNK11hspswrapper11CPluginInfo18ConfigurationStateEv @ 96 NONAME - _ZNK11hspswrapper11CPluginInfo3UidEv @ 97 NONAME - _ZNK11hspswrapper11CPluginInfo4NameEv @ 98 NONAME - _ZNK11hspswrapper11CPluginInfo4TypeEv @ 99 NONAME - _ZNK11hspswrapper11CPluginInfo8LogoIconEv @ 100 NONAME - _ZNK11hspswrapper11CPluginInfo9InterfaceEv @ 101 NONAME - _ZNK11hspswrapper12CHspsWrapper11HspsServiceEv @ 102 NONAME - _ZNK11hspswrapper12CHspsWrapper13HspsInterfaceEv @ 103 NONAME - _ZNK11hspswrapper12CHspsWrapper14ServiceHandlerEv @ 104 NONAME - _ZNK11hspswrapper12CPropertyMap4NameEv @ 105 NONAME - _ZNK11hspswrapper12CPropertyMap5ValueEv @ 106 NONAME - _ZNK11hspswrapper16CAddPluginResult6StatusEv @ 107 NONAME - _ZNK11hspswrapper16CAddPluginResult8PluginIdEv @ 108 NONAME - _ZNK11hspswrapper18CHspsConfiguration6ConfIdEv @ 109 NONAME - _ZNK11hspswrapper8CItemMap10PropertiesEv @ 110 NONAME - _ZNK11hspswrapper8CItemMap6ItemIdEv @ 111 NONAME - _ZNK11hspswrapper8CItemMap8ItemNameEv @ 112 NONAME - _ZTIN11hspswrapper10CObjectMapE @ 113 NONAME - _ZTIN11hspswrapper10CPluginMapE @ 114 NONAME - _ZTIN11hspswrapper11CPluginInfoE @ 115 NONAME - _ZTIN11hspswrapper12CHspsWrapperE @ 116 NONAME - _ZTIN11hspswrapper12CPropertyMapE @ 117 NONAME - _ZTIN11hspswrapper16CAddPluginResultE @ 118 NONAME - _ZTIN11hspswrapper18CHspsConfigurationE @ 119 NONAME - _ZTIN11hspswrapper8CItemMapE @ 120 NONAME - _ZTVN11hspswrapper10CObjectMapE @ 121 NONAME - _ZTVN11hspswrapper10CPluginMapE @ 122 NONAME - _ZTVN11hspswrapper11CPluginInfoE @ 123 NONAME - _ZTVN11hspswrapper12CHspsWrapperE @ 124 NONAME - _ZTVN11hspswrapper12CPropertyMapE @ 125 NONAME - _ZTVN11hspswrapper16CAddPluginResultE @ 126 NONAME - _ZTVN11hspswrapper18CHspsConfigurationE @ 127 NONAME - _ZTVN11hspswrapper8CItemMapE @ 128 NONAME - _ZN11hspswrapper11CPluginInfo11SetMaxChildEl @ 129 NONAME - _ZNK11hspswrapper11CPluginInfo8MaxChildEv @ 130 NONAME - _ZN11hspswrapper10CPluginMap17SetLockingStatusLERK6TDesC8 @ 131 NONAME - _ZNK11hspswrapper10CPluginMap13LockingStatusEv @ 132 NONAME + _ZN11hspswrapper10CPluginMap17SetLockingStatusLERK6TDesC8 @ 12 NONAME + _ZN11hspswrapper10CPluginMap19SetActivationStateLERK6TDesC8 @ 13 NONAME + _ZN11hspswrapper10CPluginMap4NewLEv @ 14 NONAME + _ZN11hspswrapper10CPluginMap5NewLCEv @ 15 NONAME + _ZN11hspswrapper10CPluginMapD0Ev @ 16 NONAME + _ZN11hspswrapper10CPluginMapD1Ev @ 17 NONAME + _ZN11hspswrapper10CPluginMapD2Ev @ 18 NONAME + _ZN11hspswrapper11CPluginInfo11SetMaxChildEl @ 19 NONAME + _ZN11hspswrapper11CPluginInfo12SetLogoIconLERK6TDesC8 @ 20 NONAME + _ZN11hspswrapper11CPluginInfo12SetLogoIconLERK7TDesC16 @ 21 NONAME + _ZN11hspswrapper11CPluginInfo13SetInterfaceLERK6TDesC8 @ 22 NONAME + _ZN11hspswrapper11CPluginInfo15SetDescriptionLERK6TDesC8 @ 23 NONAME + _ZN11hspswrapper11CPluginInfo17SetMultiInstanceLEl @ 24 NONAME + _ZN11hspswrapper11CPluginInfo22SetConfigurationStateLERK6TDesC8 @ 25 NONAME + _ZN11hspswrapper11CPluginInfo4NewLEv @ 26 NONAME + _ZN11hspswrapper11CPluginInfo5NewLCEv @ 27 NONAME + _ZN11hspswrapper11CPluginInfo7SetUidLERK6TDesC8 @ 28 NONAME + _ZN11hspswrapper11CPluginInfo8SetNameLERK6TDesC8 @ 29 NONAME + _ZN11hspswrapper11CPluginInfo8SetTypeLERK6TDesC8 @ 30 NONAME + _ZN11hspswrapper11CPluginInfoD0Ev @ 31 NONAME + _ZN11hspswrapper11CPluginInfoD1Ev @ 32 NONAME + _ZN11hspswrapper11CPluginInfoD2Ev @ 33 NONAME + _ZN11hspswrapper12CHspsWrapper10AddPluginLERK6TDesC8S3_ @ 34 NONAME + _ZN11hspswrapper12CHspsWrapper10AddPluginLERK6TDesC8S3_i @ 35 NONAME + _ZN11hspswrapper12CHspsWrapper11GetPluginsLER13RPointerArrayINS_11CPluginInfoEERK6TDesC8S7_ @ 36 NONAME + _ZN11hspswrapper12CHspsWrapper12MovePluginsLERK6TDesC8RK11MDesC8Array @ 37 NONAME + _ZN11hspswrapper12CHspsWrapper13RemovePluginLERK6TDesC8 @ 38 NONAME + _ZN11hspswrapper12CHspsWrapper13SetConfStateLERK6TDesC8S3_i @ 39 NONAME + _ZN11hspswrapper12CHspsWrapper14ReplacePluginLERK6TDesC8S3_ @ 40 NONAME + _ZN11hspswrapper12CHspsWrapper16SetActivePluginLERK6TDesC8 @ 41 NONAME + _ZN11hspswrapper12CHspsWrapper18SetPluginSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEE @ 42 NONAME + _ZN11hspswrapper12CHspsWrapper20GetAppConfigurationLEv @ 43 NONAME + _ZN11hspswrapper12CHspsWrapper20SetAppConfigurationLERK6TDesC8 @ 44 NONAME + _ZN11hspswrapper12CHspsWrapper21GetAppConfigurationsLER13RPointerArrayINS_11CPluginInfoEE @ 45 NONAME + _ZN11hspswrapper12CHspsWrapper23GetPluginConfigurationLERK6TDesC8 @ 46 NONAME + _ZN11hspswrapper12CHspsWrapper4NewLERK6TDesC8PNS_20MHspsWrapperObserverE @ 47 NONAME + _ZN11hspswrapper12CHspsWrapper5NewLCERK6TDesC8PNS_20MHspsWrapperObserverE @ 48 NONAME + _ZN11hspswrapper12CHspsWrapperD0Ev @ 49 NONAME + _ZN11hspswrapper12CHspsWrapperD1Ev @ 50 NONAME + _ZN11hspswrapper12CHspsWrapperD2Ev @ 51 NONAME + _ZN11hspswrapper12CPropertyMap4NewLEv @ 52 NONAME + _ZN11hspswrapper12CPropertyMap5NewLCEv @ 53 NONAME + _ZN11hspswrapper12CPropertyMap8SetNameLERK6TDesC8 @ 54 NONAME + _ZN11hspswrapper12CPropertyMap9SetValueLERK6TDesC8 @ 55 NONAME + _ZN11hspswrapper12CPropertyMapD0Ev @ 56 NONAME + _ZN11hspswrapper12CPropertyMapD1Ev @ 57 NONAME + _ZN11hspswrapper12CPropertyMapD2Ev @ 58 NONAME + _ZN11hspswrapper16CAddPluginResult12SetPluginIdLERK6TDesC8 @ 59 NONAME + _ZN11hspswrapper16CAddPluginResult4NewLEv @ 60 NONAME + _ZN11hspswrapper16CAddPluginResult9SetStatusEi @ 61 NONAME + _ZN11hspswrapper16CAddPluginResultC1Ev @ 62 NONAME + _ZN11hspswrapper16CAddPluginResultC2Ev @ 63 NONAME + _ZN11hspswrapper16CAddPluginResultD0Ev @ 64 NONAME + _ZN11hspswrapper16CAddPluginResultD1Ev @ 65 NONAME + _ZN11hspswrapper16CAddPluginResultD2Ev @ 66 NONAME + _ZN11hspswrapper18CHspsConfiguration10PluginInfoEv @ 67 NONAME + _ZN11hspswrapper18CHspsConfiguration10PluginMapsEv @ 68 NONAME + _ZN11hspswrapper18CHspsConfiguration10SetConfIdLERK6TDesC8 @ 69 NONAME + _ZN11hspswrapper18CHspsConfiguration11AddItemMapLEPNS_8CItemMapE @ 70 NONAME + _ZN11hspswrapper18CHspsConfiguration13AddObjectMapLEPNS_10CObjectMapE @ 71 NONAME + _ZN11hspswrapper18CHspsConfiguration13AddPluginMapLEPNS_10CPluginMapE @ 72 NONAME + _ZN11hspswrapper18CHspsConfiguration4NewLEv @ 73 NONAME + _ZN11hspswrapper18CHspsConfiguration5NewLCEv @ 74 NONAME + _ZN11hspswrapper18CHspsConfiguration8SettingsEv @ 75 NONAME + _ZN11hspswrapper18CHspsConfiguration9ResourcesEv @ 76 NONAME + _ZN11hspswrapper18CHspsConfigurationD0Ev @ 77 NONAME + _ZN11hspswrapper18CHspsConfigurationD1Ev @ 78 NONAME + _ZN11hspswrapper18CHspsConfigurationD2Ev @ 79 NONAME + _ZN11hspswrapper8CItemMap10SetItemIdLERK6TDesC8 @ 80 NONAME + _ZN11hspswrapper8CItemMap12SetItemNameLERK6TDesC8 @ 81 NONAME + _ZN11hspswrapper8CItemMap15AddPropertyMapLEPNS_12CPropertyMapE @ 82 NONAME + _ZN11hspswrapper8CItemMap4NewLEv @ 83 NONAME + _ZN11hspswrapper8CItemMap5NewLCEv @ 84 NONAME + _ZN11hspswrapper8CItemMapD0Ev @ 85 NONAME + _ZN11hspswrapper8CItemMapD1Ev @ 86 NONAME + _ZN11hspswrapper8CItemMapD2Ev @ 87 NONAME + _ZNK11hspswrapper10CObjectMap3TagEv @ 88 NONAME + _ZNK11hspswrapper10CObjectMap4PathEv @ 89 NONAME + _ZNK11hspswrapper10CObjectMap5NameLEv @ 90 NONAME + _ZNK11hspswrapper10CObjectMap9MediaTypeEv @ 91 NONAME + _ZNK11hspswrapper10CPluginMap13LockingStatusEv @ 92 NONAME + _ZNK11hspswrapper10CPluginMap15ActivationStateEv @ 93 NONAME + _ZNK11hspswrapper10CPluginMap8PluginIdEv @ 94 NONAME + _ZNK11hspswrapper10CPluginMap9PluginUidEv @ 95 NONAME + _ZNK11hspswrapper11CPluginInfo11DescriptionEv @ 96 NONAME + _ZNK11hspswrapper11CPluginInfo13MultiInstanceEv @ 97 NONAME + _ZNK11hspswrapper11CPluginInfo18ConfigurationStateEv @ 98 NONAME + _ZNK11hspswrapper11CPluginInfo3UidEv @ 99 NONAME + _ZNK11hspswrapper11CPluginInfo4NameEv @ 100 NONAME + _ZNK11hspswrapper11CPluginInfo4TypeEv @ 101 NONAME + _ZNK11hspswrapper11CPluginInfo8LogoIconEv @ 102 NONAME + _ZNK11hspswrapper11CPluginInfo8MaxChildEv @ 103 NONAME + _ZNK11hspswrapper11CPluginInfo9InterfaceEv @ 104 NONAME + _ZNK11hspswrapper12CHspsWrapper11HspsServiceEv @ 105 NONAME + _ZNK11hspswrapper12CHspsWrapper13HspsInterfaceEv @ 106 NONAME + _ZNK11hspswrapper12CHspsWrapper14ServiceHandlerEv @ 107 NONAME + _ZNK11hspswrapper12CPropertyMap4NameEv @ 108 NONAME + _ZNK11hspswrapper12CPropertyMap5ValueEv @ 109 NONAME + _ZNK11hspswrapper16CAddPluginResult6StatusEv @ 110 NONAME + _ZNK11hspswrapper16CAddPluginResult8PluginIdEv @ 111 NONAME + _ZNK11hspswrapper18CHspsConfiguration6ConfIdEv @ 112 NONAME + _ZNK11hspswrapper8CItemMap10PropertiesEv @ 113 NONAME + _ZNK11hspswrapper8CItemMap6ItemIdEv @ 114 NONAME + _ZNK11hspswrapper8CItemMap8ItemNameEv @ 115 NONAME + _ZTIN11hspswrapper10CObjectMapE @ 116 NONAME + _ZTIN11hspswrapper10CPluginMapE @ 117 NONAME + _ZTIN11hspswrapper11CPluginInfoE @ 118 NONAME + _ZTIN11hspswrapper12CHspsWrapperE @ 119 NONAME + _ZTIN11hspswrapper12CPropertyMapE @ 120 NONAME + _ZTIN11hspswrapper16CAddPluginResultE @ 121 NONAME + _ZTIN11hspswrapper18CHspsConfigurationE @ 122 NONAME + _ZTIN11hspswrapper8CItemMapE @ 123 NONAME + _ZTVN11hspswrapper10CObjectMapE @ 124 NONAME + _ZTVN11hspswrapper10CPluginMapE @ 125 NONAME + _ZTVN11hspswrapper11CPluginInfoE @ 126 NONAME + _ZTVN11hspswrapper12CHspsWrapperE @ 127 NONAME + _ZTVN11hspswrapper12CPropertyMapE @ 128 NONAME + _ZTVN11hspswrapper16CAddPluginResultE @ 129 NONAME + _ZTVN11hspswrapper18CHspsConfigurationE @ 130 NONAME + _ZTVN11hspswrapper8CItemMapE @ 131 NONAME diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/sapiwrapper/hspswrapper/inc/plugininfo.h --- a/idlehomescreen/sapiwrapper/hspswrapper/inc/plugininfo.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/plugininfo.h Tue Jan 26 11:48:23 2010 +0200 @@ -149,13 +149,6 @@ IMPORT_C CPluginInfo& SetMaxChild( const TInt32 aMaxChild ); /** - * Set widget description - * - * @param aDescription widget description - */ - IMPORT_C CPluginInfo& SetDescriptionL( const TDesC& aDescription ); - - /** * Set widget description (TDesC8) * * @param aDescription widget description @@ -167,7 +160,7 @@ * * @return Description widget description or KNullDesC */ - IMPORT_C const TDesC& Description() const; + IMPORT_C const TDesC8& Description() const; /** * Set Logo icon @@ -232,7 +225,7 @@ /** * Own. Plugin description */ - HBufC* iDescription; + HBufC8* iDescription; /** * Own. Plugin logo icon diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/sapiwrapper/hspswrapper/src/plugininfo.cpp --- a/idlehomescreen/sapiwrapper/hspswrapper/src/plugininfo.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/plugininfo.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -247,7 +247,7 @@ // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -EXPORT_C CPluginInfo& CPluginInfo::SetDescriptionL( const TDesC& aDescription ) +EXPORT_C CPluginInfo& CPluginInfo::SetDescriptionL( const TDesC8& aDescription ) { delete iDescription; iDescription = NULL; @@ -256,25 +256,12 @@ return *this; } - // --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -EXPORT_C CPluginInfo& CPluginInfo::SetDescriptionL( const TDesC8& aDescription ) - { - delete iDescription; - iDescription = NULL; - - iDescription = HBufC::NewL( aDescription.Length() ); - iDescription->Des().Copy( aDescription ); - return *this; - } - // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -EXPORT_C const TDesC& CPluginInfo::Description() const +EXPORT_C const TDesC8& CPluginInfo::Description() const { - return iDescription ? *iDescription : KNullDesC(); + return iDescription ? *iDescription : KNullDesC8(); } // --------------------------------------------------------------------------- diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/sapiwrapper/hspswrapper/src/pluginmap.cpp --- a/idlehomescreen/sapiwrapper/hspswrapper/src/pluginmap.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/sapiwrapper/hspswrapper/src/pluginmap.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -67,6 +67,7 @@ delete iPluginId; delete iPluginUid; delete iActivationState; + delete iLockingStatus; } // --------------------------------------------------------------------------- diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/data/widgetmanagerview.loc --- a/idlehomescreen/widgetmanager/data/widgetmanagerview.loc Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -/* -* 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: Localisation file of Widget Manager -* -*/ - - - -// TITLES OF EACH VIEW - -// d: Title of Application -// d: -// d: -// l: title_pane_t2/opt12 -// w: -// r: TB9.2 -#define qtn_wm_title_text "Widget Catalog" - - - -// OPTIONS-MENU MENUITEMS - -// d: Add-menuitem in Options-menu -// d: -// d: -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -// -#define qtn_options_wm_add "Add To Homescreen" - -// d: Launch-menuitem in Options-menu -// d: -// d: -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -// -#define qtn_options_wm_launch_widget "Launch" - -// d: Search-menuitem in Options-menu -// d: -// d: -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -// -#define qtn_options_wm_search "Search" - -// d: Uninstall-menuitem in Options-menu -// d: -// d: -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -// -#define qtn_options_wm_uninstall "Uninstall" - -// d: Open-menuitem in Options-menu -// d: -// d: -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -// -#define qtn_options_wm_open "Open" - -// d: Sort alphabetically-menuitem in Options-menu -// d: -// d: -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -// -#define qtn_options_wm_sort_alpha "Sort alphabetically" - -// d: Details-menuitem in Options-menu -// d: -// d: -// l: list_single_pane_t1_cp2 -// w: -// r: TB9.2 -// -#define qtn_options_wm_show_details "Details" - - - -// MISC - -// d: Text displayed on OVI Store button -// d: -// d: -// l: wgtman_btn_pane_t1 -// w: -// r: TB9.2 -// -#define qtn_wm_ovi_store_title "Ovi Store" - -// d: Info popup to indicate that an item can not be added to home screen -// d: because current view is full -// d: -// l: popup_note_window -// w: -// r: TB9.2 -// -#define qtn_hs_add_widget_no_space_note "Not enough space to add new widget to active page. Remove some content first" - -// d: Info popup to indicate that an item can not be added to home screen -// d: because maximum instance count of current widget would be exceeded -// d: -// l: popup_note_window -// w: -// r: TB9.2 -// -#define qtn_hs_add_widget_max_count_note "Unable to add. Home screen does not allow more instances of this widget" - -// d: widget details dialog left softkey for adding widget to home screen -// d: Note: widgets dialog is not necessarily full screen width, which may affect -// d: string max length! -// l: control_pane_t1/opt7 -// w: -// r: TB9.2 -// -#define qtn_wm_details_add_to_hs "Add" - -// d: widget details dialog - no description -// d: -// d: -// l: listrow_wgtman_pane_t2 -// w: -// r: TB9.2 -// -#define qtn_wm_details_no_description "No description available" - -// d: widget uninstall not allowed -// d: -// d: -// l: popup_note_window -// w: -// r: TB9.2 -// -#define qtn_wm_uninst_not_allowed "%U can not be uninstalled " - -// d: widget details dialog default text for wrt widgets -// d: -// d: -// l: popup_note_window -// w: -// r: TB9.2 -// -#define qtn_wm_widget_details_wrt "HomeScreen application that uses internet connection to show dynamic updates from web" - diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/data/widgetmanagerview.rss --- a/idlehomescreen/widgetmanager/data/widgetmanagerview.rss Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/data/widgetmanagerview.rss Tue Jan 26 11:48:23 2010 +0200 @@ -24,9 +24,10 @@ #include #include #include +#include #include "widgetmanager.hrh" -#include "widgetmanagerview.loc" + // RESOURCE IDENTIFIER NAME WIGZ // 4 letter ID @@ -136,11 +137,6 @@ { flags = 0; txt = qtn_wm_ovi_store_title; - bmpfile = AVKON_BITMAP_FILE; - bmpid = EMbmAvkonQgn_graf_wml_wait_globe_04; - bmpmask = EMbmAvkonQgn_graf_wml_wait_globe_04_mask; - press_bmpid = EMbmAvkonQgn_graf_wml_wait_globe_04; - press_bmpmask = EMbmAvkonQgn_graf_wml_wait_globe_04_mask; } }; } diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/group/bld.inf --- a/idlehomescreen/widgetmanager/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -21,7 +21,7 @@ PRJ_EXPORTS ../rom/widgetmanager.iby CORE_APP_LAYER_IBY_EXPORT_PATH(widgetmanager.iby) -../rom/widgetmanager_resources.iby CORE_APP_LAYER_IBY_EXPORT_PATH(widgetmanager_resources.iby) +../rom/widgetmanager_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(widgetmanager_resources.iby) ../sis/widgetmanager_stub.sis /epoc32/data/z/system/install/widgetmanager_stub.sis @@ -29,6 +29,8 @@ ../conf/widgetmanager.confml APP_LAYER_CONFML(widgetmanager.confml) ../conf/widgetmanager_20026F53.crml APP_LAYER_CRML(widgetmanager_20026F53.crml) +../loc/widgetmanagerview.loc APP_LAYER_LOC_EXPORT_PATH(widgetmanagerview.loc) + PRJ_EXTENSIONS START EXTENSION s60/mifconv OPTION TARGETFILE widgetmanager.mif diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/group/widgetmanager.mmp --- a/idlehomescreen/widgetmanager/group/widgetmanager.mmp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/group/widgetmanager.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -32,6 +32,8 @@ VERSION 1.0 paged +LANGUAGE_IDS + CAPABILITY CAP_ECOM_PLUGIN SOURCEPATH ../src @@ -59,13 +61,12 @@ SOURCEPATH ../data START RESOURCE widgetmanagerview.rss HEADER -TARGETPATH RESOURCE_FILES_DIR +TARGETPATH APP_RESOURCE_DIR LANGUAGE_IDS END //RESOURCE USERINCLUDE . USERINCLUDE ../inc -USERINCLUDE ../data APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/ecom diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/inc/wmconfiguration.h --- a/idlehomescreen/widgetmanager/inc/wmconfiguration.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmconfiguration.h Tue Jan 26 11:48:23 2010 +0200 @@ -54,13 +54,17 @@ public: // API /** - * portal button methods + * portal button methods. This - along with the parameter - + * represents the action that the portal button is configured + * to do when pressed. The portal button itself should contain + * the execution code itself. */ enum TMethod { ENone = 0, // no method EHttp, // open browser to a certain page - EWidget // open given widget with params + EWidget, // open given widget with params + EApplication // launch an application }; /** @@ -76,19 +80,12 @@ /** * Icon to be displayed on a portal button - * Logo syntax follows the widget icon syntax in MHsContentInfo + * Logo syntax follows the widget icon syntax in CWmImageConverter * @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 @@ -96,9 +93,19 @@ TMethod PortalButtonPrimaryMethod( TInt aIndex ); /** + * Service name for the primary method. + * For EHttp this is unused. + * For EWidget, this is the widget Bundle ID. + * For EApplication, this is the application name. + * @param aIndex index of the button, starting at 0 + */ + const TDesC& PortalButtonPrimaryService( TInt aIndex ); + + /** * parameters related to the method. * For EHttp this is the HTTP address - * for EWidget the parameters passed to the widget + * For EWidget the parameters passed to the widget + * For EApplication the params passed to the app. * @param aIndex index of the button, starting at 0 */ const TDesC& PortalButtonPrimaryParams( TInt aIndex ); @@ -112,18 +119,28 @@ TMethod PortalButtonSecondaryMethod( TInt aIndex ); /** + * Service name for the primary method. + * For EHttp this is unused. + * For EWidget, this is the widget Bundle ID. + * For EApplication, this is the application name. + * @param aIndex index of the button, starting at 0 + */ + const TDesC& PortalButtonSecondaryService( 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 + void LoadConfigurationL(); TInt FindCorrectLanguageId(); HBufC* ReadParameterL( TInt aKey ); HBufC* ReadLocalisedParameterL( TInt aOffset ); + void IndexConversion( TInt& aIndex ); private: @@ -144,29 +161,45 @@ TInt iLanguageIndex; /** - * OviStore widget bundle ID + * OVI store button text */ - HBufC* iOviStoreBundleId; + HBufC* iOviButtonTitle; /** - * OviStore widget client param + * OVI store button icon + */ + HBufC* iOviButtonIcon; + + /** + * OVI store button browser Url + * (browser is used if OVI client is not working) + */ + HBufC* iOviButtonUrl; + + /** + * OVI store button widget client param */ HBufC* iOviStoreClientParam; /** - * Localized Url to start browser + * OVI store button widget bundle ID */ - HBufC* iOviStoreUrl; + HBufC* iOviStoreBundleId; /** - * Localised OVI store text + * OPERATOR button text */ - HBufC* iOviStoreText; + HBufC* iOperatorButtonTitle; /** - * OVI store icon + * OPERATOR store icon */ - HBufC* iOviStoreIcon; + HBufC* iOperatorButtonIcon; + + /** + * OPERATOR store button browser Url + */ + HBufC* iOperatorButtonUrl; }; diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/inc/wmcrkeys.h --- a/idlehomescreen/widgetmanager/inc/wmcrkeys.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmcrkeys.h Tue Jan 26 11:48:23 2010 +0200 @@ -22,47 +22,53 @@ // WidgetManager CR key const TUint32 KCrWidgetManagerm = 0x20026F53; -/** - * Key Id's from 0x1 to 0x28 are reserved for languages. - * LangId_0 0x1 - * OviStoreBrowserUrl_0 0x2 - * OperatorUrl_0 0x3 - * OperatorButtonText_0 0x4 - * ... - * LangId_9 0x25 - * OviStoreBrowserUrl_9 0x26 - * OperatorUrl_9 0x27 - * OperatorButtonText_9 0x28 - */ + -const TUint32 KLangGroupSize = 4; -const TUint32 KOviStoreBrowserUrlOffset = 1; -const TUint32 OperatorUrlOffset = 2; -const TUint32 KperatorButtonTextOffset = 3; +// ************************************************************ +// LOCALISED parameters start here +// Key Id's from 0x1 to 0x28 are reserved for languages. +// LangId_0 0x1 +// OviStoreBrowserUrl_0 0x2 +// OperatorUrl_0 0x3 +// OperatorButtonText_0 0x4 +// ... +// LangId_1 0x5 +// ... +// LangId_9 0x25 +// OviStoreBrowserUrl_9 0x26 +// OperatorUrl_9 0x27 +// OperatorButtonText_9 0x28 +// ************************************************************ -/** - * Key to first language id - */ +/** localised set #0, language ID */ const TUint32 KLangId0 = 0x1; +/** localised set #0, Ovi store browser URL */ +const TUint32 KOviStoreBrowserUrl0 = 0x2; +/** localised set #0, Operator button URL */ +const TUint32 KOperatorButtonUrl0 = 0x3; +/** localised set #0, Operator button text */ +const TUint32 KOperatorButtonText0 = 0x4; -/** - * Key to last language id - */ +/** localised set #1, language ID */ +const TUint32 KLangId1 = 0x5; + +/** localised set #9, language ID */ const TUint32 KLangId9 = 0x25; -/** - * Key to Ovi Store Client param - */ + +// ************************************************************ +// NON-LOCALISED parameters +// ************************************************************ + +/** Key to Ovi Store Client param */ const TUint32 KOviStoreClientParam = 0x29; -/** - * Key to Operator button icon - */ +/** Key to Operator button icon */ const TUint32 KOperatorButtonIcon = 0x2A; -/** - * Key to Ovi Store client BunbleId - */ -const TUint32 KOviStoreBunbleId = 0x2B; +/** Key to Ovi Store client BundleId */ +const TUint32 KOviStoreBundleId = 0x2B; + + #endif // __WMCRKEYS_H__ diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/inc/wmmaincontainer.h --- a/idlehomescreen/widgetmanager/inc/wmmaincontainer.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmmaincontainer.h Tue Jan 26 11:48:23 2010 +0200 @@ -86,11 +86,6 @@ public: // new functions /** - * @return reference to WmPlugin - */ - CWmPlugin& WmPlugin(); - - /** * @return true, if portal button is currently selected */ TBool PortalSelected(); @@ -336,26 +331,19 @@ * portal button * (if there is only one button, this is it) */ - CWmPortalButton* iPortalButtonOne; + CWmPortalButton* iPortalButtonOne; /** * portal button * (if there is only one button, this is NULL) */ - CWmPortalButton* iPortalButtonTwo; + CWmPortalButton* iPortalButtonTwo; - /** GUI layout modes */ - enum TWmLayout - { - EPortrait, - ELandscape, - ELandscapeMirrored - }; + /** whether we are orientated in landscape */ + TBool iLandscape; - /** - * current widget manager container layout - */ - TWmLayout iLayout; + /** whether we have mirrored layout */ + TBool iMirrored; /** focus modes */ enum TWmFocusMode diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/inc/wmplugin.h --- a/idlehomescreen/widgetmanager/inc/wmplugin.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmplugin.h Tue Jan 26 11:48:23 2010 +0200 @@ -29,7 +29,6 @@ class CAknViewAppUi; class CWmResourceLoader; -class CWmMainContainerView; class CWmMainContainer; class CWmEffectManager; @@ -166,10 +165,6 @@ */ CWmMainContainer* iWmMainContainer; - /** - * main view (not owned) - */ - CWmMainContainerView* iWmMainView; /** * resource loader diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/inc/wmresourceloader.h --- a/idlehomescreen/widgetmanager/inc/wmresourceloader.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/inc/wmresourceloader.h Tue Jan 26 11:48:23 2010 +0200 @@ -24,9 +24,7 @@ #include // FORWARD DECLARATIONS -class CAknStylusPopUpMenu; class CEikonEnv; -class CAknButton; class CAknInformationNote; /** @@ -50,17 +48,6 @@ public: // services /** - * Loads a button from the widgetmanager resource file - * using CAknButton::ConstructFromResourceL - * - * @param aResource handle to the empty button instance - * @param aResourceId ID of the resource to use in loading - */ - void LoadButtonL( - CAknButton& aResource, - TInt aResourceId ); - - /** * shows a simple info popup with OK button * @param aResourceId the resource id of string to be shown * @param aString additional string to be replaced into %U diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/loc/widgetmanagerview.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/widgetmanager/loc/widgetmanagerview.loc Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,163 @@ +/* +* 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: Localisation file of Widget Manager +* +*/ + + + +// TITLES OF EACH VIEW + +// d: Title of Application +// d: +// d: +// l: title_pane_t2/opt12 +// w: +// r: TB9.2 +#define qtn_wm_title_text "Widget Catalog" + + + +// OPTIONS-MENU MENUITEMS + +// d: Add-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_add "Add To Homescreen" + +// d: Launch-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_launch_widget "Launch" + +// d: Search-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_search "Search" + +// d: Uninstall-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_uninstall "Uninstall" + +// d: Open-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_open "Open" + +// d: Sort alphabetically-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_sort_alpha "Sort alphabetically" + +// d: Details-menuitem in Options-menu +// d: +// d: +// l: list_single_pane_t1_cp2 +// w: +// r: TB9.2 +// +#define qtn_options_wm_show_details "Details" + + + +// MISC + +// d: Text displayed on OVI Store button +// d: +// d: +// l: wgtman_btn_pane_t1 +// w: +// r: TB9.2 +// +#define qtn_wm_ovi_store_title "Ovi Store" + +// d: Info popup to indicate that an item can not be added to home screen +// d: because current view is full +// d: +// l: popup_note_window +// w: +// r: TB9.2 +// +#define qtn_hs_add_widget_no_space_note "Not enough space to add new widget to active page. Remove some content first" + +// d: Info popup to indicate that an item can not be added to home screen +// d: because maximum instance count of current widget would be exceeded +// d: +// l: popup_note_window +// w: +// r: TB9.2 +// +#define qtn_hs_add_widget_max_count_note "Unable to add. Home screen does not allow more instances of this widget" + +// d: widget details dialog left softkey for adding widget to home screen +// d: Note: widgets dialog is not necessarily full screen width, which may affect +// d: string max length! +// l: control_pane_t1/opt7 +// w: +// r: TB9.2 +// +#define qtn_wm_details_add_to_hs "Add" + +// d: widget details dialog - no description +// d: +// d: +// l: listrow_wgtman_pane_t2 +// w: +// r: TB9.2 +// +#define qtn_wm_details_no_description "No description available" + +// d: widget uninstall not allowed +// d: +// d: +// l: popup_note_window +// w: +// r: TB9.2 +// +#define qtn_wm_uninst_not_allowed "%U can not be uninstalled " + +// d: widget details dialog default text for wrt widgets +// d: +// d: +// l: popup_note_window +// w: +// r: TB9.2 +// +#define qtn_wm_widget_details_wrt "HomeScreen application that uses internet connection to show dynamic updates from web" + diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/rom/widgetmanager_resources.iby --- a/idlehomescreen/widgetmanager/rom/widgetmanager_resources.iby Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/rom/widgetmanager_resources.iby Tue Jan 26 11:48:23 2010 +0200 @@ -18,8 +18,9 @@ #ifndef WIDGETMANAGER_RESOURCES_IBY #define WIDGETMANAGER_RESOURCES_IBY + // widgetmanager resources -data=DATAZ_\resource\widgetmanagerview.rsc \resource\widgetmanagerview.rsc +data=DATAZ_\APP_RESOURCE_DIR\widgetmanagerview.rsc APP_RESOURCE_DIR\widgetmanagerview.rsc #endif // WIDGETMANAGER_RESOURCES_IBY diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/sis/widgetmanager_udeb.pkg --- a/idlehomescreen/widgetmanager/sis/widgetmanager_udeb.pkg Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/sis/widgetmanager_udeb.pkg Tue Jan 26 11:48:23 2010 +0200 @@ -38,7 +38,12 @@ "\epoc32\data\z\resource\plugins\widgetmanager.rsc" -"C:\resource\plugins\widgetmanager.rsc" ; widgetmanager resource file -"\epoc32\data\z\resource\widgetmanagerview.rsc" -"C:\resource\widgetmanagerview.rsc" +"\epoc32\data\z\resource\apps\widgetmanagerview.rsc" -"C:\resource\apps\widgetmanagerview.rsc" + +; These two languages are added just for testing. If sis update is really used for providing +; updates to end user these need to be fixed. +"\epoc32\data\z\resource\apps\widgetmanagerview.r01" -"C:\resource\apps\widgetmanagerview.r01" +"\epoc32\data\z\resource\apps\widgetmanagerview.r02" -"C:\resource\apps\widgetmanagerview.r02" ; widgetmanager icons "\epoc32\data\z\resource\apps\widgetmanager.mif" -"C:\resource\apps\widgetmanager.mif" diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/sis/widgetmanager_urel.pkg --- a/idlehomescreen/widgetmanager/sis/widgetmanager_urel.pkg Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/sis/widgetmanager_urel.pkg Tue Jan 26 11:48:23 2010 +0200 @@ -38,7 +38,12 @@ "\epoc32\data\z\resource\plugins\widgetmanager.rsc" -"C:\resource\plugins\widgetmanager.rsc" ; widgetmanager resource file -"\epoc32\data\z\resource\widgetmanagerview.rsc" -"C:\resource\widgetmanagerview.rsc" +"\epoc32\data\z\resource\apps\widgetmanagerview.rsc" -"C:\resource\apps\widgetmanagerview.rsc" + +; These two languages are added just for testing. If sis update is really used for providing +; updates to end user these need to be fixed. +"\epoc32\data\z\resource\apps\widgetmanagerview.r01" -"C:\resource\apps\widgetmanagerview.r01" +"\epoc32\data\z\resource\apps\widgetmanagerview.r02" -"C:\resource\apps\widgetmanagerview.r02" ; widgetmanager icons "\epoc32\data\z\resource\apps\widgetmanager.mif" -"C:\resource\apps\widgetmanager.mif" diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/src/wmconfiguration.cpp --- a/idlehomescreen/widgetmanager/src/wmconfiguration.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmconfiguration.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -27,8 +27,15 @@ #include "wmresourceloader.h" #include "wmcrkeys.h" -// CONSTANTS -const TInt KMaxIconDescriptorLength = 256; +// some constants regarging the central repository localised section. +// these will ensure CR localisation section compatibility even if +// new strings are added +const TInt KLangOffsetOviStoreUrl = KOviStoreBrowserUrl0 - KLangId0; +const TInt KLangOffsetOperatorUrl = KOperatorButtonUrl0 - KLangId0; +const TInt KLangOffsetOperatorText = KOperatorButtonText0 - KLangId0; +const TInt KLangGroupSize = KLangId1 - KLangId0; +const TUint32 KLastLangId = KLangId9; + // --------------------------------------------------------- // CWmConfiguration::NewL @@ -52,12 +59,15 @@ CWmResourceLoader& aResourceLoader ) : iResourceLoader( aResourceLoader ) { - iOviStoreText = NULL; - iOviStoreIcon = NULL; - iRepository = NULL; - iOviStoreBundleId = NULL; - iOviStoreClientParam = NULL; - iOviStoreUrl = NULL; + iRepository = NULL; + iOviStoreBundleId = NULL; + iOviStoreClientParam = NULL; + iOviButtonTitle = NULL; + iOviButtonIcon = NULL; + iOviButtonUrl = NULL; + iOperatorButtonTitle = NULL; + iOperatorButtonIcon = NULL; + iOperatorButtonUrl = NULL; } // --------------------------------------------------------- @@ -66,12 +76,15 @@ // CWmConfiguration::~CWmConfiguration() { - delete iOviStoreText; - delete iOviStoreIcon; - delete iRepository; + delete iRepository; delete iOviStoreBundleId; delete iOviStoreClientParam; - delete iOviStoreUrl; + delete iOviButtonTitle; + delete iOviButtonIcon; + delete iOviButtonUrl; + delete iOperatorButtonTitle; + delete iOperatorButtonIcon; + delete iOperatorButtonUrl; } // --------------------------------------------------------- @@ -81,32 +94,54 @@ void CWmConfiguration::ConstructL() { // localised ovistore button text - iOviStoreText = StringLoader::LoadL( R_QTN_WM_GO_TO_OVI_STORE ); + iOviButtonTitle = 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 ) + _LIT( KSkinMifIconFormat, "skin( 0x%x 0x%x ):mif( %S %d %d )"); + const TInt KMaxIconDescriptorLength = 256; 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(); + iOviButtonIcon = 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 ); - ); + TRAP_IGNORE( LoadConfigurationL(); ); + } // --------------------------------------------------------- +// CWmConfiguration::LoadConfigurationL +// --------------------------------------------------------- +// +void CWmConfiguration::LoadConfigurationL() + { + iRepository = CRepository::NewL( + TUid::Uid( KCrWidgetManagerm ) ); + + // read fixed parameters + iOviStoreBundleId = ReadParameterL( KOviStoreBundleId ); + iOviStoreClientParam = ReadParameterL( KOviStoreClientParam ); + // determine language and read localised parameters + iLanguageIndex = FindCorrectLanguageId(); + iOviButtonUrl = ReadLocalisedParameterL( KLangOffsetOviStoreUrl ); + iOperatorButtonTitle = ReadLocalisedParameterL( KLangOffsetOperatorText ); + iOperatorButtonUrl = ReadLocalisedParameterL( KLangOffsetOperatorUrl ); + + if ( iOperatorButtonUrl && iOperatorButtonUrl->Length() > 0 ) + { + // construct the operator button icon. + iOperatorButtonIcon = ReadParameterL( KOperatorButtonIcon ); + } + + delete iRepository; + iRepository = NULL; + } + +// --------------------------------------------------------- // CWmConfiguration::FindCorrectLanguageId // --------------------------------------------------------- // @@ -118,7 +153,7 @@ TLanguage sysLang = User::Language(); //read language id's from cenrep, find a match - for( TUint32 i=KLangId0; i<=KLangId9 && languageIndex<0; i+=KLangGroupSize ) + for( TUint32 i=KLangId0; i<=KLastLangId && languageIndex<0; i+=KLangGroupSize ) { TInt crLang = 0; if ( iRepository->Get( i, crLang ) == KErrNone ) @@ -191,9 +226,11 @@ // --------------------------------------------------------- // TInt CWmConfiguration::PortalButtonCount() - { - return 1; - } + { + if ( iOperatorButtonUrl && iOperatorButtonUrl->Length() > 0 ) + return 2; + return 1; + } // --------------------------------------------------------- // CWmConfiguration::PortalButtonText @@ -201,7 +238,11 @@ // const TDesC& CWmConfiguration::PortalButtonText( TInt aIndex ) { - if ( aIndex == 0 && iOviStoreText ) return *iOviStoreText; + IndexConversion( aIndex ); + if ( aIndex == 0 && iOviButtonTitle ) + return *iOviButtonTitle; + if ( aIndex == 1 && iOperatorButtonTitle ) + return *iOperatorButtonTitle; return KNullDesC; } @@ -211,41 +252,54 @@ // const TDesC& CWmConfiguration::PortalButtonIcon( TInt aIndex ) { - if ( aIndex == 0 && iOviStoreIcon ) return *iOviStoreIcon; + IndexConversion( aIndex ); + if ( aIndex == 0 && iOviButtonIcon ) + return *iOviButtonIcon; + if ( aIndex == 1 && iOperatorButtonIcon ) + return *iOperatorButtonIcon; 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; + IndexConversion( aIndex ); + if ( aIndex == 0 && iOviStoreBundleId && iOviStoreBundleId->Length() > 0 ) + return EWidget; + if ( aIndex == 1 && iOperatorButtonUrl && iOperatorButtonUrl->Length() > 0 ) + return EHttp; return ENone; } // --------------------------------------------------------- +// CWmConfiguration::PortalButtonPrimaryService +// --------------------------------------------------------- +// +const TDesC& + CWmConfiguration::PortalButtonPrimaryService( TInt aIndex ) + { + IndexConversion( aIndex ); + if ( aIndex == 0 && iOviStoreBundleId && iOviStoreBundleId->Length() > 0 ) + return *iOviStoreBundleId; + return KNullDesC; + } + +// --------------------------------------------------------- // CWmConfiguration::PortalButtonPrimaryParams // --------------------------------------------------------- // const TDesC& CWmConfiguration::PortalButtonPrimaryParams( TInt aIndex ) { - if ( aIndex == 0 && iOviStoreClientParam ) return *iOviStoreClientParam; + IndexConversion( aIndex ); + if ( aIndex == 0 && iOviStoreClientParam ) + return *iOviStoreClientParam; + if ( aIndex == 1 && iOperatorButtonUrl ) + return *iOperatorButtonUrl; return KNullDesC; } @@ -257,21 +311,51 @@ CWmConfiguration::TMethod CWmConfiguration::PortalButtonSecondaryMethod( TInt aIndex ) { - if ( aIndex == 0 && iOviStoreUrl ) return EHttp; + IndexConversion( aIndex ); + if ( aIndex == 0 && iOviButtonUrl && iOviButtonUrl->Length() > 0 ) + return EHttp; return ENone; } // --------------------------------------------------------- +// CWmConfiguration::PortalButtonSecondaryService +// --------------------------------------------------------- +// +const TDesC& + CWmConfiguration::PortalButtonSecondaryService( TInt aIndex ) + { + IndexConversion( aIndex ); + return KNullDesC; + } + +// --------------------------------------------------------- // CWmConfiguration::PortalButtonSecondaryParams // --------------------------------------------------------- // const TDesC& CWmConfiguration::PortalButtonSecondaryParams( TInt aIndex ) { - if ( aIndex == 0 && iOviStoreUrl ) return *iOviStoreUrl; + IndexConversion( aIndex ); + if ( aIndex == 0 && iOviButtonUrl ) + return *iOviButtonUrl; return KNullDesC; } +// --------------------------------------------------------- +// CWmConfiguration::IndexConversion +// --------------------------------------------------------- +// +void CWmConfiguration::IndexConversion( TInt& /*aIndex*/ ) + { + // if there is a need to configure switching button places + // (operator button left, then OVI button) then this method + // would have something like this: + + // if ( iSwitchButtons ) aIndex = 1 - aIndex; + + // but for now, this method is empty. + } + diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/src/wmimageconverter.cpp --- a/idlehomescreen/widgetmanager/src/wmimageconverter.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmimageconverter.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -209,21 +209,19 @@ RApaLsSession lsSession; User::LeaveIfError( lsSession.Connect() ); CleanupClosePushL( lsSession ); - - CArrayFixFlat* sizeArray = new (ELeave) CArrayFixFlat(3); + + const TInt KAppSizeArraySize = 3; + CArrayFixFlat* sizeArray = new (ELeave) + CArrayFixFlat( KAppSizeArraySize ); CleanupStack::PushL( sizeArray ); User::LeaveIfError( lsSession.GetAppIconSizes( aUid, *sizeArray ) ); - TInt sizeCount = sizeArray->Count(); TSize size; - if ( sizeCount > 0 ) + for( TInt i=0; i < sizeArray->Count(); i++ ) { - for( TInt i=0; i < sizeArray->Count(); i++ ) + size = (*sizeArray)[i]; + if ( size == iSize ) { - size = (*sizeArray)[i]; - if ( size == iSize ) - { - break; - } + break; } } CApaMaskedBitmap* maskedBmp = CApaMaskedBitmap::NewLC(); @@ -314,6 +312,8 @@ } TDisplayMode mode = CEikonEnv::Static()->ScreenDevice()->DisplayMode(); + if ( mode >= ERgb ) // currently svg engine doesn't render correctly + { mode = EColor16M; } // in this or above mode ( ou1cimx1#229434 ) TFontSpec fontspec; CFbsBitmap* frameBuffer = new ( ELeave ) CFbsBitmap; @@ -322,18 +322,20 @@ CSvgEngineInterfaceImpl* svgEngine = CSvgEngineInterfaceImpl::NewL( frameBuffer, NULL, fontspec ); - svgEngine->SetDRMMode( EFalse ); + CleanupStack::PushL( svgEngine ); + + svgEngine->SetDRMMode( EFalse ); TInt domHandle; CheckSvgErrorL( svgEngine->PrepareDom( aFileName, domHandle ) ); CFbsBitmap* bitmap = new(ELeave) CFbsBitmap; - User::LeaveIfError( bitmap->Create( iSize, mode) ); CleanupStack::PushL( bitmap ); + User::LeaveIfError( bitmap->Create( iSize, mode ) ); CFbsBitmap* mask = new(ELeave) CFbsBitmap; + CleanupStack::PushL( mask ); User::LeaveIfError( mask->Create( iSize, EGray256 ) ); - CleanupStack::PushL( mask ); CheckSvgErrorL( svgEngine->UseDom( domHandle, bitmap, mask ) ); @@ -346,6 +348,7 @@ CleanupStack::Pop( mask ); CleanupStack::Pop( bitmap ); + CleanupStack::PopAndDestroy( svgEngine ); CleanupStack::PopAndDestroy( frameBuffer ); iBitmap = bitmap; diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/src/wmlistbox.cpp --- a/idlehomescreen/widgetmanager/src/wmlistbox.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmlistbox.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -18,8 +18,6 @@ // INCLUDE FILES #include -#include -#include #include #include #include @@ -28,6 +26,8 @@ #include #include #include +#include +#include #include #include #include "wmcommon.h" @@ -123,6 +123,20 @@ EMbmWidgetmanagerAdd_widget_button, EMbmWidgetmanagerAdd_widget_button_mask, KRgbWhite ); + + // This is temporary fix for ou1cimx1#228810 + // Can be removed when avkon provides real fix for this error. + // Currently forever loop in CFormattedCellListBoxData::DrawFormattedSimple + // never exits if there is no iconarray and name contains tab+digit which + // confuses listbox e.g. considering name as icon index + CArrayPtr* dummyArray = new( ELeave ) CAknIconArray(2); + CleanupStack::PushL(dummyArray); + CGulIcon* dummyIcon = CGulIcon::NewLC(); + CGulIcon* dummyIcon2 = CGulIcon::NewLC(); + dummyArray->AppendL(dummyIcon); + dummyArray->AppendL(dummyIcon2); + ColumnData()->SetIconArray(dummyArray); + CleanupStack::Pop(3); } // --------------------------------------------------------- @@ -256,9 +270,9 @@ TAknTextLineLayout titleTextLayout = AknLayoutScalable_Apps::listrow_wgtman_pane_t1().LayoutLine(); - TAknLayoutText textLayout; - textLayout.LayoutText( itemRect, titleTextLayout ); - textLayout.DrawText( gc, wData.Name(), ETrue, textColor ); + TAknLayoutText textLayoutTitle; + textLayoutTitle.LayoutText( itemRect, titleTextLayout ); + textLayoutTitle.DrawText( gc, wData.Name(), ETrue, textColor ); if ( !wData.IsUninstalling() && wData.HsContentInfo().CanBeAdded() ) @@ -285,8 +299,9 @@ 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 ); + TAknLayoutText textLayoutDes; + textLayoutDes.LayoutText( itemRect, descTextLayout ); + textLayoutDes.DrawText( gc, wData.Description(), ETrue, textColor ); } else { @@ -523,7 +538,11 @@ // void CWmListBox::RedrawItem( TInt aItemIndex ) { - View()->DrawItem( aItemIndex ); + if ( aItemIndex >= 0 && + aItemIndex < Model()->NumberOfItems() ) + { + View()->DrawItem( aItemIndex ); + } } // --------------------------------------------------------- @@ -552,9 +571,6 @@ cellData, this ); CleanupStack::Pop(); // cellData - - // enable extended drawing - EnableExtendedDrawingL(); } // --------------------------------------------------------- @@ -690,22 +706,31 @@ // void CWmListBox::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { - // Check if pointer is down ( needed for drawing correct hightlight frame ) + CAknDouble2LargeStyleListBox::HandlePointerEventL( aPointerEvent ); + + // Check if pointer is down ( needed for drawing correct hightlight frame ) if ( Rect().Contains( aPointerEvent.iPosition ) ) { - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - iPressedDown = ETrue; - RedrawItem( CurrentListBoxItemIndex() ); - } - else if( aPointerEvent.iType == TPointerEvent::EButton1Up ) - { - iPressedDown = EFalse; - RedrawItem( CurrentListBoxItemIndex() ); - } + TInt itemIndex = CurrentListBoxItemIndex(); + TBool itemPointed = View()->XYPosToItemIndex( + aPointerEvent.iPosition, + itemIndex ); + if ( itemIndex >= 0 && itemPointed ) + { + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iPressedDown = ETrue; + // redraw item + RedrawItem( itemIndex ); + } + else if( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + iPressedDown = EFalse; + // redraw item + RedrawItem( itemIndex ); + } + } } - - CAknDouble2LargeStyleListBox::HandlePointerEventL( aPointerEvent ); } // --------------------------------------------------------- diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/src/wmmaincontainer.cpp --- a/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -196,36 +196,53 @@ // void CWmMainContainer::LayoutControls() { - TBool landscape = Layout_Meta_Data::IsLandscapeOrientation(); - - TAknWindowLineLayout listPane = - AknLayoutScalable_Apps::listscroll_wgtman_pane(landscape ? 1 : 0).LayoutLine(); + TRect rect( Rect() ); - TAknWindowLineLayout btnPane = - AknLayoutScalable_Apps::wgtman_btn_pane(landscape ? 1 : 0).LayoutLine(); - - TRect rect = Rect(); + // determine layout type + iLandscape = Layout_Meta_Data::IsLandscapeOrientation(); + iMirrored = Layout_Meta_Data::IsMirrored(); - if ( landscape ) + // layout iPortalButtons + if ( iConfiguration->PortalButtonCount() == 1 ) { - if ( Layout_Meta_Data::IsMirrored() ) - { - iLayout = ELandscapeMirrored; - } - else - { - iLayout = ELandscape; - } + // one button + TAknWindowLineLayout btnPane = AknLayoutScalable_Apps + ::wgtman_btn_pane( iLandscape ? 1 : 0 ).LayoutLine(); + AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, btnPane ); } else { - iLayout = EPortrait; + // two buttons + // ********************************** + // we do not have layouts for two buttons yet - layout manually + TAknWindowLineLayout btnPane = AknLayoutScalable_Apps + ::wgtman_btn_pane( iLandscape ? 1 : 0 ).LayoutLine(); + TAknLayoutRect layoutrect; + layoutrect.LayoutRect( rect, btnPane ); + TRect r( layoutrect.Rect() ); + TRect r1, r2; + const TInt gap = 3; + if ( iLandscape ) + { + r1 = TRect( r.iTl, TSize( r.Width(), r.Height() / 2 - gap ) ); + r2 = r1; + r2.Move( 0, r.Height() / 2 + gap ); + } + else + { + r1 = TRect( r.iTl, TSize( r.Width() / 2 - gap, r.Height() ) ); + r2 = r1; + if (iMirrored) r1.Move( r.Width() / 2 + gap, 0 ); + else r2.Move( r.Width() / 2 + gap, 0 ); + } + iPortalButtonOne->SetRect( r1 ); + iPortalButtonTwo->SetRect( r2 ); + // ************************************* } - - // portal button layout - // todo: 2-button layout - AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, btnPane ); + // layout iWidgetsList + TAknWindowLineLayout listPane = AknLayoutScalable_Apps + ::listscroll_wgtman_pane( iLandscape ? 1 : 0 ).LayoutLine(); if( iFindbox && iFindPaneIsVisible ) { TAknLayoutRect layoutRect; @@ -420,7 +437,7 @@ // ------------------------------------ // focus is in the WIDGETS LIST // ------------------------------------ - if ( iLayout == EPortrait && + if ( !iLandscape && aKeyEvent.iScanCode == EStdKeyUpArrow && iWidgetsList->CurrentItemIndex() == 0 ) { @@ -429,7 +446,7 @@ SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == EPortrait && + else if ( !iLandscape && aKeyEvent.iScanCode == EStdKeyDownArrow && iWidgetsList->CurrentItemIndex() == iWidgetsList->Model()->NumberOfItems() - 1 ) @@ -439,15 +456,15 @@ SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == ELandscape && + else if ( iLandscape && !iMirrored && aKeyEvent.iScanCode == EStdKeyRightArrow ) { - // widget list -> right -> ovi button (landscape) + // widget list -> right -> ovi button (landscape normal) if ( aType == EEventKey ) SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == ELandscapeMirrored && + else if ( iLandscape && iMirrored && aKeyEvent.iScanCode == EStdKeyLeftArrow ) { // widget list -> left -> ovi button (landscape mirrored) @@ -461,53 +478,61 @@ // ------------------------------------ // focus is in the FIRST PORTAL BUTTON // ------------------------------------ - if ( iLayout == EPortrait && + if ( !iLandscape && aKeyEvent.iScanCode == EStdKeyDownArrow ) { - // left portal -> down -> widget list top + // left portal -> down -> widget list top (portrait) if ( aType == EEventKey ) SetFocusToWidgetList( 0 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == EPortrait && + else if ( !iLandscape && aKeyEvent.iScanCode == EStdKeyUpArrow ) { - // left portal -> up -> widget list bottom + // left portal -> up -> widget list bottom (portrait) if ( aType == EEventKey ) SetFocusToWidgetList( iWidgetsList->Model()->NumberOfItems()-1 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == EPortrait && + else if ( !iLandscape && !iMirrored && aKeyEvent.iScanCode == EStdKeyRightArrow && iConfiguration->PortalButtonCount() > 1 ) { - // left portal -> right -> right portal + // left portal -> right -> right portal (portrait normal) + if ( aType == EEventKey ) + SetFocusToPortalButton( 1 ); + keyResponse = EKeyWasConsumed; + } + else if ( !iLandscape && iMirrored && + aKeyEvent.iScanCode == EStdKeyLeftArrow && + iConfiguration->PortalButtonCount() > 1 ) + { + // right portal -> left -> left portal (portrait mirrored) if ( aType == EEventKey ) SetFocusToPortalButton( 1 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == ELandscape && + else if ( iLandscape && !iMirrored && aKeyEvent.iScanCode == EStdKeyLeftArrow ) { - // upper portal -> left -> widget list + // upper portal -> left -> widget list (landscape normal) if ( aType == EEventKey ) SetFocusToWidgetList(); keyResponse = EKeyWasConsumed; } - else if ( iLayout == ELandscapeMirrored && + else if ( iLandscape && iMirrored && aKeyEvent.iScanCode == EStdKeyRightArrow ) { - // upper portal -> right -> widget list (mirrored) + // upper portal -> right -> widget list (landscape mirrored) if ( aType == EEventKey ) SetFocusToWidgetList(); keyResponse = EKeyWasConsumed; } - else if ( ( iLayout == ELandscape || - iLayout == ELandscapeMirrored ) && + else if ( iLandscape && aKeyEvent.iScanCode == EStdKeyDownArrow && iConfiguration->PortalButtonCount() > 1 ) { - // upper portal -> down -> lower portal + // upper portal -> down -> lower portal (landscape) if ( aType == EEventKey ) SetFocusToPortalButton( 1 ); keyResponse = EKeyWasConsumed; @@ -518,52 +543,60 @@ // ------------------------------------ // focus is in the SECOND PORTAL BUTTON // ------------------------------------ - if ( iLayout == EPortrait && + if ( !iLandscape && aKeyEvent.iScanCode == EStdKeyDownArrow ) { - // right portal -> down -> widget list top + // right portal -> down -> widget list top (portrait) if ( aType == EEventKey ) SetFocusToWidgetList( 0 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == EPortrait && + else if ( !iLandscape && aKeyEvent.iScanCode == EStdKeyUpArrow ) { - // right portal -> up -> widget list bottom + // right portal -> up -> widget list bottom (portrait) if ( aType == EEventKey ) SetFocusToWidgetList( iWidgetsList->Model()->NumberOfItems()-1 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == EPortrait && + else if ( !iLandscape && !iMirrored && + aKeyEvent.iScanCode == EStdKeyLeftArrow && + iConfiguration->PortalButtonCount() > 1 ) + { + // right portal -> left -> left portal (portrait normal) + if ( aType == EEventKey ) + SetFocusToPortalButton( 0 ); + keyResponse = EKeyWasConsumed; + } + else if ( !iLandscape && iMirrored && aKeyEvent.iScanCode == EStdKeyRightArrow && iConfiguration->PortalButtonCount() > 1 ) { - // right portal -> right -> left portal + // left portal -> right -> right portal (portrait mirrored) if ( aType == EEventKey ) SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; } - else if ( iLayout == ELandscape && + else if ( iLandscape && !iMirrored && aKeyEvent.iScanCode == EStdKeyLeftArrow ) { - // lower portal -> left -> widget list + // lower portal -> left -> widget list (landscape normal) if ( aType == EEventKey ) SetFocusToWidgetList(); keyResponse = EKeyWasConsumed; } - else if ( iLayout == ELandscapeMirrored && + else if ( iLandscape && iMirrored && aKeyEvent.iScanCode == EStdKeyRightArrow ) { - // lower portal -> right -> widget list (mirrored) + // lower portal -> right -> widget list (landscape mirrored) if ( aType == EEventKey ) SetFocusToWidgetList(); keyResponse = EKeyWasConsumed; } - else if ( ( iLayout == ELandscape || - iLayout == ELandscapeMirrored ) && + else if ( iLandscape && aKeyEvent.iScanCode == EStdKeyUpArrow ) { - // lower portal -> up -> upper portal + // lower portal -> up -> upper portal (landscape) if ( aType == EEventKey ) SetFocusToPortalButton( 0 ); keyResponse = EKeyWasConsumed; @@ -705,16 +738,14 @@ { TInt itemIndex = iWidgetsList->CurrentListBoxItemIndex(); TBool itemPointed = iWidgetsList->View()->XYPosToItemIndex( - aPointerEvent.iParentPosition, + aPointerEvent.iPosition, itemIndex ); - if ( itemIndex >= 1 && itemPointed ) + if ( itemIndex >= 0 && itemPointed ) { - iWidgetsList->SetCurrentItemIndex( itemIndex - 1 ); + iWidgetsList->SetCurrentItemIndex( itemIndex ); } } - - // Set focus to the control that was clicked - control->SetFocus( ETrue ); + // remove focus from ALL other child controls. CCoeControlArray::TCursor cursor = Components().Begin(); CCoeControl* c; @@ -723,6 +754,10 @@ if ( c != control && c->IsFocused() ) c->SetFocus( EFalse ); cursor.Next(); } + + // Set focus to the control that was clicked + control->SetFocus( ETrue ); + // update focus mode accordingly UpdateFocusMode(); // repaint @@ -867,15 +902,6 @@ } // --------------------------------------------------------- -// CWmMainContainer::WmPlugin -// --------------------------------------------------------- -// -CWmPlugin& CWmMainContainer::WmPlugin() - { - return iWmPlugin; - } - -// --------------------------------------------------------- // CWmMainContainer::PortalSelected // --------------------------------------------------------- // @@ -976,7 +1002,7 @@ // TBool CWmMainContainer::CanDoDetails() { - return WidgetSelected(); + return ( WidgetSelected() && iWidgetsList->WidgetData() ); } // --------------------------------------------------------- @@ -1257,10 +1283,17 @@ void CWmMainContainer::HandleListBoxEventL( CEikListBox* /*aListBox*/, TListBoxEvent aEventType ) { - if ( !iClosingDown && ( aEventType == EEventEnterKeyPressed || - aEventType == EEventItemSingleClicked ) ) + if ( aEventType == EEventEnterKeyPressed || + aEventType == EEventItemSingleClicked ) { - AddWidgetToHomeScreenL(); + if ( iFindPaneIsVisible ) + { + DeactivateFindPaneL(); + } + else if ( !iClosingDown ) + { + AddWidgetToHomeScreenL(); + } } } diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/src/wmplugin.cpp --- a/idlehomescreen/widgetmanager/src/wmplugin.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmplugin.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include @@ -52,30 +54,47 @@ CWmPlugin::~CWmPlugin() { iPostponedCommand = ENone; + + // delete WM UI resources if ( iViewAppUi ) { if ( iWmMainContainer && IsActive() ) { + // WM is showing. Hide first! iWmMainContainer->SetClosingDown( ETrue ); TRAPD( err, iViewAppUi->ActivateLocalViewL( iPreviousViewUid.iViewUid ); ); if ( KErrNone == err ) { + // wait until previous view is switched on top + // then continue destruction. iWait->Start(); - // remove view from appui - iViewAppUi->RemoveView( - TUid::Uid( EWmMainContainerViewId ) ); } else { - TRAP_IGNORE( iViewAppUi->DeactivateActiveViewL(); ); - iViewAppUi->RemoveFromViewStack( - *iWmMainView, iWmMainContainer ); - delete iWmMainContainer; - iWmMainContainer = NULL; + // try to activate default view + TVwsViewId viewId; + if ( iViewAppUi->GetDefaultViewId( viewId ) != KErrNone ) + { + viewId.iAppUid = iViewAppUi->Application()->AppDllUid(); + viewId.iViewUid = TUid::Uid( 1 ); + } + + TRAPD( err, iViewAppUi->ActivateLocalViewL( viewId.iViewUid ); ); + if ( KErrNone == err ) + { + // wait until previous view is switched on top + // then continue destruction. + iWait->Start(); + } } } - } + // remove view from appui (also deletes it) + iViewAppUi->RemoveView( + TUid::Uid( EWmMainContainerViewId ) ); + } + + // delete other members delete iResourceLoader; delete iEffectManager; delete iPostponedContent; @@ -98,7 +117,6 @@ void CWmPlugin::ConstructL() { iWmMainContainer = NULL; - iWmMainView = NULL; // store static view app ui CEikonEnv* eikonEnv = CEikonEnv::Static(); @@ -120,7 +138,6 @@ CleanupStack::PushL( mainView ); iViewAppUi->AddViewL( mainView ); CleanupStack::Pop( mainView ); - iWmMainView = mainView; } // --------------------------------------------------------- diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/src/wmportalbutton.cpp --- a/idlehomescreen/widgetmanager/src/wmportalbutton.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmportalbutton.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -111,12 +111,6 @@ { User::Leave( KErrArgument ); } - else if ( iPortalButtonIndex != 0 ) - { - // operator button not supported until layout available. - User::Leave( KErrNotSupported ); - } - SetContainerWindowL( *aParent ); // Obtain pointer to main container. @@ -208,7 +202,7 @@ // Runs WIDGET method: (launches given widget with parameters) // --------------------------------------------------------------------------- // -void TryRunWidgetL( const TDesC& aParam, const TDesC& aBundleId ) +void TryRunWidgetL( const TDesC& aBundleId, const TDesC& aParam ) { RApaLsSession session; User::LeaveIfError( session.Connect() ); @@ -240,22 +234,34 @@ } // --------------------------------------------------------------------------- +// Runs APPLICATION method: (launches given application with parameters) +// --------------------------------------------------------------------------- +// +void TryRunApplicationL( const TDesC& /*aApplication*/, const TDesC& /*aParam*/ ) + { + // This method has not been implemented + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- // 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 ) + CWmConfiguration::TMethod aMethod, const TDesC& aService, + const TDesC& aParam ) { // open portal according to the method. if ( aMethod == CWmConfiguration::EHttp ) { TryRunHttpL( aParam ); } else if ( aMethod == CWmConfiguration::EWidget ) - { TryRunWidgetL( aParam, aBundleId ); } + { TryRunWidgetL( aService, aParam ); } + else if ( aMethod == CWmConfiguration::EApplication ) + { TryRunApplicationL( aService, aParam ); } else - { /* do nothing */ } + { User::Leave( KErrNotSupported ); } } // --------------------------------------------------------------------------- @@ -270,15 +276,15 @@ TRAPD( err, TryOpenPortalL( aConfiguration.PortalButtonPrimaryMethod( aPortalIndex ), - aConfiguration.PortalButtonPrimaryParams( aPortalIndex ), - aConfiguration.PortalButtonBundleId( aPortalIndex ) ); ); + aConfiguration.PortalButtonPrimaryService( aPortalIndex ), + aConfiguration.PortalButtonPrimaryParams( aPortalIndex ) ); ); if ( err != KErrNone ) { // if secondary method fails, leave will be propagated. TryOpenPortalL( aConfiguration.PortalButtonSecondaryMethod( aPortalIndex ), - aConfiguration.PortalButtonSecondaryParams( aPortalIndex ), - aConfiguration.PortalButtonBundleId( aPortalIndex ) ); + aConfiguration.PortalButtonSecondaryService( aPortalIndex ), + aConfiguration.PortalButtonSecondaryParams( aPortalIndex ) ); } } @@ -429,18 +435,13 @@ { TBool landscape = Layout_Meta_Data::IsLandscapeOrientation(); - // draw image if one exists if ( iButtonIcon && iButtonIconMask ) { TAknLayoutRect imageLayout; - // todo: 2-button layout - if ( iWmMainContainer->Configuration().PortalButtonCount() == 1 ) - { - imageLayout.LayoutRect( rect, - AknLayoutScalable_Apps::wgtman_btn_pane_g1( - landscape ? 1 : 0).LayoutLine() ); - } + imageLayout.LayoutRect( rect, + AknLayoutScalable_Apps::wgtman_btn_pane_g1( + landscape ? 1 : 0).LayoutLine() ); imageLayout.DrawImage( gc, iButtonIcon, iButtonIconMask ); } @@ -448,12 +449,8 @@ if ( !landscape ) { TAknTextComponentLayout leftLayout; - // todo: 2-button layout - if ( iWmMainContainer->Configuration().PortalButtonCount() == 1 ) - { - leftLayout = AknLayoutScalable_Apps::wgtman_btn_pane_t1( - landscape ? 1 : 0 ); - } + leftLayout = AknLayoutScalable_Apps::wgtman_btn_pane_t1( + landscape ? 1 : 0 ); DrawText( gc, state->Text(), leftLayout, 1 ); } } diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/widgetmanager/src/wmresourceloader.cpp --- a/idlehomescreen/widgetmanager/src/wmresourceloader.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmresourceloader.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -21,9 +21,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -33,8 +30,8 @@ // CONSTANTS _LIT( KZdrive, "Z:" ); _LIT( KRelativeMifPath, "\\resource\\apps\\widgetmanager.mif" ); -_LIT( KRelativeResourcePathWithWildcard, "\\resource\\widgetmanagerview.r*" ); -_LIT( KRelativeResourcePath, "\\resource\\widgetmanagerview.rsc" ); +_LIT( KRelativeResourcePathWithWildcard, "\\resource\\apps\\widgetmanagerview.r*" ); +_LIT( KRelativeResourcePath, "\\resource\\apps\\widgetmanagerview.rsc" ); // --------------------------------------------------------- // CWmResourceLoader::NewL @@ -163,19 +160,6 @@ } // --------------------------------------------------------- -// CWmResourceLoader::LoadButtonL -// --------------------------------------------------------- -void CWmResourceLoader::LoadButtonL( - CAknButton& aResource, - TInt aResourceId ) - { - TResourceReader reader; - iEnv.CreateResourceReaderLC( reader, aResourceId ); - aResource.ConstructFromResourceL( reader ); - CleanupStack::PopAndDestroy(); // reader - } - -// --------------------------------------------------------- // LoadStringLC // loads a string from resource. If an additional string is // given (the length is greater than zero) uses a different diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluicontroller/inc/aixmluiconstants.h --- a/idlehomescreen/xmluicontroller/inc/aixmluiconstants.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/aixmluiconstants.h Tue Jan 26 11:48:23 2010 +0200 @@ -111,6 +111,7 @@ _LIT8( KText, "text" ); _LIT8( KConfiguration, "configuration" ); _LIT8( KNewsTicker, "newsticker" ); + _LIT8( KAnimation, "animation" ); } } // End of namespace xml diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluicontroller/inc/contentrenderer.h --- a/idlehomescreen/xmluicontroller/inc/contentrenderer.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluicontroller/inc/contentrenderer.h Tue Jan 26 11:48:23 2010 +0200 @@ -22,6 +22,7 @@ #include #include #include "xnnewsticker.h" +#include "xnproperty.h" #include "aicontentobserver.h" class TXnUiEngineAppIf; @@ -124,7 +125,21 @@ TAny* Extension( TUid aUid ); TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; - + + TInt SetProperty(MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ); + + TInt SetProperty(MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType); + + CXnDomPropertyValue::TPrimitiveValueType + DomPropertyValueType(MAiContentObserver::TValueType aValueType); + private: CContentRenderer( CAppUi& aAppUi ); @@ -204,6 +219,12 @@ void RegisterNewstickerCallbackInterfaceL( CXnNodeAppIf& aTarget ); + TInt SetPropertyL(MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType); + // From XnNewstickerInterface::MXnNewstickerCallbackInterface void TitleScrolled(TInt aTitleIndex); diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluicontroller/src/contentrenderer.cpp --- a/idlehomescreen/xmluicontroller/src/contentrenderer.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/contentrenderer.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -674,6 +674,114 @@ return ETrue; } +TInt CContentRenderer::SetProperty( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ) + { + return ( SetProperty( aPlugin, aElementId, + aPropertyName, aPropertyValue, + MAiContentObserver::EValueString ) ); + } + +TInt CContentRenderer::SetProperty( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType) + { + TInt error( KErrNone ); + TInt retval( KErrNone ); + + TRAP( error, retval = SetPropertyL( aPlugin, aElementId, aPropertyName, + aPropertyValue, aValueType ) ); + + if( !error && retval ) + { + error = retval; + } + + return error; + } + +TInt CContentRenderer::SetPropertyL( MAiPropertyExtension& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType) + { + TInt err = KErrNone; + // Find node + CXnNodeAppIf* targetNode = FindNodeByIdL( aElementId, aPlugin.PublisherInfoL()->iNamespace ); + if ( targetNode ) + { + CXnDomStringPool& sp( targetNode->UiEngineL()->StringPool() ); + + CXnProperty* prop = CXnProperty::NewL( + aPropertyName, + aPropertyValue, + DomPropertyValueType(aValueType), sp ); + + CleanupStack::PushL( prop ); + + targetNode->SetPropertyL( prop ); + + CleanupStack::Pop( prop ); + } + else + { + err = KErrNotFound; + } + return err; + } + + +CXnDomPropertyValue::TPrimitiveValueType + CContentRenderer::DomPropertyValueType( + MAiContentObserver::TValueType aValueType) + { + CXnDomPropertyValue::TPrimitiveValueType type = + CXnDomPropertyValue::EUnknown; + switch ( aValueType ) + { + case MAiContentObserver::EValueNumber : + { + type = CXnDomPropertyValue::ENumber; + } + break; + case MAiContentObserver::EValuePercentage : + { + type = CXnDomPropertyValue::EPercentage; + } + break; + case MAiContentObserver::EValuePx : + { + type = CXnDomPropertyValue::EPx; + } + break; + case MAiContentObserver::EValueString : + { + type = CXnDomPropertyValue::EString; + } + break; + case MAiContentObserver::EValueRgbColor : + { + type = CXnDomPropertyValue::ERgbColor; + } + break; + case MAiContentObserver::EValueUnitValue : + { + type = CXnDomPropertyValue::EUnitValue; + } + break; + default: + { + type = CXnDomPropertyValue::EUnknown; + } + } + return type; + } + void CContentRenderer::DoStartTransactionL( TInt aTxId ) { MTransaction* tr = iFactory->CreateTransactionL( aTxId ); diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluicontroller/src/xmluicontroller.cpp --- a/idlehomescreen/xmluicontroller/src/xmluicontroller.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluicontroller/src/xmluicontroller.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -637,7 +637,8 @@ // Get the content model and configuration for the supported elements else if( nodeType == AiUiDef::xml::element::KImage || nodeType == AiUiDef::xml::element::KText || - nodeType == AiUiDef::xml::element::KNewsTicker ) + nodeType == AiUiDef::xml::element::KNewsTicker || + nodeType == AiUiDef::xml::element::KAnimation ) { // Is created in GetContenItem and used in GetConfigurationsL HBufC* confOwner( NULL ); diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xnliteral.h --- a/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xnliteral.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/inc/xnliteral.h Tue Jan 26 11:48:23 2010 +0200 @@ -62,6 +62,7 @@ _STLIT8(KEditor, "editor"); _STLIT8(KMarquee, "marquee"); _STLIT8(KNewsticker, "newsticker"); +_STLIT8(KAnimation, "animation"); _STLIT8(KTooltip, "tooltip"); //XHTML _STLIT8(KObject, "object"); diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp --- a/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/ecomelement/xndomvisitor/src/xndomvisitor.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -71,6 +71,7 @@ { (const void*)&KEditor, &SetElementWithTextPropertiesL, EEmpty}, { (const void*)&KMarquee, &SetElementWithTextPropertiesL, EPCData}, { (const void*)&KNewsticker, &SetElementWithTextPropertiesL, EPCData}, + { (const void*)&KAnimation, &SetCommonPropertiesL, EPCData}, { (const void*)&KObject, NULL, EPCData}, { (const void*)&KParam, NULL, EEmpty}, diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/group/bld.inf --- a/idlehomescreen/xmluirendering/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -41,6 +41,7 @@ #include "../renderingplugins/xnvolumecontrolfactory/group/bld.inf" #include "../renderingplugins/xnnewstickerfactory/group/bld.inf" #include "../renderingplugins/xntexteditorfactory/group/bld.inf" +#include "../renderingplugins/xnanimationfactory/group/bld.inf" #include "../ecomelement/group/bld.inf" PRJ_PLATFORMS diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,29 @@ +/* +* 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: Building information file +* +*/ + + +#include + +PRJ_PLATFORMS + +ARMV5 WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES + +xnanimationfactory.mmp diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/group/xnanimationfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/group/xnanimationfactory.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,52 @@ +/* +* 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: Xuikon Animation plugin. +* +*/ + + +#include +#include + +TARGET xn3animationfactory.dll +TARGETTYPE PLUGIN +UID 0x10009d8d AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE xnanimationfactory.cpp +SOURCE xnanimation.cpp +SOURCE xnanimationadapter.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY xn3layoutengine.lib +LIBRARY xn3utils.lib +LIBRARY avkon.lib +LIBRARY aknskins.lib + +LANG SC + +START RESOURCE xn3animationfactory.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET xn3animationfactory.rsc +#endif +END diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationadapter.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,137 @@ +/* +* 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: Implements Xuikon animation component. +* +*/ + + + +#ifndef _XNANIMATIONAPADAPTER_H +#define _XNANIMATIONAPADAPTER_H + +// INCLUDES +#include "xncontroladapter.h" + + +// FORWARD DECLARATIONS +class CXnNodePluginIf; +class CAknBitmapAnimation; +class CXnAnimationControl; +class CPeriodic; + +// CLASS DECLARATION +/** +* @ingroup group_xnbitmapfactory +* @lib xn3bitmapfactory.dll +* @since Series 60 3.1 +*/ +class CXnAnimationAdapter : public CXnControlAdapter + { + public: + /** + * 2 phase construction. + */ + static CXnAnimationAdapter* NewL(CXnNodePluginIf& aNode); + + /** + * Destructor. + */ + virtual ~CXnAnimationAdapter(); + + public: // From Base classes + /** + * From CXnControlAdapter Handles the property changes. + * @since Series 60 3.1 + * @return void. + */ + void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); + + protected: + /** + * From CCoeControl. + * Draws the control. + * + * @param aRect TRect to draw + */ + void Draw(const TRect& aRect) const; + + /** + * From CCoeControl. + * Control visual state. + * + * @param aVisible visibility (ETrue/EFalse) + */ + void MakeVisible( TBool aVisible ); + + private: + /** + * Constructor + * + * @param aNode plugin node + */ + CXnAnimationAdapter(CXnNodePluginIf& aNode); + + /** + * 2nd phase constructor + * + * @param aNode plugin node + */ + void ConstructL(CXnNodePluginIf& aNode); + + /** + * Periodic timer call back + * + * @param aAny pointer reference + */ + static TInt TimerCallBack(TAny* aAny); + + /** + * Update the next image for animation + * + */ + void Update(); + + /** + * Starts the animation + * + */ + void StartAnimation(); + + /** + * Stops the animation + * + */ + void StopAnimation(); + + private: // Data + + // UI node, not owned + CXnNodePluginIf& iNode; + + // display on(block) or off(none) + TBool iDisplay; + + // Whether the animation started or not + TBool iAnimationSarted; + + // Image Skind Id + TAknsItemID iSkinId; + + // Timer for animation, owned + CPeriodic* iPeriodicTimer; + }; + +#endif // _XNANIMATIONAPADAPTER_H + +// End of File diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationfactory.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,94 @@ +/* +* 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: Factory for creating CXnAnimation -component +* +*/ + +#ifndef _XNANIMATIONFACTORY_H +#define _XNANIMATIONFACTORY_H + +// INCLUDES +#include "xncomponentfactory.h" +#include +#include + +#include +#include + +// FORWARD DECLARATIONS +class CXnComponent; +class CXnMap; +class CXnType; + +// CLASS DECLARATION +/** +* @ingroup group_xnanimationfactory +* Layout Area UI factory interface for creating UI representations of the layout areas. +* This class is wrapper for containing CAnimation +* +* @lib xn3animationfactory.dll +* @since Series 60 3.1 +*/ +// inheritance order must be this, despite codescanner warnings +class CXnAnimationFactory : public MXnComponentFactory, public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CXnAnimationFactory* NewL(); + + /** + * Destructor. + */ + virtual ~CXnAnimationFactory(); + + public: // Functions from base classes + + /** + * @see MXnComponentFactory.h + */ + TXnComponentFactoryResponse MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ); + + /** + * @see MXnComponentFactory.h + */ + CXnControlAdapter* MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* aParent = NULL + ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CXnAnimationFactory(); + }; + +// Exported factory function required by ECOM-framework +IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); + +#endif // _XNANIMATIONFACTORY_H + +// End of File diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xn3animationfactory.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xn3animationfactory.rss Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,43 @@ +/* +* 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: +* +*/ +// 102073FE.RSS +// +#include +#include + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY; +interfaces = + { + INTERFACE_INFO + { + interface_uid = AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY_IMPLEMENTATION; + version_no = 1; + display_name = "XnAnimation"; + default_data = "animation"; + opaque_data = ""; + } + }; + } + }; +} diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimation.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,79 @@ +/* +* 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: Xuikon Animation component. +* +*/ + + + +#include "xnanimation.h" +#include "xnanimationadapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnAnimation::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnAnimation* CXnAnimation::NewL() + { + CXnAnimation* self = new( ELeave ) CXnAnimation; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnAnimation::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnAnimation::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CXnAnimation::CXnAnimation +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnAnimation::CXnAnimation() + { + } + +// ----------------------------------------------------------------------------- +// CXnAnimation::~CXnAnimation +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnAnimation::~CXnAnimation() + { + } + +// --------------------------------------------------------- +// CXnAnimation::MakeInterfaceL +// --------------------------------------------------------- +XnComponentInterface::MXnComponentInterface* CXnAnimation::MakeInterfaceL(const TDesC8& aType) + { + if (aType != XnAnimationInterface::KType) + { + return NULL; + } + XnAnimationInterface::MXnAnimationInterface* animationintr = static_cast(this); + return animationintr; + } diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,228 @@ +/* +* 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: Xuikon Bitmap Plugin. +* +*/ +#include +#include +#include +#include +#include "xnnodepluginif.h" +#include "xndomproperty.h" +#include "xnproperty.h" +#include "xncontroladapter.h" + +#include "xnanimationadapter.h" + +const TInt KPeriodicTimerInterval5Sec(100000); // 0.1 sec +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CXnAnimationAdapter::NewL +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +CXnAnimationAdapter* CXnAnimationAdapter::NewL(CXnNodePluginIf& aNode) + { + CXnAnimationAdapter* self = new( ELeave ) CXnAnimationAdapter( aNode ); + + CleanupStack::PushL( self ); + self->ConstructL( aNode ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnAnimationAdapter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnAnimationAdapter::ConstructL(CXnNodePluginIf& aNode) + { + CXnControlAdapter::ConstructL( aNode ); + iSkinId = KAknsIIDNone; + iAnimationSarted = EFalse; + } + +// ----------------------------------------------------------------------------- +// CXnAnimationAdapter::CXnAnimationAdapter +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CXnAnimationAdapter::CXnAnimationAdapter(CXnNodePluginIf& aNode) : iNode( aNode ) + { + } + +// ----------------------------------------------------------------------------- +// CXnAnimationAdapter::~CXnAnimationAdapter +// C++ destructor +// ----------------------------------------------------------------------------- +// +CXnAnimationAdapter::~CXnAnimationAdapter() + { + if (iPeriodicTimer) + { + iPeriodicTimer->Cancel(); + delete iPeriodicTimer; + iPeriodicTimer = NULL; + } + } + + +// ----------------------------------------------------------------------------- +// CXnAnimationAdapter::Draw +// ----------------------------------------------------------------------------- +// +void CXnAnimationAdapter::Draw(const TRect& aRect) const + { + CXnControlAdapter::Draw( aRect ); + AknsDrawUtils::DrawCachedImage( AknsUtils::SkinInstance(), + SystemGc(), aRect, iSkinId ); + } + +// ----------------------------------------------------------------------------- +// CXnAnimationAdapter::HandlePropertyChangeL +// ----------------------------------------------------------------------------- +// +void CXnAnimationAdapter::DoHandlePropertyChangeL( CXnProperty* aProperty ) + { + if( aProperty ) + { + const TDesC8& name( aProperty->Property()->Name( ) ); + + if( name == XnPropertyNames::style::common::KDisplay ) + { + const TDesC8& display( aProperty->StringValue() ); + + if( display == XnPropertyNames::style::common::display::KBlock ) + { + iDisplay = ETrue; + StartAnimation(); + } + else + { + iDisplay = EFalse; + StopAnimation(); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CXnNewstickerAdapter::MakeVisible() +// ----------------------------------------------------------------------------- +// +void CXnAnimationAdapter::MakeVisible( TBool aVisible ) + { + if( aVisible ) + { + StartAnimation(); + } + else + { + StopAnimation(); + } + CCoeControl::MakeVisible( aVisible ); + } + +// ----------------------------------------------------------------------------- +// CXnAnimationAdapter::Update +// ----------------------------------------------------------------------------- +// +void CXnAnimationAdapter::Update() + { + if (iAnimationSarted ) + { + switch(iSkinId.iMinor ) + { + case EAknsMinorGenericQgnHomeRefreshing1: + { + iSkinId.Set(KAknsIIDQgnHomeRefreshing2); + } + break; + case EAknsMinorGenericQgnHomeRefreshing2: + { + iSkinId.Set(KAknsIIDQgnHomeRefreshing3); + } + break; + case EAknsMinorGenericQgnHomeRefreshing3: + { + iSkinId.Set(KAknsIIDQgnHomeRefreshing4); + } + break; + case EAknsMinorGenericQgnHomeRefreshing4: + { + iSkinId.Set(KAknsIIDQgnHomeRefreshing1); + } + break; + default : + break; + }; + DrawNow(); + } + } + +// ---------------------------------------------------------------------------- +// CXnAnimationAdapter::PeriodicTimerCallBack(TAny* aAny) +// The call back function. +// ---------------------------------------------------------------------------- +// +TInt CXnAnimationAdapter::TimerCallBack(TAny* aAny) + { + CXnAnimationAdapter* self = static_cast (aAny); + + // Update widget every 5 seconds + self->Update(); + + return KErrNone; // Return value ignored by CPeriodic + } + +// ---------------------------------------------------------------------------- +// CXnAnimationAdapter::StartAnimation() +// ---------------------------------------------------------------------------- +// +void CXnAnimationAdapter::StartAnimation() + { + if ( !iAnimationSarted && iDisplay ) + { + TRAPD(err, iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle) ); + if ( err == KErrNone ) + { + iPeriodicTimer->Start( KPeriodicTimerInterval5Sec, + KPeriodicTimerInterval5Sec, TCallBack( TimerCallBack, this ) ); + iSkinId = KAknsIIDQgnHomeRefreshing1; + iAnimationSarted = ETrue; + } + } + } + +// ---------------------------------------------------------------------------- +// CXnAnimationAdapter::StopAnimation() +// ---------------------------------------------------------------------------- +// +void CXnAnimationAdapter::StopAnimation() + { + if ( iAnimationSarted ) + { + iPeriodicTimer->Cancel(); + delete iPeriodicTimer; + iPeriodicTimer = NULL; + iSkinId = KAknsIIDNone; + iAnimationSarted = EFalse; + } + } + +// End of File + diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationfactory.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,129 @@ +/* +* 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: Implementation for factory creating container for Active Idle plugins. +* +*/ + + +#include +#include +#include + +#include "xntype.h" +#include "xncomponent.h" +#include "xnnodepluginif.h" +#include "xnanimationfactory.h" +#include "xnanimationadapter.h" +#include "xnanimation.h" +#include + +// ============================ MEMBER FUNCTIONS =============================== + + +_LIT8(KXnAnimation, "animation"); +// ----------------------------------------------------------------------------- +// CXnAnimationFactory::MakeXnComponentL +// ----------------------------------------------------------------------------- +// + +MXnComponentFactory::TXnComponentFactoryResponse CXnAnimationFactory::MakeXnComponentL( + CXnNodePluginIf& aNode, + CXnComponent*& aTargetComponent + ) + { + MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported; + // Check that the given type of a control is parent (or ancestor) of this control + if (aNode.Type()->Type() == KXnAnimation) + { + aTargetComponent = CXnAnimation::NewL(); + retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CXnAnimationFactory::MakeXnControlAdapterL +// ----------------------------------------------------------------------------- +// + +CXnControlAdapter* CXnAnimationFactory::MakeXnControlAdapterL( + CXnNodePluginIf& aNode, + CXnControlAdapter* /*aParent*/ + ) + { + return CXnAnimationAdapter::NewL(aNode); + } + + +// ----------------------------------------------------------------------------- +// CXnAnimationFactory::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CXnAnimationFactory* CXnAnimationFactory::NewL() + { + CXnAnimationFactory* self = new( ELeave ) CXnAnimationFactory; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CXnAnimationFactory::CXnAnimationFactory +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CXnAnimationFactory::CXnAnimationFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnAnimationFactory::~CXnAnimationFactory +// Destructor. +// ----------------------------------------------------------------------------- +// +CXnAnimationFactory::~CXnAnimationFactory() + { + } + +// ----------------------------------------------------------------------------- +// CXnAnimationFactory::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CXnAnimationFactory::ConstructL() + { + } + + +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { + #ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY_IMPLEMENTATION, CXnAnimationFactory::NewL) + #else + {{AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY_IMPLEMENTATION}, CXnAnimationFactory::NewL} + #endif + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby --- a/idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby Tue Jan 26 11:48:23 2010 +0200 @@ -51,6 +51,7 @@ ECOM_PLUGIN( xn3clockfactory.dll , xn3clockfactory.rsc ) ECOM_PLUGIN( xn3nppluginfactory.dll , xn3nppluginfactory.rsc ) ECOM_PLUGIN( xn3texteditorfactory.dll , xn3texteditorfactory.rsc ) +ECOM_PLUGIN( xn3animationfactory.dll , xn3animationfactory.rsc ) #endif // XMLUIRENDERING_IBY diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h Tue Jan 26 11:48:23 2010 +0200 @@ -2,9 +2,9 @@ * 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" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available -* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -2,9 +2,9 @@ * 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" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available -* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -849,4 +849,17 @@ } } +// ----------------------------------------------------------------------------- +// CXnEditMode::StopDraggingL() +// ----------------------------------------------------------------------------- +// +void CXnEditMode::StopDraggingL() + { + if( iState == CXnEditMode::EDragging ) + { + StopDragL(); + UpdateScreen(); + } + } + // End of file diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -820,8 +820,16 @@ if( plugin.Removable() ) { - TRAP_IGNORE( iViewManager.UnloadWidgetFromPluginL( plugin ) ); - } + TRAPD( err, err = iViewManager.UnloadWidgetFromPluginL( plugin ) ); + + if ( err != KErrNone ) + { + HBufC* msg = StringLoader::LoadLC( + R_QTN_HS_OPERATION_FAILED_NO_DISK ); + ShowErrorNoteL( *msg ); + CleanupStack::PopAndDestroy( msg ); + } + } } // --------------------------------------------------------------------------- diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -3161,12 +3161,15 @@ if ( attribute ) { + const TDesC8& value( attribute->Value() ); TLex8 lex( value ); TInt effect; lex.Val( effect ); + aEngine.AppUiAdapter().EffectManager()->BeginFullscreenEffectL( effect, aEngine.ViewManager()->ActiveViewData() ); + } } @@ -4321,7 +4324,12 @@ } else if ( nameString == XnPropertyNames::action::event::KRunFullScreenEffect ) { - RunFullScreenEffectL( aEngine, aEventNode ); + TInt viewCount( aEngine.ViewManager()->ViewAmount() ); + + if ( viewCount > KOneView ) + { + RunFullScreenEffectL( aEngine, aEventNode ); + } } else if ( nameString == XnPropertyNames::action::event::KActivateNextView ) { diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -8678,7 +8678,7 @@ { if ( *itemType == KAddWidget ) { - if ( aPlugin ) + if ( aPlugin && &aPlugin->Node() ) { CXnPluginData& data( viewData.Plugin( &aPlugin->Node() ) ); diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -41,6 +41,7 @@ #include "xnviewadapter.h" #include "xnmenu.h" +#include "xneditmode.h" // Constants const TUid KXmlViewUid = { 1 }; @@ -475,7 +476,13 @@ aStatus == MXnUiStateObserver::EBackground ) { iFlags.Clear( EIsForeground ); - + + CXnEditMode* editMode = iAppUiAdapter.UiEngine().EditMode(); + if( editMode ) + { + editMode->StopDraggingL(); + } + iFocusControl->MakeVisible( EFalse ); TRAP_IGNORE( ChangeControlsStateL( EFalse ) ); diff -r fb3763350a08 -r 4d54b72983ae idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -869,7 +869,7 @@ } // Activate view - if ( next.Occupied() ) + if ( next.Occupied() && !next.Active() ) { iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); UpdateWallpaperL( current, next ); @@ -892,7 +892,7 @@ } // Activate view - if ( prev.Occupied() ) + if ( prev.Occupied() && !prev.Active() ) { iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ); UpdateWallpaperL( current, prev ); diff -r fb3763350a08 -r 4d54b72983ae menufw/hierarchynavigator/hnmetadatamodel/inc/hnglobals.h --- a/menufw/hierarchynavigator/hnmetadatamodel/inc/hnglobals.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnglobals.h Tue Jan 26 11:48:23 2010 +0200 @@ -149,6 +149,7 @@ _LIT8( KEventElementName8, "event" ); _LIT8( KMenuItemElementName8, "menuitem" ); _LIT8( KMenuItemSpecificElementName8, "menuitem_specific" ); +_LIT8( KMenuItemActionElementName8, "menuitem_action" ); _LIT8( KLocalizationElementName8, "localization" ); _LIT8( KNotifyRequestElementName8, "notify_request" ); _LIT8( KMenuButton8, "button" ); diff -r fb3763350a08 -r 4d54b72983ae menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdmenuitem.h --- a/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdmenuitem.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdmenuitem.h Tue Jan 26 11:48:23 2010 +0200 @@ -23,11 +23,11 @@ #include #include #include +#include struct THnMdCommonPointers; class CHnCondition; class CLiwGenericParamList; -class CHnMenuItemModel; class CHnConditionInterface; /** @@ -42,6 +42,18 @@ NONSHARABLE_CLASS(CHnMdMenuItem) : public CBase { public: + /** + * Checkes if argument descriptor is equal to one of + * menu items elements names. + * + * @since S60 5.0 + * @param aNameToCompare name to compare. + * @return ETrue if aNameToCompare is equal to one of + * menu items elements names. + */ + static TBool IsMenuItemElementName(const TDesC8& aNameToCompare); + +public: /** * Two-phase constructor. @@ -184,10 +196,10 @@ CHnConditionInterface* iCondition; /** - * Is menu item "item specific". + * Is menu item "type". */ - TBool iSpecific; - + CHnMenuItemModel::THnMenuItemType iType; + }; #endif // C_HNMULMENUITEM_H diff -r fb3763350a08 -r 4d54b72983ae menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmenuitem.cpp --- a/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmenuitem.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmenuitem.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -32,6 +32,17 @@ // // --------------------------------------------------------------------------- // +TBool CHnMdMenuItem::IsMenuItemElementName( const TDesC8& aNameToCompare ) + { + return !aNameToCompare.Compare( KMenuItemElementName8 ) + || !aNameToCompare.Compare( KMenuItemSpecificElementName8 ) + || !aNameToCompare.Compare( KMenuItemActionElementName8 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// void CHnMdMenuItem::AppendChildItemL( CHnMdMenuItem* aMenuItem ) { iChildren.AppendL( aMenuItem ); @@ -56,7 +67,7 @@ } aMenuModel->SetCommand( iEvent ); aMenuModel->SetPosition( iPosition ); - aMenuModel->SetItemSpecific( iSpecific ); + aMenuModel->SetMenuItemType( iType ); } // --------------------------------------------------------------------------- @@ -67,7 +78,15 @@ void CHnMdMenuItem::CreatePropertiesL( TXmlEngElement aElement, THnMdCommonPointers* /* aCmnPtrs */ ) { - iSpecific = !aElement.Name().Compare( KMenuItemSpecificElementName8 ); + iType = CHnMenuItemModel::EItemApplication; + if ( !aElement.Name().Compare( KMenuItemSpecificElementName8 ) ) + { + iType = CHnMenuItemModel::EItemSpecific; + } + else if ( !aElement.Name().Compare( KMenuItemActionElementName8 ) ) + { + iType = CHnMenuItemModel::EItemAction; + } // name HBufC* name = HnConvUtils::Str8ToStrLC( @@ -112,8 +131,7 @@ for ( TInt i = 0; i < count; i++ ) { TXmlEngElement child = children.Next(); - if ( !child.Name().Compare( KMenuItemElementName8 ) - || !child.Name().Compare( KMenuItemSpecificElementName8 ) ) + if ( IsMenuItemElementName( child.Name() ) ) { AppendChildItemL( CHnMdMenuItem::NewL( child, aCmnPtrs ) ); } @@ -129,8 +147,7 @@ void CHnMdMenuItem::ConstructL( TXmlEngElement aElement, THnMdCommonPointers* aCmnPtrs ) { - if ( !aElement.Name().Compare( KMenuItemElementName8 ) - || !aElement.Name().Compare( KMenuItemSpecificElementName8 ) ) + if ( IsMenuItemElementName( aElement.Name() ) ) { // this is an ordinary menu item CreatePropertiesL( aElement, aCmnPtrs ); CreateChildrenL( aElement, aCmnPtrs ); // in case there are subitems diff -r fb3763350a08 -r 4d54b72983ae menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlmodelprovider.cpp --- a/menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlmodelprovider.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnxmlmodelprovider.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -24,6 +24,7 @@ #include "menudebug.h" #include "hnhelper.inl" #include "hnmdmodel.h" +#include "hnmdmenuitem.h" // ======== MEMBER FUNCTIONS ======== @@ -306,8 +307,8 @@ TXmlEngElement child = children.Next(); TPtrC8 childName = child.Name(); - if (!childName.Compare(KEventName8) || !childName.Compare( - KMenuItemName8) ||!childName.Compare( KMenuItemSpecificName8 ) + if (!childName.Compare(KEventName8) + || CHnMdMenuItem::IsMenuItemElementName( childName ) || !child.Name().Compare(KMenuToolbar8)) { ChangeEventNamesToIdsL(child); @@ -591,8 +592,7 @@ for( TInt i( 0 ); i < count; i++ ) { TXmlEngElement element = children.Next(); - if ( !element.Name().Compare( KMenuItemName8 ) || - !element.Name().Compare( KMenuItemSpecificName8 ) || + if ( CHnMdMenuItem::IsMenuItemElementName( element.Name() ) || !element.Name().Compare( KMenuButton8 ) ) { ChangeEventNamesToIdsL( element ); diff -r fb3763350a08 -r 4d54b72983ae menufw/hierarchynavigator/hnpresentationmodel/bwins/hnpresentationmodelu.def --- a/menufw/hierarchynavigator/hnpresentationmodel/bwins/hnpresentationmodelu.def Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/hierarchynavigator/hnpresentationmodel/bwins/hnpresentationmodelu.def Tue Jan 26 11:48:23 2010 +0200 @@ -181,8 +181,8 @@ ?NewLC@CHnAttrImgProvLiwImage@@SAPAV1@AAPAVTLiwVariant@@0@Z @ 180 NONAME ; class CHnAttrImgProvLiwImage * CHnAttrImgProvLiwImage::NewLC(class TLiwVariant * &, class TLiwVariant * &) ?GetTemplate@CHnSuiteModel@@QBEABVTDesC8@@XZ @ 181 NONAME ; class TDesC8 const & CHnSuiteModel::GetTemplate(void) const ?GetActions@CHnItemModel@@QAEAAV?$RHashMap@HPAV?$CArrayPtr@VCHnActionModel@@@@@@XZ @ 182 NONAME ; class RHashMap *> & CHnItemModel::GetActions(void) - ?SetItemSpecific@CHnMenuItemModel@@QAEXH@Z @ 183 NONAME ; void CHnMenuItemModel::SetItemSpecific(int) + ?SetMenuItemType@CHnMenuItemModel@@QAEXW4THnMenuItemType@1@@Z @ 183 NONAME ; void CHnMenuItemModel::SetMenuItemType(enum CHnMenuItemModel::THnMenuItemType) ?HasNextSpecific@CHnMenuItemModel@@UAEHXZ @ 184 NONAME ; int CHnMenuItemModel::HasNextSpecific(void) ?GetNextSpecific@CHnMenuItemModel@@UAEPAV1@XZ @ 185 NONAME ; class CHnMenuItemModel * CHnMenuItemModel::GetNextSpecific(void) - ?IsItemSpecific@CHnMenuItemModel@@QAEHXZ @ 186 NONAME ; int CHnMenuItemModel::IsItemSpecific(void) + ?MenuItemType@CHnMenuItemModel@@QAE?AW4THnMenuItemType@1@XZ @ 186 NONAME ; enum CHnMenuItemModel::THnMenuItemType CHnMenuItemModel::MenuItemType(void) diff -r fb3763350a08 -r 4d54b72983ae menufw/hierarchynavigator/hnpresentationmodel/eabi/hnpresentationmodelu.def --- a/menufw/hierarchynavigator/hnpresentationmodel/eabi/hnpresentationmodelu.def Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/hierarchynavigator/hnpresentationmodel/eabi/hnpresentationmodelu.def Tue Jan 26 11:48:23 2010 +0200 @@ -194,8 +194,8 @@ _ZThn4_N16CHnMenuItemModel7HasNextEv @ 193 NONAME _ZN16CHnMenuItemModel15GetNextSpecificEv @ 194 NONAME _ZN16CHnMenuItemModel15HasNextSpecificEv @ 195 NONAME - _ZN16CHnMenuItemModel15SetItemSpecificEi @ 196 NONAME + _ZN16CHnMenuItemModel15SetMenuItemTypeENS_15THnMenuItemTypeE @ 196 NONAME _ZThn4_N16CHnMenuItemModel15GetNextSpecificEv @ 197 NONAME _ZThn4_N16CHnMenuItemModel15HasNextSpecificEv @ 198 NONAME - _ZN16CHnMenuItemModel14IsItemSpecificEv @ 199 NONAME + _ZN16CHnMenuItemModel12MenuItemTypeEv @ 199 NONAME diff -r fb3763350a08 -r 4d54b72983ae menufw/hierarchynavigator/hnpresentationmodel/inc/hnmenuitemmodel.h --- a/menufw/hierarchynavigator/hnpresentationmodel/inc/hnmenuitemmodel.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnmenuitemmodel.h Tue Jan 26 11:48:23 2010 +0200 @@ -95,6 +95,13 @@ public MHnMenuItemModelIterator { public: + enum THnMenuItemType { + EItemApplication, //in options with & without focus + EItemAction, //in options with focus + EItemSpecific //in options with focus & in stylus popup + }; + +public: /** * Two-phased constructor. @@ -185,12 +192,12 @@ IMPORT_C void SetPosition( TInt aPosition ); /** - * Sets menu item specific flag. + * Sets menu item type. * * @since S60 5.0 - * @param aItemSpecific Is menu element item specific. + * @param aMenuItemType type of menu element. */ - IMPORT_C void SetItemSpecific( TBool aItemSpecific ); + IMPORT_C void SetMenuItemType( THnMenuItemType aMenuItemType ); /** * Appends child item. @@ -201,12 +208,12 @@ IMPORT_C void AppendChildMenuL( CHnMenuItemModel* aMenuModel ); /** - * Tells if menu item is item specific. + * Returns menu item type. * * @since S60 5.0 - * @return ETrue if menu item is item specific. + * @return menu item type. */ - IMPORT_C TBool IsItemSpecific(); + IMPORT_C THnMenuItemType MenuItemType(); private: @@ -253,9 +260,9 @@ RPointerArray< CHnMenuItemModel > iChildren; /** - * Is menu item item specific. + * Type of menu item. */ - TBool iItemSpecific; + THnMenuItemType iMenuItemType; }; #endif // HNMENUITEMMODEL_H_ diff -r fb3763350a08 -r 4d54b72983ae menufw/hierarchynavigator/hnpresentationmodel/src/hnmenuitemmodel.cpp --- a/menufw/hierarchynavigator/hnpresentationmodel/src/hnmenuitemmodel.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnmenuitemmodel.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -83,7 +83,7 @@ { Reset(); } - else if ( iChildren[iNextMenu]->IsItemSpecific() ) + else if ( iChildren[iNextMenu]->MenuItemType() == EItemSpecific ) { hasNext = ETrue; } @@ -102,7 +102,7 @@ EXPORT_C CHnMenuItemModel* CHnMenuItemModel::GetNextSpecific() { ASSERT( iNextMenu < iChildren.Count() ); - ASSERT( iChildren[iNextMenu]->IsItemSpecific() ); + ASSERT( iChildren[iNextMenu]->MenuItemType() == EItemSpecific ); CHnMenuItemModel* nextSpecific = iChildren[ iNextMenu ]; iNextMenu++; return nextSpecific; @@ -143,7 +143,7 @@ void CHnMenuItemModel::ConstructL( const TDesC& aName ) { ASSERT( aName.Length() ); - iItemSpecific = EFalse; + iMenuItemType = EItemApplication; iName.CreateL( aName ); } @@ -196,18 +196,18 @@ // // --------------------------------------------------------------------------- // -EXPORT_C void CHnMenuItemModel::SetItemSpecific( TBool aItemSpecific ) +EXPORT_C void CHnMenuItemModel::SetMenuItemType( THnMenuItemType aMenuItemType ) { - iItemSpecific = aItemSpecific; + iMenuItemType = aMenuItemType; } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // -EXPORT_C TBool CHnMenuItemModel::IsItemSpecific() +EXPORT_C CHnMenuItemModel::THnMenuItemType CHnMenuItemModel::MenuItemType() { - return iItemSpecific; + return iMenuItemType; } // --------------------------------------------------------------------------- diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/matrixmenu/inc/mmappui.h --- a/menufw/menufwui/matrixmenu/inc/mmappui.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/matrixmenu/inc/mmappui.h Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: Application UI class -* Version : %version: MM_83.1.2.1.23.1.19 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_83.1.2.1.23.1.20 % << Don't touch! Updated by Synergy at check-out. * */ @@ -844,11 +844,6 @@ */ void HandleFocusLostL(); - /** - * Detects when options menu pops up and hides. - */ - void DetectOptionsMenuOpenDisplayChangeL(); - private: // Data /** @@ -1011,16 +1006,6 @@ */ CAknStylusPopUpMenu* iPopupMenu; - /** - * Application UI factory for this app UI object. - */ - MEikAppUiFactory* iAppUiFactory; - - /** - * ETrue if Options menu is open. - */ - TBool iOptionsMenuIsOpen; - }; #endif // C_MMAPPUI_H diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/matrixmenu/src/mmappui.cpp --- a/menufw/menufwui/matrixmenu/src/mmappui.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/matrixmenu/src/mmappui.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -12,8 +12,8 @@ * Contributors: * * Description: Application UI class -* 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. +* Version : %version: MM_176.1.28.1.60 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_176.1.28.1.60 % << Don't touch! Updated by Synergy at check-out. * */ @@ -96,8 +96,6 @@ EAknEnableSkin | EAknSingleClickCompatible : EAknEnableSkin | EAknEnableMSK; BaseConstructL( appUiFlags ); - iAppUiFactory = CEikonEnv::Static()->AppUiFactory( *this ); - ASSERT( iAppUiFactory ); FeatureManager::InitializeLibL(); iIsKastorEffectStarted = EFalse; @@ -129,7 +127,6 @@ iSkinSrvSession.Connect(this); iAppkeyHandler = CMmAppkeyHandler::NewL(); - iOptionsMenuIsOpen = EFalse; RProperty::Define( KMMenuPSCat, KMMenuLastViewKey, RProperty::EText ); @@ -214,12 +211,12 @@ iIsKastorEffectStarted = ETrue; TInt lastItemIndex = iCurrentContainer->NumberOfItems() - 1; - if ( lastItemIndex >= 0 && iCurrentContainer->ItemIsFullyVisible( lastItemIndex ) && + if ( lastItemIndex >= 0 && iCurrentContainer->ItemIsFullyVisible( lastItemIndex ) && !iCurrentContainer->IsHighlightVisible() ) { iCurrentContainer->SetManualHighlightL( lastItemIndex, EFalse ); } - + iCurrentContainer->SetRect( ClientRect() ); iDummyContainer->SetRect( ClientRect() ); @@ -324,6 +321,12 @@ { if ( !iAppkeyHandler->IsActive() ) { + //make dummy container visible when returning + //to menu by AppKey + iDummyContainer->MakeVisible( ETrue ); + RefreshUiPanesL( ETrue ); + iCurrentContainer->MakeVisible( EFalse ); + iDummyContainer->DrawNow(); CleanupForExitL( EExitKeyApplication ); User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); @@ -796,10 +799,7 @@ { iCurrentSuiteModel->SetVisibleL(EFalse); } - if( iMmExtManager ) - { - iMmExtManager->ExecuteActionL(TUid::Null(), KCommandDeleteDialog, NULL ); - } + } break; case ERemoveLiwObjects: @@ -1313,7 +1313,7 @@ if ( !popupMenuDisplayed && iCurrentContainer ) { - iCurrentContainer->EndLongTapL( EFalse ); + iCurrentContainer->EndLongTapL( ETrue ); HandleHighlightItemSingleClickedL( iCurrentContainer->Widget()->CurrentItemIndex() ); } @@ -1430,11 +1430,14 @@ // void CMmAppUi::HandleMessageL( const TDesC8& aMessage ) { + if( iMmExtManager ) + { + iMmExtManager->ExecuteActionL(TUid::Null(), KCommandDeleteDialog, NULL ); + } if ( IsEditMode() ) { SetEditModeL( EFalse ); } - if ( aMessage.Find( KRootWithPref ) != KErrNotFound ) { RemoveFromStack( iCurrentContainer ); @@ -1520,19 +1523,13 @@ aMenuPane-> ItemData( aMenuPane->MenuItemCommandId( i ) ) ); } - - TInt itemSpecificMenuItemsCount = 0; + //get custom menu items and their positions while ( menuIterator->HasNext() ) { CHnMenuItemModel* menuItem = menuIterator->GetNext(); - TBool isItemSpecific = menuItem->IsItemSpecific(); - if ( isItemSpecific ) - { - ++itemSpecificMenuItemsCount; - } - if ( !isItemSpecific || !ignoreItemSpecific ) + if ( (menuItem->MenuItemType() == CHnMenuItemModel::EItemApplication) || !ignoreItemSpecific ) { CEikMenuPaneItem::SData menuData; menuData.iCommandId = menuItem->Command(); @@ -1570,11 +1567,6 @@ 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(); @@ -1818,7 +1810,16 @@ { StartLayoutSwitchFullScreen(); } + + TBool highlightVisibleBefore = iCurrentContainer != NULL && + iCurrentContainer->IsHighlightVisible(); + HandleWidgetChangeRefreshL( aWidgetContainer ); + + if ( highlightVisibleBefore ) + { + iCurrentContainer->SetHighlightVisibilityL( ETrue ); + } } else { @@ -2147,9 +2148,8 @@ { HandleFullOrPartialForegroundLostL(); } + } - DetectOptionsMenuOpenDisplayChangeL(); - } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- @@ -2166,8 +2166,6 @@ return EErrorNotHandled; } - - // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- @@ -3010,19 +3008,9 @@ { DEBUG(("_Mm_:CMmAppUi::HandleWsEventL " "- KAknFullOrPartialForegroundLost")); - iMmExtManager->ExecuteActionL( - TUid::Null(), KCommandDeleteDialog, NULL ); if ( iCurrentContainer ) { iCurrentContainer->HandleBackgroundGainedL(); - if ( !IsRootdisplayedL() || IsEditMode() || - iEditModeStatus == ETransitionFromEditMode ) - { - iDummyContainer->MakeVisible( ETrue ); - RefreshUiPanesL( ETrue ); - iCurrentContainer->MakeVisible( EFalse ); - iDummyContainer->DrawNow(); - } if ( IsRootdisplayedL() ) { iCurrentContainer->RestoreWidgetPosition(); @@ -3031,23 +3019,4 @@ } } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmAppUi::DetectOptionsMenuOpenDisplayChangeL() - { - CEikMenuBar* menuBar = iAppUiFactory->MenuBar(); - TBool optionsMenuIsOpen = menuBar && menuBar->IsDisplayed(); - if ( !!iOptionsMenuIsOpen != !!optionsMenuIsOpen ) - { - iOptionsMenuIsOpen = optionsMenuIsOpen; - if ( iCurrentContainer ) - { - iCurrentContainer->HandleOptionsMenuVisibilityChangeL( - iOptionsMenuIsOpen ); - } - } - } - // End of File diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def --- a/menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/bwins/mmwidgetsu.def Tue Jan 26 11:48:23 2010 +0200 @@ -25,19 +25,16 @@ ?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 *) + ?NewListBoxContainerL@CMmWidgetContainer@@SAPAV1@ABVTRect@@PAVMObjectProvider@@PAVCMmTemplateLibrary@@@Z @ 27 NONAME ; class CMmWidgetContainer * CMmWidgetContainer::NewListBoxContainerL(class TRect const &, class MObjectProvider *, class CMmTemplateLibrary *) + ?SetEmptyTextL@CMmListBoxContainer@@UAEXABVTDesC16@@@Z @ 28 NONAME ; void CMmListBoxContainer::SetEmptyTextL(class TDesC16 const &) ?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) + ?RestoreWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 31 NONAME ; void CMmWidgetContainer::RestoreWidgetPosition(void) + ?EnableLongTapAnimation@CMmWidgetContainer@@QAEXH@Z @ 32 NONAME ; void CMmWidgetContainer::EnableLongTapAnimation(int) + ?SetHighlightVisibilityL@CMmWidgetContainer@@UAEXH@Z @ 33 NONAME ; void CMmWidgetContainer::SetHighlightVisibilityL(int) + ?ResetWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 34 NONAME ; void CMmWidgetContainer::ResetWidgetPosition(void) + ?ItemIsFullyVisible@CMmWidgetContainer@@QAEHH@Z @ 35 NONAME ; int CMmWidgetContainer::ItemIsFullyVisible(int) + ?CacheWidgetPosition@CMmWidgetContainer@@QAEXXZ @ 36 NONAME ; void CMmWidgetContainer::CacheWidgetPosition(void) + ?SetIsFaded@CMmWidgetContainer@@QAEXH@Z @ 37 NONAME ; void CMmWidgetContainer::SetIsFaded(int) + ?CancelDragL@CMmWidgetContainer@@QAEXH@Z @ 38 NONAME ; void CMmWidgetContainer::CancelDragL(int) diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def --- a/menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/eabi/mmwidgetsu.def Tue Jan 26 11:48:23 2010 +0200 @@ -1,44 +1,41 @@ EXPORTS _ZN16CMmGridContainer13SetEmptyTextLERK7TDesC16 @ 1 NONAME _ZN16CMmGridContainer20SetDefaultHighlightLEi @ 2 NONAME - _ZN17CMmHighlightTimer4NewLEP18CMmWidgetContainer @ 3 NONAME - _ZN17CMmHighlightTimer5NewLCEP18CMmWidgetContainer @ 4 NONAME - _ZN18CMmTemplateLibrary4NewLEv @ 5 NONAME - _ZN18CMmTemplateLibrary5NewLCEv @ 6 NONAME - _ZN18CMmWidgetContainer10SetIsFadedEi @ 7 NONAME - _ZN18CMmWidgetContainer10WidgetTypeEv @ 8 NONAME - _ZN18CMmWidgetContainer11CancelDragLEi @ 9 NONAME - _ZN18CMmWidgetContainer11EndLongTapLEi @ 10 NONAME - _ZN18CMmWidgetContainer11IsDraggableEv @ 11 NONAME - _ZN18CMmWidgetContainer11SetObserverEP17MMmWidgetObserver @ 12 NONAME - _ZN18CMmWidgetContainer11StopMovingLEv @ 13 NONAME - _ZN18CMmWidgetContainer12GetHighlightEv @ 14 NONAME - _ZN18CMmWidgetContainer12GetItemRectLEi @ 15 NONAME - _ZN18CMmWidgetContainer12SetHasFocusLEi @ 16 NONAME - _ZN18CMmWidgetContainer13ItemIconZoomLEi @ 17 NONAME - _ZN18CMmWidgetContainer13NumberOfItemsEv @ 18 NONAME - _ZN18CMmWidgetContainer13ScrollToItemLEi @ 19 NONAME - _ZN18CMmWidgetContainer14GetSuiteModelLEv @ 20 NONAME - _ZN18CMmWidgetContainer17NewGridContainerLERK5TRectP15MObjectProviderP18CMmTemplateLibrary @ 21 NONAME - _ZN18CMmWidgetContainer17PrepareForGarbageEv @ 22 NONAME - _ZN18CMmWidgetContainer18HandleItemRemovalLEv @ 23 NONAME - _ZN18CMmWidgetContainer18IsHighlightVisibleEv @ 24 NONAME - _ZN18CMmWidgetContainer18ItemIsFullyVisibleEi @ 25 NONAME - _ZN18CMmWidgetContainer18SetLongTapObserverEP18MMmLongTapObserver @ 26 NONAME - _ZN18CMmWidgetContainer19CacheWidgetPositionEv @ 27 NONAME - _ZN18CMmWidgetContainer19HandleItemAdditionLEv @ 28 NONAME - _ZN18CMmWidgetContainer19ResetWidgetPositionEv @ 29 NONAME - _ZN18CMmWidgetContainer20GetPreviousHighlightEv @ 30 NONAME - _ZN18CMmWidgetContainer20NewListBoxContainerLERK5TRectP15MObjectProviderP18CMmTemplateLibrary @ 31 NONAME - _ZN18CMmWidgetContainer21NumberOfItemsChangedLE16TItemsChangeType @ 32 NONAME - _ZN18CMmWidgetContainer21RestoreWidgetPositionEv @ 33 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 + _ZN18CMmTemplateLibrary4NewLEv @ 3 NONAME + _ZN18CMmTemplateLibrary5NewLCEv @ 4 NONAME + _ZN18CMmWidgetContainer10SetIsFadedEi @ 5 NONAME + _ZN18CMmWidgetContainer10WidgetTypeEv @ 6 NONAME + _ZN18CMmWidgetContainer11CancelDragLEi @ 7 NONAME + _ZN18CMmWidgetContainer11EndLongTapLEi @ 8 NONAME + _ZN18CMmWidgetContainer11IsDraggableEv @ 9 NONAME + _ZN18CMmWidgetContainer11SetObserverEP17MMmWidgetObserver @ 10 NONAME + _ZN18CMmWidgetContainer11StopMovingLEv @ 11 NONAME + _ZN18CMmWidgetContainer12GetHighlightEv @ 12 NONAME + _ZN18CMmWidgetContainer12GetItemRectLEi @ 13 NONAME + _ZN18CMmWidgetContainer12SetHasFocusLEi @ 14 NONAME + _ZN18CMmWidgetContainer13ItemIconZoomLEi @ 15 NONAME + _ZN18CMmWidgetContainer13NumberOfItemsEv @ 16 NONAME + _ZN18CMmWidgetContainer13ScrollToItemLEi @ 17 NONAME + _ZN18CMmWidgetContainer14GetSuiteModelLEv @ 18 NONAME + _ZN18CMmWidgetContainer17NewGridContainerLERK5TRectP15MObjectProviderP18CMmTemplateLibrary @ 19 NONAME + _ZN18CMmWidgetContainer17PrepareForGarbageEv @ 20 NONAME + _ZN18CMmWidgetContainer18HandleItemRemovalLEv @ 21 NONAME + _ZN18CMmWidgetContainer18IsHighlightVisibleEv @ 22 NONAME + _ZN18CMmWidgetContainer18ItemIsFullyVisibleEi @ 23 NONAME + _ZN18CMmWidgetContainer18SetLongTapObserverEP18MMmLongTapObserver @ 24 NONAME + _ZN18CMmWidgetContainer19CacheWidgetPositionEv @ 25 NONAME + _ZN18CMmWidgetContainer19HandleItemAdditionLEv @ 26 NONAME + _ZN18CMmWidgetContainer19ResetWidgetPositionEv @ 27 NONAME + _ZN18CMmWidgetContainer20GetPreviousHighlightEv @ 28 NONAME + _ZN18CMmWidgetContainer20NewListBoxContainerLERK5TRectP15MObjectProviderP18CMmTemplateLibrary @ 29 NONAME + _ZN18CMmWidgetContainer21NumberOfItemsChangedLE16TItemsChangeType @ 30 NONAME + _ZN18CMmWidgetContainer21RestoreWidgetPositionEv @ 31 NONAME + _ZN18CMmWidgetContainer22EnableLongTapAnimationEi @ 32 NONAME + _ZN18CMmWidgetContainer23HandleBackgroundGainedLEv @ 33 NONAME + _ZN18CMmWidgetContainer23HandleForegroundGainedLEv @ 34 NONAME + _ZN18CMmWidgetContainer23SetHighlightVisibilityLEi @ 35 NONAME + _ZN19CMmListBoxContainer13SetEmptyTextLERK7TDesC16 @ 36 NONAME + _ZN19CMmListBoxContainer20SetDefaultHighlightLEi @ 37 NONAME + _ZThn52_N18CMmWidgetContainer23HandleBackgroundGainedLEv @ 38 NONAME + _ZThn52_N18CMmWidgetContainer23HandleForegroundGainedLEv @ 39 NONAME diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/group/mmwidgets.mmp --- a/menufw/menufwui/mmwidgets/group/mmwidgets.mmp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/group/mmwidgets.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -37,7 +37,6 @@ SOURCE mmgridcontainer.cpp SOURCE mmwidgetcontainer.cpp SOURCE mmmarqueeadapter.cpp -SOURCE mmhighlighttimer.cpp SOURCE mmfloatingitem.cpp SOURCE mmdraweranimator.cpp SOURCE mmlctutils.cpp diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmcacheforitem.h --- a/menufw/menufwui/mmwidgets/inc/mmcacheforitem.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmcacheforitem.h Tue Jan 26 11:48:23 2010 +0200 @@ -81,7 +81,7 @@ * * @param aValid (Self-explanatory). */ - inline void SetValid( TBool aValid ); + inline void SetValidL( TBool aValid ); /** * Returns information whether at the moment of updating this cache object @@ -190,6 +190,12 @@ * 2nd phase constructor. */ void ConstructL(); + + /** + * Updates the iIconList so that it reflects the contents of + * iIconHolderList. + */ + void UpdateIconListL(); protected: /** @@ -240,6 +246,14 @@ */ CMmItemsDataCache& iParent; + /** + * Array of icons stored in the icon holders which are in iIconHolderList. + * This member is only valid when this cache object is marked as valid + * using the SetValidL method. + * Own. + */ + CArrayPtr* iIconList; + }; #include "mmcacheforitem.inl" diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmcacheforitem.inl --- a/menufw/menufwui/mmwidgets/inc/mmcacheforitem.inl Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmcacheforitem.inl Tue Jan 26 11:48:23 2010 +0200 @@ -48,9 +48,16 @@ // // ----------------------------------------------------------------------------- // -inline void CMmCacheForItem::SetValid( TBool aValid ) +inline void CMmCacheForItem::SetValidL( TBool aValid ) { - iIsValid = aValid; + if ( !!iIsValid != !!aValid ) // Ex-OR + { + iIsValid = aValid; + if ( iIsValid ) + { + UpdateIconListL(); + } + } } // ----------------------------------------------------------------------------- diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmgrid.h --- a/menufw/menufwui/mmwidgets/inc/mmgrid.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmgrid.h Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmGrid declaration -* Version : %version: MM_32.1.20 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_32.1.22 % << Don't touch! Updated by Synergy at check-out. * */ @@ -398,6 +398,34 @@ * area. In normal (non-mirrored) mode this method does nothing. */ void RedrawScrollbarBackground() const; + + /** + * Does actual handling of scroll events. + * + * @param aScrollBar Scrollbar being scrolled. + * @param aEventType Type of scrollbar event. + */ + void ProcessScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ); + + /** + * Handles periodic events from @c iRedrawTimer. + * Such events are generated at equal time intervals while + * the view is being scrolled using the scrollbar. + * This function typically calls @c ProcessScrollEventL, + * which actually scrolls the view and causes a redraw. + */ + void HandleRedrawTimerEvent(); + +private: + /** + * Callback function for @c iRedrawTimer. + * It simply calls @c HandleRedrawTimerEvent and returns 0. + * + * @param aPtr A pointer to CMmGrid object. + * @return 0 (always). + */ + static TInt RedrawTimerCallback( TAny* aPtr ); private: /** @@ -448,6 +476,33 @@ * are blocked in the CountComponentControls() method; */ TBool iDisableChildComponentDrawing; + + /** + * This member is only used in edit mode to store the position of the pointer + * during EButton1Down event. + */ + TPoint iButton1DownPos; + + /** + * ETrue if the view is being scrolled with the scrollbar. + */ + TBool iScrollbarThumbIsBeingDragged; + + /** + * Stores the number of scrollbar events that were ignored. + * It is only used while scrolling the view using scrollbar, + * in such situation the scroll events that this object receives + * are ignored, and actual scrolling is done only when + * iRedrawTimer completes. + */ + TInt iSkippedScrollbarEventsCount; + + /** + * A timer that initiates redraws at certain time intervals. + * It is used to refresh the view while scrolling with + * the scrollbar. + */ + CPeriodic* iRedrawTimer; }; #endif // C_MMGRID_H diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmgridview.h --- a/menufw/menufwui/mmwidgets/inc/mmgridview.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmgridview.h Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmGridView declaration -* Version : %version: MM_24.1.7 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_24.1.8 % << Don't touch! Updated by Synergy at check-out. * */ @@ -66,14 +66,6 @@ void Draw( const TRect* aClipRect ) const; /** - * Draws item definied by index. - * - * @since S60 v3.0 - * @param aItemIndex Item index which should be draw. - */ - void DrawItem(TInt aItemIndex) const; - - /** * Gets item position. * * This fuction from @c CAknGridView is overridden so that it diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmhighlighttimer.h --- a/menufw/menufwui/mmwidgets/inc/mmhighlighttimer.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,200 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: highlight timer class -* Version : %version: MM_11.1.4 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - -#ifndef C_MMHIGHLIGHTTIMER_H -#define C_MMHIGHLIGHTTIMER_H - -#include -#include - -class CMmWidgetContainer; - -/** - * Used by Multimedia Menu to handle highlight behaviour. - * If the timer is set up highlight is due to disappera after set up - * time. - * - * @code - * @endcode - * @lib mmwidgets - * @since S60 v3.0 - * @ingroup group_mmwidgets - */ -NONSHARABLE_CLASS( CMmHighlightTimer ) : public CActive - { -public: - /** - * Two-phased constructor. - * - * @since S60 v3.0 - * @param aContainer Widget container that will use timer. - * @return Instance of highlight timer. - */ - IMPORT_C static CMmHighlightTimer* NewL( - CMmWidgetContainer* aContainer ); - - /** - * Two-phased constructor. - * - * @since S60 v3.0 - * @param aContainer Widget container that will use timer. - * @return Instance of highlight timer. - */ - IMPORT_C static CMmHighlightTimer* NewLC( - CMmWidgetContainer* aContainer ); - - /** - * Destructor. - * - * @since S60 v3.0 - */ - virtual ~CMmHighlightTimer(); - - /** - * Starts the timer with the time specified. Also draws the highlight. - * Highlight timer is the only element eligible to draw highlight with single click. - * If aTime parameter is negative or null the highlight is set permanently until it is - * cancelled manually (e.g. by calling StopL). - * - * @since S60 v5.0 - * @param aTime Time after which timer expires. - * @param aPressDownState The highlight state to be drawn. Default is highlight pressed down. - */ - void StartL( TInt aTime, TBool aPressDownState = ETrue ); - - /** - * Continues the highlight visibility for a specific time. - * If highlight wasn't active (visible) then this method does nothing. - * - * @since S60 v5.0 - * @param aTime Time after which timer expires. - */ - void ContinueL( TInt aTime ); - - /** - * Cancels the asynchronous request and draws over the highlighted item (if told to). - * - * @since S60 v5.0 - * @param aDrawOverHighlight Tells if previous highlight should be drawn over with no highlight. - */ - void StopL( TBool aDrawOverHighlight = ETrue ); - - - /** - * Returns the previously drawn highlight index. - * - * @since S60 v5.0 - * @return Previously drawn highlight index. - */ - TInt TimerHighlightIndex() const; - -private: - - /** - * Constructor. - * - * @since S60 v3.0 - * @param aContainer The widget for which highlight is handled by the timer. - */ - CMmHighlightTimer( CMmWidgetContainer* aContainer ); - - /** - * 2nd phase constructor. - * - * @since S60 v3.0 - */ - void ConstructL(); - - /** - * Disables highlight and redraws the view. - * - * @since S60 v3.0 - */ - void RunL(); - - /** - * Cancels timer. - * - * @since S60 v3.0 - */ - void DoCancel(); - - /** - * Run if error occurred. - * - * @since S60 v3.0 - * @param aError Error for which error handling should be run. - * @return Error code. - */ - TInt RunError( TInt aError ); - - /** - * Draws the highlight. - * - * @since S60 v5.0 - * @param aItemIndex The index of the highlight. - */ - void DrawHighlightL( TInt aItemIndex ); - - /** - * Sets press down state on widget drawer to draw highlight as told. - * - * @since S60 v5.0 - * @param aPressDownState ETrue to set press down state. Otherwise press down state is disabled. - */ - void SetPressDownState(TBool aPressDownState); - -private: - - /** - * Defines states of the CMmHighlightTimer. - */ - enum THighlightTimerState - { - EInactivityState, - ETimerExpirationCompletionState, - EExternalCompletionState - }; - - /** - * Actual state of the CMmHighlightTimer. - */ - TInt iState; - - /** - * Timer class. CMmHighlightTimer requests notifications - * from this member every 6 seconds. - */ - RTimer iTimer; - - /** - * Manages highlight. Receives notifications. - * Not own. - */ - CMmWidgetContainer* iContainer; - - /** - * Index of drawn item. - */ - TInt iTimerHighlightIndex; - - }; - -#endif // C_MMHIGHLIGHTTIMER_H - diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmlistbox.h --- a/menufw/menufwui/mmwidgets/inc/mmlistbox.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmlistbox.h Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmListBox -* Version : %version: MM_22.1.14 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_22.1.16 % << Don't touch! Updated by Synergy at check-out. * */ @@ -275,6 +275,16 @@ */ void SetDisableChildComponentDrawing( TBool aDisable ); + /** + * Handles scrolling event. + * + * @since S60 v3.0 + * @param aScrollBar Scrollbar being scrolled. + * @param aEventType Type of scrollbar event. + */ + void HandleScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ); + private: /** * Default constructor. @@ -363,6 +373,34 @@ */ void RedrawScrollbarBackground() const; + /** + * Does actual handling of scroll events. + * + * @param aScrollBar Scrollbar being scrolled. + * @param aEventType Type of scrollbar event. + */ + void ProcessScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ); + + /** + * Handles periodic events from @c iRedrawTimer. + * Such events are generated at equal time intervals while + * the view is being scrolled using the scrollbar. + * This function typically calls @c ProcessScrollEventL, + * which actually scrolls the view and causes a redraw. + */ + void HandleRedrawTimerEvent(); + +private: + /** + * Callback function for @c iRedrawTimer. + * It simply calls @c HandleRedrawTimerEvent and returns 0. + * + * @param aPtr A pointer to CMmListBox object. + * @return 0 (always). + */ + static TInt RedrawTimerCallback( TAny* aPtr ); + private: // Data /** * Item drawer. @@ -384,6 +422,33 @@ * are blocked in the CountComponentControls() method; */ TBool iDisableChildComponentDrawing; + + /** + * This member is only used in edit mode to store the position of the pointer + * during EButton1Down event. + */ + TPoint iButton1DownPos; + + /** + * ETrue if the view is being scrolled with the scrollbar. + */ + TBool iScrollbarThumbIsBeingDragged; + + /** + * Stores the number of scrollbar events that were ignored. + * It is only used while scrolling the view using scrollbar, + * in such situation the scroll events that this object receives + * are ignored, and actual scrolling is done only when + * iRedrawTimer completes. + */ + TInt iSkippedScrollbarEventsCount; + + /** + * A timer that initiates redraws at certain time intervals. + * It is used to refresh the view while scrolling with + * the scrollbar. + */ + CPeriodic* iRedrawTimer; }; #endif // MMLISTBOX_H diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h --- a/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmListBoxItemDrawer -* Version : %version: MM_38.1.14 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_38.1.15 % << Don't touch! Updated by Synergy at check-out. * */ @@ -913,6 +913,22 @@ * Set to ETrue if item has backdrop. */ mutable TBool iItemHasBackdrop; + + /** + * Number of subcells in iData. + */ + mutable TInt iCurrentNumberOfSubcellsSet; + + /** + * A structure that stores color information needed to draw an item. + */ + mutable CFormattedCellListBoxData::TColors iColors; + + /** + * ETrue if the item that was last drawn was a floating item. + */ + mutable TBool iLastDrawnItemWasFloating; + }; #endif // MMLISTBOXITEMDRAWER_H diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmlistboxmodel.h --- a/menufw/menufwui/mmwidgets/inc/mmlistboxmodel.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxmodel.h Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmListBoxItemModel -* Version : %version: MM_18.1.3 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_18.1.4 % << Don't touch! Updated by Synergy at check-out. * */ @@ -121,6 +121,15 @@ void HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, CHnSuiteModel* aModel ); + /** + * Determines the number of item-specific menu items for given item. + * + * @since S60 v3.0 + * @param aItemIndex Item index. + * @return Number of item-specific menu items. + */ + TInt GetNumberOfSpecificMenuItemsL( TInt aItemIndex ); + private: /** diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmsubcellssetupcode.h --- a/menufw/menufwui/mmwidgets/inc/mmsubcellssetupcode.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmsubcellssetupcode.h Tue Jan 26 11:48:23 2010 +0200 @@ -38,10 +38,12 @@ * and in the same order. * 3. AddTemplateInfo * 4. AddIsCurrentInfo - * It was assumed that there would never be more than 6 - * MmTemplateContants::KSubCellsCount subcells. If that - * should ever change, consider changing the type of iCode - * member to TUint64. + * It is currently possible to store information about up to 21 + * subcells (type of iCode is TUint64 and single subcell info + * takes 3 bits). It can be easily proven that CMmListBoxItemDrawer + * will never try to store more than + * (2 * MmTemplateContants::KSubCellsCount) subcell infos + * (2 * 6 = 12; 12 <= 21, so everything is fine). * Default assignment operator and copy constructor are ok * for this class. */ @@ -58,7 +60,8 @@ ENoSubcell = 0, EGraphicsSubcell = 1, ETextSubcell = 2, - EBackdropSubcell = 3 + EBackdropSubcell = 3, + ESkippedSubcell = 4 }; public: /** @@ -106,7 +109,7 @@ /** * The subcells setup code. */ - TUint32 iCode; + TUint64 iCode; }; #include "mmsubcellssetupcode.inl" diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h --- a/menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmwidgetcontainer.h Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_48.1.36 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_48.1.37 % << Don't touch! Updated by Synergy at check-out. * */ @@ -182,7 +182,7 @@ * @param aVisible Visibility status. */ IMPORT_C virtual void SetHighlightVisibilityL( TBool aVisible ); - + /** * Set highlight visibility. * @@ -230,17 +230,6 @@ virtual void RemoveLiwObjects(); /** - * Checks if timer is active. - * Calling this method without parameters will cause to return - * timer activity state globally (without reference to a specific item index - which tells - * if timer is active at all). - * - * @param aItemIndex Item index for which to check timer activity. Can be not defined. - * @return ETrue if timer is active which means highlight is visible. - */ - TBool IsTimerActive( TInt aItemIndex = KErrNotFound ); - - /** * Sets the long tap observer. * * @param aObserver Observer to receive long tap events. @@ -255,12 +244,6 @@ */ IMPORT_C virtual void EndLongTapL( TBool aStopTimer = ETrue ); - /** - * Is called when options menu visibility changes (hides or pops up) - * @param aOptionsMenuVisible ETrue when option menu pops up. - */ - IMPORT_C virtual void HandleOptionsMenuVisibilityChangeL( - TBool aOptionsMenuVisible ); public: /** @@ -672,6 +655,13 @@ * if marquee animation can be enabled. */ IMPORT_C void SetIsFaded( TBool aIsFaded ); + + /** + * Determines if long tap is in progress. + * + * @return ETrue if long tap is in progress. + */ + TBool LongTapInProgress() const; public: // from MMmVisibilityObserver @@ -884,13 +874,6 @@ */ MEikListBoxObserver* iListBoxObserver; - /** - * Notifies about time expiration. - * - * Owned by descendant. - */ - CMmHighlightTimer* iTimer; - /** * Marquee adapter. * Own. diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/inc/mmwidgetsconstants.h --- a/menufw/menufwui/mmwidgets/inc/mmwidgetsconstants.h Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/inc/mmwidgetsconstants.h Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: Constants for the matrixmenu -* Version : %version: 33.1.9 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: 33.1.11 % << Don't touch! Updated by Synergy at check-out. * */ @@ -441,4 +441,17 @@ EManualAlignRight }; +/** + * The minimal drag vector y-length that can trigger kinetic scrolling. + * This is just a rough estimation of the actual trigger value used by AVKON, + * but it is sufficient for our purposes. + */ +const TInt KDragTreshold = 18; + +/** + * The interval between redraws when scrolling using the scrollbar. + * This will give us nice ~30 fps. + */ +const TInt KScrollingRedrawInterval = 33333; + #endif // MMWIDGETSCONSTANTS_H diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmcacheforitem.cpp --- a/menufw/menufwui/mmwidgets/src/mmcacheforitem.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmcacheforitem.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -21,6 +21,7 @@ #include "hniconholder.h" const TInt KIconHolderListGranularity = 2; +const TInt KIconListGranularity = 2; // ----------------------------------------------------------------------------- // @@ -54,6 +55,7 @@ ClearIconArray(); iIconHolderList.Close(); iItemText.Close(); + delete iIconList; } // ----------------------------------------------------------------------------- @@ -82,19 +84,7 @@ CArrayPtr* CMmCacheForItem::GetIconListL() { __ASSERT_DEBUG( iIsValid, User::Invariant() ); - - const TInt iconCount = iIconHolderList.Count(); - CArrayPtr* iconList = new (ELeave) CArrayPtrFlat( - Max( iconCount, 1 ) ); - CleanupStack::PushL( iconList ); - - for ( TInt i = 0; i < iconCount; ++i ) - { - iconList->AppendL( iIconHolderList[i]->GetGulIcon() ); - } - - CleanupStack::Pop( iconList ); - return iconList; + return iIconList; } // ----------------------------------------------------------------------------- @@ -121,6 +111,7 @@ // void CMmCacheForItem::ClearIconArray() { + iIconList->Reset(); const TInt count = iIconHolderList.Count(); for (TInt i = 0; i < count; ++i ) { @@ -142,7 +133,7 @@ if ( iSubcellsSetupCode != aSubcellsSetupCode || (!!iIsCurrent) != (!!aIsItemCurrent) ) { - iIsValid = EFalse; + SetValidL( EFalse ); } } @@ -160,5 +151,20 @@ // ----------------------------------------------------------------------------- // void CMmCacheForItem::ConstructL() - { + { + iIconList = new ( ELeave ) CArrayPtrFlat( KIconListGranularity ); } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmCacheForItem::UpdateIconListL() + { + iIconList->Reset(); + const TInt iconCount = iIconHolderList.Count(); + for ( TInt i = 0; i < iconCount; ++i ) + { + iIconList->AppendL( iIconHolderList[i]->GetGulIcon() ); + } + } diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmgrid.cpp --- a/menufw/menufwui/mmwidgets/src/mmgrid.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmgrid.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_95 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_97 % << Don't touch! Updated by Synergy at check-out. * */ @@ -51,6 +51,7 @@ // CMmGrid::~CMmGrid() { + delete iRedrawTimer; } // ----------------------------------------------------------------------------- @@ -215,42 +216,65 @@ void CMmGrid::HandleScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ) { - CAknGrid::HandleScrollEventL(aScrollBar, aEventType); - iCurrentTopItemIndex = TopItemIndex(); - - // setting default highligh in order not to overwrite the top item index - // set before in the SetLayout method - CMmWidgetContainer* parent = static_cast< CMmWidgetContainer* > ( Parent() ); - if (!parent->IsHighlightVisible()) - { - parent->SetDefaultHighlightL( EFalse ); + if ( aEventType == EEikScrollThumbDragVert && !iScrollbarThumbIsBeingDragged ) + { + iScrollbarThumbIsBeingDragged = ETrue; + static_cast( + View()->ItemDrawer() )->EnableCachedDataUse( ETrue ); + iRedrawTimer->Start( KScrollingRedrawInterval, KScrollingRedrawInterval, + TCallBack( &CMmGrid::RedrawTimerCallback, static_cast( this ) ) ); + } + else if ( aEventType == EEikScrollThumbReleaseVert ) + { + iScrollbarThumbIsBeingDragged = EFalse; + static_cast( + View()->ItemDrawer() )->EnableCachedDataUse( EFalse ); + // The view will be redrawn with cache disabled when ProcessScrollEventL + // calls the base class's HandleScrollEventL method -- no need to + // explicitly redraw the view. + iRedrawTimer->Cancel(); + } -#ifdef RD_UI_TRANSITION_EFFECTS_LIST - MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( - static_cast(iView)->Gc() ); - TBool effects = transApi && !transApi->EffectsDisabled(); - if ( effects && aEventType == EEikScrollPageUp || - aEventType == EEikScrollPageDown ) - { - DrawNow(); - } -#endif - - } + if ( !iScrollbarThumbIsBeingDragged ) + { + ProcessScrollEventL( aScrollBar, aEventType ); + } + else + { + __ASSERT_DEBUG( aEventType == EEikScrollThumbDragVert, User::Invariant() ); + ++iSkippedScrollbarEventsCount; + } } // ----------------------------------------------------------------------------- -// +// Clearing ELeftDownInViewRect flag before invoking the base class +// HandlePointerEventL method effectively prevents that method from doing most +// of the things it would normally do in response to EButton1Down event. +// This flag is explicitly cleared to achieve two things: +// 1. Prevent kinetic scrolling (flick) in edit mode. +// 2. Prevent highlight removal when popup menu is displayed. // ----------------------------------------------------------------------------- // void CMmGrid::HandlePointerEventInEditModeL( const TPointerEvent& aPointerEvent ) { + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iButton1DownPos = aPointerEvent.iPosition; + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + CMmWidgetContainer* parent = static_cast( Parent() ); + TPoint dragDelta = iButton1DownPos - aPointerEvent.iPosition; + if ( Abs( dragDelta.iY ) > KDragTreshold || parent->LongTapInProgress() ) + { + iListBoxFlags &= ~ELeftDownInViewRect; + } + } + TInt itemUnderPointerIndex = KErrNotFound; - if ( aPointerEvent.iType == TPointerEvent::EButton1Up || aPointerEvent.iType == TPointerEvent::EButton1Down ) { - iListBoxFlags &= ~ELeftDownInViewRect; // prevent kinetic scrolling CAknGrid::HandlePointerEventL( aPointerEvent ); } else if ( View()->XYPosToItemIndex( @@ -638,6 +662,7 @@ } DoSetupLayoutL(); + iRedrawTimer = CPeriodic::NewL( EPriorityRealTime ); } // ----------------------------------------------------------------------------- @@ -955,6 +980,62 @@ // // ----------------------------------------------------------------------------- // +void CMmGrid::ProcessScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ) + { + CAknGrid::HandleScrollEventL( aScrollBar, aEventType ); + iCurrentTopItemIndex = TopItemIndex(); + + // setting default highligh in order not to overwrite the top item index + // set before in the SetLayout method + CMmWidgetContainer* parent = static_cast< CMmWidgetContainer* > ( Parent() ); + if (!parent->IsHighlightVisible()) + { + parent->SetDefaultHighlightL( EFalse ); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( + static_cast(iView)->Gc() ); + TBool effects = transApi && !transApi->EffectsDisabled(); + if ( effects && aEventType == EEikScrollPageUp || + aEventType == EEikScrollPageDown ) + { + DrawNow(); + } +#endif + + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmGrid::HandleRedrawTimerEvent() + { + if ( iSkippedScrollbarEventsCount ) + { + ProcessScrollEventL( ScrollBarFrame()->VerticalScrollBar(), + EEikScrollThumbDragVert ); + } + iSkippedScrollbarEventsCount = 0; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmGrid::RedrawTimerCallback( TAny* aPtr ) + { + CMmGrid* self = static_cast( aPtr ); + self->HandleRedrawTimerEvent(); + return 0; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void CMmGrid::SetVerticalItemOffset(TInt aOffset) { static_cast (View())->SetItemOffsetInPixels(aOffset); diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmgridcontainer.cpp --- a/menufw/menufwui/mmwidgets/src/mmgridcontainer.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmgridcontainer.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -12,8 +12,8 @@ * Contributors: * * Description: -* Version : %version: MM_73 % << Don't touch! Updated by Synergy at check-out. -* Version : %version: MM_73 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_74 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_74 % << Don't touch! Updated by Synergy at check-out. * */ @@ -25,7 +25,6 @@ #include #include #include -#include "mmhighlighttimer.h" #include "hnsuitemodel.h" #include "mmgrid.h" #include "mmwidgetsconstants.h" diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmgridview.cpp --- a/menufw/menufwui/mmwidgets/src/mmgridview.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmgridview.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -80,24 +80,6 @@ // // ----------------------------------------------------------------------------- // -void CMmGridView::DrawItem(TInt aItemIndex) const - { - CMmListBoxItemDrawer* itemDrawer = - STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() ); - TSize size = itemDrawer->GetItemSize( 0, ETrue ); - if ( itemDrawer->ItemCellSize() != size ) - { - const_cast( this )->SetItemHeight(size.iHeight); - const_cast( this )->SetColumnWidth(size.iWidth); - } - - CAknGridView::DrawItem( aItemIndex ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// TPoint CMmGridView::ItemPos( TInt aItemIndex ) const { if ( aItemIndex < 0 ) @@ -232,6 +214,14 @@ // void CMmGridView::Draw(const TRect* aClipRect) const { + CMmListBoxItemDrawer* itemDrawer = + STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() ); + TSize size = itemDrawer->GetItemSize( 0, EFalse ); + if ( itemDrawer->ItemCellSize() != size ) + { + const_cast( this )->SetItemHeight( size.iHeight ); + const_cast( this )->SetColumnWidth( size.iWidth ); + } DoDraw( aClipRect ); } diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmhighlighttimer.cpp --- a/menufw/menufwui/mmwidgets/src/mmhighlighttimer.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: highlight control class -* -*/ -#include - -#include "mmhighlighttimer.h" -#include "mmwidgetcontainer.h" - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CMmHighlightTimer::CMmHighlightTimer(CMmWidgetContainer* aContainer) : - CActive(EPriorityStandard), iState(EInactivityState), - iContainer( aContainer ) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C CMmHighlightTimer* CMmHighlightTimer::NewLC( - CMmWidgetContainer* aContainer) - { - ASSERT(aContainer); - CMmHighlightTimer* self = new (ELeave) CMmHighlightTimer( aContainer ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C CMmHighlightTimer* CMmHighlightTimer::NewL( - CMmWidgetContainer* aContainer) - { - CMmHighlightTimer* self = CMmHighlightTimer::NewLC( aContainer ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmHighlightTimer::ConstructL() - { - User::LeaveIfError( iTimer.CreateLocal() ); - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CMmHighlightTimer::~CMmHighlightTimer() - { - Cancel(); - iTimer.Close(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmHighlightTimer::DoCancel() - { - if (iState == ETimerExpirationCompletionState) - { - iTimer.Cancel(); - } - else if (iState == EExternalCompletionState) - { - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrCancel ); - } - iState = EInactivityState; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmHighlightTimer::StartL( TInt aTime, TBool aPressDownState ) - { - CListBoxView* view = iContainer->Widget()->View(); - if ( IsActive() && - iTimerHighlightIndex != iContainer->Widget()->CurrentItemIndex()) - { - // draw over previous highlight - // this occurs when e.g. highlight is set by rocker and later another - // item is pressed. - DrawHighlightL( iTimerHighlightIndex ); - } - Cancel(); - if (aTime > 0) - { - iTimer.After(iStatus, aTime); - iState = ETimerExpirationCompletionState; - } - else - { - iStatus = KRequestPending; - iState = EExternalCompletionState; - } - - SetActive(); - iContainer->SetHighlightVisibilityL( ETrue ); - { - SetPressDownState( aPressDownState ); - TInt currentItemIndex = - iContainer->Widget()->View()->CurrentItemIndex(); - DrawHighlightL( currentItemIndex ); - iTimerHighlightIndex = currentItemIndex; - } - iContainer->SetHighlightVisibilityL( EFalse ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmHighlightTimer::RunL() - { - DrawHighlightL(iContainer->Widget()->View()->CurrentItemIndex()); - iState = EInactivityState; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CMmHighlightTimer::RunError(TInt /*aError*/) - { - iState = EInactivityState; - return KErrNone; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmHighlightTimer::StopL( TBool aDrawOverHighlight ) - { - if (IsActive()) - { - Cancel(); - if ( aDrawOverHighlight ) - { - DrawHighlightL( iContainer->Widget()->View()->CurrentItemIndex() ); - } - } - iState = EInactivityState; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CMmHighlightTimer::TimerHighlightIndex() const - { - return iTimerHighlightIndex; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmHighlightTimer::DrawHighlightL(TInt aItemIndex) - { - if ( iContainer->IsVisible() ) - { - CListBoxView* view = iContainer->Widget()->View(); - iContainer->Widget()->DrawNow( TRect( - view->ItemPos( aItemIndex ), view->ItemSize( - aItemIndex) ) ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmHighlightTimer::SetPressDownState(TBool aPressDownState) - { - if ( aPressDownState ) - { - iContainer->Widget()->View()->ItemDrawer()->SetFlags( - CListItemDrawer::EPressedDownState ); - } - else - { - iContainer->Widget()->View()->ItemDrawer()->ClearFlags( - CListItemDrawer::EPressedDownState ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMmHighlightTimer::ContinueL( TInt aTime ) - { - if ( IsActive() ) - { - Cancel(); - if ( aTime > 0 ) - { - iTimer.After( iStatus, aTime ); - iState = ETimerExpirationCompletionState; - } - else - { - iStatus = KRequestPending; - iState = EExternalCompletionState; - } - SetActive(); - } - } -// End of file diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmitemsdatacache.cpp --- a/menufw/menufwui/mmwidgets/src/mmitemsdatacache.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmitemsdatacache.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -110,7 +110,7 @@ const TInt count = iItemCacheArr.Count(); for ( TInt i = 0; i < count; ++i ) { - iItemCacheArr[i]->SetValid( EFalse ); + iItemCacheArr[i]->SetValidL( EFalse ); } } diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmlistbox.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -58,6 +58,7 @@ // CMmListBox::~CMmListBox() { + delete iRedrawTimer; } // ----------------------------------------------------------------------------- @@ -116,24 +117,42 @@ EnableExtendedDrawingL(); - iItemDrawer->SetDrawMark(EFalse); CEikListBox::ConstructL(aParent,aFlags); iMmDrawer->SetView( this ); + iRedrawTimer = CPeriodic::NewL( EPriorityRealTime ); } // ----------------------------------------------------------------------------- -// +// Clearing ELeftDownInViewRect flag before invoking the base class +// HandlePointerEventL method effectively prevents that method from doing most +// of the things it would normally do in response to EButton1Down event. +// This flag is explicitly cleared to achieve two things: +// 1. Prevent kinetic scrolling (flick) in edit mode. +// 2. Prevent highlight removal when popup menu is displayed. // ----------------------------------------------------------------------------- // void CMmListBox::HandlePointerEventInEditModeL( const TPointerEvent& aPointerEvent ) { + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iButton1DownPos = aPointerEvent.iPosition; + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + CMmWidgetContainer* parent = static_cast( Parent() ); + TPoint dragDelta = iButton1DownPos - aPointerEvent.iPosition; + if ( Abs( dragDelta.iY ) > KDragTreshold || parent->LongTapInProgress() ) + { + iListBoxFlags &= ~ELeftDownInViewRect; + } + } + TInt itemUnderPointerIndex = KErrNotFound; if ( aPointerEvent.iType == TPointerEvent::EButton1Up || aPointerEvent.iType == TPointerEvent::EButton1Down ) { - iListBoxFlags &= ~ELeftDownInViewRect; // prevent kinetic scrolling CEikFormattedCellListBoxTypedef::HandlePointerEventL( aPointerEvent ); } else if ( View()->XYPosToItemIndex( @@ -354,6 +373,42 @@ // // ----------------------------------------------------------------------------- // +void CMmListBox::ProcessScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ) + { + CEikFormattedCellListBoxTypedef::HandleScrollEventL( + aScrollBar, aEventType ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::HandleRedrawTimerEvent() + { + if ( iSkippedScrollbarEventsCount ) + { + ProcessScrollEventL( ScrollBarFrame()->VerticalScrollBar(), + EEikScrollThumbDragVert ); + } + iSkippedScrollbarEventsCount = 0; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBox::RedrawTimerCallback( TAny* aPtr ) + { + CMmListBox* self = static_cast( aPtr ); + self->HandleRedrawTimerEvent(); + return 0; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// TKeyResponse CMmListBox::OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType ) { @@ -887,4 +942,41 @@ iDisableChildComponentDrawing = aDisable; } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMmListBox::HandleScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ) + { + if ( aEventType == EEikScrollThumbDragVert && !iScrollbarThumbIsBeingDragged ) + { + iScrollbarThumbIsBeingDragged = ETrue; + static_cast( + View()->ItemDrawer() )->EnableCachedDataUse( ETrue ); + iRedrawTimer->Start( KScrollingRedrawInterval, KScrollingRedrawInterval, + TCallBack( &CMmListBox::RedrawTimerCallback, static_cast( this ) ) ); + } + else if ( aEventType == EEikScrollThumbReleaseVert ) + { + iScrollbarThumbIsBeingDragged = EFalse; + static_cast( + View()->ItemDrawer() )->EnableCachedDataUse( EFalse ); + // The view will be redrawn with cache disabled when ProcessScrollEventL + // calls the base class's HandleScrollEventL method -- no need to + // explicitly redraw the view. + iRedrawTimer->Cancel(); + } + + if ( !iScrollbarThumbIsBeingDragged ) + { + ProcessScrollEventL( aScrollBar, aEventType ); + } + else + { + __ASSERT_DEBUG( aEventType == EEikScrollThumbDragVert, User::Invariant() ); + ++iSkippedScrollbarEventsCount; + } + } + // End of file diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmlistboxcontainer.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistboxcontainer.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxcontainer.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_64 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_65 % << Don't touch! Updated by Synergy at check-out. * */ @@ -35,7 +35,7 @@ #include "mmtemplatelibrary.h" #include "mmpostevaluationprocessor.h" #include "mmdraweranimator.h" -#include "mmhighlighttimer.h" + // ============================ MEMBER FUNCTIONS =============================== diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -73,6 +73,8 @@ iRedrawBackground = ETrue; iZoomIconIndex = -1; iIconAnimationZoomRatio = 1; + // this is needed to get iColors initialized on first use: + iLastDrawnItemWasFloating = ETrue; SetFlags( CListItemDrawer::EDisableHighlight ); } @@ -86,8 +88,6 @@ delete iItemsDataCache; delete iAnimator; delete iSubcellText; - delete ColumnData()->IconArray(); - ColumnData()->SetIconArray( NULL ); } // ----------------------------------------------------------------------------- @@ -96,8 +96,11 @@ // void CMmListBoxItemDrawer::EnableCachedDataUse( TBool aEnable ) { - __ASSERT_DEBUG( !( aEnable && IsEditMode() ), User::Invariant() ); iUseCache = aEnable; + if ( aEnable ) + { + RemoveFloatingItems(); + } } // ----------------------------------------------------------------------------- @@ -351,6 +354,9 @@ { if ( !Widget()->View()->RedrawDisabled() ) { + TBool highlightVisible = + !( Flags() & CListItemDrawer::ESingleClickDisabledHighlight ); + aItemIsCurrent = aItemIsCurrent && highlightVisible; DoDrawItem( aItemIndex, aItemRectPos, aItemIsSelected, aItemIsCurrent, aViewIsEmphasized, aViewIsDimmed); } @@ -444,19 +450,20 @@ SetupSubCellsL( aItemIsCurrent, aItemIndex ); } __ASSERT_DEBUG( cache->IsValid(), User::Invariant() ); - CArrayPtr* oldIconList = FormattedCellData()->IconArray(); + FormattedCellData()->SetIconArray( cache->GetIconListL() ); - delete oldIconList; - oldIconList = NULL; - - TBool highlightShown = ETrue; - CFormattedCellListBoxData::TColors colors; - - colors = SetupColors( IsFloating( aItemIndex ) ); + TBool isFloating = !iUseCache && IsFloating( aItemIndex ); + if ( !!isFloating != !!iLastDrawnItemWasFloating ) // Ex-OR + { + iLastDrawnItemWasFloating = isFloating; + iColors = SetupColors( isFloating ); + } CFormattedCellListBoxData* data = static_cast(iData); data->EnableMarqueeL( EFalse ); + + TBool highlightShown = ETrue; if (FormattedCellData()->RespectFocus() && !aViewIsEmphasized) { #ifdef RD_UI_TRANSITION_EFFECTS_LIST @@ -468,9 +475,9 @@ #endif highlightShown = EFalse; } - + data->Draw( Properties(aItemIndex), *iGc, &( cache->GetItemText() ), aItemTextRect, - GetHighlightVisibility( aItemIndex, aItemIsCurrent, highlightShown ), colors ); + GetHighlightVisibility( aItemIndex, aItemIsCurrent, highlightShown ), iColors ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); @@ -493,7 +500,6 @@ } #endif - delete ColumnData()->IconArray(); ColumnData()->SetIconArray( NULL ); } @@ -624,7 +630,7 @@ { if (iMarqueeAdapter && IsTextClippedL( aSubCellTemplate, *iSubcellText ) - && STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsTimerActive() ) + && STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsHighlightVisible() ) { data->SetSubCellSizeL( aIndex, TSize(0,0)); const_cast(this)->AddSubcellMarqueeElementL( @@ -751,6 +757,7 @@ void CMmListBoxItemDrawer::AddFloatingItemL( TMmFloatingItem& aFloatingItem, TInt aPosition ) { + EnableCachedDataUse( EFalse ); if (aPosition != KErrNotFound) { iFloatingItems.InsertL( aFloatingItem, aPosition ); @@ -1202,13 +1209,9 @@ } else { - // Even when there is no graphics in the model, it is - // necessary to set up an empty subcell in place of - // what would normally be an icon (graphics) subcell. - // This ensures that TMmSubcellsSetupCode will work - // properly. - SetupSubNoCellL( aSubcellIncrement, aItemIndex ); - aSubcellIncrement++; + // Mark the fact that subcell was not set to ensure that TMmSubcellsSetupCode + // works properly. + iLastSubcellsSetupCode.AddSubcellInfo( TMmSubcellsSetupCode::ESkippedSubcell ); } } @@ -1336,7 +1339,7 @@ TInt aItemIndex ) const { CMmCacheForItem* cache = iItemsDataCache->GetItemCacheL( aItemIndex ); - cache->SetValid( EFalse ); + cache->SetValidL( EFalse ); const TDesC8& mmTemplate = iMmModel->GetAttributeAsText( aItemIndex, KMmTemplate8 ); if ( !mmTemplate.Compare( KNullDesC8 ) || !mmTemplate.Compare( KEmpty8 ) ) @@ -1397,8 +1400,12 @@ SetupIconSubcellL( templateChildArray, i, aItemIndex, itemText, subcellIncrement ); } } + TInt subcellsJustSet = subcellIncrement; + iCurrentNumberOfSubcellsSet = Max( iCurrentNumberOfSubcellsSet, subcellsJustSet ); + __ASSERT_DEBUG( iCurrentNumberOfSubcellsSet <= MmTemplateContants::KSubCellsCount, + User::Invariant() ); - for ( TInt i = subcellIncrement; i < MmTemplateContants::KSubCellsCount; i++ ) + for ( TInt i = subcellIncrement; i < iCurrentNumberOfSubcellsSet; i++ ) { SetupSubNoCellL( i, aItemIndex ); } @@ -1412,7 +1419,7 @@ cache->SetSubcellsSetupCode( iLastSubcellsSetupCode ); // the line below is here only to make the cached information complete GetItemSize( aItemIndex, aItemIsCurrent ); - cache->SetValid( ETrue ); + cache->SetValidL( ETrue ); } // ----------------------------------------------------------------------------- @@ -1491,7 +1498,7 @@ ItemHasFloatingType( aItemIndex, EDrag ) || ItemHasFloatingType( aItemIndex, EDragTransition ); - if ( ( STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsTimerActive() + if ( ( STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsHighlightVisible() && aItemIsCurrent && aAllowHighlightForNonDraggedItem ) || currentlyDraggedItem ) { @@ -1516,7 +1523,7 @@ && !currentlyDraggedItem /* backdrop is disabled for dragged items */ && !iIsIndicatorItem /* in non-touch backdrop is not drawn, just "move indicators" */ && !iLeftOverAreaUnderAnimatedItem /* is the currently drawn item the area left over behind dragged item*/ - && !( STATIC_CAST( CMmWidgetContainer*,Widget()->Parent() )->IsTimerActive() + && !( STATIC_CAST( CMmWidgetContainer*,Widget()->Parent() )->IsHighlightVisible() && aItemIsCurrent );/*if the timer is active then we want to draw highlight (not backdrop) on the current index*/ } diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmlistboxmodel.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistboxmodel.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxmodel.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -25,6 +25,7 @@ #include "hnitemmodel.h" #include "hnattributebase.h" #include "hnattributeimage.h" +#include "hnmenuitemmodel.h" // ----------------------------------------------------------------------------- // @@ -195,4 +196,29 @@ } } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMmListBoxModel::GetNumberOfSpecificMenuItemsL( TInt aItemIndex ) + { + TInt itemSpecificMenuItemCount = KErrNotFound; + if ( iSuiteModel ) + { + TInt itemId = iSuiteModel->IdByIndex( aItemIndex ); + if ( itemId != KErrNotFound ) + { + itemSpecificMenuItemCount = 0; + MHnMenuItemModelIterator* menuItemModelIter = + iSuiteModel->GetMenuStructureL( itemId ); + while ( menuItemModelIter && menuItemModelIter->HasNextSpecific() ) + { + menuItemModelIter->GetNextSpecific(); + ++itemSpecificMenuItemCount; + } + } + } + return itemSpecificMenuItemCount; + } + // End of file diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmlistboxview.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistboxview.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxview.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: - * Version : %version: MM_49 % << Don't touch! Updated by Synergy at check-out. + * Version : %version: MM_50 % << Don't touch! Updated by Synergy at check-out. * */ @@ -596,10 +596,13 @@ // void CMmListBoxView::DrawSingleItem (TInt aItemIndex) const { - CMmListBoxItemDrawer* itemDrawer= STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer ); - TSize size = itemDrawer->GetItemSize( aItemIndex, CurrentItemIndex () - == aItemIndex); - itemDrawer->SetItemCellSize (size); + CMmListBoxItemDrawer* itemDrawer = + STATIC_CAST( CMmListBoxItemDrawer*, iItemDrawer ); + TBool highlightVisible = !( itemDrawer->Flags() + & CListItemDrawer::ESingleClickDisabledHighlight ); + TSize size = itemDrawer->GetItemSize( aItemIndex, highlightVisible && + CurrentItemIndex() == aItemIndex ); + itemDrawer->SetItemCellSize( size ); // CMmListBoxView* view= CONST_CAST( CMmListBoxView*, this ); // view->SetItemHeight( size.iHeight ); diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmpostevaluationprocessor.cpp --- a/menufw/menufwui/mmwidgets/src/mmpostevaluationprocessor.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmpostevaluationprocessor.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -91,8 +91,6 @@ if ( mm_template.Compare( KNullDesC8 ) && mm_template.Compare( KEmpty8 ) ) { iDrawer.SetupSubCellsL( EFalse, iIndexToProcess ); - delete iDrawer.ColumnData()->IconArray(); - iDrawer.ColumnData()->SetIconArray( NULL ); } if ( ++iIndexToProcess < iDrawer.iMmModel->NumberOfItems() ) diff -r fb3763350a08 -r 4d54b72983ae menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp --- a/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_71.1.17.1.47 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_71.1.17.1.49 % << Don't touch! Updated by Synergy at check-out. * */ @@ -33,7 +33,6 @@ #include "mmlistboxmodel.h" #include "mmmarqueeadapter.h" #include "mmwidgetobserver.h" -#include "mmhighlighttimer.h" #include "mmvisibilityobserver.h" #include "mmlistboxcontainer.h" #include "mmgridcontainer.h" @@ -91,10 +90,6 @@ // void CMmWidgetContainer::ConstructL() { - if ( AknLayoutUtils::PenEnabled() ) - { - iTimer = CMmHighlightTimer::NewL( this ); - } iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMainAppsGrid, Rect(), EFalse); iLongTapDetector = CAknLongTapDetector::NewL( this ); @@ -124,7 +119,6 @@ { AknsUtils::DeregisterControlPosition( this ); AknsUtils::DeregisterControlPosition( this->iWidget ); - delete iTimer; delete iBgContext; delete iPostProcessor; delete iLongTapDetector; @@ -441,8 +435,7 @@ } if ( !aHasFocus ) { - ASSERT(iTimer); - iTimer->StopL(); + SetHighlightVisibilityL( EFalse ); } } @@ -463,6 +456,15 @@ // // ----------------------------------------------------------------------------- // +TBool CMmWidgetContainer::LongTapInProgress() const + { + return iLongTapInProgress; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// TBool CMmWidgetContainer::IsDeleteLockedL( TInt aItemIndex ) { TBool result = ETrue; @@ -610,6 +612,21 @@ TInt index = KErrNotFound; TBool itemExists = iWidget->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ); + + if ( iLongTapDetector ) + { + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + iLongTapDetector->EnableLongTapAnimation( itemExists && + GetMmModel()->GetNumberOfSpecificMenuItemsL( index ) > 0 ); + } + TPointerEvent longTapPointerEvent = aPointerEvent; + if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat ) + { + longTapPointerEvent.iType = TPointerEvent::EDrag; + } + iLongTapDetector->PointerEventL( longTapPointerEvent ); + } CCoeControl::HandlePointerEventL(aPointerEvent); @@ -627,7 +644,7 @@ { if ( GetHighlight() != index ) { - iTimer->StopL(); + SetHighlightVisibilityL( EFalse ); if ( IsEditMode() ) { SetHighlightL( index ); @@ -636,7 +653,7 @@ } else { - iTimer->StopL(); + SetHighlightVisibilityL( EFalse ); } } @@ -653,21 +670,6 @@ { HandlePointerEventsInEditModeL(aPointerEvent, abortAnimation); } - - if ( iLongTapDetector ) - { - if ( !itemExists ) - { - iLongTapDetector->EnableLongTapAnimation( EFalse ); - } - TPointerEvent longTapPointerEvent = aPointerEvent; - if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat ) - { - longTapPointerEvent.iType = TPointerEvent::EDrag; - } - iLongTapDetector->PointerEventL( longTapPointerEvent ); - } - } // ----------------------------------------------------------------------------- @@ -743,7 +745,7 @@ if ( !aEnable ) { iWidget->View()->ItemDrawer()->SetFlags( - CListItemDrawer::EDisableHighlight ); + CListItemDrawer::ESingleClickDisabledHighlight ); #ifdef RD_UI_TRANSITION_EFFECTS_LIST if ( transApi ) { @@ -754,17 +756,26 @@ else { iWidget->View()->ItemDrawer()->ClearFlags( - CListItemDrawer::EDisableHighlight ); + CListItemDrawer::ESingleClickDisabledHighlight ); } - } + + if ( IsVisible() ) + { + TInt highlight = GetHighlight(); + CListBoxView* view = Widget()->View(); + Widget()->DrawNow( TRect( view->ItemPos( highlight ), + view->ItemSize( highlight ) ) ); + } + } // ----------------------------------------------------------------------------- // -// ----------------------------------------------- ------------------------------ +// ---------------------------------------------------------------------------- // EXPORT_C TBool CMmWidgetContainer::IsHighlightVisible() { - return IsTimerActive(); + return !( iWidget->View()->ItemDrawer()->Flags() & + CListItemDrawer::ESingleClickDisabledHighlight ); } // ----------------------------------------------------------------------------- @@ -1014,11 +1025,7 @@ if ( resp == EKeyWasNotConsumed ) { -// here is a workaround for avkon to enable cursor movement we need to set highlight visibility -// to ETrue so that single click implementation in avkon will change the current item index. - SetHighlightVisibilityL(ETrue); //workaround resp = iWidget->OfferKeyEventL( aKeyEvent, aType ); - SetHighlightVisibilityL(EFalse);//workaround } if ( iKeyEventObserver ) @@ -1040,79 +1047,12 @@ SetHighlightVisibilityL( ETrue ); SetDefaultHighlightL( ETrue ); - if ( iTimer ) - { - iTimer->StartL( KDelayInSeconds6, EFalse ); - HandleForegroundGainedL(); - } + HandleForegroundGainedL(); } } return resp; } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -//TBool CMmWidgetContainer::HighlightWouldLoop( const TKeyEvent& aKeyEvent, -// const TEventCode& aType ) -// { -// TInt viewColCount ( ColumnsInCurrentView() ); -// -// if ( viewColCount == 0 ) -// return ETrue; -// -// // this allows to finish drag'n'drop operation -// if ( iDraggedIndex != KErrNotFound && aType == EEventKeyUp ) -// return EFalse; -// -// TBool wouldLoop = EFalse; -// TInt highlightIndex = GetHighlight(); -// -// TInt highlightRow = highlightIndex / viewColCount; -// TInt lastRowWithItems = ( NumberOfItems() - 1 ) / viewColCount; -// TInt highlightCol = highlightIndex % viewColCount; -// TInt lastItemCol = ( NumberOfItems() - 1 ) % viewColCount; -// -// TInt keyScanCode = aKeyEvent.iScanCode; -// -// if ( AknLayoutUtils::LayoutMirrored() ) -// { -// if ( keyScanCode == EStdKeyLeftArrow ) -// keyScanCode = EStdKeyRightArrow; -// else if ( keyScanCode == EStdKeyRightArrow ) -// keyScanCode = EStdKeyLeftArrow; -// } -// -// if ( keyScanCode == EStdKeyRightArrow ) -// { -// if ( highlightIndex == NumberOfItems() - 1 ) -// wouldLoop = ETrue; -// else if ( highlightCol == viewColCount - 1 ) -// wouldLoop = ETrue; -// } -// else if ( keyScanCode == EStdKeyLeftArrow ) -// { -// if ( highlightCol == 0 ) -// wouldLoop = ETrue; -// } -// else if ( keyScanCode == EStdKeyUpArrow ) -// { -// if ( highlightRow == 0 ) -// wouldLoop = ETrue; -// } -// else if ( keyScanCode == EStdKeyDownArrow ) -// { -// if ( highlightRow == lastRowWithItems ) -// wouldLoop = ETrue; -// else if ( highlightRow == lastRowWithItems - 1 && highlightCol > lastItemCol) -// wouldLoop = ETrue; -// } -// -// return wouldLoop; -// } - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -1172,19 +1112,18 @@ // handle arrow: draw highlight when arrow used if ( arrowHasHandling ) { - if ( !iTimer->IsActive() ) + if ( !IsHighlightVisible() ) { if ( aType == EEventKey || aType == EEventKeyUp ) { - // if no highlight and key released - show highlight - SetDefaultHighlightL( EFalse ); + SetHighlightVisibilityL( ETrue ); + SetDefaultHighlightL( ETrue ); } - // ignore all navigation events when highlight not visible + // override avkon's default highlight setting resp = EKeyWasConsumed; } else { - // this block is used to set the highlight only once for each event if ( aKeyEvent.iRepeats > 0 ) { @@ -1203,13 +1142,6 @@ } } } - - // run timer in order to hide the highlight - if ( aType == EEventKey && iTimer) - { - iTimer->StartL( KDelayInSeconds6, EFalse ); - HandleForegroundGainedL(); - } } else if( arrowKeyPressed ) { @@ -1649,20 +1581,22 @@ // void CMmWidgetContainer::MakeVisible(TBool aVisible) { - if (!aVisible) + if ( !aVisible ) { - ASSERT(iTimer); - TRAP_IGNORE( iTimer->StopL( EFalse ) ); RestoreWidgetPosition(); CacheWidgetPosition(); iDrawer->RemoveFloatingItems(); } - else if (aVisible) + else if ( aVisible ) { RestoreWidgetPosition(); } CCoeControl::MakeVisible(aVisible); iWidget->MakeVisible(aVisible); + if ( !aVisible ) + { + SetHighlightVisibilityL( EFalse ); + } } // --------------------------------------------------------------------------- @@ -1710,8 +1644,7 @@ // void CMmWidgetContainer::HandleNumberOfItemsChangedL( TItemsChangeType aChange ) { - ASSERT(iTimer); - iTimer->StopL(); + SetHighlightVisibilityL( EFalse ); if ( aChange == EItemsAdded ) { HandleItemAdditionL(); @@ -1894,29 +1827,13 @@ // // ----------------------------------------------------------------------------- // -TBool CMmWidgetContainer::IsTimerActive( TInt aItemIndex ) - { - ASSERT(iTimer); - TBool timerActive = iTimer->IsActive(); - if ( aItemIndex >= 0 && timerActive ) - { - timerActive = ( aItemIndex == iTimer->TimerHighlightIndex() ); - } - return timerActive; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// void CMmWidgetContainer::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ) { TInt index( KErrNotFound ); if ( iWidget->View()->XYPosToItemIndex( aPenEventLocation, index ) ) { - ASSERT( iTimer ); - iTimer->ContinueL( KDelayInfinite ); + SetHighlightVisibilityL( ETrue ); iLongTapInProgress = ETrue; if ( iLongTapObserver ) { @@ -1945,8 +1862,7 @@ iLongTapInProgress = EFalse; if( aStopTimer ) { - ASSERT( iTimer ); - iTimer->StopL(); + SetHighlightVisibilityL( EFalse ); } } } @@ -1958,7 +1874,6 @@ void CMmWidgetContainer::HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ) { - ASSERT( iTimer ); // handle same behaviour in edit mode and normal mode switch ( aEventType ) { @@ -1967,7 +1882,7 @@ iDragOccured = EFalse; if ( !iLongTapInProgress ) { - iTimer->StartL( KDelayInfinite ); + SetHighlightVisibilityL( ETrue ); } break; } @@ -1976,14 +1891,14 @@ if ( !iDragOccured && !iLongTapInProgress ) { SetHighlightL( Widget()->CurrentItemIndex() ); - iTimer->StopL( ETrue ); + SetHighlightVisibilityL( EFalse ); } iDragOccured = EFalse; break; } case MEikListBoxObserver::EEventItemDraggingActioned: { - iTimer->StopL(); + SetHighlightVisibilityL( EFalse ); iDragOccured = ETrue; break; } @@ -1992,7 +1907,7 @@ case MEikListBoxObserver::EEventFlickStarted: case MEikListBoxObserver::EEventFlickStopped: { - iTimer->StopL( EFalse ); + SetHighlightVisibilityL( EFalse ); break; } } @@ -2040,17 +1955,4 @@ } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C void CMmWidgetContainer::HandleOptionsMenuVisibilityChangeL( - TBool aOptionsMenuVisible ) - { - if ( IsTimerActive() ) - { - TInt delay = (aOptionsMenuVisible) ? KDelayInfinite : KDelayInSeconds6; - iTimer->StartL( delay, EFalse ); - } - } //End of file diff -r fb3763350a08 -r 4d54b72983ae menufw/menusuites/data/mmenuschema.xsd --- a/menufw/menusuites/data/mmenuschema.xsd Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menusuites/data/mmenuschema.xsd Tue Jan 26 11:48:23 2010 +0200 @@ -1,4 +1,4 @@ - + @@ -320,6 +320,11 @@ This tag is the same as menuitem but describes menu items displayed only which have specific relation to the item + + + This tag is the same as menuitem but describes action commands - such functions that happen via touch-down and release on the item (e.g. Open) + + This element describes the layout of toolbar, for the highlighted item. diff -r fb3763350a08 -r 4d54b72983ae menufw/menusuites/foldersuite/data/items_touch.xml --- a/menufw/menusuites/foldersuite/data/items_touch.xml Fri Jan 22 09:35:14 2010 +0200 +++ b/menufw/menusuites/foldersuite/data/items_touch.xml Tue Jan 26 11:48:23 2010 +0200 @@ -72,7 +72,7 @@ - + @@ -129,6 +129,7 @@ + @@ -260,6 +261,7 @@ + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/group/bld.inf --- a/taskswitcher/contextengine/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ b/taskswitcher/contextengine/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -1,19 +1,18 @@ /* -* ============================================================================ -* Name : bld.inf -* Part of : Huriganes / Context Services -* Description : Build info file for Context Services. -* Version : %version: sa1spcx1#55 % +* 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". * -* 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. -* ============================================================================ +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build info file for Context Services. +* */ #include @@ -21,14 +20,12 @@ PRJ_EXPORTS // stub sis files -../sis/stubs/hgctxsrv_stub.sis /epoc32/release/winscw/udeb/z/system/install/hgctxsrv_stub.sis +../sis/stubs/tsctxsrv_stub.sis /epoc32/release/winscw/udeb/z/system/install/tsctxsrv_stub.sis // iby files -../rom/hgcontextservices.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hgcontextservices.iby) - - +../rom/tscontextservices.iby CORE_MW_LAYER_IBY_EXPORT_PATH(tscontextservices.iby) -#include "../hgfswpreviewprovider/group/bld.inf" -#include "../hgfswserver/group/bld.inf" +#include "../tsfswpreviewprovider/group/bld.inf" +#include "../tsfswserver/group/bld.inf" -#include "../hgctxutils/group/bld.inf" +#include "../tsctxutils/group/bld.inf" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgctxutils/BWINS/hgcontextservicesutilsu.def --- a/taskswitcher/contextengine/hgctxutils/BWINS/hgcontextservicesutilsu.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgctxutils/EABI/hgcontextservicesutilsu.def --- a/taskswitcher/contextengine/hgctxutils/EABI/hgcontextservicesutilsu.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgctxutils/group/bld.inf --- a/taskswitcher/contextengine/hgctxutils/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* ============================================================================ -* 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 - -PRJ_EXPORTS -../inc/hgproplistener.h |../../inc/hgproplistener.h -../inc/hgcenreplistener.h |../../inc/hgcenreplistener.h - -PRJ_MMPFILES -hgcontextservicesutils.mmp - -PRJ_TESTMMPFILES - diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgctxutils/group/hgcontextservicesutils.mmp --- a/taskswitcher/contextengine/hgctxutils/group/hgcontextservicesutils.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* =========================================================================== -* 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 -#include - - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgctxutils/inc/hgcenreplistener.h --- a/taskswitcher/contextengine/hgctxutils/inc/hgcenreplistener.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* =========================================================================== -* 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgctxutils/inc/hgproplistener.h --- a/taskswitcher/contextengine/hgctxutils/inc/hgproplistener.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* =========================================================================== -* 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 -#include - -/** - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgctxutils/src/hgcenreplistener.cpp --- a/taskswitcher/contextengine/hgctxutils/src/hgcenreplistener.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* =========================================================================== -* 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 -#include -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgctxutils/src/hgproplistener.cpp --- a/taskswitcher/contextengine/hgctxutils/src/hgproplistener.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* =========================================================================== -* 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 - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/bwins/hgpreviewprovideru.def --- a/taskswitcher/contextengine/hgfswpreviewprovider/bwins/hgpreviewprovideru.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/eabi/hgpreviewprovideru.def --- a/taskswitcher/contextengine/hgfswpreviewprovider/eabi/hgpreviewprovideru.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/group/bld.inf --- a/taskswitcher/contextengine/hgfswpreviewprovider/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* ============================================================================== -* 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/group/previewprovider.mmp --- a/taskswitcher/contextengine/hgfswpreviewprovider/group/previewprovider.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* ============================================================================== -* 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 -#include - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/inc/hgfastswappreviewproviderlogging.h --- a/taskswitcher/contextengine/hgfswpreviewprovider/inc/hgfastswappreviewproviderlogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewobserver.h --- a/taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewobserver.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* ============================================================================== -* 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 - -/** - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewprovider.h --- a/taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewprovider.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* ============================================================================== -* 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 -#include - -// 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/inc/previewmsg.h --- a/taskswitcher/contextengine/hgfswpreviewprovider/inc/previewmsg.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* ============================================================================== -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/inc/previewproviderlogging.h --- a/taskswitcher/contextengine/hgfswpreviewprovider/inc/previewproviderlogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* ============================================================================ -* 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 -#include "hglogging.h" - -#endif // PREVIEWPROVIDERLOGGING_H - -// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/rom/hgfastswappreviewprovider.iby --- a/taskswitcher/contextengine/hgfswpreviewprovider/rom/hgfastswappreviewprovider.iby Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* ============================================================================== -* 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 - -// 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/src/previewprovider.cpp --- a/taskswitcher/contextengine/hgfswpreviewprovider/src/previewprovider.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,586 +0,0 @@ -/* -* ============================================================================== -* 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 -#include -#include - -#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( 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 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 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 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(aMode) - }; - TPckgC buf(msg); - SendMessage(buf); - Flush(); - - HGLOG_OUT(); - } - -// -------------------------------------------------------------------------- -// CHgFastSwapPreviewProviderClient::TakePreview -// -------------------------------------------------------------------------- -// -void CHgFastSwapPreviewProviderClient::TakePreview() - { - HGLOG_CONTEXT( TakePreview, HGLOG_LOCAL ); - HGLOG_IN(); - - TPckgC 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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/group/bld.inf --- a/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* ============================================================================== -* 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 - -PRJ_PLATFORMS -DEFAULT - -PRJ_MMPFILES -previewprovidercrp.mmp diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/group/previewprovidercrp.mmp --- a/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/group/previewprovidercrp.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* ============================================================================== -* 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 -#include - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/inc/previewprovidercrp.h --- a/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/inc/previewprovidercrp.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -/* -* ============================================================================== -* 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 -#include -#include - -// 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 iScreenshots; - TSize iScreenshotSize; - TDisplayMode iScreenshotMode; - RArray iWgIds; - }; - -#endif // PREVIEWPROVIDERCRP_H - -// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/inc/previewprovidercrplogging.h --- a/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/inc/previewprovidercrplogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* ============================================================================ -* 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 -#include "hglogging.h" - -#endif // PREVIEWPROVIDERCRPLOGGING_H - -// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/src/20016BEC.rss --- a/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/src/20016BEC.rss Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* ============================================================================== -* 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp --- a/taskswitcher/contextengine/hgfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,437 +0,0 @@ -/* -* ============================================================================== -* 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 -#ifdef SYMBIAN_BUILD_GCE -#define NGA -#endif - -#include "previewprovidercrp.h" -#include "previewmsg.h" -#include "previewprovidercrplogging.h" -#include -#include //RDesReadStream - -#ifdef NGA -#include -#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( 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 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 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(); - - const TSize sz = screenConfig->ScreenModeSizeInPixels(); - - // Get the screen buffer (containing screenshot data) - MWsFrontBuffer* screenFront = - Env().Screen( iScreen )->ObjectInterface(); - - // 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( - 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 ( 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/bwins/hgfswclientu.def --- a/taskswitcher/contextengine/hgfswserver/client/bwins/hgfswclientu.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -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 &) - ?CloseApp@CHgFswClient@@QAEXH@Z @ 8 NONAME ; void CHgFswClient::CloseApp(int) - diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/eabi/hgfswclientu.def --- a/taskswitcher/contextengine/hgfswserver/client/eabi/hgfswclientu.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/group/bld.inf --- a/taskswitcher/contextengine/hgfswserver/client/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* - * =========================================================================== - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/group/hgfswclient.mmp --- a/taskswitcher/contextengine/hgfswserver/client/group/hgfswclient.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* - * =========================================================================== - * 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/inc/clientlogging.h --- a/taskswitcher/contextengine/hgfswserver/client/inc/clientlogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/inc/hgfswclient.h --- a/taskswitcher/contextengine/hgfswserver/client/inc/hgfswclient.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* - * =========================================================================== - * 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 -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/inc/hgfswclientimpl.h --- a/taskswitcher/contextengine/hgfswserver/client/inc/hgfswclientimpl.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* - * =========================================================================== - * 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 -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/inc/hgfswclientobserver.h --- a/taskswitcher/contextengine/hgfswserver/client/inc/hgfswclientobserver.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * =========================================================================== - * 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 - -/** - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/src/hgfswclient.cpp --- a/taskswitcher/contextengine/hgfswserver/client/src/hgfswclient.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* - * =========================================================================== - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/client/src/hgfswclientimpl.cpp --- a/taskswitcher/contextengine/hgfswserver/client/src/hgfswclientimpl.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,232 +0,0 @@ -/* - * =========================================================================== - * 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 - -#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 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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/bwins/hgfswengineu.def --- a/taskswitcher/contextengine/hgfswserver/engine/bwins/hgfswengineu.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -EXPORTS - ?FswDataL@CHgFswEngine@@QAEABV?$RPointerArray@VCHgFswEntry@@@@XZ @ 1 NONAME ; class RPointerArray 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/eabi/hgfswengineu.def --- a/taskswitcher/contextengine/hgfswserver/engine/eabi/hgfswengineu.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -EXPORTS - _ZN12CHgFswEngine12SwitchToAppLEi @ 1 NONAME - _ZN12CHgFswEngine17ForegroundAppUidLEi @ 2 NONAME - _ZN12CHgFswEngine4NewLER20MHgFswEngineObserver @ 3 NONAME - _ZN12CHgFswEngine5NewLCER20MHgFswEngineObserver @ 4 NONAME - _ZN12CHgFswEngine8FswDataLEv @ 5 NONAME - _ZN12CHgFswEngine9CloseAppLEi @ 6 NONAME - diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/group/bld.inf --- a/taskswitcher/contextengine/hgfswserver/engine/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* - * =========================================================================== - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/group/hgfswengine.mmp --- a/taskswitcher/contextengine/hgfswserver/engine/group/hgfswengine.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* - * =========================================================================== - * 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/inc/enginelogging.h --- a/taskswitcher/contextengine/hgfswserver/engine/inc/enginelogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/inc/hgfsalwaysshownapplist.h --- a/taskswitcher/contextengine/hgfswserver/engine/inc/hgfsalwaysshownapplist.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -/** - * 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& AppList() { return iAppList; } - -private: - void ConstructL(); - RArray iAppList; - RApaLsSession iAppArcSession; - }; - -#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/inc/hgfshiddenapplist.h --- a/taskswitcher/contextengine/hgfswserver/engine/inc/hgfshiddenapplist.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* ============================================================================ -* 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 // For CActive, link against: euser.lib -#include // For RTimer, link against: euser.lib -#include // 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* iHiddenAppList; - - /** - * hidden apps list observer - */ - MHgFsHiddenAppListObserver& iObserver; - }; - -#endif /*HGFSHIDDENAPPLIST_H_*/ diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/inc/hgfswengine.h --- a/taskswitcher/contextengine/hgfswserver/engine/inc/hgfswengine.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,329 +0,0 @@ -/* - * =========================================================================== - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#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 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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/inc/hgfswiconcache.h --- a/taskswitcher/contextengine/hgfswserver/engine/inc/hgfswiconcache.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* ============================================================================ -* 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 -#include - -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 iAppIcons; - - CGulIcon* iDefaultIcon; - }; - -#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/inc/hgfswidgetlist.h --- a/taskswitcher/contextengine/hgfswserver/engine/inc/hgfswidgetlist.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/inc/hgfswobservers.h --- a/taskswitcher/contextengine/hgfswserver/engine/inc/hgfswobservers.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* - * =========================================================================== - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/src/hgfsalwaysshownapplist.cpp --- a/taskswitcher/contextengine/hgfswserver/engine/src/hgfsalwaysshownapplist.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* - * ============================================================================ - * 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 -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/src/hgfshiddenapplist.cpp --- a/taskswitcher/contextengine/hgfswserver/engine/src/hgfshiddenapplist.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* ============================================================================ -* 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 - -#include - -// 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( 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/src/hgfswengine.cpp --- a/taskswitcher/contextengine/hgfswserver/engine/src/hgfswengine.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1062 +0,0 @@ -/* - * =========================================================================== - * 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 -#include -#include -#include // for CleanupResetAndDestroyPushL -#include -#include - -#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 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( *eventData ) = KWidgetAppUidValue; - eventData += sizeof( TUint32 ); - // Fill bits 32-63 with uid of the widget that should be closed. - reinterpret_cast( *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 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( 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 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 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 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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/src/hgfswiconcache.cpp --- a/taskswitcher/contextengine/hgfswserver/engine/src/hgfswiconcache.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* - * ============================================================================ - * 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 -#include -#include -#include - -// 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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/engine/src/hgfswidgetlist.cpp --- a/taskswitcher/contextengine/hgfswserver/engine/src/hgfswidgetlist.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* - * ============================================================================ - * 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 - -// -------------------------------------------------------------------------- -// 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( 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/group/bld.inf --- a/taskswitcher/contextengine/hgfswserver/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * =========================================================================== - * 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/inc/hgfswcommon.h --- a/taskswitcher/contextengine/hgfswserver/inc/hgfswcommon.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * =========================================================================== - * 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 - -_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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/rom/hgfswserver.iby --- a/taskswitcher/contextengine/hgfswserver/rom/hgfswserver.iby Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/group/bld.inf --- a/taskswitcher/contextengine/hgfswserver/server/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* - * =========================================================================== - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/group/hgfswserver.mmp --- a/taskswitcher/contextengine/hgfswserver/server/group/hgfswserver.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* - * =========================================================================== - * 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/inc/hgfswappui.h --- a/taskswitcher/contextengine/hgfswserver/server/inc/hgfswappui.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * =========================================================================== - * 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/inc/hgfswserver.h --- a/taskswitcher/contextengine/hgfswserver/server/inc/hgfswserver.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* - * =========================================================================== - * 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 -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/inc/hgfswsession.h --- a/taskswitcher/contextengine/hgfswserver/server/inc/hgfswsession.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* - * =========================================================================== - * 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 iSubscribeRequests; // non-completed EHgFswSubscribe messages - }; - -#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/inc/serverlogging.h --- a/taskswitcher/contextengine/hgfswserver/server/inc/serverlogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/src/hgfswappui.cpp --- a/taskswitcher/contextengine/hgfswserver/server/src/hgfswappui.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* - * =========================================================================== - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/src/hgfswserver.cpp --- a/taskswitcher/contextengine/hgfswserver/server/src/hgfswserver.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,283 +0,0 @@ -/* - * =========================================================================== - * 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 -#include -#include - -// -------------------------------------------------------------------------- -// 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 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 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( iSessionIter++ ) ) - { - if ( session->IsListening() ) - { - session->FswDataChanged(); - } - } - } - -// -------------------------------------------------------------------------- -// CHgFswServer::FswDataListenersCount -// callback from engine -// -------------------------------------------------------------------------- -// -TInt CHgFswServer::FswDataListenerCount() - { - TInt n = 0; - iSessionIter.SetToFirst(); - while ( CHgFswSession* session = static_cast( 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/server/src/hgfswsession.cpp --- a/taskswitcher/contextengine/hgfswserver/server/src/hgfswsession.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* - * =========================================================================== - * 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( - const_cast( 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/utils/bwins/hgfswutilsu.def --- a/taskswitcher/contextengine/hgfswserver/utils/bwins/hgfswutilsu.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -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 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 &) - ?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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/utils/eabi/hgfswutilsu.def --- a/taskswitcher/contextengine/hgfswserver/utils/eabi/hgfswutilsu.def Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/utils/group/bld.inf --- a/taskswitcher/contextengine/hgfswserver/utils/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* - * =========================================================================== - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/utils/group/hgfswutils.mmp --- a/taskswitcher/contextengine/hgfswserver/utils/group/hgfswutils.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* - * =========================================================================== - * 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/utils/inc/hgfswentry.h --- a/taskswitcher/contextengine/hgfswserver/utils/inc/hgfswentry.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* - * =========================================================================== - * 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 -#include - -class CHgFswEntry; -class RReadStream; -class RWriteStream; - -typedef RPointerArray 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/utils/inc/utilslogging.h --- a/taskswitcher/contextengine/hgfswserver/utils/inc/utilslogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/hgfswserver/utils/src/hgfswentry.cpp --- a/taskswitcher/contextengine/hgfswserver/utils/src/hgfswentry.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,278 +0,0 @@ -/* - * =========================================================================== - * 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 - -// -------------------------------------------------------------------------- -// 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/rom/hgcontextservices.iby --- a/taskswitcher/contextengine/rom/hgcontextservices.iby Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/rom/tscontextservices.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/rom/tscontextservices.iby Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,30 @@ +/* +* 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: Iby file for Context Services +* +*/ + +#ifndef TSCONTEXTSERVICES_IBY +#define TSCONTEXTSERVICES_IBY + +// Context Services binaries +file=ABI_DIR/BUILD_DIR/tscontextservicesutils.dll SHARED_LIB_DIR/tscontextservicesutils.dll + +// backup registration +data=DATAZ_/private/20011417/backup_registration.xml private/20011417/backup_registration.xml + +// stub sis +data=ZSYSTEM/install/tsctxsrv_stub.sis system/install/tsctxsrv_stub.sis + +#endif // TSCONTEXTSERVICES diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/sis/stubs/createstubs.bat --- a/taskswitcher/contextengine/sis/stubs/createstubs.bat Fri Jan 22 09:35:14 2010 +0200 +++ b/taskswitcher/contextengine/sis/stubs/createstubs.bat Tue Jan 26 11:48:23 2010 +0200 @@ -1,1 +1,17 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + for %%f in (*.pkg) do makesis -s %%f diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/sis/stubs/hgctxsrv_stub.pkg --- a/taskswitcher/contextengine/sis/stubs/hgctxsrv_stub.pkg Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -; ------------------------------------------------------------------------------ -; 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/sis/stubs/hgctxsrv_stub.sis Binary file taskswitcher/contextengine/sis/stubs/hgctxsrv_stub.sis has changed diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/sis/stubs/tsctxsrv_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/sis/stubs/tsctxsrv_stub.pkg Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,35 @@ +; +; 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: +; +; ------------------------------------------------------------------------------ +; TS Context Services stub SIS package file. +; Used to enable TS 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 +#{"tsctxutils"},(0x20019569),1,0,0,TYPE=SA + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +""-"Z:\sys\bin\tscontextservicesutils.dll" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/sis/stubs/tsctxsrv_stub.sis Binary file taskswitcher/contextengine/sis/stubs/tsctxsrv_stub.sis has changed diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/trace/hglogging.h --- a/taskswitcher/contextengine/trace/hglogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ -/* -* ============================================================================== -* 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 - * - * #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 -#include - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/trace/hglogutils.h --- a/taskswitcher/contextengine/trace/hglogutils.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ -/* -* ============================================================================== -* 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 -#include - -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: -* - _DEBUG -* - With this flag undefined, all traces are disabled -* - __KERNEL_MODE__ -* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) -* - DISABLE_SYNTAX_CHECK -* - 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 - #include - #include - #include - -// both of headers defines KLogBufferSize -#ifndef __COMMSDEBUGUTILITY_H__ - #include -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/trace/tslogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/trace/tslogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,218 @@ +/* +* 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: Defines all available logging macros. +* +*/ + + +#ifndef TSLOGLOGUTILS_H +#define TSLOGLOGUTILS_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( KTsLogFile, "text_file_for_logging.txt" ); + * _LIT( KTsLogPath, "folder_for_text_file" ); + * #define _TSLOG_LOG_COMPONENT_ID + * + * #include "tslogging.h" + * + * @/code + * + * KTsLogFile : This is the name of the file, where all the logs for + * this components are being written. + * + * KTsLogPath : This is the folder name under c:\logs, where the file + * is to be stored. For example, if KTsLogPath is "test", + * log file is created into folder c:\logs\test. + * + * _TSLOG_LOG_COMPONENT_ID : Unique number id of the component. This is + * for filtering purposes. + * + * _TSLOG_RDEBUG : When defined tracing instead of file logging. + * Default is for file logging. + * + * -------------------------------------------------------------------------- + * + * USING LOGGING: + * + * Basically the use is simple, register function use with TSLOG_CONTEXT, + * then log function enter by any TSLOG_IN -macro, then possibly use TSLOG + * -macros for function logging and finally TSLOG_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. + * TSLOG_CONTEXT( Example, TSLOG_LOCAL ); + * + * // Indicate we are entering the function. + * TSLOG_IN1( "aSomething contains value %d", aSomething ); + * + * // Your buggy code... + * + * // Before leaving, indicate function execution has ended. + * TSLOG_OUT(); + * + * return 0; + * } + * @/code + */ + +#include +#include + +#include "tslogutils.h" + +#define TSLOG_API 0 +#define TSLOG_LOCAL 1 + +#define TSLOG_INFO 0 +#define TSLOG_WARNING 1 +#define TSLOG_ERROR 2 + +#define TSLOG_ASSERT(_assertion) __TSLOG_ASSERT_DBG(_assertion) +#define TSLOG_TRACE_ASSERT(_assertion) __ASSERT_DEBUG((_assertion), User::Invariant() ) + +#ifdef _DEBUG + +/***************************************************************************** + LOGGING MACROS - LOGGING ON +*****************************************************************************/ + + /** + * Context initialization + * NOTE: TSLOG_STATIC_CONTEXT is meant for static methods. + * + * @param _fn Name of the function. + * @param _vis Visibility for the client, use values TSLOG_API or TSLOG_LOCAL + * @param _thdId For static functions, thread id can be given here. + */ + #define TSLOG_CONTEXT(_fn, _vis ) _TTsLogContext _dc((TText*)L ## #_fn, _TSLOG_LOG_COMPONENT_ID, _vis, (TUint)this, RProcess().SecureId().iId ) + #define TSLOG_STATIC_CONTEXT(_fn, _vis, _thdId) _TTsLogContext _dc((TText*)L ## #_fn, _TSLOG_LOG_COMPONENT_ID, _vis, _thdId, RProcess().SecureId().iId ) + + /** + * Entering function + * + * @param string Custom text. Example: TSLOG_IN0( "Yeah!!!" ); + * @param p1 - p5 For multiple variables in same string. + */ + #define TSLOG_IN() do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG0_IN(string) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG1_IN(string, p1) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG2_IN(string, p1, p2) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG3_IN(string, p1, p2, p3) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG4_IN(string, p1, p2, p3, p4) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG5_IN(string, p1, p2, p3, p4, p5) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG_OUT() do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG0_OUT(string) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG1_OUT(string, p1) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG2_OUT(string, p1, p2) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG3_OUT(string, p1, p2, p3) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG4_OUT(string, p1, p2, p3, p4) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG5_OUT(string, p1, p2, p3, p4, p5) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG0_RET(val, fmtstr) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG1_RET(val, fmtstr, p1) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG2_RET(val, fmtstr, p1, p2) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG3_RET(val, fmtstr, p1, p2, p3) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG4_RET(val, fmtstr, p1, p2, p3, p4) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG0(level, string) do { _DOINCHK(); _TSLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); } while(0) + #define TSLOG1(level, string, p1) do { _DOINCHK(); _TSLOGPRINTER(_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 TSLOG2(level, string, p1, p2) do { _DOINCHK(); _TSLOGPRINTER(_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 TSLOG3(level, string, p1, p2, p3) do { _DOINCHK(); _TSLOGPRINTER(_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 TSLOG4(level, string, p1, p2, p3, p4) do { _DOINCHK(); _TSLOGPRINTER(_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 TSLOG5(level, string, p1, p2, p3, p4, p5) do { _DOINCHK(); _TSLOGPRINTER(_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 __TSLOG_ASSERT_DBG( _assertion ) do { if( _assertion ) { break; } TFileName file; file.Copy( _L8( __FILE__ ) ); _TSLOGPRINTER(_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 __TSLOG_TRACE_ASSERT_DBG(_assertion, _textToPrint, _panicCode) do { if (_assertion) { break; } _TSLOGPRINTER(_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 TSLOG_TRAPHANDLER() _TTsLogTrapHandler _traceTrapHandler; _traceTrapHandler.oldHandler = User::SetTrapHandler(&_traceTrapHandler) + +/***************************************************************************** + LOGGING MACROS - NO LOGGING +*****************************************************************************/ +#else // _DEBUG + + #define TSLOG_CONTEXT(_fn, _vis ) + #define TSLOG_STATIC_CONTEXT(_fn, _vis, _thdId) + + #define TSLOG_IN() + #define TSLOG0_IN(string) + #define TSLOG1_IN(string, p1) + #define TSLOG2_IN(string, p1, p2) + #define TSLOG3_IN(string, p1, p2, p3) + #define TSLOG4_IN(string, p1, p2, p3, p4) + #define TSLOG5_IN(string, p1, p2, p3, p4, p5) + + #define TSLOG_OUT() + #define TSLOG0_OUT(string) + #define TSLOG1_OUT(string, p1) + #define TSLOG2_OUT(string, p1, p2) + #define TSLOG3_OUT(string, p1, p2, p3) + #define TSLOG4_OUT(string, p1, p2, p3, p4) + #define TSLOG5_OUT(string, p1, p2, p3, p4, p5) + + #define TSLOG0_RET(val, fmtstr) return val + #define TSLOG1_RET(val, fmtstr, p1) return val + #define TSLOG2_RET(val, fmtstr, p1, p2) return val + #define TSLOG3_RET(val, fmtstr, p1, p2, p3) return val + #define TSLOG4_RET(val, fmtstr, p1, p2, p3, p4) return val + #define TSLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) return val + + #define TSLOG0(level, string) + #define TSLOG1(level, string, p1) + #define TSLOG2(level, string, p1, p2) + #define TSLOG3(level, string, p1, p2, p3) + #define TSLOG4(level, string, p1, p2, p3, p4) + #define TSLOG5(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 __TSLOG_ASSERT_DBG(_assertion) + #define __TRACE_ASSERT_DBG(_assertion, _message, _panicCode ) + +#endif // _DEBUG + +#endif // TSLOGLOGUTILS_H + +// End of File diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/trace/tslogutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/trace/tslogutils.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,211 @@ +/* +* 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: Logging behavior +* +*/ + + +#ifndef TSLOGUTILS_H +#define TSLOGUTILS_H + +/** + * NOTE: This file contains the logic related to logging. Change only if you + * know what you're doing. + */ + + + + + + + + + + +#ifdef _DEBUG + +#include +#include + +static const TUint TSLOGERR = 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 _TSLOG_UNCONTROLLED_INPUT_MSG L"%s%d[%x:%x:%x]>%s UNCONTROLLED ENTRY!" +#define _TSLOG_MULTIPLE_ENTRY_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL ENTRY!" +#define _TSLOG_UNCONTROLLER_EXIT_MSG L"%s%d[%x:%x:%x]<%s UNCONTROLLED EXIT!" +#define _TSLOG_MULTIPLE_EXIT_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL EXIT!" +#define _TSLOG_TRAP_HARNESS_ENTRY L"_D%d[%x:%x:%x]TraceFramework: Entering trap harness" +#define _TSLOG_TRAP_HARNESS_EXIT L"_D%d[%x:%x:%x]TraceFramework: Exiting trap harness" +#define _TSLOG_TRAP_HARNESS_LEAVE L"_D%d[%x:%x:%x]TraceFramework: ---------- LEAVE OCCURRED !!! ---------- " +#define _TSLOG_API_PREFIX L"_A" +#define _TSLOG_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: +* - _DEBUG +* - With this flag undefined, all traces are disabled +* - __KERNEL_MODE__ +* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) +* - DISABLE_SYNTAX_CHECK +* - 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 _TSLOG_RDEBUG + #define _IT(a) (TPtrC((const TText *)(a))) + #define _TSLOGPRINTER RDebug::Print + +/** For filedebug */ +#else // _TSLOG_RDEBUG + + /** Includes */ + #include + #include + #include + #include + +// both of headers defines KLogBufferSize +#ifndef __COMMSDEBUGUTILITY_H__ + #include +#endif + + #define _IT(a) KTsLogPath, KTsLogFile, EFileLoggingModeAppend, (TPtrC((const TText *)(a))) + #define _TSLOGPRINTER RFileLogger::WriteFormat +#endif // _TSLOG_RDEBUG + +class _TTsLogContext + { + public: + _TTsLogContext( + 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*)_TSLOG_API_PREFIX : (TText*)_TSLOG_LOCAL_PREFIX)), + iCategory(_category) + #ifndef DISABLE_SYNTAX_CHECK + ,outOk(EFalse), inOk(EFalse) + #endif + { + } + ~_TTsLogContext() + { + #ifndef DISABLE_SYNTAX_CHECK + do + { + DoInChk(); + if (!outOk) + { + _TSLOGPRINTER(_IT(_TSLOG_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) + { + _TSLOGPRINTER(_IT(_TSLOG_UNCONTROLLED_INPUT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + inOk = ETrue; + } + } + + inline void ChkMultiIn() + { + if (inOk) + { + _TSLOGPRINTER(_IT(_TSLOG_MULTIPLE_ENTRY_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + inline void ChkMultiOut() + { + if (outOk) + { + _TSLOGPRINTER(_IT(_TSLOG_MULTIPLE_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + TBool inOk; + TBool outOk; + #endif // DISABLE_SYNTAX_CHECK + }; + +class _TTsLogTrapHandler: public TTrapHandler + { + public: + + _TTsLogTrapHandler(_TTsLogContext& _context) : _dc( _context ) + { + RThread me; + iThdId = (TInt)me.Id(); + } + void Trap() + { + _TSLOGPRINTER(_IT(_TSLOG_TRAP_HARNESS_ENTRY), 0, TSLOGERR, iThdId, this); + oldHandler->Trap(); + } + void UnTrap() + { + _TSLOGPRINTER(_IT(_TSLOG_TRAP_HARNESS_EXIT), 0, TSLOGERR, iThdId, this); + oldHandler->UnTrap(); + } + void Leave(TInt aValue) + { + _TSLOGPRINTER(_IT(_TSLOG_TRAP_HARNESS_LEAVE), 0, TSLOGERR, iThdId, this); + oldHandler->Leave(aValue); + } + TTrapHandler* oldHandler; + private: + _TTsLogContext& _dc; + TInt iThdId; + }; + +#endif // _DEBUG + +#endif // TSLOGUTILS_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsctxutils/bwins/tscontextservicesutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsctxutils/bwins/tscontextservicesutilsu.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,8 @@ +EXPORTS + ?NewLC@CTsCenrepListener@@SAPAV1@ABVTUid@@KAAVMTsCenrepChangeObserver@@@Z @ 1 NONAME ; class CTsCenrepListener * CTsCenrepListener::NewLC(class TUid const &, unsigned long, class MTsCenrepChangeObserver &) + ??0CTsPropertyListener@@QAE@VTUid@@IAAVMTsPropertyChangeObserver@@@Z @ 2 NONAME ; CTsPropertyListener::CTsPropertyListener(class TUid, unsigned int, class MTsPropertyChangeObserver &) + ??1CTsCenrepListener@@UAE@XZ @ 3 NONAME ; CTsCenrepListener::~CTsCenrepListener(void) + ?Value@CTsCenrepListener@@QAEHXZ @ 4 NONAME ; int CTsCenrepListener::Value(void) + ?NewL@CTsCenrepListener@@SAPAV1@ABVTUid@@KAAVMTsCenrepChangeObserver@@@Z @ 5 NONAME ; class CTsCenrepListener * CTsCenrepListener::NewL(class TUid const &, unsigned long, class MTsCenrepChangeObserver &) + ??1CTsPropertyListener@@UAE@XZ @ 6 NONAME ; CTsPropertyListener::~CTsPropertyListener(void) + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsctxutils/eabi/tscontextservicesutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsctxutils/eabi/tscontextservicesutilsu.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,13 @@ +EXPORTS + _ZN17CTsCenrepListener4NewLERK4TUidmR23MTsCenrepChangeObserver @ 1 NONAME + _ZN17CTsCenrepListener5NewLCERK4TUidmR23MTsCenrepChangeObserver @ 2 NONAME + _ZN17CTsCenrepListener5ValueEv @ 3 NONAME + _ZN17CTsCenrepListenerD0Ev @ 4 NONAME + _ZN17CTsCenrepListenerD1Ev @ 5 NONAME + _ZN17CTsCenrepListenerD2Ev @ 6 NONAME + _ZN19CTsPropertyListenerC1E4TUidjR25MTsPropertyChangeObserver @ 7 NONAME + _ZN19CTsPropertyListenerC2E4TUidjR25MTsPropertyChangeObserver @ 8 NONAME + _ZN19CTsPropertyListenerD0Ev @ 9 NONAME + _ZN19CTsPropertyListenerD1Ev @ 10 NONAME + _ZN19CTsPropertyListenerD2Ev @ 11 NONAME + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsctxutils/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsctxutils/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +PRJ_EXPORTS +../inc/tsproplistener.h |../../inc/tsproplistener.h +../inc/tscenreplistener.h |../../inc/tscenreplistener.h + +PRJ_MMPFILES +tscontextservicesutils.mmp + +PRJ_TESTMMPFILES + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsctxutils/group/tscontextservicesutils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsctxutils/group/tscontextservicesutils.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,41 @@ +/* +* 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: +* +*/ + +#include +#include + +TARGET tscontextservicesutils.dll +TARGETTYPE dll +UID 0x1000008d + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +USERINCLUDE ../inc +USERINCLUDE ../../trace + +SOURCEPATH ../src +SOURCE tsproplistener.cpp +SOURCE tscenreplistener.cpp + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY centralrepository.lib + +DEBUGLIBRARY flogger.lib + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsctxutils/inc/tscenreplistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsctxutils/inc/tscenreplistener.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CTSCENREPLISTENER_H +#define CTSCENREPLISTENER_H + +#include + +class CRepository; + +/** + * Observer interface for getting notifications about a cenrep key change. + */ +class MTsCenrepChangeObserver + { +public: + virtual void CenrepChanged( TUint32 aKey, TInt aNewValue ) = 0; + }; + +/** + * Class to get notifications about changes to a cenrep key. + */ +NONSHARABLE_CLASS( CTsCenrepListener ) : public CActive + { +public: + /** + * Fist step constructor + */ + IMPORT_C static CTsCenrepListener* NewL(const TUid& aRep, TUint32 aKey, + MTsCenrepChangeObserver& aObserver); + + /** + * Fist step constructor + */ + IMPORT_C static CTsCenrepListener* NewLC(const TUid& aRep, TUint32 aKey, + MTsCenrepChangeObserver& aObserver); + + /** + * Destructor. + */ + IMPORT_C ~CTsCenrepListener(); + + /** + * Returns the current value of the watched key. + */ + IMPORT_C TInt Value(); + +private: + /** + * Constructor. + * Starts listening for the key. + */ + CTsCenrepListener(TUint32 aKey, + MTsCenrepChangeObserver& aObserver ); + + /** + * Second step constructor + */ + void ConstructL(const TUid& aRep); + + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + + MTsCenrepChangeObserver& iObserver; + CRepository* iRep; + TUint32 iKey; + }; + +#endif /*CTSCENREPLISTENER_H*/ diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsctxutils/inc/tsproplistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsctxutils/inc/tsproplistener.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CTSPROPERTYLISTENER_H +#define CTSPROPERTYLISTENER_H + +#include +#include + +/** + * Observer interface for getting notifications about a P&S property change. + */ +class MTsPropertyChangeObserver + { +public: + virtual void PropertyChanged( TUid aCategory, TUint aKey ) = 0; + }; + +/** + * Class to get notifications about changes to a P&S property. + */ +NONSHARABLE_CLASS( CTsPropertyListener ) : public CActive + { +public: + /** + * Constructor. + * Starts listening for the property with the given category/key. + */ + IMPORT_C CTsPropertyListener( TUid aCategory, + TUint aKey, MTsPropertyChangeObserver& aObserver ); + + /** + * Destructor. + */ + IMPORT_C ~CTsPropertyListener(); + +private: + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + + MTsPropertyChangeObserver& iObserver; + RProperty iProperty; + TUid iCategory; + TUint iKey; + }; + +#endif /*CTSPROPERTYLISTENER_H*/ + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsctxutils/src/tscenreplistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsctxutils/src/tscenreplistener.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,113 @@ +/* +* 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: +* +*/ + +#include +#include + +#include "tscenreplistener.h" +// ----------------------------------------------------------------------------- +// CTsCenrepListener::NewL +// ----------------------------------------------------------------------------- +EXPORT_C CTsCenrepListener* CTsCenrepListener::NewL(const TUid& aRep, TUint32 aKey, + MTsCenrepChangeObserver& aObserver) + { + CTsCenrepListener* self = CTsCenrepListener::NewLC(aRep, aKey, aObserver); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsCenrepListener::NewLC +// ----------------------------------------------------------------------------- +EXPORT_C CTsCenrepListener* CTsCenrepListener::NewLC(const TUid& aRep, TUint32 aKey, + MTsCenrepChangeObserver& aObserver) + { + CTsCenrepListener *self = new(ELeave) CTsCenrepListener(aKey, aObserver); + CleanupStack::PushL(self); + self->ConstructL(aRep); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsCenrepListener::CTsCenrepListener +// ----------------------------------------------------------------------------- +CTsCenrepListener::CTsCenrepListener(TUint32 aKey, + MTsCenrepChangeObserver& aObserver) +: CActive( CActive::EPriorityStandard ), iObserver( aObserver ), iKey( aKey ) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CTsCenrepListener::ConstructL +// ----------------------------------------------------------------------------- +void CTsCenrepListener::ConstructL(const TUid& aRep) + { + iRep = CRepository::NewL( aRep ); + iRep->NotifyRequest( iKey, iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CTsCenrepListener::~CTsCenrepListener +// ----------------------------------------------------------------------------- +EXPORT_C CTsCenrepListener::~CTsCenrepListener() + { + Cancel(); + delete iRep; + } + +// ----------------------------------------------------------------------------- +// CTsCenrepListener::DoCancel +// ----------------------------------------------------------------------------- +void CTsCenrepListener::DoCancel() + { + iRep->NotifyCancelAll(); + } + +// ----------------------------------------------------------------------------- +// CTsCenrepListener::RunL +// ----------------------------------------------------------------------------- +void CTsCenrepListener::RunL() + { + if ( iStatus.Int() != KErrCancel ) + { + iObserver.CenrepChanged( iKey, Value() ); + iRep->NotifyRequest( iKey, iStatus ); + SetActive(); + } + } + +// ----------------------------------------------------------------------------- +// CTsCenrepListener::RunError +// ----------------------------------------------------------------------------- +TInt CTsCenrepListener::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTsCenrepListener::Value +// ----------------------------------------------------------------------------- +EXPORT_C TInt CTsCenrepListener::Value() + { + TInt val = 0; + iRep->Get( iKey, val ); + return val; + } + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsctxutils/src/tsproplistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsctxutils/src/tsproplistener.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,83 @@ +/* +* 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: +* +*/ + +#include +#include "tsproplistener.h" + +// -------------------------------------------------------------------------- +// CTsPropertyListener::CTsPropertyListener +// -------------------------------------------------------------------------- +// +EXPORT_C CTsPropertyListener::CTsPropertyListener( + TUid aCategory, TUint aKey, MTsPropertyChangeObserver& 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(); + } + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::~CTsPropertyListener +// -------------------------------------------------------------------------- +// +EXPORT_C CTsPropertyListener::~CTsPropertyListener() + { + Cancel(); + iProperty.Close(); + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::DoCancel +// -------------------------------------------------------------------------- +// +void CTsPropertyListener::DoCancel() + { + iProperty.Cancel(); + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::RunL +// -------------------------------------------------------------------------- +// +void CTsPropertyListener::RunL() + { + if ( iStatus.Int() != KErrCancel ) // when cancelling the subscribe it completes with KErrCancel + { + iObserver.PropertyChanged( iCategory, iKey ); + iProperty.Subscribe( iStatus ); + SetActive(); + } + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::RunError +// -------------------------------------------------------------------------- +// +TInt CTsPropertyListener::RunError( TInt /*aError*/ ) + { + iProperty.Subscribe( iStatus ); + SetActive(); + return KErrNone; + } + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/bwins/tspreviewprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/bwins/tspreviewprovideru.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + ??1CTsFastSwapPreviewProvider@@UAE@XZ @ 1 NONAME ; CTsFastSwapPreviewProvider::~CTsFastSwapPreviewProvider(void) + ?TakePreview@CTsFastSwapPreviewProvider@@QAEHXZ @ 2 NONAME ; int CTsFastSwapPreviewProvider::TakePreview(void) + ?AckPreview@CTsFastSwapPreviewProvider@@QAEXH@Z @ 3 NONAME ; void CTsFastSwapPreviewProvider::AckPreview(int) + ?ChangeScreen@CTsFastSwapPreviewProvider@@QAEHH@Z @ 4 NONAME ; int CTsFastSwapPreviewProvider::ChangeScreen(int) + ?NewL@CTsFastSwapPreviewProvider@@SAPAV1@AAVMTsFastSwapPreviewObserver@@@Z @ 5 NONAME ; class CTsFastSwapPreviewProvider * CTsFastSwapPreviewProvider::NewL(class MTsFastSwapPreviewObserver &) + ?Register@CTsFastSwapPreviewProvider@@QAEHH@Z @ 6 NONAME ; int CTsFastSwapPreviewProvider::Register(int) + ?SetPreviewParam@CTsFastSwapPreviewProvider@@QAEHABVTSize@@W4TDisplayMode@@@Z @ 7 NONAME ; int CTsFastSwapPreviewProvider::SetPreviewParam(class TSize const &, enum TDisplayMode) + ?Unregister@CTsFastSwapPreviewProvider@@QAEHH@Z @ 8 NONAME ; int CTsFastSwapPreviewProvider::Unregister(int) + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/eabi/tspreviewprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/eabi/tspreviewprovideru.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,12 @@ +EXPORTS + _ZN26CTsFastSwapPreviewProvider10AckPreviewEi @ 1 NONAME + _ZN26CTsFastSwapPreviewProvider10UnregisterEi @ 2 NONAME + _ZN26CTsFastSwapPreviewProvider11TakePreviewEv @ 3 NONAME + _ZN26CTsFastSwapPreviewProvider12ChangeScreenEi @ 4 NONAME + _ZN26CTsFastSwapPreviewProvider15SetPreviewParamERK5TSize12TDisplayMode @ 5 NONAME + _ZN26CTsFastSwapPreviewProvider4NewLER26MTsFastSwapPreviewObserver @ 6 NONAME + _ZN26CTsFastSwapPreviewProvider8RegisterEi @ 7 NONAME + _ZN26CTsFastSwapPreviewProviderD0Ev @ 8 NONAME + _ZN26CTsFastSwapPreviewProviderD1Ev @ 9 NONAME + _ZN26CTsFastSwapPreviewProviderD2Ev @ 10 NONAME + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,31 @@ +/* +* 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: bld.inf +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/tsfastswappreviewprovider.iby CORE_MW_LAYER_IBY_EXPORT_PATH(tsfastswappreviewprovider.iby) +../inc/tspreviewprovider.h |../../inc/tspreviewprovider.h +../inc/tspreviewobserver.h |../../inc/tspreviewobserver.h + +PRJ_MMPFILES +previewprovider.mmp + +#include "../wsplugin/group/bld.inf" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/group/previewprovider.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/group/previewprovider.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,41 @@ +/* +* 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: MMP file for tspreviewprovider dll +* +*/ + + +#include +#include + +TARGET tspreviewprovider.dll +TARGETTYPE DLL +UID 0x1000008D 0x20016BEB +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +USERINCLUDE ../inc +USERINCLUDE ../../trace + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE tspreviewprovider.cpp +SOURCE tspreviewproviderclient.cpp +SOURCE tspropertylistener.cpp + +LIBRARY euser.lib +LIBRARY ws32.lib +LIBRARY estor.lib +DEBUGLIBRARY flogger.lib diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/inc/previewmsg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/previewmsg.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,45 @@ +/* +* 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: Message types for preview plugin +* +*/ + + +#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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/inc/previewproviderlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/previewproviderlogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,32 @@ +/* +* 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: Header file used for logging +* +*/ + + +#ifndef PREVIEWPROVIDERLOGGING_H +#define PREVIEWPROVIDERLOGGING_H + +_LIT( KTsLogFile, "tspreviewprovider.txt" ); +_LIT( KTsLogPath, "tspreviewprovider" ); +#define _TSLOG_LOG_COMPONENT_ID 6715359 +//#define _TSLOG_RDEBUG + +#include +#include "tslogging.h" + +#endif // PREVIEWPROVIDERLOGGING_H + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/inc/tsfastswappreviewproviderlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/tsfastswappreviewproviderlogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Defines logs for tsfastswappreviewprovider +* +*/ + + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KTsLogFile, "tsfastswappreviewprovider.txt" ); +_LIT( KTsLogPath, "taskswitcher" ); +#define _TSLOG_LOG_COMPONENT_ID 0x20016BEC + +#endif +#include "tslogging.h" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewobserver.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,59 @@ +/* +* 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: Preview provider API +* +*/ + + +#ifndef TSPREVIEWOBSERVER_H +#define TSPREVIEWOBSERVER_H + +// INCLUDES +#include + +/** + * Observer for preview screenshot changes. Client must implement this and + * register itself when calling CTsFastSwapPreviewProvider::NewL. Callback + * methods are called whenever there is a new preview screenshot taken from + * the applications or when an application is exited. + * + * @see CTsFastSwapPreviewProvider + */ +class MTsFastSwapPreviewObserver + { +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 // TSPREVIEWOBSERVER_H + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewprovider.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,129 @@ +/* +* 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: Preview provider API +* +*/ + + +#ifndef TSFASTSWAPPREVIEWPROVIDER_H +#define TSFASTSWAPPREVIEWPROVIDER_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CTsFastSwapPreviewProviderClient; +class MTsFastSwapPreviewObserver; + +/** + * 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 MTsFastSwapPreviewObserver. + * + * @see MTsFastSwapPreviewObserver + * @lib tspreviewprovider.lib + */ +NONSHARABLE_CLASS( CTsFastSwapPreviewProvider ) : public CBase + { +public: + + /** + * Two phased constructor. + * @see MTsFastSwapPreviewObserver + * + * @param aObs Observer. + */ + IMPORT_C static CTsFastSwapPreviewProvider* NewL( + MTsFastSwapPreviewObserver& aObs ); + + /** + * Destructor. + */ + IMPORT_C ~CTsFastSwapPreviewProvider(); + + /** + * 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. + */ + CTsFastSwapPreviewProvider(); + + /** + * 2nd phase constructor. + * + * @param aObs Observer. + */ + void ConstructL( MTsFastSwapPreviewObserver& aObs ); + +private: + + /** + * Implementation class. + */ + CTsFastSwapPreviewProviderClient* iClient; + }; + +#endif // TSFASTSWAPPREVIEWPROVIDER_H + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewproviderclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewproviderclient.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,47 @@ +/* +* 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". +*/ + +#ifndef TSFASTSWAPPREVIEWPROVIDERCLIENT_H +#define TSFASTSWAPPREVIEWPROVIDERCLIENT_H + +#include +#include +#include "tspreviewobserver.h" + +class CTsPropertyListener; + +/** + * CTsFastSwapPreviewProviderClient + */ +NONSHARABLE_CLASS( CTsFastSwapPreviewProviderClient ) : public CWsGraphic + { +public: + CTsFastSwapPreviewProviderClient( MTsFastSwapPreviewObserver& 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 ~CTsFastSwapPreviewProviderClient(); +private: + void HandleMessage( const TDesC8& aData ); + void OnReplace(); +private: + void DoHandleMessageL( const TDesC8& aData ); + void SetProperties( TInt aHandle, TInt aWgId, TInt aOp ); +private: + MTsFastSwapPreviewObserver& iObs; + CTsPropertyListener* iListener; + }; + +#endif // TSPREVIEWPROVIDERCLIENT_H + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/inc/tspropertylistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/inc/tspropertylistener.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,70 @@ +/* +* 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". +*/ + + +#ifndef TSPROPERTYLISTENER_H +#define TSPROPERTYLISTENER_H + +#include +#include + +#include "tspreviewobserver.h" + +// 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( CTsPropertyListener ) : public CActive + { +public: + static CTsPropertyListener* NewL( MTsFastSwapPreviewObserver& aObs ); + virtual ~CTsPropertyListener(); + +protected: + CTsPropertyListener( MTsFastSwapPreviewObserver& aObs ); + void ConstructL(); + +private: // From CActive + void RunL(); + void DoCancel(); + +private: + void ReadPropertiesL(); + void DefinePropertyL( TInt aPSKey ); + void Subscribe(); + +private: + MTsFastSwapPreviewObserver& iObs; + RProperty iProperty; + + TInt iWgId; + TInt iFbsBitmapId; + + TPreviewOperation iOperation; + }; + +#endif // TSPROPERTYLISTENER_H + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/rom/tsfastswappreviewprovider.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/rom/tsfastswappreviewprovider.iby Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file +* +*/ + + +#ifndef TSFASTSWAPPREVIEWPROVIDER_IBY +#define TSFASTSWAPPREVIEWPROVIDER_IBY + +#include + +// fsw preview +ECOM_PLUGIN( 20016BEC.DLL, 20016BEC.rsc ) +file=ABI_DIR/BUILD_DIR/tspreviewprovider.dll SHARED_LIB_DIR/tspreviewprovider.dll + +#endif // TSFASTSWAPPREVIEWPROVIDER_IBY diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/src/tspreviewprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/src/tspreviewprovider.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,151 @@ +/* +* 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: Preview provider API +* +*/ + + +#include "tspreviewprovider.h" +#include "previewproviderlogging.h" +#include "tspreviewproviderclient.h" + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CTsFastSwapPreviewProvider* CTsFastSwapPreviewProvider::NewL( + MTsFastSwapPreviewObserver& aObs) + { + CTsFastSwapPreviewProvider* p = new (ELeave) CTsFastSwapPreviewProvider(); + CleanupStack::PushL( p ); + p->ConstructL( aObs ); + CleanupStack::Pop( p ); + return p; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::~CTsFastSwapPreviewProvider +// -------------------------------------------------------------------------- +// +EXPORT_C CTsFastSwapPreviewProvider::~CTsFastSwapPreviewProvider() + { + if ( iClient ) + { + iClient->Destroy(); + } + delete iClient; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::Register +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFastSwapPreviewProvider::Register( TInt aWgId ) + { + iClient->Register( aWgId ); + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::Unregister +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFastSwapPreviewProvider::Unregister( TInt aWgId ) + { + iClient->Unregister( aWgId ); + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::ChangeScreen +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFastSwapPreviewProvider::ChangeScreen( TInt aScreenId ) + { + iClient->ChangeScreen( aScreenId ); + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::SetPreviewParam +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFastSwapPreviewProvider::SetPreviewParam(const TSize& aSize, + TDisplayMode aMode) + { + TSLOG_CONTEXT( SetPreviewParam, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt error( KErrNone ); + + if ( aMode == ENone || aMode == EColor64K ) + { + iClient->SetPreviewParam( aSize, aMode ); + } + else + { + error = KErrNotSupported; + } + + TSLOG_OUT(); + return error; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::TakePreview +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFastSwapPreviewProvider::TakePreview() + { + // Reset timer for screensaver (dismiss screensaver) + User::ResetInactivityTime(); + + iClient->TakePreview(); + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::AckPreview +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFastSwapPreviewProvider::AckPreview( TInt aPreviewId ) + { + iClient->AckPreview( aPreviewId ); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::CTsFastSwapPreviewProvider +// -------------------------------------------------------------------------- +// +CTsFastSwapPreviewProvider::CTsFastSwapPreviewProvider() + { + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProvider::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProvider::ConstructL( MTsFastSwapPreviewObserver& aObs ) + { + TSLOG_CONTEXT( ConstructL, TSLOG_LOCAL ); + TSLOG_IN(); + + iClient = new ( ELeave ) CTsFastSwapPreviewProviderClient( aObs ); + iClient->ConstructL(); + + TSLOG_OUT(); + } + +// End of file + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/src/tspreviewproviderclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/src/tspreviewproviderclient.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,236 @@ +/* +* 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". +* +*/ + +#include "tspreviewproviderclient.h" +#include "previewproviderlogging.h" +#include "tspropertylistener.h" +#include "previewmsg.h" + +#include + +#define SZ( x ) ( sizeof( x ) / sizeof( TInt ) ) + + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::CTsFastSwapPreviewProviderClient +// -------------------------------------------------------------------------- +// +CTsFastSwapPreviewProviderClient::CTsFastSwapPreviewProviderClient( + MTsFastSwapPreviewObserver& aObs ) : iObs( aObs ) + { + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::~CTsFastSwapPreviewProviderClient +// -------------------------------------------------------------------------- +// +CTsFastSwapPreviewProviderClient::~CTsFastSwapPreviewProviderClient() + { + delete iListener; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::ConstructL() + { + TSLOG_CONTEXT( ConstructL, TSLOG_LOCAL ); + TSLOG_IN(); + + const TUid id = { 0x20016BEC }; + BaseConstructL( id, KNullDesC8 ); + iListener = CTsPropertyListener::NewL( iObs ); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::Register +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::Register( TInt aWgId ) + { + TSLOG_CONTEXT( Register, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::ERegister, + aWgId + }; + TPckgC buf(msg); + SendMessage(buf); + Flush(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::Unregister +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::Unregister( TInt aWgId ) + { + TSLOG_CONTEXT( Unregister, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::EUnregister, + aWgId + }; + TPckgC buf(msg); + SendMessage(buf); + Flush(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::ChangeScreen +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::ChangeScreen( TInt aScreenNo ) + { + TSLOG_CONTEXT( ChangeScreen, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::EChangeScreen, + aScreenNo + }; + TPckgC buf(msg); + SendMessage(buf); + Flush(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::SetPreviewParam +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::SetPreviewParam(const TSize& aSize, + TDisplayMode aMode) + { + TSLOG_CONTEXT( SetPreviewParam, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::ESetPreviewParam, + aSize.iWidth, + aSize.iHeight, + static_cast(aMode) + }; + TPckgC buf(msg); + SendMessage(buf); + Flush(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::TakePreview +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::TakePreview() + { + TSLOG_CONTEXT( TakePreview, TSLOG_LOCAL ); + TSLOG_IN(); + + TPckgC buf(NPreviewMsg::ETakePreview); + SendMessage(buf); + Flush(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::AckPreview +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::AckPreview( TInt aPreviwId ) + { + TSLOG_CONTEXT( TakePreview, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt msg[] = { NPreviewMsg::EAckPreviewReady, + aPreviwId }; + TPckgC buf(msg); + SendMessage(buf); + Flush(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::HandleMessage +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::HandleMessage( const TDesC8& aData ) + { + TRAP_IGNORE(DoHandleMessageL(aData)); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::DoHandleMessageL +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::DoHandleMessageL( const TDesC8& aData ) + { + TSLOG_CONTEXT( DoHandleMessageL, TSLOG_LOCAL ); + TSLOG_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; + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::SetProperties +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::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 ); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapPreviewProviderClient::OnReplace +// -------------------------------------------------------------------------- +// +void CTsFastSwapPreviewProviderClient::OnReplace() + { + } + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/src/tspropertylistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/src/tspropertylistener.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,147 @@ +/* +* 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". +*/ + +#include "tspropertylistener.h" +#include "previewproviderlogging.h" + + + +// -------------------------------------------------------------------------- +// CTsPropertyListener::~CTsPropertyListener +// -------------------------------------------------------------------------- +// +CTsPropertyListener::~CTsPropertyListener() + { + Cancel(); + iProperty.Close(); + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::CTsPropertyListener +// -------------------------------------------------------------------------- +// +CTsPropertyListener::CTsPropertyListener( MTsFastSwapPreviewObserver& aObs ) : + CActive( CActive::EPriorityHigh ), iObs( aObs ) + { + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::NewL +// -------------------------------------------------------------------------- +// +CTsPropertyListener* CTsPropertyListener::NewL( MTsFastSwapPreviewObserver& aObs ) + { + CTsPropertyListener* self = new ( ELeave ) CTsPropertyListener( aObs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::RunL +// -------------------------------------------------------------------------- +// +void CTsPropertyListener::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; + } + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::DoCancel +// -------------------------------------------------------------------------- +// +void CTsPropertyListener::DoCancel() + { + iProperty.Cancel(); + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::ReadProperties +// -------------------------------------------------------------------------- +// +void CTsPropertyListener::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( operation ); + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::DefinePropertyL +// -------------------------------------------------------------------------- +// +void CTsPropertyListener::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 ); + } + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::Subscribe +// -------------------------------------------------------------------------- +// +void CTsPropertyListener::Subscribe() + { + iProperty.Subscribe( iStatus ); + SetActive(); + } + +// -------------------------------------------------------------------------- +// CTsPropertyListener::ConstructL +// -------------------------------------------------------------------------- +// +void CTsPropertyListener::ConstructL() + { + TSLOG_CONTEXT( ConstructL, TSLOG_LOCAL ); + TSLOG_IN(); + + DefinePropertyL( KPSKeyWgId ); + DefinePropertyL( KPSKeyFbsBitmapId ); + DefinePropertyL( KPSKeyOperation ); + + User::LeaveIfError( iProperty.Attach( KPSUidPreviewProvider, KPSKeyWgId ) ); + CActiveScheduler::Add( this ); + + // initial subscription + Subscribe(); + + TSLOG_OUT(); + } + +// End of file + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +/* +* 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: bld.inf +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +previewprovidercrp.mmp diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/group/previewprovidercrp.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/group/previewprovidercrp.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,46 @@ +/* +* 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: MMP file for preview provider ECOM plugin +* +*/ + +#include +#include + +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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/inc/previewprovidercrp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/inc/previewprovidercrp.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,178 @@ +/* +* 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: Preview provider ECOM plugin +* +*/ + + +#ifndef PREVIEWPROVIDERCRP_H +#define PREVIEWPROVIDERCRP_H + +// INCLUDES +#include +#include +#include + +// 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 iScreenshots; + TSize iScreenshotSize; + TDisplayMode iScreenshotMode; + RArray iWgIds; + }; + +#endif // PREVIEWPROVIDERCRP_H + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/inc/previewprovidercrplogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/inc/previewprovidercrplogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,32 @@ +/* +* 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: Header file used for logging +* +*/ + + +#ifndef PREVIEWPROVIDERCRPLOGGING_H +#define PREVIEWPROVIDERCRPLOGGING_H + +_LIT( KTsLogFile, "tspreviewprovidercrp.txt" ); +_LIT( KTsLogPath, "tspreviewprovider" ); +#define _TSLOG_LOG_COMPONENT_ID 6715358 +//#define _TSLOG_RDEBUG + +#include +#include "tslogging.h" + +#endif // PREVIEWPROVIDERCRPLOGGING_H + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/src/20016BEC.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/src/20016BEC.rss Tue Jan 26 11:48:23 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: ECOM registration file +* +*/ + + +#include + +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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,436 @@ +/* +* 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: Preview provider ECOM plugin +* +*/ + + +#include +#ifdef SYMBIAN_BUILD_GCE +#define NGA +#endif + +#include "previewprovidercrp.h" +#include "previewmsg.h" +#include "previewprovidercrplogging.h" +#include +#include //RDesReadStream + +#ifdef NGA +#include +#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 ) + { + TSLOG_CONTEXT( DoHandleMessageL, TSLOG_LOCAL ); + TSLOG_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( in.ReadInt32L() ); + break; + case NPreviewMsg::ETakePreview: + ScreenshotL(); + break; + case NPreviewMsg::EAckPreviewReady: + RemoveScreenshot( in.ReadInt32L() ); + break; + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::ConstructL +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::ConstructL( MWsGraphicDrawerEnvironment& aEnv, + const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& /*aData*/ ) + { + TSLOG_CONTEXT( ConstructL, TSLOG_LOCAL ); + TSLOG_IN(); + + BaseConstructL( aEnv, aId, aOwner ); + aEnv.RegisterEventHandler( this, this, TWservCrEvent::EWindowGroupChanged ); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::DoHandleEvent +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::DoHandleEvent( const TWservCrEvent& aEvent ) + { + TSLOG_CONTEXT( DoHandleEvent, TSLOG_LOCAL ); + TSLOG_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; + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::ScaleComplete +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::ScaleCompleteL( const CFbsBitmap& aBitmap ) + { + TSLOG_CONTEXT( ScaleComplete, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::EPreviewReady, + iPrevId?iPrevId:iPrevReg, + aBitmap.Handle() + }; + TPckgC buf(msg); + User::LeaveIfError( SendMessage( buf ) ); + TSLOG3( TSLOG_INFO, "size = %dx%d handle = %d", + aBitmap.SizeInPixels().iWidth, + aBitmap.SizeInPixels().iHeight, + aBitmap.Handle() ); + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::UnregisterComplete +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::UnregisterComplete( TInt aWgId ) + { + TSLOG_CONTEXT( UnregisterComplete, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt msg[] = { + NPreviewMsg::EUnregisterReady, + aWgId, + 0 + }; + TPckgC buf(msg); + SendMessage(buf); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::Register +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::Register( TInt aWgId ) + { + TSLOG_CONTEXT( Register, TSLOG_LOCAL ); + TSLOG_IN(); + + iPrevReg = aWgId; + iWgIds.InsertInOrder( aWgId ); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::Unregister +// -------------------------------------------------------------------------- +// +void CPreviewProviderCRP::Unregister( TInt aWgId ) + { + TSLOG_CONTEXT( Unregister, TSLOG_LOCAL ); + TSLOG_IN(); + + const TInt index = iWgIds.FindInOrder( aWgId ); + if ( index >= 0 ) + { + iWgIds.Remove( index ); + } + + UnregisterComplete( aWgId ); + + TSLOG_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) + { + TSLOG_CONTEXT( ScreenShot, TSLOG_LOCAL ); + TSLOG_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(); + + const TSize sz = screenConfig->ScreenModeSizeInPixels(); + + // Get the screen buffer (containing screenshot data) + MWsFrontBuffer* screenFront = + Env().Screen( iScreen )->ObjectInterface(); + + // 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(); + + TSLOG3( TSLOG_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 ) + { + TSLOG0( TSLOG_INFO, "non-NGA, using front buffer" ); + FrontBufferScreenShot( aBitmap, *screenFront, sz, screenConfig->Stride() ); + } +#ifdef NGA + else + { + TSLOG0( TSLOG_INFO, "NGA, using CopyScreenToBitmapL" ); + MWsScreenDevice* screenDevice = static_cast( + Env().Screen( iScreen )->ResolveObjectInterface( + MWsScreenDevice::EWsObjectInterfaceId ) ); + User::LeaveIfNull( screenDevice ); + screenDevice->CopyScreenToBitmapL( &aBitmap, iScreenshotSize ); + } +#endif + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CPreviewProviderCRP::RemoveScreenshot +// -------------------------------------------------------------------------- +// +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 ) + { + TSLOG_CONTEXT( CPreviewProviderCRP::FrontBufferScreenShot, TSLOG_LOCAL ); + TSLOG_IN(); + + const TUint8* src = static_cast ( aFront.GetBits() ); + TSLOG1( TSLOG_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(); + TSLOG_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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/bwins/tsfswclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/bwins/tsfswclientu.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + ?SwitchToApp@CTsFswClient@@QAEXH@Z @ 1 NONAME ; void CTsFswClient::SwitchToApp(int) + ?GetContentL@CTsFswClient@@QAEXAAV?$RPointerArray@VCTsFswEntry@@@@@Z @ 2 NONAME ; void CTsFswClient::GetContentL(class RPointerArray &) + ?ForegroundAppUid@CTsFswClient@@QAE?AVTUid@@W4TTsFswFgAppType@1@@Z @ 3 NONAME ; class TUid CTsFswClient::ForegroundAppUid(enum CTsFswClient::TTsFswFgAppType) + ?Subscribe@CTsFswClient@@QAEXAAVMTsFswObserver@@@Z @ 4 NONAME ; void CTsFswClient::Subscribe(class MTsFswObserver &) + ?NewLC@CTsFswClient@@SAPAV1@XZ @ 5 NONAME ; class CTsFswClient * CTsFswClient::NewLC(void) + ?CloseApp@CTsFswClient@@QAEXH@Z @ 6 NONAME ; void CTsFswClient::CloseApp(int) + ?NewL@CTsFswClient@@SAPAV1@XZ @ 7 NONAME ; class CTsFswClient * CTsFswClient::NewL(void) + ?CancelSubscribe@CTsFswClient@@QAEXXZ @ 8 NONAME ; void CTsFswClient::CancelSubscribe(void) + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/eabi/tsfswclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/eabi/tsfswclientu.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,10 @@ +EXPORTS + _ZN12CTsFswClient11GetContentLER13RPointerArrayI11CTsFswEntryE @ 1 NONAME + _ZN12CTsFswClient11SwitchToAppEi @ 2 NONAME + _ZN12CTsFswClient15CancelSubscribeEv @ 3 NONAME + _ZN12CTsFswClient16ForegroundAppUidENS_15TTsFswFgAppTypeE @ 4 NONAME + _ZN12CTsFswClient4NewLEv @ 5 NONAME + _ZN12CTsFswClient5NewLCEv @ 6 NONAME + _ZN12CTsFswClient8CloseAppEi @ 7 NONAME + _ZN12CTsFswClient9SubscribeER14MTsFswObserver @ 8 NONAME + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,24 @@ +/* +* 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: build info file for client dll + * +*/ + + +PRJ_EXPORTS +../inc/tsfswclient.h |../../../inc/tsfswclient.h +../inc/tsfswclientobserver.h |../../../inc/tsfswclientobserver.h + +PRJ_MMPFILES +tsfswclient.mmp diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/group/tsfswclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/group/tsfswclient.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,41 @@ +/* +* 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: client dll + * +*/ + + +#include + +TARGET tsfswclient.dll +TARGETTYPE DLL +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE tsfswclient.cpp +SOURCE tsfswclientimpl.cpp + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../trace + +LIBRARY euser.lib +LIBRARY estor.lib + +LIBRARY tsfswutils.lib + +DEBUGLIBRARY flogger.lib diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/inc/clientlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/inc/clientlogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Defines logs for client +* +*/ + + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KTsLogFile, "tsfswclient.txt" ); +_LIT( KTsLogPath, "taskswitcher" ); +#define _TSLOG_LOG_COMPONENT_ID 0x0000000 +#endif + +#include "tslogging.h" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/inc/tsfswclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/inc/tsfswclient.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,131 @@ +/* +* 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: Client API + * +*/ + + +#ifndef TSFSWCLIENT_H +#define TSFSWCLIENT_H + +#include +#include "tsfswentry.h" + +class MTsFswObserver; +class CTsFswClientImpl; + +/** + * Client API for the Huriganes Fast Swap Server. + */ +NONSHARABLE_CLASS( CTsFswClient ) : public CBase + { +public: + /** + * Possible values for aType argument of ForegroundAppUid(). + */ + enum TTsFswFgAppType + { + /** + * 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 CTsFswClient* NewL(); + + /** + * Creates a new instance. + * @capability LocalServices + */ + IMPORT_C static CTsFswClient* NewLC(); + + /** + * Destructor. + */ + ~CTsFswClient(); + + /** + * 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( RTsFswArray& 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( MTsFswObserver& 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( TTsFswFgAppType aType ); + +private: + CTsFswClient(); + void ConstructL(); + + CTsFswClientImpl* iImpl; + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/inc/tsfswclientimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/inc/tsfswclientimpl.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,68 @@ +/* +* 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: Client API, private implementation + * +*/ + + +#ifndef TSFSWCLIENTIMPL_H +#define TSFSWCLIENTIMPL_H + +#include +#include "tsfswentry.h" + +class MTsFswObserver; + +NONSHARABLE_CLASS( CTsFswClientImpl ) : public CActive + { +public: + static CTsFswClientImpl* NewL(); + static CTsFswClientImpl* NewLC(); + ~CTsFswClientImpl(); + + void GetContentL( RTsFswArray& aDst ); + + void Subscribe( MTsFswObserver& aObserver ); + void CancelSubscribe(); + + void CloseApp( TInt aWgId ); + void SwitchToApp( TInt aWgId ); + + TUid ForegroundAppUid( TInt aType ); + +private: + void RunL(); + void DoCancel(); + +private: + CTsFswClientImpl(); + void ConstructL(); + + NONSHARABLE_CLASS( RTsFswClient ) : public RSessionBase + { + public: + TInt Connect(); + void Subscribe( TRequestStatus& aStatus ); + void CancelSubscribe(); + void GetContentL( RTsFswArray& aDst ); + void CloseApp( TInt aWgId ); + void SwitchToApp( TInt aWgId ); + TUid ForegroundAppUid( TInt aType ); + }; + RTsFswClient iClient; + + MTsFswObserver* iObserver; // not own + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/inc/tsfswclientobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/inc/tsfswclientobserver.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,37 @@ +/* +* 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: Client API + * +*/ + + +#ifndef TSFSWCLIENTOBSERVER_H +#define TSFSWCLIENTOBSERVER_H + +#include + +/** + * Observer interface for getting notifications about fast swap content changes. + */ +class MTsFswObserver + { +public: + /** + * Called when there is a change in the fast swap content. + * The data can be queried via CTsFswClient::GetContentL + */ + virtual void HandleFswContentChanged() = 0; + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/src/tsfswclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/src/tsfswclient.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,126 @@ +/* +* 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: Client API + * +*/ + + +#include "tsfswclient.h" +#include "tsfswclientimpl.h" + +// -------------------------------------------------------------------------- +// CTsFswClient::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CTsFswClient* CTsFswClient::NewL() + { + CTsFswClient* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswClient::NewLC +// -------------------------------------------------------------------------- +// +EXPORT_C CTsFswClient* CTsFswClient::NewLC() + { + CTsFswClient* self = new ( ELeave ) CTsFswClient; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswClient::CTsFswClient +// -------------------------------------------------------------------------- +// +CTsFswClient::CTsFswClient() + { + } + +// -------------------------------------------------------------------------- +// CTsFswClient::~CTsFswClient +// -------------------------------------------------------------------------- +// +CTsFswClient::~CTsFswClient() + { + delete iImpl; + } + +// -------------------------------------------------------------------------- +// CTsFswClient::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFswClient::ConstructL() + { + iImpl = CTsFswClientImpl::NewL(); + } + +// -------------------------------------------------------------------------- +// CTsFswClient::GetContentL +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswClient::GetContentL( RTsFswArray& aDst ) + { + iImpl->GetContentL( aDst ); + } + +// -------------------------------------------------------------------------- +// CTsFswClient::Subscribe +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswClient::Subscribe( MTsFswObserver& aObserver ) + { + iImpl->Subscribe( aObserver ); + } + +// -------------------------------------------------------------------------- +// CTsFswClient::CancelSubscribe +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswClient::CancelSubscribe() + { + iImpl->CancelSubscribe(); + } + +// -------------------------------------------------------------------------- +// CTsFswClient::CloseApp +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswClient::CloseApp( TInt aWgId ) + { + iImpl->CloseApp( aWgId ); + } + +// -------------------------------------------------------------------------- +// CTsFswClient::SwitchToApp +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswClient::SwitchToApp( TInt aWgId ) + { + iImpl->SwitchToApp( aWgId ); + } + +// -------------------------------------------------------------------------- +// CTsFswClient::ForegroundAppUid +// -------------------------------------------------------------------------- +// +EXPORT_C TUid CTsFswClient::ForegroundAppUid( TTsFswFgAppType aType ) + { + return iImpl->ForegroundAppUid( aType ); + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/client/src/tsfswclientimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/client/src/tsfswclientimpl.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,315 @@ +/* +* 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: Client API, private implementation + * +*/ + + +#include "tsfswclientimpl.h" +#include "tsfswclientobserver.h" +#include "tsfswcommon.h" +#include + +#include "clientlogging.h" + +// -------------------------------------------------------------------------- +// StartServer +// -------------------------------------------------------------------------- +// +static TInt StartServer() + { + RProcess server; + const TUidType uid( KNullUid, KNullUid, KTsFswServerUid ); + TInt err = server.Create( KTsFswServerImg, 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; + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::RTsFswClient::Connect +// -------------------------------------------------------------------------- +// +TInt CTsFswClientImpl::RTsFswClient::Connect() + { + const TInt KAsyncMessageSlots = 4; + const TInt KMaxRetry = 4; + + TInt retry = KMaxRetry; + for ( ; ; ) + { + TInt err = CreateSession( KTsFswServerName, 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; + } + } + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::RTsFswClient::Subscribe +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::RTsFswClient::Subscribe( TRequestStatus& aStatus ) + { + SendReceive( ETsFswSubscribe, aStatus ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::RTsFswClient::CancelSubscribe +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::RTsFswClient::CancelSubscribe() + { + SendReceive( ETsFswCancel ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::RTsFswClient::GetContentL +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::RTsFswClient::GetContentL( RTsFswArray& aDst ) + { + TSLOG_CONTEXT( GetContentL, TSLOG_LOCAL ); + TSLOG_IN(); + + for ( ; ; ) + { + TPckgBuf bufSize; + User::LeaveIfError( SendReceive( ETsFswGetBufferSize, + TIpcArgs( &bufSize ) ) ); + HBufC8* buf = HBufC8::NewLC( bufSize() ); + TPtr8 p( buf->Des() ); + TInt err = SendReceive( ETsFswGetBuffer, + TIpcArgs( &p, bufSize() ) ); + if ( err == KErrNone ) + { + RDesReadStream strm( p ); + CleanupClosePushL( strm ); + CTsFswEntry::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. + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::RTsFswClient::CloseApp +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::RTsFswClient::CloseApp( TInt aWgId ) + { + SendReceive( ETsFswCloseApp, TIpcArgs( aWgId ) ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::RTsFswClient::SwitchToApp +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::RTsFswClient::SwitchToApp( TInt aWgId ) + { + SendReceive( ETsFswSwitchToApp, TIpcArgs( aWgId ) ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::RTsFswClient::ForegroundAppUid +// -------------------------------------------------------------------------- +// +TUid CTsFswClientImpl::RTsFswClient::ForegroundAppUid( TInt aType ) + { + TUid result = KNullUid; + TPckgBuf uidBuf; + if ( SendReceive( ETsFswForegroundAppUid, + TIpcArgs( &uidBuf, &aType ) ) == KErrNone ) + { + result = TUid::Uid( uidBuf() ); + } + return result; + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::NewL +// -------------------------------------------------------------------------- +// +CTsFswClientImpl* CTsFswClientImpl::NewL() + { + CTsFswClientImpl* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::NewLC() +// -------------------------------------------------------------------------- +// +CTsFswClientImpl* CTsFswClientImpl::NewLC() + { + CTsFswClientImpl* self = new ( ELeave ) CTsFswClientImpl; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::CTsFswClientImpl() +// -------------------------------------------------------------------------- +// +CTsFswClientImpl::CTsFswClientImpl() + : CActive( CActive::EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::~CTsFswClientImpl() +// -------------------------------------------------------------------------- +// +CTsFswClientImpl::~CTsFswClientImpl() + { + Cancel(); + iClient.Close(); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::ConstructL() +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::ConstructL() + { + User::LeaveIfError( iClient.Connect() ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::GetContentL +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::GetContentL( RTsFswArray& aDst ) + { + iClient.GetContentL( aDst ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::Subscribe +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::Subscribe( MTsFswObserver& aObserver ) + { + Cancel(); + iObserver = &aObserver; + iClient.Subscribe( iStatus ); + SetActive(); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::CancelSubscribe +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::CancelSubscribe() + { + Cancel(); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::CloseApp +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::CloseApp( TInt aWgId ) + { + iClient.CloseApp( aWgId ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::SwitchToApp +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::SwitchToApp( TInt aWgId ) + { + iClient.SwitchToApp( aWgId ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::ForegroundAppUid +// -------------------------------------------------------------------------- +// +TUid CTsFswClientImpl::ForegroundAppUid( TInt aType ) + { + return iClient.ForegroundAppUid( aType ); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::RunL +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::RunL() + { + TSLOG_CONTEXT( RunL, TSLOG_LOCAL ); + TSLOG1_IN( "%d", iStatus.Int() ); + + if ( iStatus == KErrNone && iObserver ) + { + iClient.Subscribe( iStatus ); + SetActive(); + iObserver->HandleFswContentChanged(); + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswClientImpl::DoCancel +// -------------------------------------------------------------------------- +// +void CTsFswClientImpl::DoCancel() + { + iClient.CancelSubscribe(); + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/bwins/tsfswengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/bwins/tsfswengineu.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,8 @@ +EXPORTS + ?NewLC@CTsFswEngine@@SAPAV1@AAVMTsFswEngineObserver@@@Z @ 1 NONAME ; class CTsFswEngine * CTsFswEngine::NewLC(class MTsFswEngineObserver &) + ?FswDataL@CTsFswEngine@@QAEABV?$RPointerArray@VCTsFswEntry@@@@XZ @ 2 NONAME ; class RPointerArray const & CTsFswEngine::FswDataL(void) + ?CloseAppL@CTsFswEngine@@QAEXH@Z @ 3 NONAME ; void CTsFswEngine::CloseAppL(int) + ?NewL@CTsFswEngine@@SAPAV1@AAVMTsFswEngineObserver@@@Z @ 4 NONAME ; class CTsFswEngine * CTsFswEngine::NewL(class MTsFswEngineObserver &) + ?ForegroundAppUidL@CTsFswEngine@@QAE?AVTUid@@H@Z @ 5 NONAME ; class TUid CTsFswEngine::ForegroundAppUidL(int) + ?SwitchToAppL@CTsFswEngine@@QAEXH@Z @ 6 NONAME ; void CTsFswEngine::SwitchToAppL(int) + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/eabi/tsfswengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/eabi/tsfswengineu.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,8 @@ +EXPORTS + _ZN12CTsFswEngine12SwitchToAppLEi @ 1 NONAME + _ZN12CTsFswEngine17ForegroundAppUidLEi @ 2 NONAME + _ZN12CTsFswEngine4NewLER20MTsFswEngineObserver @ 3 NONAME + _ZN12CTsFswEngine5NewLCER20MTsFswEngineObserver @ 4 NONAME + _ZN12CTsFswEngine8FswDataLEv @ 5 NONAME + _ZN12CTsFswEngine9CloseAppLEi @ 6 NONAME + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,24 @@ +/* +* 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: build info file for engine component + * +*/ + + +PRJ_EXPORTS +../inc/tsfswengine.h |../../../inc/tsfswengine.h +../inc/tsfswobservers.h |../../../inc/tsfswobservers.h + +PRJ_MMPFILES +tsfswengine.mmp diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/group/tsfswengine.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/group/tsfswengine.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,58 @@ +/* +* 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: engine component + * +*/ + + +#include + +TARGET tsfswengine.dll +TARGETTYPE DLL +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE tsfswengine.cpp +SOURCE tsfshiddenapplist.cpp +SOURCE tsfsalwaysshownapplist.cpp +SOURCE tsfswidgetlist.cpp +SOURCE tsfswiconcache.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 tspreviewprovider.lib +LIBRARY tsfswutils.lib + +DEBUGLIBRARY flogger.lib + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/inc/enginelogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/enginelogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Defines logs for engine +* +*/ + + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KTsLogFile, "tsfswengine.txt" ); +_LIT( KTsLogPath, "taskswitcher" ); +#define _TSLOG_LOG_COMPONENT_ID 0x0000000 +#endif + +#include "tslogging.h" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/inc/tsfsalwaysshownapplist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfsalwaysshownapplist.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,75 @@ +/* +* 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: Non-closeable app list class + * +*/ + + +#ifndef TSFSALWAYSSHOWNAPPLIST_H +#define TSFSALWAYSSHOWNAPPLIST_H + +#include +#include + +/** + * List of always shown applications. + */ +NONSHARABLE_CLASS( CTsFsAlwaysShownAppList ) : public CBase + { +public: + /** + * Two-phased constructor. + * + * @param aParent + */ + static CTsFsAlwaysShownAppList* NewL(); + + /* + * Default C++ constructor + */ + CTsFsAlwaysShownAppList(); + + /* + * Destructor + */ + ~CTsFsAlwaysShownAppList(); + + /** + * 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& AppList() { return iAppList; } + +private: + void ConstructL(); + RArray iAppList; + RApaLsSession iAppArcSession; + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/inc/tsfshiddenapplist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfshiddenapplist.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,107 @@ +/* +* 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: Class that checks if chosen applications should be hidden +* from the task swap. +* +*/ + + +#ifndef TSFSHIDDENAPPLIST_H_ +#define TSFSHIDDENAPPLIST_H_ + +#include // For CActive, link against: euser.lib +#include // For RTimer, link against: euser.lib +#include // For RProperty +#include "tsfswobservers.h" + +//FORWARD DECLARATIONS +class RWsSession; + +/** + * This class is handling the application which are hidden + * from fast swap feature. + */ +NONSHARABLE_CLASS( CTsFsHiddenAppList ) : public CActive + { +public: + + /** + * Symbian based two phased constructor. + */ + static CTsFsHiddenAppList* NewL( MTsFsHiddenAppListObserver& aObserver ); + + /** + * Symbian based two phased constructor. + */ + static CTsFsHiddenAppList* NewLC( MTsFsHiddenAppListObserver& aObserver ); + + /** + * Destructor + */ + ~CTsFsHiddenAppList(); + + /** + * Whether application is hidden from FSW. + */ + TBool IsHiddenL( TUid aAppUid, const RWsSession& aWsSession, TInt aWgId ); + + /** + * Updating application list + */ + void UpdateListL(); + +protected: + /** + * Default constructor. + */ + CTsFsHiddenAppList( MTsFsHiddenAppListObserver& 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* iHiddenAppList; + + /** + * hidden apps list observer + */ + MTsFsHiddenAppListObserver& iObserver; + }; + +#endif /*TSFSHIDDENAPPLIST_H_*/ diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/inc/tsfswengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswengine.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,326 @@ +/* +* 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: Task monitor engine + * +*/ + + +#ifndef TSFSWENGINE_H +#define TSFSWENGINE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "tspreviewobserver.h" +#include "tsfswentry.h" +#include "tsfswobservers.h" + +class CTsFsAlwaysShownAppList; +class CTsFsHiddenAppList; +class CTsFsWidgetList; +class MTsFswEngineObserver; +class CTsFswIconCache; +class CTsFastSwapPreviewProvider; +class CApaWindowGroupName; + +// 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( CTsFswEngine ) : public CActive, + public MTsFswTaskListObserver, + public MTsFswResourceObserver, + public MTsFsHiddenAppListObserver, + public MTsFastSwapPreviewObserver + { +public: + /** + * Creates a new instance. + * @param aObserver ref to observer + */ + IMPORT_C static CTsFswEngine* NewL( MTsFswEngineObserver& aObserver ); + + /** + * @copydoc NewL + */ + IMPORT_C static CTsFswEngine* NewLC( MTsFswEngineObserver& aObserver ); + + /** + * Destructor. + */ + ~CTsFswEngine(); + + /** + * 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 RTsFswArray& 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 CTsFswClient::TTsFswFgAppType + */ + IMPORT_C TUid ForegroundAppUidL( TInt aType ); + +private: + // from CActive + void RunL(); + TInt RunError( TInt aError ); + void DoCancel(); + + // from MTsFswTaskListObserver + void UpdateTaskList(); + + // from MTsFswResourceObserver + void HandleResourceChange( TInt aType ); + + // from MTsFsHiddenAppListObserver + void HiddenAppListUpdated(); + + // from MTsFastSwapPreviewObserver + void HandleFswPpApplicationChange( TInt aWgId, TInt aFbsHandle ); + void HandleFswPpApplicationUnregistered( TInt aWgId ); + +private: + /** + * Constructor. + */ + CTsFswEngine( MTsFswEngineObserver& 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, RTsFswArray& 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( CTsFswEntry& aEntry, + const TUid& aAppUid, + TBool& aChanged, + RTsFswArray& aNewList ); + + /** + * Adds running widgets to the list. + * @param aNewList array to add to + */ + void CheckWidgetsL( RTsFswArray& 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 + MTsFswEngineObserver& iObserver; + RTsFswArray iData; // current fsw content, i.e. the task list + CEikonEnv* iEnv; // not own + + // always shown app list, own + CTsFsAlwaysShownAppList* iAlwaysShownAppList; + + // hidden app list, own + CTsFsHiddenAppList* iHiddenAppList; + + // web widget list, own + CTsFsWidgetList* 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 iScreenshots; + + // preview provider instance, own + CTsFastSwapPreviewProvider* iPreviewProvider; + + // timer to defer content refresh + CPeriodic* iUpdateStarter; + + // app icon provider/container instance, own + CTsFswIconCache* 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 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 + TAppUidHexString iFgAppUidStr; + TUid iFgAppUid; + + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/inc/tsfswiconcache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswiconcache.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,100 @@ +/* +* 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: Icon cache +* +*/ + + +#ifndef TSFSWICONCACHE_H_ +#define TSFSWICONCACHE_H_ + +#include +#include + +class CFbsBitmap; +class CGulIcon; + +/** + * App icon cache. + */ +NONSHARABLE_CLASS( CTsFswIconCache ) : public CBase + { +public: + + /** + * Two phased constructor. + */ + static CTsFswIconCache* NewL(); + + /** + * Two phased constructor. + */ + static CTsFswIconCache* NewLC(); + + /** + * Destructor + */ + ~CTsFswIconCache(); + + /** + * 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. + */ + CTsFswIconCache(); + + /** + * 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 STsBitmapPair + { + STsBitmapPair( CFbsBitmap* aBitmap, CFbsBitmap* aMask ) + : iBitmap( aBitmap ), iMask( aMask ) { } + CFbsBitmap* iBitmap; + CFbsBitmap* iMask; + }; + RHashMap iAppIcons; + + CGulIcon* iDefaultIcon; + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/inc/tsfswidgetlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswidgetlist.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,62 @@ +/* +* 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: web widget list + * +*/ + + +#ifndef TSFSWIDGETLIST_H_ +#define TSFSWIDGETLIST_H_ + +#include +#include + +const TUint32 KWidgetAppUidValue = 0x10282822; + +/** + * class handling the list of running wrt widgets + */ +NONSHARABLE_CLASS(CTsFsWidgetList) : public CBase + { +public: + static CTsFsWidgetList* NewL(); + + /** Destructor */ + ~CTsFsWidgetList(); + + /** + * 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 */ + CTsFsWidgetList(); + 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/inc/tsfswobservers.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswobservers.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,80 @@ +/* +* 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: Observer interfaces to get notifications from appui and from engine + * +*/ + + +#ifndef TSFSWOBSERVERS_H +#define TSFSWOBSERVERS_H + +/** + * Interface to get notifications from appui when window groups + * have changed. + */ +class MTsFswTaskListObserver + { +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 MTsFswResourceObserver + { +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 MTsFswEngineObserver + { +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 CTsFsHiddenAppList + * to notify about list change + */ +class MTsFsHiddenAppListObserver + { +public: + /** + * This function is called by CTsFsHiddenAppList when list is changed. + */ + virtual void HiddenAppListUpdated() = 0; + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/src/tsfsalwaysshownapplist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfsalwaysshownapplist.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,119 @@ +/* +* 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: File containing application list classes + * +*/ + + +//INCLUDES: +#include +#include "tsfsalwaysshownapplist.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 KTsFsUidArray[] = + { + 0x102750F0 // Idle App Uid + ,0x0EFC346A //Search App Uid +/* never show menu app */ //,0x101F4CD2 // Menu App Uid + }; + +// ================= MEMBER FUNCTIONS ======================= + +// -------------------------------------------------------------------------- +// CTsFsAlwaysShownAppList::NewL +// -------------------------------------------------------------------------- +// +CTsFsAlwaysShownAppList* CTsFsAlwaysShownAppList::NewL() + { + CTsFsAlwaysShownAppList* self = + new (ELeave) CTsFsAlwaysShownAppList; + CleanupStack::PushL (self ); + self->ConstructL ( ); + CleanupStack::Pop ( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFsAlwaysShownAppList::CTsFsAlwaysShownAppList +// -------------------------------------------------------------------------- +// +CTsFsAlwaysShownAppList::CTsFsAlwaysShownAppList() + { + } + +// -------------------------------------------------------------------------- +// CTsFsAlwaysShownAppList::~CTsFsAlwaysShownAppList +// -------------------------------------------------------------------------- +// +CTsFsAlwaysShownAppList::~CTsFsAlwaysShownAppList( ) + { + iAppList.Close(); + iAppArcSession.Close(); + } + +// -------------------------------------------------------------------------- +// CTsFsAlwaysShownAppList::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFsAlwaysShownAppList::ConstructL( ) + { + User::LeaveIfError( iAppArcSession.Connect() ); + } + +// -------------------------------------------------------------------------- +// CTsFsAlwaysShownAppList::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 CTsFsAlwaysShownAppList::InitializeAlwaysShownListL( ) + { + iAppList.Reset(); + // order of always shown applications + TApaAppInfo applicationInfo; + for (TInt index = 0, + sizeOfArray = ( sizeof(KTsFsUidArray) / sizeof( TUint32 ) ); + index < sizeOfArray; index++ ) + { + // if exists in phone rom + if ( iAppArcSession.GetAppInfo( applicationInfo, + TUid::Uid( KTsFsUidArray[index] ) )!= KErrNotFound ) + { + iAppList.AppendL( TUid::Uid( KTsFsUidArray[index] ) ); + } + } + } + +// -------------------------------------------------------------------------- +// CTsFsAlwaysShownAppList::IsAlwaysShownApp +// If application uid exists in the always shown application list +// -------------------------------------------------------------------------- +// +TBool CTsFsAlwaysShownAppList::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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/src/tsfshiddenapplist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfshiddenapplist.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,226 @@ +/* +* 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: Class that checks if chosen applications should be hidden +* from the task swap. +* +*/ + + +// INCLUDES +#include "tsfshiddenapplist.h" +#include + +#include + +// 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 KTsFsAlwaysHiddenUidArray[] = + { + 0x100056CF // screensaver + }; + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::NewL +// ----------------------------------------------------------------------------- +// +CTsFsHiddenAppList* CTsFsHiddenAppList::NewL( + MTsFsHiddenAppListObserver& aObserver ) + { + CTsFsHiddenAppList* self = + new ( ELeave ) CTsFsHiddenAppList( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::NewLC +// ----------------------------------------------------------------------------- +// +CTsFsHiddenAppList* CTsFsHiddenAppList::NewLC( + MTsFsHiddenAppListObserver& aObserver ) + { + CTsFsHiddenAppList* self = CTsFsHiddenAppList::NewL( aObserver ); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::~CTsFsHiddenAppList +// ----------------------------------------------------------------------------- +// +CTsFsHiddenAppList::~CTsFsHiddenAppList() + { + Cancel(); + + ResetArray(); + delete iHiddenAppList; + + iProperty.Close(); + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::IsHiddenL +// ----------------------------------------------------------------------------- +// +TBool CTsFsHiddenAppList::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( KTsFsAlwaysHiddenUidArray ) / sizeof( TUint32 ); + i != arrCnt; ++i ) + { + if ( KTsFsAlwaysHiddenUidArray[i] == aAppUid.iUid ) + { + ret = ETrue; + break; + } + } + } + } + + CleanupStack::PopAndDestroy( windowName ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::CTsFsHiddenAppList +// ----------------------------------------------------------------------------- +// +CTsFsHiddenAppList::CTsFsHiddenAppList( + MTsFsHiddenAppListObserver& aObserver ) + :CActive( CActive::EPriorityHigh ), iObserver( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::ConstructL +// ----------------------------------------------------------------------------- +// +void CTsFsHiddenAppList::ConstructL() + { + const TInt KMaxGranularity = 4; + CActiveScheduler::Add( this ); + + iHiddenAppList = new (ELeave) CArrayFixFlat( 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(); + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::ResetArray +// ----------------------------------------------------------------------------- +// +void CTsFsHiddenAppList::ResetArray() + { + if ( iHiddenAppList ) + { + iHiddenAppList->Reset(); + } + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::UpdateListL +// ----------------------------------------------------------------------------- +// +void CTsFsHiddenAppList::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(); + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::DoCancel +// ----------------------------------------------------------------------------- +// +void CTsFsHiddenAppList::DoCancel() + { + iProperty.Cancel(); + } + +// ----------------------------------------------------------------------------- +// CTsFsHiddenAppList::RunL +// ----------------------------------------------------------------------------- +// +void CTsFsHiddenAppList::RunL() + { + if ( !IsActive() ) + { + iProperty.Subscribe( iStatus ); + SetActive(); + } + UpdateListL(); + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,1043 @@ +/* +* 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: Task monitor engine + * +*/ + + +#include "tsfswengine.h" +#include "tsfsalwaysshownapplist.h" +#include "tsfshiddenapplist.h" +#include "tsfswidgetlist.h" +#include "tsfswiconcache.h" +#include "tspreviewprovider.h" +#include "tsfswclient.h" +#include +#include +#include +#include // for CleanupResetAndDestroyPushL +#include +#include + +#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" ); + +// -------------------------------------------------------------------------- +// CTsFswEngine::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CTsFswEngine* CTsFswEngine::NewL( MTsFswEngineObserver& aObserver ) + { + CTsFswEngine* self = NewLC( aObserver ); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::NewLC +// -------------------------------------------------------------------------- +// +EXPORT_C CTsFswEngine* CTsFswEngine::NewLC( MTsFswEngineObserver& aObserver ) + { + CTsFswEngine* self = new ( ELeave ) CTsFswEngine( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::CTsFswEngine +// -------------------------------------------------------------------------- +// +CTsFswEngine::CTsFswEngine( MTsFswEngineObserver& aObserver ) + : CActive( EPriorityStandard ), iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFswEngine::ConstructL() + { + iEnv = CEikonEnv::Static(); + + User::LeaveIfError( iWsSession.Connect() ); + User::LeaveIfError( iAppArcSession.Connect() ); + + iHiddenAppList = CTsFsHiddenAppList::NewL( *this ); + iAlwaysShownAppList = CTsFsAlwaysShownAppList::NewL(); + + iWidgetsSupported = FeatureManager::FeatureSupported( KFeatureIdWebWidgets ); + if ( iWidgetsSupported ) + { + iWidgetList = CTsFsWidgetList::NewL(); + } + + // create app icon retriever instance + iAppIcons = CTsFswIconCache::NewL(); + + // get an initial list of tasks + iAppDataRefreshNeeded = ETrue; + CollectTasksL(); + + // listen for app screenshots + iPreviewProvider = CTsFastSwapPreviewProvider::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(); + } + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::~CTsFswEngine +// -------------------------------------------------------------------------- +// +CTsFswEngine::~CTsFswEngine() + { + Cancel(); + iSwiProp.Close(); + + delete iUpdateStarter; + delete iPreviewProvider; + + // delete the bitmaps as the hash map cannot do that + THashMapIter 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; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::FswDataL +// -------------------------------------------------------------------------- +// +EXPORT_C const RTsFswArray& CTsFswEngine::FswDataL() + { + TSLOG_CONTEXT( FswDataL, TSLOG_LOCAL ); + TSLOG1_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 ); + } + } + } + + TSLOG_OUT(); + return iData; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::CloseAppL +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEngine::CloseAppL( TInt aWgId ) + { + TSLOG_CONTEXT( CloseAppL, TSLOG_LOCAL ); + TSLOG1_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( *eventData ) = KWidgetAppUidValue; + eventData += sizeof( TUint32 ); + // Fill bits 32-63 with uid of the widget that should be closed. + reinterpret_cast( *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(); + TSLOG0_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 ); + TSLOG0( TSLOG_INFO, "event sent to wg" ); + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::SwitchToAppL +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEngine::SwitchToAppL( TInt aWgId ) + { + TSLOG_CONTEXT( SwitchToAppL, TSLOG_LOCAL ); + TSLOG1_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 ); + TSLOG1_OUT( "switched to widget %d", idx ); + return; + } + } + + TApaTask task( iEnv->WsSession() ); + task.SetWgId( aWgId ); + task.BringToForeground(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::SwitchToWidgetL +// -------------------------------------------------------------------------- +// +void CTsFswEngine::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 ); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::UpdateTaskList +// Callback from appui +// -------------------------------------------------------------------------- +// +void CTsFswEngine::UpdateTaskList() + { + TSLOG_CONTEXT( UpdateTaskList, TSLOG_LOCAL ); + TSLOG_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(); + TSLOG1( TSLOG_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() ); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::ForegroundAppUidL +// -------------------------------------------------------------------------- +// +EXPORT_C TUid CTsFswEngine::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 Taskswitcher. + + TUid result = KNullUid; + RArray 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 == CTsFswClient::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; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::PublishFgAppUidL +// -------------------------------------------------------------------------- +// +void CTsFswEngine::PublishFgAppUidL() + { + TSLOG_CONTEXT( PublishFgAppUidL, TSLOG_LOCAL ); + TSLOG_IN(); + + TUid newUid = ForegroundAppUidL( CTsFswClient::EUseEmbeddedUid ); + TSLOG2( TSLOG_INFO, "ws says: %x we have: %x", newUid.iUid, iFgAppUid.iUid ); + if ( iFgAppUid != newUid && newUid.iUid ) + { + iFgAppUid = newUid; + iFgAppUidStr.Format( KHexFmt, iFgAppUid.iUid ); + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::UpdateStarterCallback +// Callback for the timer +// -------------------------------------------------------------------------- +// +TInt CTsFswEngine::UpdateStarterCallback( TAny* aParam ) + { + CTsFswEngine* self = static_cast( 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; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::CollectTasksL +// -------------------------------------------------------------------------- +// +TBool CTsFswEngine::CollectTasksL() + { + TSLOG_CONTEXT( CollectTasksL, TSLOG_LOCAL ); + TSLOG_IN(); + + // clear dirty flag + iTaskListDirty = EFalse; + + TBool changed = EFalse; + RTsFswArray newList; + CleanupResetAndDestroyPushL( newList ); + + // update app data if needed + // (usually on startup and when new apps might have been installed) + if ( iAppDataRefreshNeeded ) + { + TSLOG0( TSLOG_INFO, "refreshing app data" ); + iAppArcSession.GetAllApps(); + iAlwaysShownAppList->InitializeAlwaysShownListL(); + iAppDataRefreshNeeded = EFalse; + } + + // get all window groups + RArray 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() ); + TSLOG4( TSLOG_INFO, "[%d] wgid=%d appuid=%x (%S)", i, wgId, + appUid.iUid, &captionDbg ); + TSLOG4( TSLOG_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(); + TSLOG1( TSLOG_INFO, "new list count = %d", newListCount ); + for ( TInt i = 0; i < newListCount; ++i ) + { + TSLOG3( TSLOG_INFO, "[%d] %S wgid=%d", + i, &newList[i]->AppName(), newList[i]->WgId() ); + iData.AppendL( newList[i] ); + newList[i] = 0; + } + CleanupStack::PopAndDestroy( &newList ); + + TSLOG1_OUT( "change flag = %d", changed ); + return changed; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::AddEntryL +// -------------------------------------------------------------------------- +// +TBool CTsFswEngine::AddEntryL( TInt aWgId, const TUid& aAppUid, + CApaWindowGroupName* aWgName, RTsFswArray& aNewList, + TBool aIsWidget ) + { + TBool changed = EFalse; + CTsFswEntry* entry = CTsFswEntry::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; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::CheckIfExistsL +// -------------------------------------------------------------------------- +// +TBool CTsFswEngine::CheckIfExistsL( CTsFswEntry& aEntry, + const TUid& aAppUid, + TBool& aChanged, + RTsFswArray& 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; + } + CTsFswEntry* oldEntry = iData[entryIdx]; + aEntry.SetAppNameL( oldEntry->AppName() ); + aEntry.SetScreenshotHandle( oldEntry->ScreenshotHandle() ); + aEntry.SetAlwaysShown( oldEntry->AlwaysShown() ); + aEntry.SetSystemApp( oldEntry->SystemApp() ); + return ETrue; + } + } + return EFalse; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::CheckWidgetsL +// -------------------------------------------------------------------------- +// +void CTsFswEngine::CheckWidgetsL( RTsFswArray& 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 ); + } + } + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::HiddenAppListUpdated +// Callback from the hidden app list watcher +// -------------------------------------------------------------------------- +// +void CTsFswEngine::HiddenAppListUpdated() + { + UpdateTaskList(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::AppUidForWgIdL +// -------------------------------------------------------------------------- +// +TUid CTsFswEngine::AppUidForWgIdL( TInt aWgId ) + { + CApaWindowGroupName* windowName = + CApaWindowGroupName::NewLC( iWsSession, aWgId ); + TUid appUid = windowName->AppUid(); + CleanupStack::PopAndDestroy( windowName ); + return appUid; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::FindParentWgId +// -------------------------------------------------------------------------- +// +TInt CTsFswEngine::FindParentWgId( TInt aWgId ) + { + TInt parent( KErrNotFound ); + RArray 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; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::FindAppNameLC +// -------------------------------------------------------------------------- +// +HBufC* CTsFswEngine::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; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::CopyBitmapL +// -------------------------------------------------------------------------- +// +CFbsBitmap* CTsFswEngine::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; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::UpdatePreviewContent +// -------------------------------------------------------------------------- +// +void CTsFswEngine::UpdatePreviewContent() + { + TSLOG_CONTEXT( UpdatePreviewContent, TSLOG_LOCAL ); + TSLOG_IN(); + + RArray 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 ) + { + TSLOG1( TSLOG_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; + TSLOG1( TSLOG_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(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::HandleFswPpApplicationChange +// Callback from CTsFastSwapPreviewProvider +// 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 CTsFswEngine::HandleFswPpApplicationChange( TInt aWgId, TInt aFbsHandle ) + { + TSLOG_CONTEXT( HandleFswPpApplicationChange, TSLOG_LOCAL ); + TSLOG2_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() ); + } + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::HandleFswPpApplicationUnregistered +// Callback from CTsFastSwapPreviewProvider +// -------------------------------------------------------------------------- +// +void CTsFswEngine::HandleFswPpApplicationUnregistered( TInt aWgId ) + { + TSLOG_CONTEXT( HandleFswPpApplicationUnregistered, TSLOG_LOCAL ); + TSLOG1_IN( "aWgId = %d", aWgId ); + + CFbsBitmap** bmp = iScreenshots.Find( aWgId ); + if ( bmp ) + { + delete *bmp; + iScreenshots.Remove( aWgId ); + AssignScreenshotHandle( aWgId, 0 ); + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::AssignScreenshotHandle +// Called when a screenshot arrives to check if there is a corresponding +// application in the task list. +// -------------------------------------------------------------------------- +// +void CTsFswEngine::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(); + } + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::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 CTsFswEngine::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 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; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::RunL +// -------------------------------------------------------------------------- +// +void CTsFswEngine::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(); + } + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::DoCancel +// -------------------------------------------------------------------------- +// +void CTsFswEngine::DoCancel() + { + iSwiProp.Cancel(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::RunError +// -------------------------------------------------------------------------- +// +TInt CTsFswEngine::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::HandleResourceChange +// callback from appui's HandleResourceChangeL +// -------------------------------------------------------------------------- +// +void CTsFswEngine::HandleResourceChange( TInt aType ) + { + TSLOG_CONTEXT( HandleResourceChange, TSLOG_LOCAL ); + TSLOG_IN(); + + if ( iPreviewProvider && aType == KEikDynamicLayoutVariantSwitch ) + { + SetPreviewParams(); + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFswEngine::SetPreviewParams +// -------------------------------------------------------------------------- +// +void CTsFswEngine::SetPreviewParams() + { + TSize screenSize = iEnv->ScreenDevice()->SizeInPixels(); + iPreviewProvider->SetPreviewParam( + TSize( screenSize.iWidth / KScreenSizeFactor, + screenSize.iHeight / KScreenSizeFactor ), + EColor64K ); // displaymode is ignored + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/src/tsfswiconcache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswiconcache.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,141 @@ +/* +* 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: Icon cache + * +*/ + + +#include "tsfswiconcache.h" +#include +#include +#include +#include + +// size for the created app icons +const TInt KAppIconWidth = 96; +const TInt KAppIconHeight = 96; + +// -------------------------------------------------------------------------- +// CTsFswIconCache::NewL +// -------------------------------------------------------------------------- +// +CTsFswIconCache* CTsFswIconCache::NewL() + { + CTsFswIconCache* self = new (ELeave) CTsFswIconCache; + CleanupStack::PushL (self ); + self->ConstructL ( ); + CleanupStack::Pop ( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswIconCache::CTsFswIconCache +// -------------------------------------------------------------------------- +// +CTsFswIconCache::CTsFswIconCache() + { + } + +// -------------------------------------------------------------------------- +// CTsFswIconCache::~CTsFswIconCache +// -------------------------------------------------------------------------- +// +CTsFswIconCache::~CTsFswIconCache( ) + { + THashMapIter iter( iAppIcons ); + while ( const TInt* key = iter.NextKey() ) + { + STsBitmapPair* value = iter.CurrentValue(); + delete value->iBitmap; + delete value->iMask; + } + iAppIcons.Close(); + delete iDefaultIcon; + } + +// -------------------------------------------------------------------------- +// CTsFswIconCache::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFswIconCache::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 ); + } + +// -------------------------------------------------------------------------- +// CTsFswIconCache::GetAppIconL +// -------------------------------------------------------------------------- +// +void CTsFswIconCache::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 ); + } + } + +// -------------------------------------------------------------------------- +// CTsFswIconCache::GetIconL +// -------------------------------------------------------------------------- +// +void CTsFswIconCache::GetIconL( const TUid& aAppUid, + CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ) + { + aBitmap = aMask = 0; + STsBitmapPair* 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, STsBitmapPair( aBitmap, aMask ) ); + } + } + +// -------------------------------------------------------------------------- +// CTsFswIconCache::DefaultIcon +// -------------------------------------------------------------------------- +// +void CTsFswIconCache::DefaultIcon( CFbsBitmap*& aBitmap, CFbsBitmap*& aMask ) + { + aBitmap = iDefaultIcon->Bitmap(); + aMask = iDefaultIcon->Mask(); + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/engine/src/tsfswidgetlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswidgetlist.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,89 @@ +/* +* 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: web widget list + * +*/ + + +#include "tsfswidgetlist.h" +#include + +// -------------------------------------------------------------------------- +// CTsFsWidgetList::NewL +// -------------------------------------------------------------------------- +// +CTsFsWidgetList* CTsFsWidgetList::NewL() + { + return new (ELeave) CTsFsWidgetList; + } + +// -------------------------------------------------------------------------- +// CTsFsWidgetList::CTsFsWidgetList +// -------------------------------------------------------------------------- +// +CTsFsWidgetList::CTsFsWidgetList() + { + } + +// -------------------------------------------------------------------------- +// CTsFsWidgetList::~CTsFsWidgetList +// -------------------------------------------------------------------------- +// +CTsFsWidgetList::~CTsFsWidgetList() + { + ResetArrayOfWidgetInfo( iRunningWidgets ); + iRunningWidgets.Reset(); + } + +// -------------------------------------------------------------------------- +// CTsFsWidgetList::CleanupConnect +// -------------------------------------------------------------------------- +// +void CTsFsWidgetList::CleanupConnect( TAny* aThis ) + { + CTsFsWidgetList* self = static_cast( aThis ); + self->iWidgetRegistryClientSession.Disconnect(); + } + +// -------------------------------------------------------------------------- +// CTsFsWidgetList::InitializeWidgetListL +// -------------------------------------------------------------------------- +// +void CTsFsWidgetList::InitializeWidgetListL() + { + ResetArrayOfWidgetInfo( iRunningWidgets ); + iRunningWidgets.Reset(); + User::LeaveIfError( iWidgetRegistryClientSession.Connect() ); + CleanupStack::PushL( TCleanupItem( CleanupConnect, this) ); + iWidgetRegistryClientSession.RunningWidgetsL(iRunningWidgets); + CleanupStack::Pop(); // clean WidgetRegistryClientSession item + iWidgetRegistryClientSession.Disconnect(); + } + +// -------------------------------------------------------------------------- +// CTsFsWidgetList::ResetArrayOfWidgetInfo +// -------------------------------------------------------------------------- +// +void CTsFsWidgetList::ResetArrayOfWidgetInfo( + RWidgetInfoArray& aWidgetInfoArr ) + { + for ( TInt i = 0; i < aWidgetInfoArr.Count(); i++ ) + { + CWidgetInfo *item = aWidgetInfoArr[i]; + delete item; + } + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,28 @@ +/* +* 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: main build info file + * +*/ + + +#include + +PRJ_EXPORTS +../rom/tsfswserver.iby CORE_MW_LAYER_IBY_EXPORT_PATH(tsfswserver.iby) + +#include "../utils/group/bld.inf" +#include "../engine/group/bld.inf" +#include "../server/group/bld.inf" +#include "../client/group/bld.inf" + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/inc/tsfswclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/inc/tsfswclient.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,131 @@ +/* +* 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: Client API + * +*/ + + +#ifndef TSFSWCLIENT_H +#define TSFSWCLIENT_H + +#include +#include "tsfswentry.h" + +class MTsFswObserver; +class CTsFswClientImpl; + +/** + * Client API for the Huriganes Fast Swap Server. + */ +NONSHARABLE_CLASS( CTsFswClient ) : public CBase + { +public: + /** + * Possible values for aType argument of ForegroundAppUid(). + */ + enum TTsFswFgAppType + { + /** + * 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 CTsFswClient* NewL(); + + /** + * Creates a new instance. + * @capability LocalServices + */ + IMPORT_C static CTsFswClient* NewLC(); + + /** + * Destructor. + */ + ~CTsFswClient(); + + /** + * 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( RTsFswArray& 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( MTsFswObserver& 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( TTsFswFgAppType aType ); + +private: + CTsFswClient(); + void ConstructL(); + + CTsFswClientImpl* iImpl; + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/inc/tsfswclientobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/inc/tsfswclientobserver.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,37 @@ +/* +* 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: Client API + * +*/ + + +#ifndef TSFSWCLIENTOBSERVER_H +#define TSFSWCLIENTOBSERVER_H + +#include + +/** + * Observer interface for getting notifications about fast swap content changes. + */ +class MTsFswObserver + { +public: + /** + * Called when there is a change in the fast swap content. + * The data can be queried via CTsFswClient::GetContentL + */ + virtual void HandleFswContentChanged() = 0; + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/inc/tsfswcommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/inc/tsfswcommon.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,40 @@ +/* +* 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: common constants + * +*/ + + +#ifndef TSFSWCOMMON_H +#define TSFSWCOMMON_H + +#include + +_LIT( KTsFswServerName, "tsfswserver" ); +_LIT( KTsFswServerImg, "tsfswserver" ); + +const TUid KTsFswServerUid = { 0x2001CBE1 }; + +enum TTsFswServerMessages + { + ETsFswSubscribe, + ETsFswCancel, + ETsFswGetBufferSize, + ETsFswGetBuffer, // there must be a GetBufferSize request before GetBuffer + ETsFswCloseApp, + ETsFswSwitchToApp, + ETsFswForegroundAppUid + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/rom/tsfswserver.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/rom/tsfswserver.iby Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,27 @@ +/* +* 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: Iby file for fast swap server +* +*/ + + +#ifndef TSFSWSERVER_IBY +#define TSFSWSERVER_IBY + +file=ABI_DIR/BUILD_DIR/tsfswclient.dll SHARED_LIB_DIR/tsfswclient.dll +file=ABI_DIR/BUILD_DIR/tsfswutils.dll SHARED_LIB_DIR/tsfswutils.dll +file=ABI_DIR/BUILD_DIR/tsfswengine.dll SHARED_LIB_DIR/tsfswengine.dll +file=ABI_DIR/BUILD_DIR/tsfswserver.exe SHARED_LIB_DIR/tsfswserver.exe + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,20 @@ +/* +* 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: server component build info file + * +*/ + + +PRJ_MMPFILES +tsfswserver.mmp diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/group/tsfswserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/group/tsfswserver.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,48 @@ +/* +* 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: server component + * +*/ + + +#include + +TARGET tsfswserver.exe +TARGETTYPE EXE +UID 0x0 0x2001CBE1 +// AllFiles cap needed to get icon for wrt widgets +CAPABILITY CAP_SERVER AllFiles + +SOURCEPATH ../src +SOURCE tsfswserver.cpp +SOURCE tsfswsession.cpp +SOURCE tsfswappui.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 tsfswengine.lib +LIBRARY tsfswutils.lib diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/inc/serverlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/inc/serverlogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Defines logs for server +* +*/ + + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KTsLogFile, "tsfswserver.txt" ); +_LIT( KTsLogPath, "taskswitcher" ); +#define _TSLOG_LOG_COMPONENT_ID 0x2001CBE1 + +#endif +#include "tslogging.h" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/inc/tsfswappui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/inc/tsfswappui.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,63 @@ +/* +* 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: appui for server + * +*/ + + +#ifndef TSFSWAPPUI_H +#define TSFSWAPPUI_H + +#include + +class MTsFswTaskListObserver; +class MTsFswResourceObserver; + +/** + * Appui for the fsw server. + * Reimplements HandleWsEventL from base class to get notifications about + * window group changes. + */ +class CTsFswAppUi : public CAknAppUi + { +public: + ~CTsFswAppUi(); + void ConstructL(); + + /** + * Setter function. + * + * @param aTaskListObserver Observer to be notified if task list + * has changed + */ + void SetTaskListObserver( MTsFswTaskListObserver& aTaskListObserver ); + + /** + * Setter function. + * + * @param aResourceObserver Observer to be notified when resources are changed. + */ + void SetResourceObserver( MTsFswResourceObserver& aResourceObserver ); + +private: + // from CEikAppUi + void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); + void HandleResourceChangeL( TInt aType ); + +private: + MTsFswTaskListObserver* iTaskListObserver; // not own + MTsFswResourceObserver* iResourceObserver; // not own + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/inc/tsfswserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/inc/tsfswserver.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,78 @@ +/* +* 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: server class + * +*/ + + +#ifndef TSFSWSERVER_H +#define TSFSWSERVER_H + +#include +#include "tsfswcommon.h" +#include "tsfswobservers.h" + +/** + * Possible panic reasons. + */ +enum TTsFswPanic + { + EPanicBadDescriptor, + EPanicIllegalFunction, + EPanicAccessDenied + }; + +/** + * Panic name. + */ +_LIT( KTsFswPanicName, "tsfsw" ); + +class CTsFswEngine; +class CTsFswAppUi; + +/** + * Ts FastSwap Server. + */ +class CTsFswServer : public CServer2, public MTsFswEngineObserver + { +public: + static CTsFswServer* NewLC( CTsFswAppUi& aAppUi ); + ~CTsFswServer(); + 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: + CTsFswServer( TInt aPriority, CTsFswAppUi& aAppUi ); + void ConstructL(); + CSession2* NewSessionL( const TVersion& aVersion, + const RMessage2& aMessage ) const; + + // from MTsFswEngineObserver + void FswDataChanged(); + TInt FswDataListenerCount(); + +private: + TInt iSessionCount; + CTsFswEngine* iEngine; + CBufFlat* iBuffer; + CTsFswAppUi& iAppUi; + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/inc/tsfswsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/inc/tsfswsession.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,54 @@ +/* +* 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: session class for server + * +*/ + + +#ifndef TSFSWSESSION_H +#define TSFSWSESSION_H + +#include "tsfswserver.h" +#include "tsfswentry.h" + +/** + * Session class. + */ +class CTsFswSession : public CSession2 + { +public: + CTsFswSession(); + 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: + ~CTsFswSession(); + CTsFswServer& Server(); + void ServiceL( const RMessage2& aMessage ); + void ServiceError( const RMessage2& aMessage, TInt aError ); + void CompleteSubscribe( TInt aError ); + + RArray iSubscribeRequests; // non-completed ETsFswSubscribe messages + }; + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/src/tsfswappui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/src/tsfswappui.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,94 @@ +/* +* 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: appui implementation + * +*/ + + +#include "tsfswappui.h" +#include "tsfswobservers.h" + +// -------------------------------------------------------------------------- +// CTsFswAppUi::~CTsFswAppUi +// -------------------------------------------------------------------------- +// +CTsFswAppUi::~CTsFswAppUi() + { + // empty + } + +// -------------------------------------------------------------------------- +// CTsFswAppUi::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFswAppUi::ConstructL() + { + CAknAppUi::BaseConstructL( ENoAppResourceFile | EAknEnableSkin ); + RWindowGroup& windowGroup = CCoeEnv::Static()->RootWin(); + windowGroup.EnableFocusChangeEvents(); + windowGroup.EnableGroupListChangeEvents(); + } + +// -------------------------------------------------------------------------- +// CTsFswAppUi::SetTaskListObserver +// -------------------------------------------------------------------------- +// +void CTsFswAppUi::SetTaskListObserver( MTsFswTaskListObserver& aTaskListObserver ) + { + iTaskListObserver = &aTaskListObserver; + } + +// -------------------------------------------------------------------------- +// CTsFswAppUi::SetResourceObserver +// -------------------------------------------------------------------------- +// +void CTsFswAppUi::SetResourceObserver( MTsFswResourceObserver& aResourceObserver ) + { + iResourceObserver = &aResourceObserver; + } + +// -------------------------------------------------------------------------- +// CTsFswAppUi::HandleWsEventL +// -------------------------------------------------------------------------- +// +void CTsFswAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ) + { + TInt eventType = aEvent.Type(); + + if ( eventType == EEventFocusGroupChanged + || eventType == EEventWindowGroupListChanged ) + { + if ( iTaskListObserver ) + { + iTaskListObserver->UpdateTaskList(); + } + } + + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + } + +// -------------------------------------------------------------------------- +// CTsFswAppUi::HandleResourceChangeL +// -------------------------------------------------------------------------- +// +void CTsFswAppUi::HandleResourceChangeL( TInt aType ) // codescanner::LFunctionCantLeave (virtual) + { + if ( iResourceObserver ) + { + iResourceObserver->HandleResourceChange( aType ); + } + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/src/tsfswserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/src/tsfswserver.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,282 @@ +/* +* 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: server implementation + * +*/ + + +#include "tsfswserver.h" +#include "tsfswsession.h" +#include "tsfswappui.h" +#include "tsfswengine.h" + +#include +#include +#include + +// -------------------------------------------------------------------------- +// CTsFswServer::CTsFswServer +// -------------------------------------------------------------------------- +// +CTsFswServer::CTsFswServer( TInt aPriority, CTsFswAppUi& aAppUi ) + : CServer2( aPriority ), iAppUi( aAppUi ) + { + } + +// -------------------------------------------------------------------------- +// CTsFswServer::NewLC +// -------------------------------------------------------------------------- +// +CTsFswServer* CTsFswServer::NewLC( CTsFswAppUi& aAppUi ) + { + CTsFswServer* self = new ( ELeave ) CTsFswServer( + EPriorityNormal, aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswServer::ConstructL +// -------------------------------------------------------------------------- +// +void CTsFswServer::ConstructL() + { + StartL( KTsFswServerName ); + iEngine = CTsFswEngine::NewL( *this ); + iAppUi.SetTaskListObserver( *iEngine ); + iAppUi.SetResourceObserver( *iEngine ); + } + +// -------------------------------------------------------------------------- +// CTsFswServer::~CTsFswServer +// -------------------------------------------------------------------------- +// +CTsFswServer::~CTsFswServer() + { + delete iBuffer; + delete iEngine; + } + +// -------------------------------------------------------------------------- +// CTsFswServer::NewSessionL +// -------------------------------------------------------------------------- +// +CSession2* CTsFswServer::NewSessionL( const TVersion&, + const RMessage2& ) const + { + return new ( ELeave ) CTsFswSession; + } + +// -------------------------------------------------------------------------- +// CTsFswServer::AddSession +// -------------------------------------------------------------------------- +// +void CTsFswServer::AddSession() + { + ++iSessionCount; + } + +// -------------------------------------------------------------------------- +// CTsFswServer::DropSession +// -------------------------------------------------------------------------- +// +void CTsFswServer::DropSession() + { + --iSessionCount; + } + +// -------------------------------------------------------------------------- +// CTsFswServer::SerializeAndGetBufferSizeL +// -------------------------------------------------------------------------- +// +void CTsFswServer::SerializeAndGetBufferSizeL( const RMessage2& aMessage ) + { + const TInt KBufferExpandSize = 128; + const RTsFswArray& array( iEngine->FswDataL() ); + delete iBuffer; iBuffer = NULL; + iBuffer = CBufFlat::NewL( KBufferExpandSize ); + RBufWriteStream ws; + CleanupClosePushL( ws ); + ws.Open( *iBuffer ); + CTsFswEntry::ExternalizeArrayL( ws, array ); + CleanupStack::PopAndDestroy( &ws ); + TPtr8 p( iBuffer->Ptr( 0 ) ); + TPckg size( p.Length() ); + aMessage.WriteL( 0, size ); + aMessage.Complete( KErrNone ); + } + +// -------------------------------------------------------------------------- +// CTsFswServer::GetBufferL +// -------------------------------------------------------------------------- +// +void CTsFswServer::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 ); + } + +// -------------------------------------------------------------------------- +// CTsFswServer::CloseAppL +// -------------------------------------------------------------------------- +// +void CTsFswServer::CloseAppL( TInt aWgId ) + { + iEngine->CloseAppL( aWgId ); + } + +// -------------------------------------------------------------------------- +// CTsFswServer::SwitchToAppL +// -------------------------------------------------------------------------- +// +void CTsFswServer::SwitchToAppL( TInt aWgId ) + { + iEngine->SwitchToAppL( aWgId ); + } + +// -------------------------------------------------------------------------- +// CTsFswServer::ForegroundAppUidL +// -------------------------------------------------------------------------- +// +void CTsFswServer::ForegroundAppUidL( const RMessage2& aMessage ) + { + TUid uid = iEngine->ForegroundAppUidL( aMessage.Int1() ); + TPckg uidPckg( uid.iUid ); + aMessage.WriteL( 0, uidPckg ); + } + +// -------------------------------------------------------------------------- +// CTsFswServer::FswDataChanged +// callback from engine +// -------------------------------------------------------------------------- +// +void CTsFswServer::FswDataChanged() + { + // notify all sessions about the change + iSessionIter.SetToFirst(); + while ( CTsFswSession* session = static_cast( iSessionIter++ ) ) + { + if ( session->IsListening() ) + { + session->FswDataChanged(); + } + } + } + +// -------------------------------------------------------------------------- +// CTsFswServer::FswDataListenersCount +// callback from engine +// -------------------------------------------------------------------------- +// +TInt CTsFswServer::FswDataListenerCount() + { + TInt n = 0; + iSessionIter.SetToFirst(); + while ( CTsFswSession* session = static_cast( iSessionIter++ ) ) + { + if ( session->IsListening() ) + { + ++n; + } + } + return n; + } + +// -------------------------------------------------------------------------- +// RunServerL +// -------------------------------------------------------------------------- +// +static void RunServerL( CTsFswAppUi& aAppUi, CEikonEnv& aEnv ) + { + // change thread name + User::LeaveIfError( RThread::RenameMe( KTsFswServerName ) ); + + // set app as hidden + CApaWindowGroupName* wgName = + CApaWindowGroupName::NewL( aEnv.WsSession(), + aEnv.RootWin().Identifier() ); + wgName->SetHidden( ETrue ); + wgName->SetWindowGroupName( aEnv.RootWin() ); + delete wgName; + + // start server + CTsFswServer* server = CTsFswServer::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 ); + CTsFswAppUi* ui = new CTsFswAppUi; + 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/server/src/tsfswsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/server/src/tsfswsession.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,158 @@ +/* +* 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: session implementation + * +*/ + + +#include "tsfswsession.h" + +// -------------------------------------------------------------------------- +// CTsFswSession::CTsFswSession +// -------------------------------------------------------------------------- +// +CTsFswSession::CTsFswSession() + { + } + +// -------------------------------------------------------------------------- +// CTsFswSession::Server +// -------------------------------------------------------------------------- +// +CTsFswServer& CTsFswSession::Server() + { + return *static_cast( + const_cast( CSession2::Server() ) ); + } + +// -------------------------------------------------------------------------- +// CTsFswSession::CreateL +// -------------------------------------------------------------------------- +// +void CTsFswSession::CreateL() // codescanner::LFunctionCantLeave (virtual) + { + Server().AddSession(); + } + +// -------------------------------------------------------------------------- +// CTsFswSession::~CTsFswSession +// -------------------------------------------------------------------------- +// +CTsFswSession::~CTsFswSession() + { + CompleteSubscribe( KErrCancel ); + iSubscribeRequests.Close(); + Server().DropSession(); + } + +// -------------------------------------------------------------------------- +// CTsFswSession::CompleteSubscribe +// -------------------------------------------------------------------------- +// +void CTsFswSession::CompleteSubscribe( TInt aError ) + { + for ( TInt i = 0, ie = iSubscribeRequests.Count(); i != ie; ++i ) + { + iSubscribeRequests[i].Complete( aError ); + } + iSubscribeRequests.Reset(); + } + +// -------------------------------------------------------------------------- +// CTsFswSession::ServiceL +// -------------------------------------------------------------------------- +// +void CTsFswSession::ServiceL( const RMessage2& aMessage ) + { + if ( !aMessage.HasCapability( ECapabilityLocalServices ) ) + { + aMessage.Panic( KTsFswPanicName, EPanicAccessDenied ); + return; + } + + switch ( aMessage.Function() ) + { + case ETsFswSubscribe: + iSubscribeRequests.AppendL( aMessage ); + break; + + case ETsFswCancel: + CompleteSubscribe( KErrCancel ); + aMessage.Complete( KErrNone ); + break; + + case ETsFswGetBufferSize: + Server().SerializeAndGetBufferSizeL( aMessage ); + break; + + case ETsFswGetBuffer: + Server().GetBufferL( aMessage ); + break; + + case ETsFswCloseApp: + Server().CloseAppL( aMessage.Int0() ); + aMessage.Complete( KErrNone ); + break; + + case ETsFswSwitchToApp: + Server().SwitchToAppL( aMessage.Int0() ); + aMessage.Complete( KErrNone ); + break; + + case ETsFswForegroundAppUid: + Server().ForegroundAppUidL( aMessage ); + aMessage.Complete( KErrNone ); + break; + + default: + aMessage.Panic( KTsFswPanicName, EPanicIllegalFunction ); + break; + } + } + +// -------------------------------------------------------------------------- +// CTsFswSession::ServiceError +// -------------------------------------------------------------------------- +// +void CTsFswSession::ServiceError( const RMessage2& aMessage, + TInt aError ) + { + if ( aError == KErrBadDescriptor ) + { + aMessage.Panic( KTsFswPanicName, EPanicBadDescriptor ); + } + CSession2::ServiceError( aMessage, aError ); + } + +// -------------------------------------------------------------------------- +// CTsFswSession::FswDataChanged +// called by server when notification is received from engine +// -------------------------------------------------------------------------- +// +void CTsFswSession::FswDataChanged() + { + CompleteSubscribe( KErrNone ); + } + +// -------------------------------------------------------------------------- +// CTsFswSession::IsListening +// -------------------------------------------------------------------------- +// +TBool CTsFswSession::IsListening() + { + return iSubscribeRequests.Count() > 0; + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/utils/bwins/tsfswutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/utils/bwins/tsfswutilsu.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +EXPORTS + ?ScreenshotHandle@CTsFswEntry@@QBEHXZ @ 1 NONAME ; int CTsFswEntry::ScreenshotHandle(void) const + ?AlwaysShown@CTsFswEntry@@QBEHXZ @ 2 NONAME ; int CTsFswEntry::AlwaysShown(void) const + ?SystemApp@CTsFswEntry@@QBEHXZ @ 3 NONAME ; int CTsFswEntry::SystemApp(void) const + ?SetAppNameL@CTsFswEntry@@QAEXABVTDesC16@@@Z @ 4 NONAME ; void CTsFswEntry::SetAppNameL(class TDesC16 const &) + ?ExternalizeL@CTsFswEntry@@QAEXAAVRWriteStream@@@Z @ 5 NONAME ; void CTsFswEntry::ExternalizeL(class RWriteStream &) + ?ExternalizeArrayL@CTsFswEntry@@SAXAAVRWriteStream@@ABV?$RPointerArray@VCTsFswEntry@@@@@Z @ 6 NONAME ; void CTsFswEntry::ExternalizeArrayL(class RWriteStream &, class RPointerArray const &) + ?AppName@CTsFswEntry@@QBEABVTDesC16@@XZ @ 7 NONAME ; class TDesC16 const & CTsFswEntry::AppName(void) const + ?AppUid@CTsFswEntry@@QBE?AVTUid@@XZ @ 8 NONAME ; class TUid CTsFswEntry::AppUid(void) const + ?AppIconMaskHandle@CTsFswEntry@@QBEHXZ @ 9 NONAME ; int CTsFswEntry::AppIconMaskHandle(void) const + ?SetAppIconHandles@CTsFswEntry@@QAEXHH@Z @ 10 NONAME ; void CTsFswEntry::SetAppIconHandles(int, int) + ?SetAlwaysShown@CTsFswEntry@@QAEXH@Z @ 11 NONAME ; void CTsFswEntry::SetAlwaysShown(int) + ?NewLC@CTsFswEntry@@SAPAV1@XZ @ 12 NONAME ; class CTsFswEntry * CTsFswEntry::NewLC(void) + ?NewL@CTsFswEntry@@SAPAV1@XZ @ 13 NONAME ; class CTsFswEntry * CTsFswEntry::NewL(void) + ?WgId@CTsFswEntry@@QBEHXZ @ 14 NONAME ; int CTsFswEntry::WgId(void) const + ?SetWidget@CTsFswEntry@@QAEXH@Z @ 15 NONAME ; void CTsFswEntry::SetWidget(int) + ?SetAppUid@CTsFswEntry@@QAEXABVTUid@@@Z @ 16 NONAME ; void CTsFswEntry::SetAppUid(class TUid const &) + ?SetWgId@CTsFswEntry@@QAEXH@Z @ 17 NONAME ; void CTsFswEntry::SetWgId(int) + ?SetScreenshotHandle@CTsFswEntry@@QAEXH@Z @ 18 NONAME ; void CTsFswEntry::SetScreenshotHandle(int) + ?InternalizeL@CTsFswEntry@@QAEXAAVRReadStream@@@Z @ 19 NONAME ; void CTsFswEntry::InternalizeL(class RReadStream &) + ?AppIconBitmapHandle@CTsFswEntry@@QBEHXZ @ 20 NONAME ; int CTsFswEntry::AppIconBitmapHandle(void) const + ?SetSystemApp@CTsFswEntry@@QAEXH@Z @ 21 NONAME ; void CTsFswEntry::SetSystemApp(int) + ?Widget@CTsFswEntry@@QBEHXZ @ 22 NONAME ; int CTsFswEntry::Widget(void) const + ?InternalizeArrayL@CTsFswEntry@@SAXAAVRReadStream@@AAV?$RPointerArray@VCTsFswEntry@@@@@Z @ 23 NONAME ; void CTsFswEntry::InternalizeArrayL(class RReadStream &, class RPointerArray &) + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/utils/eabi/tsfswutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/utils/eabi/tsfswutilsu.def Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +EXPORTS + _ZN11CTsFswEntry11SetAppNameLERK7TDesC16 @ 1 NONAME + _ZN11CTsFswEntry12ExternalizeLER12RWriteStream @ 2 NONAME + _ZN11CTsFswEntry12InternalizeLER11RReadStream @ 3 NONAME + _ZN11CTsFswEntry12SetSystemAppEi @ 4 NONAME + _ZN11CTsFswEntry14SetAlwaysShownEi @ 5 NONAME + _ZN11CTsFswEntry17ExternalizeArrayLER12RWriteStreamRK13RPointerArrayIS_E @ 6 NONAME + _ZN11CTsFswEntry17InternalizeArrayLER11RReadStreamR13RPointerArrayIS_E @ 7 NONAME + _ZN11CTsFswEntry17SetAppIconHandlesEii @ 8 NONAME + _ZN11CTsFswEntry19SetScreenshotHandleEi @ 9 NONAME + _ZN11CTsFswEntry4NewLEv @ 10 NONAME + _ZN11CTsFswEntry5NewLCEv @ 11 NONAME + _ZN11CTsFswEntry7SetWgIdEi @ 12 NONAME + _ZN11CTsFswEntry9SetAppUidERK4TUid @ 13 NONAME + _ZN11CTsFswEntry9SetWidgetEi @ 14 NONAME + _ZNK11CTsFswEntry11AlwaysShownEv @ 15 NONAME + _ZNK11CTsFswEntry16ScreenshotHandleEv @ 16 NONAME + _ZNK11CTsFswEntry17AppIconMaskHandleEv @ 17 NONAME + _ZNK11CTsFswEntry19AppIconBitmapHandleEv @ 18 NONAME + _ZNK11CTsFswEntry4WgIdEv @ 19 NONAME + _ZNK11CTsFswEntry6AppUidEv @ 20 NONAME + _ZNK11CTsFswEntry6WidgetEv @ 21 NONAME + _ZNK11CTsFswEntry7AppNameEv @ 22 NONAME + _ZNK11CTsFswEntry9SystemAppEv @ 23 NONAME + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/utils/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/utils/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,23 @@ +/* +* 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: build info file for utility component + * +*/ + + +PRJ_EXPORTS +../inc/tsfswentry.h |../../../inc/tsfswentry.h + +PRJ_MMPFILES +tsfswutils.mmp diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/utils/group/tsfswutils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/utils/group/tsfswutils.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,32 @@ +/* +* 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: utility component + * +*/ + + +#include + +TARGET tsfswutils.dll +TARGETTYPE DLL +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE tsfswentry.cpp + +MW_LAYER_SYSTEMINCLUDE +USERINCLUDE ../inc + +LIBRARY euser.lib +LIBRARY estor.lib diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/utils/inc/tsfswentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/utils/inc/tsfswentry.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,129 @@ +/* +* 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: Task list entry + * +*/ + + +#ifndef TSFSWENTRY_H +#define TSFSWENTRY_H + +#include +#include + +class CTsFswEntry; +class RReadStream; +class RWriteStream; + +typedef RPointerArray RTsFswArray; + +/** + * An entry in the task list. + */ +NONSHARABLE_CLASS( CTsFswEntry ) : public CBase + { +public: + IMPORT_C static CTsFswEntry* NewL(); + IMPORT_C static CTsFswEntry* NewLC(); + ~CTsFswEntry(); + + /** + * 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 RTsFswArray& aArray ); + IMPORT_C static void InternalizeArrayL( RReadStream& aStream, + RTsFswArray& 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 fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/utils/inc/utilslogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/utils/inc/utilslogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Defines logs for utils +* +*/ + + +#ifdef _DEBUG // codescanner::ifpreprocessor +_LIT( KTsLogFile, "tsfswutils.txt" ); +_LIT( KTsLogPath, "taskswitcher" ); +#define _TSLOG_LOG_COMPONENT_ID 0x0000000 + +#endif +#include "tslogging.h" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/contextengine/tsfswserver/utils/src/tsfswentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/contextengine/tsfswserver/utils/src/tsfswentry.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,277 @@ +/* +* 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: Task list entry + * +*/ + + +#include "tsfswentry.h" +#include + +// -------------------------------------------------------------------------- +// CTsFswEntry::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CTsFswEntry* CTsFswEntry::NewL() + { + CTsFswEntry* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::NewLC +// -------------------------------------------------------------------------- +// +EXPORT_C CTsFswEntry* CTsFswEntry::NewLC() + { + CTsFswEntry* self = new ( ELeave ) CTsFswEntry; + CleanupStack::PushL( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::~CTsFswEntry +// -------------------------------------------------------------------------- +// +CTsFswEntry::~CTsFswEntry() + { + delete iAppName; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SetWgId +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::SetWgId( TInt aWgId ) + { + iWgId = aWgId; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SetAppUid +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::SetAppUid( const TUid& aUid ) + { + iAppUid = aUid; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SetAppNameL +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::SetAppNameL( const TDesC& aAppName ) + { + delete iAppName; iAppName = 0; + iAppName = aAppName.AllocL(); + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SetScreenshotHandle +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::SetScreenshotHandle( TInt aHandle ) + { + iScreenshotHandle = aHandle; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SetAlwaysShown +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::SetAlwaysShown( TBool aValue ) + { + iAlwaysShown = aValue; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SetSystemApp +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::SetSystemApp( TBool aValue ) + { + iSystemApp = aValue; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SetWidget +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::SetWidget( TBool aValue ) + { + iWidget = aValue; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SetAppIconHandles +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::SetAppIconHandles( TInt aBitmapHandle, TInt aMaskHandle ) + { + iAppIconBitmapHandle = aBitmapHandle; + iAppIconMaskHandle = aMaskHandle; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::WgId +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFswEntry::WgId() const + { + return iWgId; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::AppUid +// -------------------------------------------------------------------------- +// +EXPORT_C TUid CTsFswEntry::AppUid() const + { + return iAppUid; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::AppName +// -------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CTsFswEntry::AppName() const + { + return iAppName ? *iAppName : KNullDesC(); + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::ScreenshotHandle +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFswEntry::ScreenshotHandle() const + { + return iScreenshotHandle; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::AlwaysShown +// -------------------------------------------------------------------------- +// +EXPORT_C TBool CTsFswEntry::AlwaysShown() const + { + return iAlwaysShown; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::SystemApp +// -------------------------------------------------------------------------- +// +EXPORT_C TBool CTsFswEntry::SystemApp() const + { + return iSystemApp; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::Widget +// -------------------------------------------------------------------------- +// +EXPORT_C TBool CTsFswEntry::Widget() const + { + return iWidget; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::AppIconBitmapHandle +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFswEntry::AppIconBitmapHandle() const + { + return iAppIconBitmapHandle; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::AppIconMaskHandle +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CTsFswEntry::AppIconMaskHandle() const + { + return iAppIconMaskHandle; + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::ExternalizeL +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::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 ); + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::InternalizeL +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::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(); + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::ExternalizeArrayL +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::ExternalizeArrayL( RWriteStream& aStream, + const RTsFswArray& aArray ) + { + TInt count = aArray.Count(); + aStream.WriteInt32L( count ); + for ( TInt i = 0; i < count; ++i ) + { + aArray[i]->ExternalizeL( aStream ); + } + } + +// -------------------------------------------------------------------------- +// CTsFswEntry::InternalizeArrayL +// -------------------------------------------------------------------------- +// +EXPORT_C void CTsFswEntry::InternalizeArrayL( RReadStream& aStream, + RTsFswArray& aArray ) + { + aArray.ResetAndDestroy(); + TInt count = aStream.ReadInt32L(); + for ( TInt i = 0; i < count; ++i ) + { + CTsFswEntry* entry = CTsFswEntry::NewLC(); + entry->InternalizeL( aStream ); + aArray.AppendL( entry ); + CleanupStack::Pop( entry ); + } + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/group/bld.inf --- a/taskswitcher/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ b/taskswitcher/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -1,21 +1,21 @@ /* -* ============================================================================ -* Name : bld.inf -* Part of : Huriganes / Teleport -* Description : Build info file for Teleport -* Version : %version: sa1spcx1#33 % +* 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". * -* 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. -* ============================================================================ +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build info file for Taskswitcher +* */ + #include "../contextengine/group/bld.inf" -#include "../teleportui/group/bld.inf" +#include "../taskswitcherui/group/bld.inf" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,31 @@ +/* +* 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: +* +*/ +#include + +PRJ_EXPORTS +// iby file +../rom/taskswitcher.iby CORE_MW_LAYER_IBY_EXPORT_PATH(taskswitcher.iby) +../rom/taskswitcherresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(taskswitcherresources.iby) + +// stub sis +../sis/stubs/taskswitcher_stub.sis /epoc32/data/z/system/install/taskswitcher_stub.sis +../sis/stubs/taskswitcher_stub.sis /epoc32/release/winscw/udeb/z/system/install/taskswitcher_stub.sis + +#include "../taskswitcherappecom/group/bld.inf" +#include "../taskswitcherapp/group/bld.inf" + +PRJ_MMPFILES diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/inc/tsappuid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/inc/tsappuid.hrh Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef TSAPPUID_HRH +#define TSAPPUID_HRH + +#define KTsAppUidValue 0x20016BF0 + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/inc/tsgraphicids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/inc/tsgraphicids.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TSGRAPHICIDS_H +#define TSGRAPHICIDS_H + +#include + +/** + * Logical IDs for all icons used in Taskswitcher. + */ +enum TTsGraphicId + { + ETsGraphicIdLAST + }; + +#endif // TSGRAPHICIDS_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/inc/tsgraphictab.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/inc/tsgraphictab.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TSGRAPHICTAB_H +#define TSGRAPHICTAB_H + +#include + +#include +#include // skinned icons +#include // 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 TTsGraphicId. (except the last-marker) + */ +static const TText* const KTsGraphicFiles[] = + { + _S( "" ) + }; + +/** + * Skin related IDs. Not in use yet. + * Use all zeros if image file should be used instead. + * Order and count must match TTsGraphicId. (except the last-marker) + */ +static const TAknsItemID KTsGraphicSkinIds[] = + { + KAknsIIDNone + }; + +#endif // TSGRAPHICTAB_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/inc/tsuid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/inc/tsuid.hrh Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,24 @@ +/* +* 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: Taskswitcher application's UID3 + * +*/ + + +#ifndef TSAPPUID_HRH +#define TSAPPUID_HRH + +#define KTsAppUidValue 0x20016BF0 + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/rom/taskswitcher.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/rom/taskswitcher.iby Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TASKSWITCHER_IBY +#define TASKSWITCHER_IBY + +// AknCapServer alternate fast swap plugin +ECOM_PLUGIN( tsappecom.dll, tsappecom.rsc ) + +data=DATAZ_/private/10003a3f/apps/tstaskswitcher_reg.rsc private/10003a3f/import/apps/tstaskswitcher_reg.rsc +file=ABI_DIR/BUILD_DIR/taskswitcher.exe PROGRAMS_DIR/hgteleport.exe + +// backup registration +data=DATAZ_/private/20016BF0/backup_registration.xml private/20016BF0/backup_registration.xml + +// stub sis +data=ZSYSTEM/install/taskswitcher_stub.sis system/install/taskswitcher_stub.sis + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/rom/taskswitcherresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/rom/taskswitcherresources.iby Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TASKSWITCHERRES_IBY +#define TASKSWITCHERRES_IBY + +// resources for taskswitcher app +data=DATAZ_/APP_RESOURCE_DIR/tstaskswitcher.rsc APP_RESOURCE_DIR/hgteleport.rsc + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/sis/stubs/createstubs.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/sis/stubs/createstubs.bat Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,17 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +for %%f in (*.pkg) do makesis -s %%f diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.pkg Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,40 @@ +; +; 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: +; +; ------------------------------------------------------------------------------ +; Taskswitcher stub SIS package file. +; Used to enable Taskswitcher 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 +#{"taskswitcher"},(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\tstaskswitcher_reg.rsc" + +""-"Z:\sys\bin\tsappecom.dll" +""-"Z:\resource\plugins\tsappecom.rsc" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.sis Binary file taskswitcher/taskswitcherui/sis/stubs/taskswitcher_stub.sis has changed diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/sis/taskswitcher.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/sis/taskswitcher.pkg Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,33 @@ +; +; 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: +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"taskswitcher"},(0x20016BF0),1,0,0,TYPE=SA, RU + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +"/epoc32/release/armv5/urel/taskswitcher.exe" - "!:\sys\bin\hgteleport.exe" +"/epoc32/data/z/resource/apps/tstaskswitcher.rsc" - "!:\resource\apps\hgteleport.rsc" +"/epoc32/data/z/private/10003a3f/apps/tstaskswitcher_reg.rsc" - "!:\private\10003a3f\import\apps\tstaskswitcher_reg.rsc" + +"/epoc32/release/armv5/urel/tsappecom.dll" - "!:\sys\bin\tsappecom.dll" +"/epoc32/data/z/resource/plugins/tsappecom.rsc" - "!:\resource\plugins\tsappecom.rsc" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/data/tstaskswitcher.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/data/tstaskswitcher.rss Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,282 @@ +/* +* 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: Resource files for task switcher app +* +*/ + + +NAME HGTL + +#include +#include +#include +#include +#include + +#include +#include + +#include "tscommands.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_ts_menubar; + cba = r_ts_cba_nontouch; + } + +// --------------------------------------------------------- +// +// CBA for non-touch. +// +// --------------------------------------------------------- +// +RESOURCE CBA r_ts_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_ts_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_ts_menubar +// Menubar for ts +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_ts_menubar + { + titles = + { + MENU_TITLE {menu_pane = r_ts_menu;} + }; + } + + +// --------------------------------------------------------- +// +// r_ts_menu +// Menu for "Options" +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_ts_menu + { + items = + { + MENU_ITEM { command = ETsCmdHelp; txt = qtn_options_help; }, + MENU_ITEM { command = EAknSoftkeyExit; txt = text_softkey_exit; } + }; + } + +// --------------------------------------------------------- +// +// r_ts_panel__name +// task switcher panel name +// +// --------------------------------------------------------- +// +RESOURCE TBUF r_ts_panel_name + { + buf="Task Switcher"; + } + +// --------------------------------------------------------- +// +// r_ts_message_dialog_okcancel +// message dialog with ok and cancel softkeys labels +// +// --------------------------------------------------------- +// +RESOURCE DIALOG r_ts_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_ts_message_dialog_yesno +// message dialog with yes and no softkeys labels +// +// --------------------------------------------------------- +// +RESOURCE DIALOG r_ts_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_ts_message_dialog_ok +// message dialog with ok softkey label +// +// --------------------------------------------------------- +// +RESOURCE DIALOG r_ts_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_ts_fsw_confirm_close_query +// shown when Clear key is pressed in FSW +// +// --------------------------------------------------------- +// +RESOURCE DIALOG r_ts_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_ts_title { buf = "Task Switcher"; } + +RESOURCE TBUF r_ts_fsw_activate { buf = qtn_task_switcher_popup_open_app; } +RESOURCE TBUF r_ts_fsw_close { buf = qtn_task_switcher_popup_close_app; } +RESOURCE TBUF r_ts_fsw_close_all { buf = qtn_task_switcher_popup_close_all; } +RESOURCE TBUF r_ts_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 fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/data/tstaskswitcher_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/data/tstaskswitcher_reg.rss Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2008-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: task switcher application's registration resource file +* +*/ + + +#include +#include + +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 fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/group/backup_registration.xml Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,30 @@ +/* +* 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: Build information file for task switcher +* +*/ + + +#include + +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/tsuid.hrh |../../inc/tsuid.hrh + +PRJ_MMPFILES +tsapp.mmp + +PRJ_TESTMMPFILES diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/group/tsapp.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/group/tsapp.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,101 @@ +/* +* 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: mmp file for taskswitcher application +* +*/ + + +#include +#include +#include "../inc/tsuid.hrh" + +EPOCHEAPSIZE 0x100000 0xa00000 // 1 Mb - 10 Mb +EPOCSTACKSIZE 0x5000 // 20KB + +TARGET taskswitcher.exe +TARGETTYPE exe +UID 0x100039CE KTsAppUidValue +CAPABILITY CAP_APPLICATION NetworkControl PowerMgmt +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE tsappui.cpp +SOURCE tsapplication.cpp +SOURCE tsdocument.cpp +SOURCE tstaskswitcher.cpp +SOURCE tsappview.cpp +SOURCE tsfastswaparea.cpp +SOURCE tsfastswapgrid.cpp +SOURCE tsdevicestate.cpp +SOURCE tseventcontroler.cpp +SOURCE tsphysicsengine.cpp +SOURCE tsphysics.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 tscontextservicesutils.lib +LIBRARY tsfswclient.lib +LIBRARY tsfswutils.lib + +SOURCEPATH ../data +START RESOURCE tstaskswitcher.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END + +SOURCEPATH ../data +START RESOURCE tstaskswitcher_reg.rss +DEPENDS tstaskswitcher.rsg +TARGETPATH /private/10003a3f/apps +END diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsapplication.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,48 @@ +/* +* 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: Application class + * +*/ + + +#ifndef TSAPPLICATION_H +#define TSAPPLICATION_H + +#include +#include + +class CTsApplication : 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 // TSAPPLICATION_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsapplogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsapplogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines logs for tsapp +* +*/ + + +#ifdef _DEBUG +#include "../inc/tsuid.hrh" +_LIT( KTsLogFile, "tsapp.txt" ); +_LIT( KTsLogPath, "taskswitcher" ); +#define _TSLOG_LOG_COMPONENT_ID KTsAppUidValue + +#endif +#include "tslogging.h" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappui.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,164 @@ +/* +* 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: appui + * +*/ + + +#ifndef TSAPPUI_H +#define TSAPPUI_H + +#include +#include + +#include +#include + +#include "tsproplistener.h" +#include "tscenreplistener.h" + +// FORWARD DECLARATIONS +class CTsAppView; +class CTsActionUtility; +class CTsDeviceState; + +/** + * CTsAppUi + * Appui for tsak swicher app + */ +class CTsAppUi : public CAknAppUi, + public MTsPropertyChangeObserver, + public MTsCenrepChangeObserver, + public MGfxTransEffectObserver + { + +public: + /** + * Perform the second phase construction of a CTsAppUi 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 + */ + CTsAppUi(); + + /** + * Destroy the object and release all memory objects + */ + ~CTsAppUi(); + +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 MTsCenrepChangeObserver + */ + void CenrepChanged( TUint32 aKey, TInt aNewValue ); + + +private: + + // From MTsPropertyChangeObserver + 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 Taskswitcher to + * background/foreground and short/long app key press. + * + * @param aValue Property value. + */ + void SetTaskswitcherStateProperty( TInt aValue ); + + /** + * Sends request for close some + * other apps to free memory for + * task switcher app + */ + void FreeMemoryRequest(); + + static TInt GoToBackgroundTimerCallback( TAny* aParam ); + +private: + + // Taskswitcher application view, owned + CTsAppView* iAppView; + + // Listener for app key long press P&S, owned + CTsPropertyListener* iPropListener; + + // Tells if Taskswitcher is in foreground or in background + TBool iForeground; + + // Application arch task which refers to our own app + TApaTask iApplicationTask; + + // Device state + CTsDeviceState* 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. + */ + CTsCenrepListener* iThemeEffectsEnabledWatcher; + }; + +#endif // TSAPPUI_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappview.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,242 @@ +/* +* 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: appui + * +*/ + + +#ifndef TSAPPVIEW_H +#define TSAPPVIEW_H + +#include +#include +#include +#include "tsdevicestate.h" +#include "tsdatachangeobserver.h" +#include "tseventcontrolerobserver.h" + +// FORWARD DECLARATIONS +class CAknsFrameBackgroundControlContext; +class CTsFastSwapArea; +class CAknPopupHeadingPane; +class CTsEventControler; + +/** + * Taskswitcher applicatio view class. + */ +class CTsAppView : public CCoeControl, public MCoeControlObserver, + public MTsDeviceStateObserver, + public MAknFadedComponent, + public MTsDataChangeObserver, + public MTsEventControlerObserver + { +public: + + /** + * Two-phase constructor. + * + * @param aRect Area where view should draw itself. + */ + static CTsAppView* NewL(const TRect& aRect, + CTsDeviceState& aDeviceState); + + /** + * @copydoc NewL + */ + static CTsAppView* NewLC(const TRect& aRect, + CTsDeviceState& aDeviceState); + + /** + * Destructor. + */ + ~CTsAppView(); + + /** + * 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 MTsDeviceStateObserver + void HandleDeviceStateChanged( TChangeType aChangeType ); + +protected: // from MAknFadedComponent + TInt CountFadedComponents(); + CCoeControl* FadedComponent( TInt aIndex ); + +protected: // from MTsCenrepChangeObserver + void CenrepChanged( TUint32 aKey, TInt aNewValue ); + +protected: // from MTsDataChangeObserver + void DataChanged( CCoeControl* aWhere, TInt aNewCount ); + +private: + + /** + * @copydoc NewL + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ constructor. + */ + CTsAppView( CTsDeviceState& 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& aRects ); + + /** + * 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 taskswitcher app. + * (the automatic effects that are applied when coming/leaving foreground) + */ + void DisableAppSwitchEffects(); + + +public://From MTsEventControlerObserver + /** + * 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 + CTsDeviceState& iDeviceState; + + // Background context, owned + CAknsFrameBackgroundControlContext* iBgContext; + + // Fast Swap area, owned + CTsFastSwapArea* 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; + CTsEventControler* iEvtHandler; //own + }; + +#endif // TSAPPVIEW_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tscommands.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tscommands.hrh Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: command ids +* +*/ + + +#ifndef __TSCOMMANDS_HRH__ +#define __TSCOMMANDS_HRH__ + +enum + { + ETsCmdBase = 20000, + ETsCmdHelp + }; + +#endif //__TSCOMMANDS_HRH__ diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsdatachangeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsdatachangeobserver.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,35 @@ +/* +* 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: + * +*/ + + +#ifndef TSDATACHANGEINTERFACE_H +#define TSDATACHANGEINTERFACE_H + +#include + +class CCoeControl; + +/** + * Callback mixin class to move the whole app to background or foreground. + */ +class MTsDataChangeObserver + { +public: + virtual void DataChanged( CCoeControl* aWhere, TInt aNewCount ) = 0; + }; + +#endif // TSDATACHANGEINTERFACE_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsdevicestate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsdevicestate.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,227 @@ +/* +* 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: Device state (touch mode, screen orientation) handler + * +*/ + + +#ifndef TSDEVICESTATE_H_ +#define TSDEVICESTATE_H_ + +#include +#include "tsappui.h" +#include "tsproplistener.h" + +/** + * Interface for getting notifications about screen orientation + * and/or touch state etc. changes. + */ +class MTsDeviceStateObserver + { +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 CTsDeviceState : + public CBase, + public MTsPropertyChangeObserver + { +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 CTsDeviceState* NewL(); + + /** + * Destructor. + */ + ~CTsDeviceState(); + + /** + * 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( MTsDeviceStateObserver& aObserver, TInt aMask ); + + /** + * Deregisters the given observer. + * @param aObserver ref to observer + */ + void RemoveObserver( MTsDeviceStateObserver& aObserver ); + + /** + * Called from appui. + */ + void HandleResourceChange( TInt aType ); + + //From MTsPropertyChangeObserver +public: + /** + * Observer interface for getting notifications about a P&S property change. + */ + virtual void PropertyChanged( TUid aCategory, TUint aKey ); +private: + /** + * Constructor. + */ + CTsDeviceState(); + + /** + * 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( MTsDeviceStateObserver::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; + MTsDeviceStateObserver* iObserver; // not owned + SObserver( TInt aMask, MTsDeviceStateObserver* aObserver ) + : iMask( aMask ), iObserver( aObserver ) { } + }; + + /** + * Observer array. + */ + RArray iObservers; + + /** + * Counter to indicate that we have not yet returned + * from a previous HandleResourceChange. + */ + TInt iResChangeActiveCount; + + /** + * Flip status change observer. + */ + CTsPropertyListener* iFlipStatusObserver; + }; + +#endif // TSDEVICESTATE_H_ diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsdocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsdocument.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,90 @@ +/* +* 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: Document class + * +*/ + + +#ifndef TSDOCUMENT_H +#define TSDOCUMENT_H + +#include +#include + +class CTsDocument : public CAknDocument + { +public: + /** + * Construct a CTsDocument 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 CTsDocument + */ + static CTsDocument* NewL( CEikApplication& aApp ); + + /** + * Construct a CTsDocument 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 CTsDocument + */ + static CTsDocument* NewLC( CEikApplication& aApp ); + + /** + * Destroy the object and release all memory objects + * + * @since S60 v5.0 + */ + ~CTsDocument( ); + + /** + * 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 CTsAppUi 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 CTsDocument 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 + */ + CTsDocument( CEikApplication& aApp ); + }; + +#endif // TSDOCUMENT_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontroler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontroler.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,176 @@ +/* +* 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: Gesture and physics helper declaration + * +*/ + + +#ifndef TSEVENTCONTROLER_H +#define TSEVENTCONTROLER_H + +#include "tseventcontrolerobserver.h" +#include +#include + +class CTsPhysicsEngine; +using namespace AknTouchGestureFw; +/** + * CTsEventControler + * Input events handler. Class analyse pointer events and translate it to gesture. Procerss animations physics + */ +NONSHARABLE_CLASS(CTsEventControler): + 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 CTsEventControler* NewLC(MTsEventControlerObserver& 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 CTsEventControler* NewL(MTsEventControlerObserver& aObs, + CCoeControl& aEventSrc); + + /** + * Destructor + */ + ~CTsEventControler(); + +private: + /** + * First phase construction + */ + CTsEventControler(MTsEventControlerObserver& 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 + */ + MTsEventControlerObserver& iObserver; + + /** + * Gesture recognition helper. Own + */ + CAknTouchGestureFw* iGestureHelper; + + /** + * Physics helper. Own + */ + CTsPhysicsEngine* iPhysicsHelper; + }; + +#endif // TSEVENTCONTROLER_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontrolerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontrolerobserver.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,67 @@ +/* +* 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: Define gesture observer interface + * +*/ + + +#ifndef TSGESTUREOBSERVER_H +#define TSGESTUREOBSERVER_H + +#include +#include + +/** + * MTsGestureObserver + * Define gesture observer interface + */ +NONSHARABLE_CLASS(MTsEventControlerObserver) + { +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 // TSGESTUREOBSERVER_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,442 @@ +/* +* 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: Taskswitcher Fast Swap area UI + * +*/ + +#ifndef TSFASTSWAPAREA_H +#define TSFASTSWAPAREA_H + +#include +#include +#include "tsdevicestate.h" +#include "tsfswclientobserver.h" +#include "tsfastswapgrid.h" +#include "tseventcontrolerobserver.h" + + +// FORWARD DECLARATIONS +class CTsFswClient; +class CTsFswEntry; +class CAknStylusPopUpMenu; +class CAknQueryDialog; +class CTsEventControler; +class MTsDataChangeObserver; + +/** + * Taskswitcher Fast Swap area UI. + */ +class CTsFastSwapArea: public CCoeControl, + public MEikMenuObserver, + public MTsFswObserver, + public MEikListBoxObserver, + public MTsFastSwapGridObserver, + private MTsEventControlerObserver, + public MTsDeviceStateObserver, + public MTsFastSwapTimerObserver + { +public: + /** + * Two-phase constructor. + * + * @param aRect Area where fast swap info & list should draw itself. + * @param aParent Parent CoeControl. + */ + static CTsFastSwapArea* NewL( const TRect& aRect, + CCoeControl& aParent, CTsDeviceState& aDeviceState, + CTsEventControler& aEventHandler); + + /** + * @copydoc NewL + */ + static CTsFastSwapArea* NewLC( const TRect& aRect, + CCoeControl& aParent, CTsDeviceState& aDeviceState, + CTsEventControler& aEventHandler); + + /** + * Destructor. + */ + ~CTsFastSwapArea(); + + /** + * 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( MTsDataChangeObserver* aDcObserver ); + + /* + * Handling short/long app key. + */ + void HandleAppKey(TInt aType); + +private: + + /** + * @copydoc NewL + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ constructor. + */ + CTsFastSwapArea(CCoeControl& aParent, + CTsDeviceState& aDeviceState, + CTsEventControler& aEventHandler); + + // From MEikListBoxObserver + void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); + +public: + /** + * Implements drag gesture handling + * @see MTsEventControlerObserver + */ + void MoveOffset(const TPoint&); + + /** + * Implements tap gesture handling + * @see MTsEventControlerObserver + */ + void TapL(const TPoint&); + + /** + * Implements long tap gesture handling + * @see MTsEventControlerObserver + */ + void LongTapL(const TPoint&); + + /** + * Implements drag gesture handling + * @see MTsEventControlerObserver + */ + void Drag(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); + + /** + * Implements animation stop handling + * @see MTsEventControlerObserver + */ + void Stop(); + + /** + * Implements view position getter. Returns point in the middle of the + * grid view window. + * + * @see MTsEventControlerObserver + */ + 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 MTsFswObserver + void HandleFswContentChanged(); + + // From MEikMenuObserver + void ProcessCommandL( TInt aCommandId ); + void SetEmphasis( CCoeControl*, TBool ) { } + + // From MTsFastSwapGridObserver + void HandleCloseEventL(TInt aItemIdx); + + // From MTsDeviceStateObserver + void HandleDeviceStateChanged( TChangeType aChangeType ); + + // From MTsFastSwapTimerObserver + void TimerCompletedL( CTsFastSwapTimer* 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& 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& 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 + CTsDeviceState& iDeviceState; + + // grid, own + CTsFastSwapGrid* iGrid; + + // fsw client, own + CTsFswClient* iFSClient; + // fsw content, ptrs owned + RPointerArray 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 + MTsDataChangeObserver* iDcObserver; + + //Input events handler + CTsEventControler& iEvtHandler; + + TInt iMaxItemsOnScreen; + TInt iPreviousNoOfItems; + + // Tap event + TPointerEvent iTapEvent; + CTsFastSwapTimer* iHighlightTimer; + + // Grid scrolling + TInt iGridItemWidth; + TInt iGridItemGap; + + CTsFastSwapTimer* iRedrawTimer; // owned + + CTsFastSwapTimer* iUpdateGridTimer;//owned + + // Key event handling + TBool iConsumeEvent; + TBool iKeyEvent; + }; + +#endif // TSFASTSWAPAREA_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,362 @@ +/* +* 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: Taskswitcher Fast Swap area UI + * +*/ + + +#ifndef TSFASTSWAPGRID_H_ +#define TSFASTSWAPGRID_H_ + +#include +#include +#include "tsdevicestate.h" + +class CAknsFrameBackgroundControlContext; +class CTsFastSwapTimer; + +/** + * Observer for handling fast swap grid events + */ +class MTsFastSwapGridObserver + { +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 MTsFastSwapTimerObserver + { +public: + /** + * Called when timer is completed + */ + virtual void TimerCompletedL( CTsFastSwapTimer* aSource ) = 0; + }; + + +/** + * Avkon grid implementing custom item drawer + */ +class CTsFastSwapGrid: + public CAknGrid, + public MTsDeviceStateObserver + { +public: // enums + enum TFastSwapGridBehaviour + { + // Highlight always visible + EHybrid, + + // Touch only highlight handling + ETouchOnly + }; + +public: // Constructor and destructor + CTsFastSwapGrid(); + ~CTsFastSwapGrid(); + 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 MTsDeviceStateObserver + /** + * 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( MTsFastSwapGridObserver* aObserver ); + + /** + * Set indexes of items which can be closed. + * Copies item index array. + */ + void SetCloseItemsL( RArray& 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(); + + /** + * Launch tactile ETouchFeedbackSensitive feedback. + */ + void LaunchTactileFeedback(); + + /** + * Set tactile feedback support. + * + * @param aSupport new support value + */ + void SetTactileFeedbackSupport(TBool aSupport); + + /** + * Remove item from iFullyVisibleItems and iPartialVisibleItems arrays + * + * @param aItem idem index + * @return ETrue if item was removed + * EFalse if item was not found + */ + TBool RemoveFromVisibleItems(TInt aItem) const; + + /** + * Add item to iFullyVisibleItems array + * + * @param aItem idem index + * @return ETrue if item was added + * EFalse if item was not added because it was there before + */ + TBool AddToFullyVisibleItems(TInt aItem) const; + + /** + * Remove item from iPartialVisibleItems array + * + * @param aItem idem index + * @return ETrue if item was removed + * EFalse if item was not removed because it was not found + */ + TBool MoveToPartialVisibleItems(TInt aItem) const; + +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 + + // Grid's parent + const CCoeControl* iParent; + + // Background context for grid + CAknsFrameBackgroundControlContext* iBgContext; + + // Close icon handling + RArray iCloseItems; + TInt iCloseIconHitIdx; + MTsFastSwapGridObserver* iFastSwapGridObserver; + + // Highlight handling + TFastSwapGridBehaviour iBehaviour; + TBool iHighlightVisible; + + // Visible view rectangle (horizontal scrolling support) + TRect iVisibleViewRect; + + TBool iTactileFeedbackSupport; + + mutable RArray iFullyVisibleItems; + mutable RArray iPartialVisibleItems; + }; + + + +/** + * Custom item drawer for drawing grid items + */ +class CTsGridItemDrawer: public CFormattedCellListBoxItemDrawer + { + +public: // Constructor and destructor + CTsGridItemDrawer( CTsFastSwapGrid* aGrid, + CFormattedCellListBoxData* aData ); + ~CTsGridItemDrawer(); + +public: // New functions + + /** + * Sets close icon drawn for items that can be closed. + * Ownership transferred. + */ + void SetCloseIcon( CFbsBitmap* aBmp, CFbsBitmap* aMask ); + + /** + * Initializes close icon rectangles. + * + * @param aButtonRect rectangle for the button, coordinates must be relative to the grid item + * @param aIconRect rectangle for the icon, coordinates must be relative to the grid item + */ + void SetCloseIconRect( const TRect& aButtonRect, const TRect& aIconRect ); + + /** + * Returns current close icon coordinates for the given item rectangle + * + * @param aItemRect rectangle of the item for which close button coordinates + * are to be returned + */ + TRect GetCloseButtonRect( 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 ); + + /** + * Enables/Disables item drawer background redrawing + * + * @param aEnable if set to ETrue, background will be redrawn by item drawer + * if set to EFalse, background will not be redrawn + */ + void SetRedrawBackground( TBool aEnable ); + +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; + + /** + * Checks if the aRectContained rectancle is contained by aRectContainig + * + * @param aRectContained rectangle that is suppose to be contained + * @param aRectContainig rectangle that is suppose to be containing + * @return ETrue if rectangle is fully contained + * EFalse if rectangle is not fully contained + */ + TBool IsRectContained(const TRect& aRectContained, + const TRect& aRectContainig) const; + + /** + * Calculates current inner button rectangle for close icon + */ + TRect CalculateInnerButtonRect( const TRect& aOuterRect ) const; + +private: // Data + // Not owned + CTsFastSwapGrid* iGrid; + // Owned + CFbsBitmap* iCloseIcon; + CFbsBitmap* iCloseIconMask; + + TRect iScreenRect; + TInt iLeftOffset; + TInt iRightOffset; + + // Layout data + TRect iCloseIconRect; + TRect iCloseButtonRect; + + TBool iRedrawBackground; + }; + + + +/** + * Timer class for handling highlight bevaiour + */ +class CTsFastSwapTimer : public CTimer + { +public: + // Constructor + CTsFastSwapTimer( MTsFastSwapTimerObserver& aObserver ); + // Destructor + ~CTsFastSwapTimer(); + // 2nd phase constructor + void ConstructL(); + +private: // From CTimer + void RunL(); + +private: // Data + MTsFastSwapTimerObserver* iObserver; // not own + }; + +#endif /* TSFASTSWAPGRID_H_ */ diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysics.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysics.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,140 @@ +/* +* 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: Application class + * +*/ + + +#ifndef TSPHYSICS_H +#define TSPHYSICS_H + +#include +#include + +class MAknPhysicsObserver; + +/** + * Simple physics for grid animation + */ +class CTsPhysics : public CActive + { +public: + /* + * Destructor + */ + ~CTsPhysics(); + + /** + * Two-phased constructor. + */ + static CTsPhysics* NewL( MAknPhysicsObserver& aObserver ); + + /** + * Two-phased constructor. + */ + static CTsPhysics* 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 + */ + CTsPhysics( 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 iAnimationSteps; + + }; + +#endif // TSPHYSICS_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysicsengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysicsengine.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,116 @@ +/* +* 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: Taskswitcher physic engine + * +*/ + + +#ifndef TSPHYSICSENGINE_H_ +#define TSPHYSICSENGINE_H_ + +#include +#include +// CLASS DECLARATION +class CAknPhysics; +class CTsPhysics; +/** + * Taskswitcher physic engine implementation + */ +class CTsPhysicsEngine: public CBase + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CTsPhysicsEngine(); + + /** + * Two-phased constructor. + */ + static CTsPhysicsEngine* NewL(MAknPhysicsObserver& aPhysicObserver, + CCoeControl& aViewControl); + + /** + * Two-phased constructor. + */ + static CTsPhysicsEngine* NewLC(MAknPhysicsObserver& aPhysicObserver, + CCoeControl& aViewControl); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CTsPhysicsEngine(); + + /** + * 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; + + /** + * Taskswitcher physics for item switch animation + */ + CTsPhysics* iTaskswitcherPhysics; + + }; + +#endif /* TSPHYSICSENGINE_H_*/ diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/inc/tsuid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsuid.hrh Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,24 @@ +/* +* 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: Taskswitcher application's UID3 + * +*/ + + +#ifndef TSAPPUID_HRH +#define TSAPPUID_HRH + +#define KTsAppUidValue 0x20016BF0 + +#endif diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/loc/taskswitcher.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/loc/taskswitcher.loc Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,50 @@ +/* +* 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: Task Switcher application's localization texts +* +*/ + + +//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" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsapplication.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,50 @@ +/* +* 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: Application class + * +*/ + + +#include "tsdocument.h" +#include "tsapplication.h" +#include "tsuid.hrh" + +// UID for the application, this should correspond +// to the uid defined in the mmp file +static const TUid KUidTsApp = { KTsAppUidValue }; + +// ----------------------------------------------------------------------------- +// CTsApplication::CreateDocumentL( ) +// Create a CApaDocument object and return a pointer to it +// ----------------------------------------------------------------------------- +// +CApaDocument* CTsApplication::CreateDocumentL( ) + { + CApaDocument* document = CTsDocument::NewL( *this ); + return document; + } + +// ----------------------------------------------------------------------------- +// CTsApplication::AppDllUid( ) +// Returns the application DLL UID value +// ----------------------------------------------------------------------------- +// +TUid CTsApplication::AppDllUid( ) const + { + // Return the UID for the task switcher application + return KUidTsApp; + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,581 @@ +/* +* 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: AppUi class + * +*/ + + +#include "tsappui.h" +#include "tsappview.h" +#include "tsapplogging.h" +#include "tsdevicestate.h" +#include "tsuid.hrh" +#include "tscommands.hrh" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// AknCapServer UID, used for P&S category +const TUid KTaskswitcherStateCategory = { 0x10207218 }; + +// Taskswitcher UI, used as P&S key +const TInt KTaskswitcherStateKey = KTsAppUidValue; + +// Values for Taskswitcher launching P&S +const TInt KTaskswitcherBackgroundValue = 1; +const TInt KTaskswitcherForegroundValue = KTaskswitcherBackgroundValue << 1; +const TInt KTaskswitcherShortAppKeyPressed = KTaskswitcherForegroundValue << 1; +const TInt KTaskswitcherLongAppKeyPressed = KTaskswitcherShortAppKeyPressed << 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; + +// ----------------------------------------------------------------------------- +// CTsAppUi::ConstructL() +// ConstructL is called by the application framework +// ----------------------------------------------------------------------------- +// +void CTsAppUi::ConstructL() + { + TSLOG_CONTEXT( CTsAppUi::ConstructL, TSLOG_LOCAL ); + TSLOG_IN(); + +#ifdef _DEBUG + // create log folder + _LIT( KLogPath, "c:\\logs\\taskswitcher\\" ); + 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 = + CTsCenrepListener::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_TS_CBA_TOUCH ); + } + Cba()->MakeVisible(EFalse); + + // Create timer + iGoToBackgroundTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + + // Create commonly used instances (device state only?) + iDeviceState = CTsDeviceState::NewL(); + + // Create UI + iAppView = CTsAppView::NewL( ApplicationRect(), *iDeviceState ); + AddToStackL( iAppView ); + + //Enable effects + GfxTransEffect::Enable(); + GfxTransEffect::Register(iAppView,TUid::Uid(KTsAppUidValue)); + GfxTransEffect::SetTransitionObserver(this); + + // Listen for change in the value of the ts state property. + iPropListener = new ( ELeave ) CTsPropertyListener( + KTaskswitcherStateCategory, KTaskswitcherStateKey, *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 ); + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::CTsAppUi() +// Perform the first phase of two phase construction +// ----------------------------------------------------------------------------- +// +CTsAppUi::CTsAppUi(): iForeground( ETrue ), + iApplicationTask( iCoeEnv->WsSession() ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::~CTsAppUi() +// Destructor +// ----------------------------------------------------------------------------- +// +CTsAppUi::~CTsAppUi() + { + 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; + } + +// ----------------------------------------------------------------------------- +// CTsAppView::EffectsEnabled +// ----------------------------------------------------------------------------- +// +TBool CTsAppUi::EffectsEnabled() const + { + return iEffectsEnabled; + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::StartTransion +// ----------------------------------------------------------------------------- +// +void CTsAppUi::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; + } + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::StartTransition +// ----------------------------------------------------------------------------- +// +void CTsAppUi::StartTransition( TUint aTranstionId, + TBool aVisibility, + TBool /*aLayers*/, + TUint aSubCom ) + { + const TDesC8* ptr = reinterpret_cast(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(aSubCom) ); + GfxTransEffect::NotifyExternalState( ECaptureComponentsEnd, ptr ); + GfxTransEffect::End( iAppView ); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::TransitionFinished +// ----------------------------------------------------------------------------- +// +void CTsAppUi::TransitionFinished(const CCoeControl* /*aControl*/, + TUint /*aAction*/) + { + /*if( aControl == iAppView ) + { + @TODO IMPLEMENT + }*/ + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::HandleCommandL() +// Takes care of command handling. +// ----------------------------------------------------------------------------- +// +void CTsAppUi::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EAknCmdExit: + case EEikCmdExit: + Exit(); + break; + + case EAknSoftkeyExit: + case EAknSoftkeyBack: + // RSK => just hide + MoveAppToBackground( AknTransEffect::EApplicationExit ); + break; + + case ETsCmdHelp: + { + MoveAppToBackground( AknTransEffect::EApplicationExit ); + CArrayFix* 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; + } + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::HandleForegroundEventL +// Called by the system when the app is moved to foreground or background. +// ----------------------------------------------------------------------------- +// +void CTsAppUi::HandleForegroundEventL( TBool aForeground ) + { + TSLOG_CONTEXT( HandleForegroundEventL, TSLOG_LOCAL ); + TSLOG1_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 ); + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::PropertyChanged +// ----------------------------------------------------------------------------- +// +void CTsAppUi::PropertyChanged( TUid aCategory, TUint aKey ) + { + TSLOG_CONTEXT( PropertyChanged, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt value( 0 ); + + if ( RProperty::Get( aCategory, aKey, value ) == KErrNone ) + { + if ( iForeground && (value & KTaskswitcherBackgroundValue) ) + { + MoveAppToBackground( AknTransEffect::EApplicationExit ); + } + else if ( !iForeground && (value & KTaskswitcherForegroundValue) ) + { + MoveAppToForeground( AknTransEffect::EApplicationStart ); + } + else if( value & KTaskswitcherLongAppKeyPressed ) + { + if(!iForeground) + { + MoveAppToBackground( AknTransEffect::EApplicationExit ); + } + else + { + iAppView->HandleAppKey(KAppKeyTypeLong); + } + } + else if( value & KTaskswitcherShortAppKeyPressed ) + { + iAppView->HandleAppKey(KAppKeyTypeShort); + } + } + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::HandleResourceChangeL +// ----------------------------------------------------------------------------- +// +void CTsAppUi::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 ); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::MoveAppToBackground() +// ----------------------------------------------------------------------------- +// +void CTsAppUi::MoveAppToBackground( TUint aTransitionType ) + { + TSLOG_CONTEXT( MoveAppToBackground, TSLOG_LOCAL ); + TSLOG_IN(); + + if ( AknTransEffect::ENone == aTransitionType || !EffectsEnabled() ) + { + GoToBackgroundTimerCallback( this ); + } + else + { + StartTransion(AknTransEffect::EApplicationExit); + iGoToBackgroundTimer->Cancel(); + iGoToBackgroundTimer->Start( + KWaitBeforeGoingToBackground, + 0, + TCallBack( GoToBackgroundTimerCallback, this ) ); + } + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::CenrepChanged +// ----------------------------------------------------------------------------- +// +void CTsAppUi::CenrepChanged( TUint32 /*aKey*/, TInt aNewValue ) + { + iEffectsEnabled = !(aNewValue & AknTransEffect::EFullScreenTransitionsOff); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::GoToBackgroundTimerCallback +// ----------------------------------------------------------------------------- +// +TInt CTsAppUi::GoToBackgroundTimerCallback( TAny* aParam ) + { + CTsAppUi* self = static_cast( aParam ); + if ( self->iGoToBackgroundTimer ) + { + self->iGoToBackgroundTimer->Cancel(); + } + + // Request window server to bring our application + // to background + self->iApplicationTask.SendToBackground(); + + // Notify + self->HandleSwitchToBackgroundEvent(); + + return 0; + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::MoveAppToForeground() +// ----------------------------------------------------------------------------- +// +void CTsAppUi::MoveAppToForeground( TUint /*aTransitionType*/ ) + { + TSLOG_CONTEXT( MoveAppToForeground, TSLOG_LOCAL ); + TSLOG_IN(); + + // Request window server to bring our application + // to foreground + iApplicationTask.BringToForeground(); + + // Notify + HandleSwitchToForegroundEvent(); + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::HandleSwitchToBackgroundEvent +// ----------------------------------------------------------------------------- +// +void CTsAppUi::HandleSwitchToBackgroundEvent() + { + TSLOG_CONTEXT( HandleSwitchToBackgroundEvent, TSLOG_LOCAL ); + TSLOG_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; + SetTaskswitcherStateProperty( KTaskswitcherBackgroundValue ); + + //allocating extra memory space + if ( !iMemAllocBuf ) + { + iMemAllocBuf = + (TUint8*) User::Alloc( KMemoryToBeReservedInBytes ); + } + + // notify view + iAppView->HandleSwitchToBackgroundEvent(); + } + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::HandleSwitchToForegroundEvent +// ----------------------------------------------------------------------------- +// +void CTsAppUi::HandleSwitchToForegroundEvent() + { + TSLOG_CONTEXT( HandleSwitchToForegroundEvent, TSLOG_LOCAL ); + TSLOG_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; + SetTaskswitcherStateProperty( KTaskswitcherForegroundValue ); + + // notify view + iAppView->HandleSwitchToForegroundEvent(); + } + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::SetTaskswitcherShowProperty +// ----------------------------------------------------------------------------- +// +void CTsAppUi::SetTaskswitcherStateProperty( TInt aValue ) + { + TSLOG_CONTEXT( CTsAppUi::SetTaskswitcherShowProperty, TSLOG_LOCAL ); + TSLOG_IN(); + + if ( RProperty::Set( + KTaskswitcherStateCategory, KTaskswitcherStateKey, aValue ) != KErrNone ) + { + TInt error = RProperty::Define( + KTaskswitcherStateCategory, KTaskswitcherStateKey, RProperty::EInt ); + if ( error != KErrNone ) + { + TSLOG1( TSLOG_INFO, "RProperty::Define Error: %d", error ); + } + + error = RProperty::Set( KTaskswitcherStateCategory, KTaskswitcherStateKey, aValue ); + if ( error != KErrNone ) + { + TSLOG1( TSLOG_INFO, "RProperty::Set Error: %d", error ); + } + } + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppUi::FreeMemoryRequest +// ----------------------------------------------------------------------------- +// +void CTsAppUi::FreeMemoryRequest() + { + TSLOG_CONTEXT( CTsAppUi::FreeMemoryRequest, TSLOG_LOCAL ); + TSLOG_IN(); + ROomMonitorSession oomMs; + TInt error = oomMs.Connect(); + if ( error != KErrNone) + { + TSLOG1( TSLOG_INFO, "Could not connect to ROomMonitorSession, %d", error ); + } + else + { + oomMs.RequestFreeMemory( KMemoryRequestAmountInBytes ); + oomMs.Close(); + } + TSLOG_OUT(); + } + + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,731 @@ +/* +* 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: Taskswitcher view class + * +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tsappview.h" +#include "tsappui.h" +#include "tsapplogging.h" +#include "tsfastswaparea.h" +#include "tseventcontroler.h" +#include "tsuid.hrh" + +// ----------------------------------------------------------------------------- +// CTsAppView::NewL +// ----------------------------------------------------------------------------- +// +CTsAppView* CTsAppView::NewL( const TRect& aRect, + CTsDeviceState& aDeviceState ) + { + CTsAppView* self = CTsAppView::NewLC( aRect, aDeviceState ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsAppView::NewLC +// ----------------------------------------------------------------------------- +// +CTsAppView* CTsAppView::NewLC( const TRect& aRect, + CTsDeviceState& aDeviceState ) + { + CTsAppView* self = new (ELeave) CTsAppView( aDeviceState ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsAppView::CTsAppView +// ----------------------------------------------------------------------------- +// +CTsAppView::CTsAppView(CTsDeviceState& aDeviceState) + : iDeviceState( aDeviceState ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// InvalidateWindows +// ----------------------------------------------------------------------------- +// +static void InvalidateWindows( CCoeControl* aControl ) + { + if ( aControl ) + { + if ( aControl->OwnsWindow() ) + { + static_cast( aControl->DrawableWindow() )->ClearRedrawStore(); + } + + for ( TInt i = aControl->CountComponentControls() - 1; i >= 0; --i ) + { + InvalidateWindows( aControl->ComponentControl( i ) ); + } + } + } + +// ----------------------------------------------------------------------------- +// CTsAppView::~CTsAppView +// ----------------------------------------------------------------------------- +// +CTsAppView::~CTsAppView() + { + 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; + } + +// ----------------------------------------------------------------------------- +// CTsAppView::ConstructL +// ----------------------------------------------------------------------------- +// +void CTsAppView::ConstructL( const TRect& aRect ) + { + TSLOG_CONTEXT( CTsAppView::ConstructL, TSLOG_LOCAL ); + TSLOG_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 ); + + TSLOG4( TSLOG_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, MTsDeviceStateObserver::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(); + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::DisableAppSwitchEffects +// ----------------------------------------------------------------------------- +// +void CTsAppView::DisableAppSwitchEffects() + { + TInt flags = AknTransEffect::TParameter::ENoEffects; + GfxTransEffect::BeginFullScreen( + AknTransEffect::ENone, + TRect(0,0,0,0), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( TUid::Uid(KTsAppUidValue), flags ) ); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::GetPopupRects +// ----------------------------------------------------------------------------- +// +void CTsAppView::UpdatePopupRects( ) + { + TSLOG_CONTEXT( UpdatePopupRects, TSLOG_LOCAL ); + TSLOG_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(); + TSLOG4( TSLOG_INFO, "outer rect for popup = %d %d %d %d", + iBgContextOuterRect.iTl.iX, iBgContextOuterRect.iTl.iY, + iBgContextOuterRect.iBr.iX, iBgContextOuterRect.iBr.iY ); + TSLOG4( TSLOG_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 + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::CreateControlsL +// ----------------------------------------------------------------------------- +// +void CTsAppView::CreateControlsL() + { + RArray rects; + CleanupClosePushL( rects ); + rects.ReserveL( 2 ); // so appending in GetRects cannot fail + GetRects( rects ); + + iEvtHandler = CTsEventControler::NewL(*this, *this); + iFastSwapArea = CTsFastSwapArea::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(); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::GetRects +// ----------------------------------------------------------------------------- +// +void CTsAppView::GetRects( RArray& aRects ) + { + TSLOG_CONTEXT( CTsAppView::GetRects, TSLOG_LOCAL ); + TSLOG_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 ) ); + TSLOG4( TSLOG_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 ) ); + TSLOG4( TSLOG_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 + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::SizeChanged +// ----------------------------------------------------------------------------- +// +void CTsAppView::SizeChanged() + { + TSLOG_CONTEXT( CTsAppView::SizeChanged, TSLOG_LOCAL ); + TSLOG_IN(); + UpdatePopupRects(); + iBgContext->SetFrameRects(iBgContextOuterRect, iBgContextInnerRect); + if ( iFastSwapArea && iAppsHeading ) + { + RArray 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 ); + } + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::Draw +// ----------------------------------------------------------------------------- +// +void CTsAppView::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::DrawFrame( skin, + gc, + iBgContextOuterRect, + iBgContextInnerRect, + KAknsIIDQsnFrPopup, + KAknsIIDQsnFrPopupCenter ); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::MopSupplyObject +// ----------------------------------------------------------------------------- +// +TTypeUid::Ptr CTsAppView::MopSupplyObject( TTypeUid aId ) + { + if ( aId.iUid == MAknsControlContext::ETypeId ) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CCoeControl::MopSupplyObject( aId ); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CTsAppView::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TSLOG_CONTEXT( OfferKeyEventL, TSLOG_LOCAL ); + TSLOG2_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 ); + } + + TSLOG1_OUT( "response = %d", result ); + return result; + } + +// ----------------------------------------------------------------------------- +// CTsAppView::OfferKeyEventPortraitStyleL +// ----------------------------------------------------------------------------- +// +TKeyResponse CTsAppView::OfferKeyEventPortraitStyleL( + const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/) + { + TKeyResponse result = EKeyWasNotConsumed; + return result; + } + + +// ----------------------------------------------------------------------------- +// CTsAppView::CountComponentControls +// ----------------------------------------------------------------------------- +// +TInt CTsAppView::CountComponentControls() const + { + return 2; + } + +// ----------------------------------------------------------------------------- +// CTsAppView::ComponentControl +// ----------------------------------------------------------------------------- +// +CCoeControl* CTsAppView::ComponentControl( TInt aIndex ) const + { + switch ( aIndex ) + { + case 0: + return iFastSwapArea; + case 1: + return iAppsHeading; + default: + return NULL; + } + } + +// ----------------------------------------------------------------------------- +// CTsAppView::HandleSwitchToBackgroundEvent +// ----------------------------------------------------------------------------- +// +void CTsAppView::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 ); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::HandleSwitchToForegroundEvent +// ----------------------------------------------------------------------------- +// +void CTsAppView::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 + CTsAppUi* appui = + static_cast( iEikonEnv->AppUi() ); + if ( appui->EffectsEnabled() ) + { + InvalidateWindows( this ); + appui->StartTransion(AknTransEffect::EApplicationStart); + } + else + { + CAknTransitionUtils::MakeVisibleSubComponents( this, + CAknTransitionUtils::EForceVisible ); + MakeVisible( ETrue ); + } + + DrawDeferred(); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::ChangeFocus +// ----------------------------------------------------------------------------- +// +void CTsAppView::ChangeFocus( CCoeControl* aNewFocusedControl ) + { + if ( iFocused != aNewFocusedControl ) + { + if ( iFocused ) + { + iFocused->SetFocus( EFalse, EDrawNow ); + } + iFocused = aNewFocusedControl; + if ( iFocused ) + { + iFocused->SetFocus( ETrue, EDrawNow ); + } + } + } + +// ----------------------------------------------------------------------------- +// CTsAppView::HandleControlEventL +// EEventRequestFocus must be handled to have proper focus change also with +// pointer events. +// Observed controls are the ganes list and grid. +// ----------------------------------------------------------------------------- +// +void CTsAppView::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + switch ( aEventType ) + { + case EEventRequestFocus: + // must use the parent because aControl is the ganes control + ChangeFocus( aControl->Parent() ); + break; + } + } + +// ----------------------------------------------------------------------------- +// CTsAppView::HandleDeviceStateChanged +// Called when screen orientation, touch awareness, or the skin has been changed. +// ----------------------------------------------------------------------------- +// +void CTsAppView::HandleDeviceStateChanged( TChangeType /*aChangeType*/ ) + { + TSLOG_CONTEXT( HandleDeviceStateChanged, TSLOG_LOCAL ); + TSLOG_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(); + TSLOG4( TSLOG_INFO, "setting rect %d %d %d %d", + iViewRect.iTl.iX, iViewRect.iTl.iY, + iViewRect.iBr.iX, iViewRect.iBr.iY ); + SetRect( iViewRect ); + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::CountFadedComponents +// ----------------------------------------------------------------------------- +// +TInt CTsAppView::CountFadedComponents() + { + return 3; + } + +// ----------------------------------------------------------------------------- +// CTsAppView::FadedComponent +// ----------------------------------------------------------------------------- +// +CCoeControl* CTsAppView::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; + } + } + +// ----------------------------------------------------------------------------- +// CTsAppView::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CTsAppView::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); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::DataChanged +// ----------------------------------------------------------------------------- +// +void CTsAppView::DataChanged( CCoeControl* /*aWhere*/, TInt /*aNewCount*/ ) + { + TRAP_IGNORE( UpdateHeadingsL() ); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::UpdateHeadingsL +// ----------------------------------------------------------------------------- +// +void CTsAppView::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 ); + + } + + +// ----------------------------------------------------------------------------- +// CTsAppView::HandleAppKey +// ----------------------------------------------------------------------------- +// +void CTsAppView::HandleAppKey(TInt aType) + { + iFastSwapArea->HandleAppKey(aType); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::MoveOffset +// ----------------------------------------------------------------------------- +// +void CTsAppView::MoveOffset(const TPoint& aOffset) + { + iFastSwapArea->MoveOffset(aOffset); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::TapL +// ----------------------------------------------------------------------------- +// +void CTsAppView::TapL(const TPoint& aPoint) + { + if(iFastSwapArea->Rect().Contains(aPoint)) + { + iFastSwapArea->TapL(aPoint); + DrawNow(); + } + else if( !iAppsHeading->Rect().Contains(aPoint)) + { + //move task switcher to background + iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); + } + } + +// ----------------------------------------------------------------------------- +// CTsAppView::LongTapL +// ----------------------------------------------------------------------------- +// +void CTsAppView::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); + } + } + +// ----------------------------------------------------------------------------- +// CTsAppView::Drag() +// ----------------------------------------------------------------------------- +// +void CTsAppView::Drag(const MAknTouchGestureFwDragEvent& aEvent) + { + iFastSwapArea->Drag(aEvent); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::Stop +// ----------------------------------------------------------------------------- +// +void CTsAppView::Stop() + { + iFastSwapArea->Stop(); + } + +// ----------------------------------------------------------------------------- +// CTsAppView::ViewPos +// ----------------------------------------------------------------------------- +// +TPoint CTsAppView::ViewPos() const + { + return iFastSwapArea->ViewPos(); + } + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsdevicestate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsdevicestate.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,272 @@ +/* +* 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: Device state (touch mode, screen orientation) handler + * +*/ + + +#include "tsdevicestate.h" +#include "tsapplogging.h" + +#include +#include + +// ----------------------------------------------------------------------------- +// CTsDeviceState::NewL +// ----------------------------------------------------------------------------- +// +CTsDeviceState* CTsDeviceState::NewL() + { + CTsDeviceState* self = new ( ELeave ) CTsDeviceState; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsDeviceState::CTsDeviceState +// ----------------------------------------------------------------------------- +// +CTsDeviceState::CTsDeviceState() + { + } + +// ----------------------------------------------------------------------------- +// CTsDeviceState::ConstructL +// ----------------------------------------------------------------------------- +// +void CTsDeviceState::ConstructL() + { + iFlipStatusObserver = new ( ELeave ) CTsPropertyListener(KPSUidHWRM, + KHWRMFlipStatus, *this); + // check if touch is enabled or not + CheckTouchState(); + // are we in portrait or landscape + CheckOrientation(); + // checks the qwerty input mode. + CheckDeviceType(); + } + +// ----------------------------------------------------------------------------- +// CTsDeviceState::~CTsDeviceState +// ----------------------------------------------------------------------------- +// +CTsDeviceState::~CTsDeviceState() + { + iObservers.Close(); + delete iFlipStatusObserver; + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::HandleResourceChange +// -------------------------------------------------------------------------- +// +void CTsDeviceState::HandleResourceChange( TInt aType ) + { + TSLOG_CONTEXT( HandleResourceChange, TSLOG_LOCAL ); + TSLOG2_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 ) + { + TSLOG0( TSLOG_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 ) + { + TSLOG0( TSLOG_INFO, "skin change" ); + NotifyObservers( MTsDeviceStateObserver::ESkin ); + } + --iResChangeActiveCount; + } + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::PropertyChanged +// -------------------------------------------------------------------------- +// +void CTsDeviceState::PropertyChanged(TUid aCategory, TUint aKey) + { + TSLOG_CONTEXT( PropertyChanged, TSLOG_LOCAL ); + TSLOG2_IN( "aKey = %d aNewValue = %d", aCategory, aKey ); + CheckDeviceType(); + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::CheckTouchState +// -------------------------------------------------------------------------- +// +void CTsDeviceState::CheckTouchState() + { + TSLOG_CONTEXT( CheckTouchState, TSLOG_LOCAL ); + TSLOG_IN(); + + TTouchState oldValue = iTouchState; + iTouchState = AknLayoutUtils::PenEnabled() ? ETouchEnabled : ETouchDisabled; + if ( iTouchState != oldValue ) + { + NotifyObservers( MTsDeviceStateObserver::ETouchState ); + } + + TSLOG1_OUT( "new value for iTouchState: %d", iTouchState ); + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::CheckOrientation +// -------------------------------------------------------------------------- +// +void CTsDeviceState::CheckOrientation() + { + TSLOG_CONTEXT( CheckOrientation, TSLOG_LOCAL ); + TSLOG_IN(); + + TRect rect; + AknLayoutUtils::LayoutMetricsRect ( AknLayoutUtils::EScreen, rect ); + TOrientation oldValue = iOrientation; + iOrientation = rect.Width() > rect.Height() ? ELandscape : EPortrait; + if ( iOrientation != oldValue ) + { + NotifyObservers( MTsDeviceStateObserver::EOrientation ); + } + + TSLOG1_OUT( "new value for iOrientation: %d", iOrientation ); + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::DeviceType +// -------------------------------------------------------------------------- +// +void CTsDeviceState::CheckDeviceType() + { + TSLOG_CONTEXT( CheckQwerty, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt oldDeviceType = iDeviceType; + TInt value( 0 ); + if( RProperty::Get( KPSUidHWRM, KHWRMFlipStatus, value ) == KErrNone ) + { + iDeviceType = (value == EPSHWRMFlipOpen ? EHybrid : EFullTouch); + } + + if( iDeviceType != oldDeviceType ) + { + NotifyObservers( MTsDeviceStateObserver::EDeviceType); + } + + TSLOG1_OUT( "new value for iDeviceType: %d", iDeviceType ); + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::TouchState +// -------------------------------------------------------------------------- +// +CTsDeviceState::TTouchState CTsDeviceState::TouchState() const + { + return iTouchState; + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::Orientation +// -------------------------------------------------------------------------- +// +CTsDeviceState::TOrientation CTsDeviceState::Orientation() const + { + return iOrientation; + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::Qwerty +// -------------------------------------------------------------------------- +// +CTsDeviceState::TDeviceType CTsDeviceState::DeviceType() const + { + return iDeviceType; + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::ObserverIdentity +// -------------------------------------------------------------------------- +// +TBool CTsDeviceState::ObserverIdentity( const SObserver& aA, + const SObserver& aB ) + { + return aA.iObserver == aB.iObserver; + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::AddDeviceStateObserverL +// -------------------------------------------------------------------------- +// +void CTsDeviceState::AddObserverL( MTsDeviceStateObserver& aObserver, + TInt aMask ) + { + iObservers.AppendL( SObserver( aMask, &aObserver ) ); + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::RemoveObserver +// -------------------------------------------------------------------------- +// +void CTsDeviceState::RemoveObserver( MTsDeviceStateObserver& aObserver ) + { + for ( ; ; ) + { + TInt pos = iObservers.Find( SObserver( MTsDeviceStateObserver::EAny, + &aObserver ), ObserverIdentity ); + if ( pos >= 0 ) + { + iObservers.Remove( pos ); + } + else + { + break; + } + } + } + +// -------------------------------------------------------------------------- +// CTsDeviceState::NotifyObservers +// -------------------------------------------------------------------------- +// +void CTsDeviceState::NotifyObservers( + MTsDeviceStateObserver::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 fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsdocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsdocument.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,105 @@ +/* +* 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: Document class + * +*/ + + +#include + +#include "tsappui.h" +#include "tsdocument.h" + +// ----------------------------------------------------------------------------- +// CTsDocument::NewLC( ) +// Create a CTsDocument object and return a pointer to it +// ----------------------------------------------------------------------------- +// +CTsDocument* CTsDocument::NewL( CEikApplication& aApp ) + { + CTsDocument* self = NewLC ( aApp ); + CleanupStack::Pop ( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsDocument::NewLC( ) +// Create a CTsDocument object and return a pointer to it +// ----------------------------------------------------------------------------- +// +CTsDocument* CTsDocument::NewLC( CEikApplication& aApp ) + { + CTsDocument* self = new ( ELeave ) CTsDocument( aApp ); + CleanupStack::PushL ( self ); + self->ConstructL ( ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsDocument::ConstructL( ) +// Second phase constructor +// ----------------------------------------------------------------------------- +// +void CTsDocument::ConstructL( ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CTsDocument::~CTsDocument( ) +// First phase constructor +// ----------------------------------------------------------------------------- +// +CTsDocument::CTsDocument( CEikApplication& aApp ) : + CAknDocument( aApp ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CTsDocument::~CTsDocument( ) +// Destructor +// ----------------------------------------------------------------------------- +// +CTsDocument::~CTsDocument( ) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CTsDocument::CreateAppUiL( ) +// Create a CTsAppUi object and return a pointer to it +// ----------------------------------------------------------------------------- +// +CEikAppUi* CTsDocument::CreateAppUiL( ) + { + // Create the application user interface, and return a pointer to it, + // the framework takes ownership of this object + CEikAppUi* appUi = new ( ELeave ) CTsAppUi; + return appUi; + } + +// ----------------------------------------------------------------------------- +// CTsDocument::UpdateTaskNameL( ) +// Makes app hidden in fastswap window +// ----------------------------------------------------------------------------- +// +void CTsDocument::UpdateTaskNameL( CApaWindowGroupName* aWgName ) + { + CEikDocument::UpdateTaskNameL ( aWgName ); + aWgName->SetHidden ( ETrue ); + } + + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,194 @@ +/* +* 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: Gesture and physics helper declaration + * +*/ + +#include "tseventcontroler.h" +#include "tsphysicsengine.h" + +// ----------------------------------------------------------------------------- +// NewLC +// ----------------------------------------------------------------------------- +// +CTsEventControler* CTsEventControler::NewLC( + MTsEventControlerObserver& aObserver, + CCoeControl& aEventSrc) + { + CTsEventControler* self = + new(ELeave)CTsEventControler(aObserver); + CleanupStack::PushL(self); + self->ConstructL(aEventSrc); + return self; + } + +// ----------------------------------------------------------------------------- +// NewL +// ----------------------------------------------------------------------------- +// +CTsEventControler* CTsEventControler::NewL( + MTsEventControlerObserver& aObserver, + CCoeControl& aEventSrc) + { + CTsEventControler* self = + CTsEventControler::NewLC(aObserver, aEventSrc); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// ~CTsPointerHandler +// ----------------------------------------------------------------------------- +// +CTsEventControler::~CTsEventControler() + { + delete iGestureHelper; + delete iPhysicsHelper; + } + +// ----------------------------------------------------------------------------- +// CTsPointerHandler +// ----------------------------------------------------------------------------- +// +CTsEventControler::CTsEventControler( + MTsEventControlerObserver& aObserver) + : + CBase(), + iObserver(aObserver) + { + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +// +void CTsEventControler::ConstructL(CCoeControl& aEventSrc) + { + iGestureHelper = + AknTouchGestureFw::CAknTouchGestureFw::NewL(*this, aEventSrc); + iGestureHelper->SetGestureInterestL(EAknTouchGestureFwAll); + iPhysicsHelper = CTsPhysicsEngine::NewL(*this, aEventSrc); + } + +// ----------------------------------------------------------------------------- +// HandleTouchGestureL +// ----------------------------------------------------------------------------- +// +void CTsEventControler::HandleTouchGestureL( + AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent) + { + if (AknTouchGestureFwEventDrag(aEvent)) + { + HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent)); + } + else if (AknTouchGestureFwEventTap(aEvent)) + { + HandleTapEventL(*AknTouchGestureFwEventTap(aEvent)); + } + //ignore flick and pinch events + } + +// ----------------------------------------------------------------------------- +// HandleTapEventL +// ----------------------------------------------------------------------------- +// +void CTsEventControler::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 CTsEventControler::HandleDragEventL( + MAknTouchGestureFwDragEvent& aEvent) + { + iObserver.Drag(aEvent); + iPhysicsHelper->HandleDragEvent(aEvent); + } + +// ----------------------------------------------------------------------------- +// PhysicEmulationEnded +// ----------------------------------------------------------------------------- +// +void CTsEventControler::ViewPositionChanged(const TPoint& aNewPosition, + TBool /*aDrawNow*/, + TUint /*aFlags*/) + { + iObserver.MoveOffset(aNewPosition); + } + +// ----------------------------------------------------------------------------- +// PhysicEmulationEnded +// ----------------------------------------------------------------------------- +// +void CTsEventControler::PhysicEmulationEnded() + { + iObserver.Stop(); + } + +// ----------------------------------------------------------------------------- +// ViewPosition +// ----------------------------------------------------------------------------- +// +TPoint CTsEventControler::ViewPosition() const + { + return iObserver.ViewPos(); + } + +// ----------------------------------------------------------------------------- +// Animate +// ----------------------------------------------------------------------------- +// +void CTsEventControler::Animate(const TPoint& aPoint) + { + iPhysicsHelper->AnimateToTarget(aPoint); + } + +// ----------------------------------------------------------------------------- +// ReInitPhysicL +// ----------------------------------------------------------------------------- +// +void CTsEventControler::ReInitPhysicsL(const TSize& aWorldSize, + const TSize& aViewSize, TBool aLandscape) + { + iPhysicsHelper->ReInitPhysicsL( aWorldSize, aViewSize, aLandscape); + } + +// ----------------------------------------------------------------------------- +// StopAnimation +// ----------------------------------------------------------------------------- +// +void CTsEventControler::StopAnimation() + { + iPhysicsHelper->Stop(); + } + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,1605 @@ +/* +* 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: Taskswitcher Fast Swap area UI + * +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tsfastswaparea.h" +#include "tsapplogging.h" +#include "tsfswclient.h" +#include "tsappui.h" +#include "tsdatachangeobserver.h" +#include "tseventcontroler.h" + +/** command ids for the fsw popup */ +enum TPopupCommands + { + EFswCmdClose = 10000, + EFswCmdCloseAll + }; + +/** Number of closable applications, to show "close all" option. */ +const TInt KTsMaxClosableApps = 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 = 4; + +const TInt KRedrawTime = 250000; // 0.25 sec +const TInt KHighlighActivationTime = 100000; // 100 ms +const TInt KUpdateGridTime = 1000000; // 1 s + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::NewL +// ----------------------------------------------------------------------------- +// +CTsFastSwapArea* CTsFastSwapArea::NewL( const TRect& aRect, + CCoeControl& aParent, CTsDeviceState& aDeviceState, + CTsEventControler& aEventHandler ) + { + CTsFastSwapArea* self = CTsFastSwapArea::NewLC(aRect, + aParent, aDeviceState, aEventHandler); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::NewLC +// ----------------------------------------------------------------------------- +// +CTsFastSwapArea* CTsFastSwapArea::NewLC( const TRect& aRect, + CCoeControl& aParent, CTsDeviceState& aDeviceState, + CTsEventControler& aEventHandler) + { + CTsFastSwapArea* self = new (ELeave) CTsFastSwapArea( + aParent, aDeviceState, aEventHandler); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::CTsFastSwapArea +// ----------------------------------------------------------------------------- +// +CTsFastSwapArea::CTsFastSwapArea(CCoeControl& aParent, + CTsDeviceState& aDeviceState, + CTsEventControler& aEventHandler) : + iParent(aParent), iDeviceState(aDeviceState), iEvtHandler(aEventHandler), + iPreviousNoOfItems(0) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::~CTsFastSwapArea +// ----------------------------------------------------------------------------- +// +CTsFastSwapArea::~CTsFastSwapArea() + { + iArray.ResetAndDestroy(); + delete iGrid; + delete iFSClient; + delete iPopup; + delete iConfirmCloseQuery; + delete iHighlightTimer; + delete iRedrawTimer; + delete iUpdateGridTimer; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ConstructL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::ConstructL( const TRect& aRect ) + { + SetContainerWindowL( iParent ); + + SetRect( aRect ); + + // setup ganes grid + ReCreateGridL(); + + // create stylus popup instance + PreCreatePopupL(); + + // connect to fsw server + iFSClient = CTsFswClient::NewL(); + + iEvtHandler.ReInitPhysicsL(GridWorldSize(), ViewSize(), ETrue); + + // add self to device state observer + iDeviceState.AddObserverL( *this, EDeviceType ); + + iHighlightTimer = new (ELeave) CTsFastSwapTimer( *this ); + iHighlightTimer->ConstructL(); + + iRedrawTimer = new (ELeave) CTsFastSwapTimer( *this ); + iRedrawTimer->ConstructL(); + + iUpdateGridTimer = new (ELeave) CTsFastSwapTimer( *this ); + iUpdateGridTimer->ConstructL(); + + ActivateL(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ReCreateGridL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::ReCreateGridL() + { + MCoeControlObserver* obs = NULL; + TBool wasHighlight = iDeviceState.DeviceType() == + CTsDeviceState::EHybrid ? ETrue : EFalse; + if ( iGrid ) + { + obs = iGrid->Observer(); + iDeviceState.RemoveObserver(*iGrid); + wasHighlight = iGrid->IsHighlightVisible(); + delete iGrid; + iGrid = NULL; + } + + iGrid = new( ELeave ) CTsFastSwapGrid; + iGrid->ConstructL( this ); + iDeviceState.AddObserverL(*iGrid, MTsDeviceStateObserver::ESkin); + + AknListBoxLayouts::SetupStandardGrid( *iGrid ); + + RArray rects; + CleanupClosePushL(rects); + rects.ReserveL(KLayoutItemCount); + GetFastSwapAreaRects(rects); + TAknLayoutRect gridAppPane = rects[0]; + TAknLayoutRect gridItem = rects[1]; + TAknLayoutRect gridImage = rects[2]; + TAknLayoutRect gridNextItem = rects[3]; + 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 ); + + AknListBoxLayouts::SetupFormGfxCell( *iGrid, iGrid->ItemDrawer(), 0, + AknLayoutScalable_Apps::cell_tport_appsw_pane_g1( variety ).LayoutLine(), + empty, empty ); + + // 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 + 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*/); + + // Setup grid observers + if ( obs ) + { + iGrid->SetObserver( obs ); + } + iGrid->SetListBoxObserver(this); + iGrid->SetFastSwapGridObserver(this); + iGrid->SetContainerWindowL(*this); + + if ( AknLayoutUtils::LayoutMirrored() ) + { + iGridItemGap = gridItem.Rect().iTl.iX - gridNextItem.Rect().iBr.iX; + } + else + { + iGridItemGap = gridNextItem.Rect().iTl.iX - gridItem.Rect().iBr.iX; + } + iMaxItemsOnScreen = Rect().Width() / gridItem.Rect().Width(); + if ( iMaxItemsOnScreen > 1 ) + { + TInt widthWithGaps = + (iMaxItemsOnScreen - 1) * iGridItemGap + iMaxItemsOnScreen * gridItem.Rect().Width(); + if ( widthWithGaps > Rect().Width() ) + { + iMaxItemsOnScreen--; + } + } + iGridItemWidth = gridItem.Rect().Width(); + + 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(); + } + + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::GetFastSwapAreaRects +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::GetFastSwapAreaRects( RArray& aRects ) + { + TAknLayoutRect gridAppPane; + TAknLayoutRect gridItem; + TAknLayoutRect gridImage; + TAknLayoutRect gridNextItem; + + 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); + gridNextItem.LayoutRect( gridAppPane.Rect(), + AknLayoutScalable_Apps::cell_tport_appsw_pane_cp03( variety ) ); + aRects.Append(gridNextItem); + } + + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::Setup +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::Setup( MCoeControlObserver& aControlObserver ) + { + iGrid->SetObserver( &aControlObserver ); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::SizeChanged +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::SizeChanged() + { + TSLOG_CONTEXT( CTsFastSwapArea::SizeChanged, TSLOG_LOCAL ); + TSLOG_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 ) + { + TSLOG1( TSLOG_INFO, "ReCreateGridL leaves with %d", err ); + } + HandleFswContentChanged(); + iGrid->SetCurrentDataIndex(selIdx); + UpdateGrid(ETrue, EFalse); + DrawDeferred(); + } + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::Draw +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, + cc, + this, + gc, + Rect() ); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::SwitchToApp +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::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 ts if the activated app is closed. + // Therefore ts must be moved to background. + CTsAppUi* appui = + static_cast( iEikonEnv->AppUi() ); + appui->MoveAppToBackground( AknTransEffect::EApplicationStartRect ); + } + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::TryCloseAppL +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::TryCloseAppL( TInt aIndex, + TBool aSuppressRendering ) + { + TSLOG_CONTEXT( TryCloseAppL, TSLOG_LOCAL ); + TSLOG2_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(); + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::TryCloseAppWithQueryL +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::TryCloseAppWithQueryL( TInt aIndex ) + { + if ( aIndex >= 0 && aIndex < iArray.Count() + && CanClose( aIndex ) + && ConfirmCloseL( aIndex ) ) + { + TryCloseAppL( aIndex ); + } + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::TryCloseAllL +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::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(); + } + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::CanClose +// -------------------------------------------------------------------------- +// +TBool CTsFastSwapArea::CanClose( TInt aIndex ) const + { + CTsFswEntry* e = iArray[aIndex]; + return !e->AlwaysShown() && !e->SystemApp(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::CanCloseOthers +// -------------------------------------------------------------------------- +// +TBool CTsFastSwapArea::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 < KTsMaxClosableApps; ) + { + if ( CanClose( i ) ) + { + count++; + } + } + return ( count >= KTsMaxClosableApps ) || + ( count && !CanClose( aSelectedItem ) ); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::HandleFswContentChanged +// From MTsFswObserver +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::HandleFswContentChanged() + { + TSLOG_CONTEXT( HandleFswContentChanged, TSLOG_LOCAL ); + TSLOG_IN(); + + TRAPD( err, HandleFswContentChangedL() ); + if ( err != KErrNone ) + { + TSLOG1( TSLOG_INFO, "leave occured: %d", err ); + } + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::HandleFswContentChangedL +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::HandleFswContentChangedL() + { + TSLOG_CONTEXT( HandleFswContentChangedL, TSLOG_LOCAL ); + TSLOG_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 ) + { + TSLOG1_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 ) + { + CTsFswEntry* e = iArray[i]; + const TDesC& name( e->AppName() ); + TSLOG4( TSLOG_INFO, "[%d]: %d %d %S", i, e->WgId(), e->AppUid(), &name ); + } +#endif + + // draw + RenderContentL(); + + // notify observer, if present + NotifyChange(); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::RenderContentL +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::RenderContentL() + { + TSLOG_CONTEXT( RenderContentL, TSLOG_LOCAL ); + TSLOG_IN(); + + _LIT(KSeparator, "\t"); + + CArrayPtr* iconArray = new ( ELeave ) CAknIconArray( iArray.Count() ); + CleanupStack::PushL( iconArray ); + CDesCArrayFlat* textArray = new ( ELeave ) CDesCArrayFlat( iArray.Count() ); + CleanupStack::PushL( textArray ); + RArray closeItemArray; + CleanupClosePushL(closeItemArray); + + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + RArray rects; + CleanupClosePushL(rects); + rects.ReserveL(KLayoutItemCount); + GetFastSwapAreaRects(rects); + TAknLayoutRect gridItem = rects[1]; + CleanupStack::PopAndDestroy(&rects); + if ( AknLayoutUtils::LayoutMirrored() ) + { + iGrid->SetLayoutL( EFalse, EFalse, ETrue, iArray.Count(), 1, gridItem.Rect().Size(), iGridItemGap ); + } + else + { + iGrid->SetLayoutL( EFalse, ETrue, ETrue, iArray.Count(), 1, gridItem.Rect().Size(), iGridItemGap ); + } + + 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(); + TSLOG2( TSLOG_INFO, "'%S' screenshot handle %d", &appName, h ); + TInt maskh = 0; + CFbsBitmap* mask = 0; + if ( !h ) + { + h = iArray[i]->AppIconBitmapHandle(); + maskh = iArray[i]->AppIconMaskHandle(); + TSLOG1( TSLOG_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* 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 ); + + TSLOG_OUT(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::CopyBitmapL +// Copy and scale. +// -------------------------------------------------------------------------- +// +CFbsBitmap* CTsFastSwapArea::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; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::CountComponentControls +// -------------------------------------------------------------------------- +// +TInt CTsFastSwapArea::CountComponentControls() const + { + return 1; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::ComponentControl +// -------------------------------------------------------------------------- +// +CCoeControl* CTsFastSwapArea::ComponentControl( TInt aIndex ) const + { + if ( aIndex == 0 ) + { + return iGrid; + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::HandleSwitchToBackgroundEvent +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::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; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::HandleSwitchToForegroundEvent +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::HandleSwitchToForegroundEvent() + { + TSLOG_CONTEXT( CTsFastSwapArea::HandleSwitchToForegroundEvent, TSLOG_LOCAL ); + TSLOG_IN(); + + // get the current task list + HandleFswContentChanged(); + // and then start listening for changes + iFSClient->Subscribe( *this ); + + if ( iDeviceState.DeviceType() == CTsDeviceState::EFullTouch ) + { + iGrid->HideHighlight(); + } + else + { + iGrid->ShowHighlight(); + } + + RestoreSelectedIndex(); + UpdateGrid(ETrue, EFalse); + + iRedrawTimer->Cancel(); + iRedrawTimer->After(KRedrawTime); + + // give feedback + LaunchPopupFeedback(); + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::FocusChanged +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::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(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::OfferKeyEventL +// ----------------------------------------------------------------------------- +// +TKeyResponse CTsFastSwapArea::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + iKeyEvent = ETrue; + iGrid->SetTactileFeedbackSupport(EFalse); + // 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; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + iKeyEvent = EFalse; + iGrid->SetTactileFeedbackSupport(ETrue); + if(aPointerEvent.iType == TPointerEvent::EButton1Down) + { + iTapEvent = aPointerEvent; + } + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ConfirmCloseL +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapArea::ConfirmCloseL( TInt aIndex ) + { + HBufC* msg = StringLoader::LoadLC( R_TS_FSW_CONFIRM_CLOSE, + iArray[aIndex]->AppName() ); + iConfirmCloseQuery = CAknQueryDialog::NewL( + CAknQueryDialog::EConfirmationTone ); + iConfirmCloseQuery->SetPromptL( *msg ); + CleanupStack::PopAndDestroy( msg ); + TBool ok = iConfirmCloseQuery->ExecuteLD( + R_TS_FSW_CONFIRM_CLOSE_QUERY ); + iConfirmCloseQuery = 0; + return ok; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::SelectedIndex +// ----------------------------------------------------------------------------- +// +TInt CTsFastSwapArea::SelectedIndex() const + { + return iGrid->CurrentDataIndex(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::SaveSelectedIndex +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::SaveSelectedIndex() + { + iSavedSelectedIndex = SelectedIndex(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::RestoreSelectedIndex +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::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->SetCurrentDataIndex( iSavedSelectedIndex ); + TBool forceRedraw(ETrue); + UpdateGrid(forceRedraw); + } + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ProcessCommandL +// Handle fsw popup commands +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::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; + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::HandleCloseEventL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::HandleCloseEventL(TInt aItemIdx) + { + TryCloseAppWithQueryL( aItemIdx ); + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::HandleDeviceStateChanged +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::HandleDeviceStateChanged( TChangeType aChangeType ) + { + if ( aChangeType == EDeviceType ) + { + CTsDeviceState::TDeviceType state = iDeviceState.DeviceType(); + switch ( state ) + { + case CTsDeviceState::EHybrid: + { + iGrid->SetGridBehaviour( CTsFastSwapGrid::EHybrid ); + } + break; + case CTsDeviceState::EFullTouch: + { + iGrid->SetGridBehaviour( CTsFastSwapGrid::ETouchOnly ); + } + break; + default: + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::TimerCompletedL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::TimerCompletedL( CTsFastSwapTimer* aSource ) + { + if(aSource == iHighlightTimer) + { + iTapEvent.iType = TPointerEvent::EButton1Up; + iGrid->HandlePointerEventL(iTapEvent); + } + else if(aSource == iRedrawTimer) + { + DrawNow(); + } + else if( aSource == iUpdateGridTimer ) + { + UpdateGrid(ETrue, ETrue); + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::PreCreatePopupL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::PreCreatePopupL() + { + if ( !iPopup ) + { + iPopup = CAknStylusPopUpMenu::NewL( this, Rect().iTl ); + HBufC* text = StringLoader::LoadLC( R_TS_FSW_CLOSE ); + iPopup->AddMenuItemL( *text, EFswCmdClose ); + CleanupStack::PopAndDestroy( text ); + text = StringLoader::LoadLC( R_TS_FSW_CLOSE_ALL ); + iPopup->AddMenuItemL( *text, EFswCmdCloseAll ); + CleanupStack::PopAndDestroy( text ); + } + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ShowPopupL +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapArea::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; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::Count +// ----------------------------------------------------------------------------- +// +TInt CTsFastSwapArea::Count() const + { + return iArray.Count(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::SetDataChangeObserver +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::SetDataChangeObserver( + MTsDataChangeObserver* aDcObserver ) + { + iDcObserver = aDcObserver; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::NotifyChange +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::NotifyChange() + { + if ( iDcObserver ) + { + iDcObserver->DataChanged( this, Count() ); + } + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::SwapApplicationOrder +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::SwapApplicationOrder( + RPointerArray& aArray ) + { + for ( TInt i = 0; i < aArray.Count(); ++i ) + { + if( aArray[i]->AppUid() == KAiUid ) + { + CTsFswEntry* homescreenEntry(0); + homescreenEntry = aArray[i]; + aArray.Remove(i); + aArray.Insert(homescreenEntry, KAiPosition); + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::PreferredImageSize +// ----------------------------------------------------------------------------- +// +TSize CTsFastSwapArea::PreferredImageSize() + { + TAknLayoutRect gridImage; + TRAP_IGNORE( + RArray rects; + CleanupClosePushL(rects); + rects.ReserveL(KLayoutItemCount); + GetFastSwapAreaRects(rects); + gridImage = rects[2]; + CleanupStack::PopAndDestroy(&rects); + ); + return gridImage.Rect().Size(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::GridItemCount +// ----------------------------------------------------------------------------- +// +TInt CTsFastSwapArea::GridItemCount() + { + return iGrid->Model()->ItemTextArray()->MdcaCount(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::HandleListBoxEventL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType) + { + if ( aListBox == iGrid ) + { + switch ( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemClicked: + { + SwitchToApp(SelectedIndex()); + } + break; + case EEventPenDownOnItem: + { + iGrid->ShowHighlight(); + } + break; + default: + break; + } + } + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::CalculateSizePreserveRatio +// -------------------------------------------------------------------------- +// +TSize CTsFastSwapArea::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; + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::SelectNextItem +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::SelectNextItem() + { + iKeyEvent = ETrue; + iGrid->SetTactileFeedbackSupport(EFalse); + 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->SetCurrentDataIndex(selectedItem); + UpdateGrid(forceRedraw, animate); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::ShowHiglight +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::ShowHighlight() + { + iGrid->ShowHighlight(); + UpdateGrid(ETrue, EFalse); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::CenterItem +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::CenterItem(TInt aRedrawDelay) + { + if( iMaxItemsOnScreen < GridItemCount() ) + { + TInt visibleItem = ViewToVisibleItem( ViewPos() ); + if(iKeyEvent) + { + visibleItem = SelectedIndex(); + } + if(visibleItem != SelectedIndex()) + { + iGrid->SetCurrentDataIndex( visibleItem ); + DrawNow(); + } + } + + iUpdateGridTimer->Cancel(); + iUpdateGridTimer->After(aRedrawDelay); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::GridWorldSize +// -------------------------------------------------------------------------- +// +TSize CTsFastSwapArea::GridWorldSize() + { + return TSize( GridItemCount() * iGridItemWidth + (GridItemCount() - 1) * iGridItemGap, Rect().Height() ); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::UpdateGrid +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::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(); + } + } + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::HandleAppKey +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::HandleAppKey(TInt aType) + { + if( aType == KAppKeyTypeShort ) + { + if(iGrid->IsHighlightVisible()) + { + SelectNextItem(); + } + else + { + ShowHighlight(); + } + } + else if( aType == KAppKeyTypeLong ) + { + SwitchToApp( SelectedIndex() ); + } + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::MoveOffset +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::MoveOffset(const TPoint& aPoint) + { + TSLOG_CONTEXT( CTsFastSwapArea::MoveOffset, TSLOG_LOCAL ); + TSLOG2_IN("Old position x: %d, y:%d", ViewPos().iX, ViewPos().iY); + TSLOG2_IN("New position x: %d, y:%d", aPoint.iX, aPoint.iY); + TSLOG_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(); + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::Tap +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::TapL(const TPoint& aPoint) + { + if(iGrid->Rect().Contains(aPoint)) + { + //provide tap pointer event to grid + iGrid->HandlePointerEventL(iTapEvent); + iHighlightTimer->Cancel(); + iHighlightTimer->After(KHighlighActivationTime); + } + else + { + //move task switcher to background + iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); + } + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::LongTap +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::LongTapL(const TPoint& aPoint) + { + TInt index(KErrNotFound); + if( iGrid->GridView()->XYPosToItemIndex(aPoint,index) ) + { + iGrid->SetCurrentItemIndex(index); + SaveSelectedIndex(); + if ( !ShowPopupL(iSavedSelectedIndex, aPoint) ) + { + TapL(aPoint); + } + else + { + iGrid->ShowHighlight(); + DrawNow(); + } + } + else + { + TapL(aPoint); + } + } + +// -------------------------------------------------------------------------- +// CTsFastSwapArea::Drag +// -------------------------------------------------------------------------- +// +void CTsFastSwapArea::Drag( + const MAknTouchGestureFwDragEvent& /*aEvent*/) + { + iGrid->SetTactileFeedbackSupport(ETrue); + iGrid->HideHighlight(); + CenterItem( KUpdateGridTime ); + DrawNow(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ViewSize +// ----------------------------------------------------------------------------- +// +TSize CTsFastSwapArea::ViewSize() + { + return TSize(Rect().Width(), Rect().Height()); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::Stop +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::Stop() + { + CenterItem( KUpdateGridTime ); + DrawNow(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ViewSize +// ----------------------------------------------------------------------------- +// +TPoint CTsFastSwapArea::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; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ItemPosition +// ----------------------------------------------------------------------------- +// +TPoint CTsFastSwapArea::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; + retVal.iX += ( GridItemCount() - 1 - aItemIdx ) * iGridItemGap; + } + else // normal layout + { + retVal.iX = iGridItemWidth * aItemIdx - screenMiddleItemOffset; + retVal.iX += iGridItemGap * aItemIdx; + } + 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; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::ViewToVisibleItem +// ----------------------------------------------------------------------------- +// +TInt CTsFastSwapArea::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; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapArea::LaunchPopupFeedback +// ----------------------------------------------------------------------------- +// +void CTsFastSwapArea::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 fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,843 @@ +/* +* 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: Taskswitcher Fast Swap area UI + * +*/ + + +#include +#include +#include +#include +#include + +#include "tsfastswapgrid.h" + + /* ================================================================================ + * CTsFastSwapGrid + * ================================================================================ + */ + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::CTsFastSwapGrid +// ----------------------------------------------------------------------------- +// +CTsFastSwapGrid::CTsFastSwapGrid() +: CAknGrid(), + iCloseIconHitIdx( KErrNotFound ), + iBehaviour( ETouchOnly ), + iHighlightVisible( EFalse ) + { + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::~CTsFastSwapGrid +// ----------------------------------------------------------------------------- +// +CTsFastSwapGrid::~CTsFastSwapGrid() + { + iCloseItems.Close(); + delete iBgContext; + iFullyVisibleItems.Close(); + iPartialVisibleItems.Close(); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::ConstructL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::ConstructL( const CCoeControl* aParent ) + { + iParent = 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 ); + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::HandlePointerEventL( const TPointerEvent &aPointerEvent ) + { + TBool eventHandled( EFalse ); + if ( aPointerEvent.iType == TPointerEvent::EButton1Up || + aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + // 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 ); + CTsGridItemDrawer* itemDrawer = + static_cast( ItemDrawer() ); + TRect closeIconRect = itemDrawer->GetCloseButtonRect( itemRect ); + if ( closeIconRect.Contains( aPointerEvent.iParentPosition ) ) + { + // Close icon hit + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + // pointer down - finish processing but do not forward to grid + eventHandled = ETrue; + } + else + { + // Pointer up + TInt hitDataIdx(hitItem); + if ( AknLayoutUtils::LayoutMirrored() ) + { + // Calculate logical item index + hitDataIdx = Model()->ItemTextArray()->MdcaCount() - 1 - hitItem; + } + iCloseIconHitIdx = hitDataIdx; + 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( hitDataIdx ); + } + ResetCloseHit(); + if ( GridBehaviour() == EHybrid ) + { + ShowHighlight(); + } + else + { + Redraw(); + } + } + } + } + } + + if ( !eventHandled ) + { + CTsGridItemDrawer* itemDrawer = + static_cast( ItemDrawer() ); + if( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + itemDrawer->SetRedrawBackground( ETrue ); + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + itemDrawer->SetRedrawBackground( EFalse ); + } + CAknGrid::HandlePointerEventL( aPointerEvent ); + Redraw(); + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::HandleDeviceStateChanged +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::HandleDeviceStateChanged( TChangeType aChangeType ) + { + if ( aChangeType == ESkin ) + { + LoadCloseIcon(); + } + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::MopSupplyObject +// ----------------------------------------------------------------------------- +// +TTypeUid::Ptr CTsFastSwapGrid::MopSupplyObject( TTypeUid aId ) + { + if ( aId.iUid == MAknsControlContext::ETypeId ) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CCoeControl::MopSupplyObject( aId ); + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::HandleResourceChange +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::HandleResourceChange( TInt aType ) + { + if ( aType != KEikDynamicLayoutVariantSwitch ) + { + CAknGrid::HandleResourceChange( aType ); + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::SizeChanged +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::SizeChanged() + { + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::SetFastSwapGridObserver +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::SetFastSwapGridObserver( MTsFastSwapGridObserver* aObserver ) + { + iFastSwapGridObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::CreateItemDrawerL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::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 ); + CTsGridItemDrawer* itemDrawer = + new ( ELeave ) CTsGridItemDrawer( this, data ); + CleanupStack::PushL( itemDrawer ); + itemDrawer->SetEdgeOffset( leftOffset, rightOffset ); + iItemDrawer = itemDrawer; + CleanupStack::Pop( itemDrawer ); + CleanupStack::Pop( data ); + LoadCloseIcon(); + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::SetCloseItemsL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::SetCloseItemsL( RArray& aItemIndex ) + { + iCloseItems.Close(); + for ( TInt i = 0; i < aItemIndex.Count(); i++ ) + { + iCloseItems.AppendL( aItemIndex[i] ); + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::CanCloseItem +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapGrid::CanCloseItem( TInt aItemIndex ) + { + return iCloseItems.Find(aItemIndex) != KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::ItemCloseHit +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapGrid::IsItemCloseHit( TInt aItemIndex ) + { + return iCloseIconHitIdx == aItemIndex; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::ResetCloseHit +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::ResetCloseHit() + { + iCloseIconHitIdx = KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::SetBehaviour +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::SetGridBehaviour( TFastSwapGridBehaviour aBehaviour ) + { + iBehaviour = aBehaviour; + switch ( iBehaviour ) + { + case ETouchOnly: + { + HideHighlight(); + } + break; + default: + { + ShowHighlight(); + } + break; + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::GridBehaviour +// ----------------------------------------------------------------------------- +// +CTsFastSwapGrid::TFastSwapGridBehaviour CTsFastSwapGrid::GridBehaviour() + { + return iBehaviour; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::ShowHighlight +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::ShowHighlight() + { + if ( !iHighlightVisible ) + { + // Draw highlight + iHighlightVisible = ETrue; + Redraw(); + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::HideHighlight +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::HideHighlight() + { + if ( iHighlightVisible ) + { + iHighlightVisible = EFalse; + Redraw(); + } + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::IsHighlightVisible +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapGrid::IsHighlightVisible() + { + return iHighlightVisible; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::SetVisibleViewRect +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::SetVisibleViewRect( const TRect aRect ) + { + iVisibleViewRect = aRect; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::VisibleViewRect +// ----------------------------------------------------------------------------- +// +TRect CTsFastSwapGrid::VisibleViewRect() + { + TRect retVal; + TRect emptyRect = TRect( 0, 0, 0, 0 ); + if ( iVisibleViewRect == emptyRect ) + { + retVal = Rect(); + } + else + { + retVal = iVisibleViewRect; + } + return retVal; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::LoadCloseIconL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::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 + ); + + TAknLayoutRect gridAppPane; + TAknLayoutRect gridItem; + TAknLayoutRect gridCloseButton; + TAknLayoutRect gridCloseIcon; + TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; + TRect source = iParent ? iParent->Rect() : Rect(); + gridAppPane.LayoutRect( source, + AknLayoutScalable_Apps::tport_appsw_pane( variety ) ); + gridItem.LayoutRect( gridAppPane.Rect(), + AknLayoutScalable_Apps::cell_tport_appsw_pane( variety, 0, 0 ) ); + gridCloseButton.LayoutRect( gridItem.Rect(), + AknLayoutScalable_Apps::bg_button_pane_cp16( variety, 0, 0 )); + gridCloseIcon.LayoutRect( gridItem.Rect(), + AknLayoutScalable_Apps::cell_tport_appsw_pane_g3( variety, 0, 0 )); + AknIconUtils::SetSize( icon, gridCloseIcon.Rect().Size(), EAspectRatioPreserved ); + AknIconUtils::SetSize( mask, gridCloseIcon.Rect().Size(), EAspectRatioPreserved ); + CTsGridItemDrawer* itemDrawer = + static_cast(iItemDrawer); + itemDrawer->SetCloseIcon( icon, mask ); + TRect relGridCloseButton = TRect( TPoint( gridCloseButton.Rect().iTl.iX - gridItem.Rect().iTl.iX, + gridCloseButton.Rect().iTl.iY - gridItem.Rect().iTl.iY), + gridCloseButton.Rect().Size() ); + TRect relGridCloseIconRect = TRect( TPoint( gridCloseIcon.Rect().iTl.iX - gridItem.Rect().iTl.iX, + gridCloseIcon.Rect().iTl.iY - gridItem.Rect().iTl.iY), + gridCloseIcon.Rect().Size() ); + itemDrawer->SetCloseIconRect( relGridCloseButton, relGridCloseIconRect ); + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::Redraw +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::Redraw() + { + DrawDeferred(); + CCoeControl* ctrlToRedraw = Parent(); + if ( ctrlToRedraw ) + { + ctrlToRedraw->DrawDeferred(); + ctrlToRedraw = ctrlToRedraw->Parent(); + if ( ctrlToRedraw ) + { + ctrlToRedraw->DrawNow(); + } + } + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::LaunchTactileFeedback +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::LaunchTactileFeedback() + { + if( !iTactileFeedbackSupport ) + { + return; + } + + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if (feedback) + { + feedback->InstantFeedback(ETouchFeedbackSensitive); + } + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::SetTactileFeedbackSupport +// ----------------------------------------------------------------------------- +// +void CTsFastSwapGrid::SetTactileFeedbackSupport(TBool aSupport) + { + iTactileFeedbackSupport = aSupport; + } + + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::RemoveFromVisibleItems +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapGrid::RemoveFromVisibleItems(TInt aItem) const + { + TBool retVal(EFalse); + TInt idx(0); + idx = iFullyVisibleItems.Find(aItem); + if( idx >= 0) + { + iFullyVisibleItems.Remove(idx); + retVal = ETrue; + } + idx = iPartialVisibleItems.Find( aItem ); + if( idx >= 0) + { + iPartialVisibleItems.Remove(idx); + retVal = ETrue; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::AddToFullyVisibleItems +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapGrid::AddToFullyVisibleItems( TInt aItem ) const + { + TBool retVal(EFalse); + TInt idx(0); + + idx = iPartialVisibleItems.Find(aItem); + if( idx >= 0) + { + iPartialVisibleItems.Remove(idx); + } + idx = iFullyVisibleItems.Find( aItem ); + if( idx == KErrNotFound ) + { + iFullyVisibleItems.Append(aItem); + retVal = ETrue; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CTsFastSwapGrid::MoveToPartialVisibleItems +// ----------------------------------------------------------------------------- +// +TBool CTsFastSwapGrid::MoveToPartialVisibleItems( TInt aItem ) const + { + TInt idx(0); + idx = iFullyVisibleItems.Find(aItem); + if( idx >= 0) + { + iFullyVisibleItems.Remove(idx); + } + idx = iPartialVisibleItems.Find( aItem ); + if( idx == KErrNotFound ) + { + iPartialVisibleItems.Append(aItem); + } + return EFalse; + } + +/* ================================================================================ + * CTsGridItemDrawer + * ================================================================================ + */ + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::CTsGridItemDrawer +// ----------------------------------------------------------------------------- +// +CTsGridItemDrawer::CTsGridItemDrawer( + CTsFastSwapGrid* aGrid, + CFormattedCellListBoxData* aData ) +: CFormattedCellListBoxItemDrawer( aGrid->Model(), + NULL, + aData ), + iGrid( aGrid ) + { + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, iScreenRect); + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::~CTsGridItemDrawer +// ----------------------------------------------------------------------------- +// +CTsGridItemDrawer::~CTsGridItemDrawer() + { + delete iCloseIcon; + delete iCloseIconMask; + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::SetCloseIcon +// ----------------------------------------------------------------------------- +// +void CTsGridItemDrawer::SetCloseIcon( CFbsBitmap* aBmp, CFbsBitmap* aMask ) + { + delete iCloseIcon; + iCloseIcon = aBmp; + delete iCloseIconMask; + iCloseIconMask = aMask; + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::SetCloseIconRect +// ----------------------------------------------------------------------------- +// +void CTsGridItemDrawer::SetCloseIconRect( const TRect& aButtonRect, const TRect& aIconRect ) + { + iCloseButtonRect = aButtonRect; + iCloseIconRect = aIconRect; + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::GetCloseButtonRect +// ----------------------------------------------------------------------------- +// +TRect CTsGridItemDrawer::GetCloseButtonRect( const TRect& aItemRect ) const + { + TRect retVal; + retVal = TRect( TPoint(aItemRect.iTl.iX + iCloseButtonRect.iTl.iX, + aItemRect.iTl.iY + iCloseButtonRect.iTl.iY), + iCloseButtonRect.Size() ); + return retVal; + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::SetEdgeOffset +// ----------------------------------------------------------------------------- +// +void CTsGridItemDrawer::SetEdgeOffset( TInt aLeftOffset, TInt aRightOffset ) + { + iLeftOffset = aLeftOffset; + iRightOffset = aRightOffset; + } + + +// ----------------------------------------------------------------------------- +// CTsTeleportGridItemDrawer::SetRedrawBackground +// ----------------------------------------------------------------------------- +// +void CTsGridItemDrawer::SetRedrawBackground( TBool aEnable ) + { + iRedrawBackground = aEnable; + } + + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::DrawActualItem +// ----------------------------------------------------------------------------- +// + void CTsGridItemDrawer::DrawActualItem( TInt aItemIndex, const TRect& aActualItemRect, + TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aViewIsDimmed, TBool aItemIsSelected ) const + { + TBool feedbackNeed(EFalse);//feedback when item disappear or fully appear + + 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); + + if(IsRectContained( aActualItemRect, drawRect )) + { + feedbackNeed = iGrid->AddToFullyVisibleItems( aItemIndex ); + } + else + { + feedbackNeed = iGrid->MoveToPartialVisibleItems( aItemIndex ); + } + + // Check for item highlight + TBool itemIsCurrent = !iGrid->IsHighlightVisible() ? EFalse : aItemIsCurrent; + + // Draw background if necessary + if ( iRedrawBackground ) + { + CCoeControl* targetCtrlCtx = iGrid->Parent(); + if(targetCtrlCtx) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( targetCtrlCtx ); + AknsDrawUtils::Background( skin, + cc, + targetCtrlCtx, + *iGc, + drawRect ); + } + } + + // Draw item + CFormattedCellListBoxItemDrawer::DrawActualItem(aItemIndex, aActualItemRect, + itemIsCurrent, aViewIsEmphasized, aViewIsDimmed, aItemIsSelected ); + + if ( iGrid->CanCloseItem( aItemIndex ) && iCloseIcon && iCloseIconMask ) + { + TRect closeIconRect = GetCloseButtonRect( aActualItemRect ); + // Draw frame + TRect outerRect = closeIconRect; + TRect innerRect = CalculateInnerButtonRect( outerRect ); + 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( innerRect, iCloseIcon, sourceRect, iCloseIconMask, ETrue ); + } + } + else + { + feedbackNeed = iGrid->RemoveFromVisibleItems(aItemIndex); + } + if(feedbackNeed) + { + iGrid->LaunchTactileFeedback(); + } + } + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::DrawActualItem +// ----------------------------------------------------------------------------- +// +TBool CTsGridItemDrawer::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; + } + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::IsRectContained +// ----------------------------------------------------------------------------- +// +TBool CTsGridItemDrawer::IsRectContained( + const TRect& aRectContained, const TRect& aRectContainig) const + { + TBool retVal(EFalse); + TRect intersectionRect(aRectContainig); + intersectionRect.Intersection( aRectContained ); + if( intersectionRect == aRectContained) + { + retVal = ETrue; + } + return retVal; + } + +// ----------------------------------------------------------------------------- +// CTsGridItemDrawer::CalculateInnerButtonRect +// ----------------------------------------------------------------------------- +// +TRect CTsGridItemDrawer::CalculateInnerButtonRect( const TRect& aOuterRect ) const + { + TRect retVal(aOuterRect); + retVal.iTl.iX += iCloseIconRect.iTl.iX - iCloseButtonRect.iTl.iX; + retVal.iTl.iY += iCloseIconRect.iTl.iY - iCloseButtonRect.iTl.iY; + retVal.iBr.iX -= iCloseButtonRect.iBr.iX - iCloseIconRect.iBr.iX; + retVal.iBr.iY -= iCloseButtonRect.iBr.iY - iCloseIconRect.iBr.iY; + return retVal; + } + + + + /* ================================================================================ + * CTsGridHighlightTimer + * ================================================================================ + */ + +// ----------------------------------------------------------------------------- +// CTsGridHighlightTimer::CTsGridHighlightTimer +// ----------------------------------------------------------------------------- +// +CTsFastSwapTimer::CTsFastSwapTimer( MTsFastSwapTimerObserver& aObserver ) +: CTimer( EPriorityStandard ), + iObserver( &aObserver ) + { + } + + +// ----------------------------------------------------------------------------- +// CTsGridHighlightTimer::CTsGridHighlightTimer +// ----------------------------------------------------------------------------- +// +CTsFastSwapTimer::~CTsFastSwapTimer() + { + Cancel(); + } + + +// ----------------------------------------------------------------------------- +// CTsGridHighlightTimer::ConstructL +// ----------------------------------------------------------------------------- +// +void CTsFastSwapTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + + +// ----------------------------------------------------------------------------- +// CTsGridHighlightTimer::CTsGridHighlightTimer +// ----------------------------------------------------------------------------- +// +void CTsFastSwapTimer::RunL() + { + iObserver->TimerCompletedL(this); + } + + // End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysics.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysics.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,211 @@ +/* +* 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: Application class + * +*/ + + +#include + +#include "tsphysics.h" + +const TInt KSingleItemChangeAnimTime = 1000000; // 1 second +const TInt KAnimationFrameCount = 15; // 15 frames per second + +// ----------------------------------------------------------------------------- +// CTsPhysics::CTsPhysics +// ----------------------------------------------------------------------------- +// +CTsPhysics::CTsPhysics( MAknPhysicsObserver& aObserver ) : + CActive( EPriorityStandard ), iObserver( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::NewLC +// ----------------------------------------------------------------------------- +// +CTsPhysics* CTsPhysics::NewLC( MAknPhysicsObserver& aObserver ) + { + CTsPhysics* self = new ( ELeave ) CTsPhysics( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::NewL +// ----------------------------------------------------------------------------- +// +CTsPhysics* CTsPhysics::NewL( MAknPhysicsObserver& aObserver ) + { + CTsPhysics* self = CTsPhysics::NewLC( aObserver ); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::ConstructL +// ----------------------------------------------------------------------------- +// +void CTsPhysics::ConstructL() + { + User::LeaveIfError( iTimer.CreateLocal() ); + CActiveScheduler::Add( this ); + // Animation parameters + const TInt KInitValue = 0; + iAnimationTickTime = KSingleItemChangeAnimTime / KSingleItemChangeAnimTime; + iPhysicsState = EStopped; + iAnimationTicks = KInitValue; + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::~CTsPhysics +// ----------------------------------------------------------------------------- +// +CTsPhysics::~CTsPhysics() + { + Cancel(); + iTimer.Close(); + iAnimationSteps.Close(); + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::DoCancel +// ----------------------------------------------------------------------------- +// +void CTsPhysics::DoCancel() + { + iTimer.Cancel(); + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::StartPhysics +// ----------------------------------------------------------------------------- +// +void CTsPhysics::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(); + } + } + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::StopPhysics +// ----------------------------------------------------------------------------- +// +void CTsPhysics::StopPhysics() + { + Cancel(); + if ( iPhysicsState == ERunning || iPhysicsState == EFinished ) + { + iObserver.PhysicEmulationEnded(); + } + iPhysicsState = EStopped; + iAnimationTicks = 0; + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::RunL +// ----------------------------------------------------------------------------- +// +void CTsPhysics::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(); + } + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::RunError +// ----------------------------------------------------------------------------- +// +TInt CTsPhysics::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTsPhysics::CalculateAnimationSteps +// ----------------------------------------------------------------------------- +// +TInt CTsPhysics::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 fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysicsengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysicsengine.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,142 @@ +/* +* 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: Taskswitcher physics + * +*/ + +#include + +#include "tsphysicsengine.h" +#include "tsphysics.h" + +// ----------------------------------------------------------------------------- +// CTsPhysicsHandler::CTsPhysicsHandler +// ----------------------------------------------------------------------------- +// +CTsPhysicsEngine::CTsPhysicsEngine() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::~CTsPhysicsEngine +// ----------------------------------------------------------------------------- +// +CTsPhysicsEngine::~CTsPhysicsEngine() + { + delete iTaskswitcherPhysics; + delete iPhysics; + } + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::NewLC +// ----------------------------------------------------------------------------- +// +CTsPhysicsEngine* CTsPhysicsEngine::NewLC( + MAknPhysicsObserver& aPhysicObserver, CCoeControl& aViewControl) + { + CTsPhysicsEngine* self = new (ELeave) CTsPhysicsEngine(); + CleanupStack::PushL(self); + self->ConstructL(aPhysicObserver, aViewControl); + return self; + } + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::NewL +// ----------------------------------------------------------------------------- +// +CTsPhysicsEngine* CTsPhysicsEngine::NewL( + MAknPhysicsObserver& aPhysicObserver, CCoeControl& aViewControl) + { + CTsPhysicsEngine* self = CTsPhysicsEngine::NewLC( + aPhysicObserver, aViewControl); + CleanupStack::Pop(); // self; + return self; + } + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::ConstructL +// ----------------------------------------------------------------------------- +// +void CTsPhysicsEngine::ConstructL(MAknPhysicsObserver& aPhysicObserver, + CCoeControl& aViewControl) + { + iPhysics = CAknPhysics::NewL(aPhysicObserver, &aViewControl);//TODO: + iTaskswitcherPhysics = CTsPhysics::NewL(aPhysicObserver); + } + + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::IsRunning +// ----------------------------------------------------------------------------- +// +TBool CTsPhysicsEngine::IsRunning() const + { + return iPhysics->OngoingPhysicsAction() != CAknPhysics::EAknPhysicsActionNone; + } + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::HandleDragEvent +// ----------------------------------------------------------------------------- +// +void CTsPhysicsEngine::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); + } + } + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::Stop +// ----------------------------------------------------------------------------- +// +void CTsPhysicsEngine::Stop() + { + iPhysics->StopPhysics(); + iTaskswitcherPhysics->StopPhysics(); + } + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::AnimateToTargetL +// ----------------------------------------------------------------------------- +// +void CTsPhysicsEngine::AnimateToTarget(const TPoint& aPoint) + { + iTaskswitcherPhysics->StartPhysics(aPoint); + } + +// ----------------------------------------------------------------------------- +// CTsPhysicsEngine::ReInitPhysicsL +// ----------------------------------------------------------------------------- +// +void CTsPhysicsEngine::ReInitPhysicsL(const TSize& aWorldSize, + const TSize& aViewSize, TBool aLandscape) + { + iPhysics->InitPhysicsL(aWorldSize, aViewSize, aLandscape); + } + +//End file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherapp/src/tstaskswitcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tstaskswitcher.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,44 @@ +/* +* 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: Main cpp of application. Definition of start function + * +*/ + + +#include + +#include "tsapplication.h" + +// ----------------------------------------------------------------------------- +// NewApplication +// Create main class of application +// ----------------------------------------------------------------------------- +// +CApaApplication* NewApplication( ) + { + return new CTsApplication; + } + +// ----------------------------------------------------------------------------- +// E32Main +// Application enty point. +// ----------------------------------------------------------------------------- +// +TInt E32Main( ) + { + return EikStart::RunApplication( NewApplication ); + } + + +// end of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherappecom/data/tsappecom.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherappecom/data/tsappecom.rss Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,47 @@ +/* +* 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: Ecom registration file for alternate fast swap plugin +* +*/ + + +#include +#include "tsappecomconst.hrh" +#include "akncapserveralternatefspluginconst.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = KTsAppPluginDllUid; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = KAknCapServerAlternateFsPluginInterfaceUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KTsAppPluginImplementationUid; + version_no = 1; + display_name = ""; + default_data = ""; + opaque_data = ""; + } + }; + } + }; + } diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherappecom/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherappecom/group/bld.inf Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,29 @@ +/* +* 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: Taskswitcher application ecom plugin +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +tsappecom.mmp + +PRJ_TESTMMPFILES diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherappecom/group/tsappecom.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherappecom/group/tsappecom.mmp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,49 @@ +/* +* 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: Taskswitcher application ecom plugin +* +*/ + + +#include +#include +#include "../inc/tsappecomconst.hrh" + +TARGET tsappecom.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KTsAppPluginDllUid +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE proxy.cpp +SOURCE tsappecom.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../trace + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data +START RESOURCE tsappecom.rss + TARGET tsappecom.rsc + TARGETPATH /resource/plugins +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY apgrfx.lib +LIBRARY cone.lib + +DEBUGLIBRARY flogger.lib + diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherappecom/inc/tsappecom.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherappecom/inc/tsappecom.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,108 @@ +/* +* 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: Taskswitcher application ecom plugin +* +*/ + + +#ifndef TSAPPECOM_H +#define TSAPPECOM_H + +#include +#include + +/** + * Taskswitcher ecom plugin which is loaded by AknCapServer as an alternate Fast + * Swap. Uses P&S to show/dismiss the Taskswitcher application. + */ +class CTsEcomPlugin : public CAknCapAppServerAlternateFs + { +public: + + /** + * Symbian two phased constructors. + * + * @return CTsEcomPlugin pointer. + */ + static CTsEcomPlugin* NewL(); + + /** + * Destructor. + */ + ~CTsEcomPlugin(); + +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(). + */ + CTsEcomPlugin(); + + /** + * 2nd phase construction, called by NewL(). + */ + void ConstructL(); + + /** + * Sets the P&S property to given value. + * + * @param aValue Value + */ + void SetTaskswitcherStateProperty( TInt aValue ); + + /** + * Defines the P&S property. + */ + void DefineTaskswitcherStateProperty(); + + }; + +#endif // TSAPPECOM_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherappecom/inc/tsappecomconst.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherappecom/inc/tsappecomconst.hrh Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Taskswitcher application ecom plugin UIDs +* +*/ + + +#ifndef TSAPPECOMCONST_HRH +#define TSAPPECOMCONST_HRH + +#define KTsAppPluginDllUid 0x2001FD72 +#define KTsAppPluginImplementationUid 0x2001FD72 + +#endif // TSAPPECOMCONST_HRH diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherappecom/inc/tsappecomlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherappecom/inc/tsappecomlogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Defines logs for tsappecom +* +*/ + + +#ifdef _DEBUG +_LIT( KTsLogFile, "tsappecom.txt" ); +_LIT( KTsLogPath, "taskswitcher" ); +#define _TSLOG_LOG_COMPONENT_ID KTsAppPluginDllUid + +#endif +#include "tslogging.h" diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherappecom/src/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherappecom/src/proxy.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,44 @@ +/* +* 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: Taskswitcher application ecom plugin +* +*/ + + +// INCLUDE FILES +#include +#include + +#include "tsappecom.h" +#include "tsappecomconst.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( + KTsAppPluginImplementationUid, + CTsEcomPlugin::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 fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/taskswitcherappecom/src/tsappecom.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/taskswitcherappecom/src/tsappecom.cpp Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,252 @@ +/* +* 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: Taskswitcher application ecom plugin + * +*/ + + +#include +#include +#include + +#include "tsappecomconst.hrh" +#include "tsappecom.h" + +#include "tsappecomlogging.h" + +// AknCapServer UID, used for P&S category +const TUid KTaskswitcherStateCategory = { 0x10207218 }; + +// Taskswitcher UI, used as P&S key +const TInt KTaskswitcherStateKey = 0x20016BF0; + +// Values for Taskswitcher launching P&S +const TInt KTaskswitcherBackgroundValue = 1; +const TInt KTaskswitcherForegroundValue = KTaskswitcherBackgroundValue << 1; +const TInt KTaskswitcherShortAppKeyPressed = KTaskswitcherForegroundValue << 1; +const TInt KTaskswitcherLongAppKeyPressed = KTaskswitcherShortAppKeyPressed << 1; + +// Taskswitcher application UID, for checking if taskswitcher is running +const TUid KTaskswitcherAppUidValue = { 0x20016BF0 }; + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::CTsEcomPlugin() +// Default constructor for first phase construction. +// --------------------------------------------------------------------------- +// +CTsEcomPlugin::CTsEcomPlugin() + { + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::NewL() +// Standard NewL. +// --------------------------------------------------------------------------- +// +CTsEcomPlugin* CTsEcomPlugin::NewL() + { + CTsEcomPlugin* self = new ( ELeave ) CTsEcomPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::ConstructL() +// 2nd phase construction. +// --------------------------------------------------------------------------- +// +void CTsEcomPlugin::ConstructL() + { + TSLOG_CONTEXT( CTsEcomPlugin::ConstructL, TSLOG_LOCAL ); + TSLOG_IN(); + + DefineTaskswitcherStateProperty(); + + TSLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::~CTsEcomPlugin() +// Destructor. +// --------------------------------------------------------------------------- +// +CTsEcomPlugin::~CTsEcomPlugin() + { + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::Show +// --------------------------------------------------------------------------- +// +void CTsEcomPlugin::Show() + { + TSLOG_CONTEXT( CTsEcomPlugin::Show, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTaskswitcherStateCategory, KTaskswitcherStateKey, value ); + value &= ~KTaskswitcherBackgroundValue; + value |= KTaskswitcherForegroundValue; + SetTaskswitcherStateProperty( value ); + + TSLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::Dismiss +// --------------------------------------------------------------------------- +// +void CTsEcomPlugin::Dismiss() + { + TSLOG_CONTEXT( CTsEcomPlugin::Dismiss, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTaskswitcherStateCategory, KTaskswitcherStateKey, value ); + value &= ~KTaskswitcherForegroundValue; + value |= KTaskswitcherBackgroundValue; + SetTaskswitcherStateProperty( value ); + + TSLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::HandleLongAppKeyPress +// --------------------------------------------------------------------------- +// +void CTsEcomPlugin::HandleLongAppKeyPress() + { + TSLOG_CONTEXT( CTsEcomPlugin::Show, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTaskswitcherStateCategory, KTaskswitcherStateKey, value ); + value &= ~KTaskswitcherShortAppKeyPressed; + value |= KTaskswitcherLongAppKeyPressed; + SetTaskswitcherStateProperty( value ); + + TSLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::HandleShortAppKeyPress +// --------------------------------------------------------------------------- +// +void CTsEcomPlugin::HandleShortAppKeyPress() + { + TSLOG_CONTEXT( CTsEcomPlugin::Dismiss, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTaskswitcherStateCategory, KTaskswitcherStateKey, value ); + value &= ~KTaskswitcherLongAppKeyPressed; + value |= KTaskswitcherShortAppKeyPressed; + SetTaskswitcherStateProperty( value ); + + TSLOG_OUT(); + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::IsVisible +// --------------------------------------------------------------------------- +// +TBool CTsEcomPlugin::IsVisible() + { + TSLOG_CONTEXT( CTsEcomPlugin::IsVisible, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt value( 0 ); + RProperty::Get( KTaskswitcherStateCategory, KTaskswitcherStateKey, value ); + if ( value & KTaskswitcherForegroundValue ) + { + TSLOG_OUT(); + return ETrue; + } + TSLOG_OUT(); + return EFalse; + } + +// --------------------------------------------------------------------------- +// CTsEcomPlugin::IsReady +// --------------------------------------------------------------------------- +// +TBool CTsEcomPlugin::IsReady() + { + TSLOG_CONTEXT( CTsEcomPlugin::IsReady, TSLOG_LOCAL ); + TSLOG_IN(); + + TBool ret = EFalse; + CEikonEnv* eikonEnv = CEikonEnv::Static(); + + if ( eikonEnv ) + { + TApaTaskList taskList( eikonEnv->WsSession() ); + TApaTask task = taskList.FindApp( KTaskswitcherAppUidValue ); + + if ( task.Exists() ) + { + ret = ETrue; + } + } + + TSLOG1_OUT( "IsReady returns: %d", ret ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CTsEcomPlugin::SetTaskswitcherStateProperty +// ----------------------------------------------------------------------------- +// +void CTsEcomPlugin::SetTaskswitcherStateProperty( TInt aValue ) + { + TSLOG_CONTEXT( CTsEcomPlugin::SetTaskswitcherShowProperty, TSLOG_LOCAL ); + TSLOG_IN(); + + if ( RProperty::Set( + KTaskswitcherStateCategory, KTaskswitcherStateKey, aValue ) != KErrNone ) + { + DefineTaskswitcherStateProperty(); + TInt error = + RProperty::Set( KTaskswitcherStateCategory, KTaskswitcherStateKey, aValue ); + if ( error != KErrNone ) + { + TSLOG1( TSLOG_INFO, "RProperty::Set Error: %d", error ); + } + } + + TSLOG_OUT(); + } + +// ----------------------------------------------------------------------------- +// CTsEcomPlugin::DefineTaskswitcherStateProperty +// ----------------------------------------------------------------------------- +// +void CTsEcomPlugin::DefineTaskswitcherStateProperty() + { + TSLOG_CONTEXT( CTsEcomPlugin::DefineTaskswitcherShowProperty, TSLOG_LOCAL ); + TSLOG_IN(); + + TInt error = RProperty::Define( + KTaskswitcherStateCategory, KTaskswitcherStateKey, RProperty::EInt ); + if ( error != KErrNone ) + { + TSLOG1( TSLOG_INFO, "RProperty::Define Error: %d", error ); + } + + TSLOG_OUT(); + } + +// End of file diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/trace/tslogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/trace/tslogging.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,218 @@ +/* +* 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: Defines all available logging macros. +* +*/ + + +#ifndef TSLOGLOGUTILS_H +#define TSLOGLOGUTILS_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( KTsLogFile, "text_file_for_logging.txt" ); + * _LIT( KTsLogPath, "folder_for_text_file" ); + * #define _TSLOG_LOG_COMPONENT_ID + * + * #include "tslogging.h" + * + * @/code + * + * KTsLogFile : This is the name of the file, where all the logs for + * this components are being written. + * + * KTsLogPath : This is the folder name under c:\logs, where the file + * is to be stored. For example, if KTsLogPath is "test", + * log file is created into folder c:\logs\test. + * + * _TSLOG_LOG_COMPONENT_ID : Unique number id of the component. This is + * for filtering purposes. + * + * _TSLOG_RDEBUG : When defined tracing instead of file logging. + * Default is for file logging. + * + * -------------------------------------------------------------------------- + * + * USING LOGGING: + * + * Basically the use is simple, register function use with TSLOG_CONTEXT, + * then log function enter by any TSLOG_IN -macro, then possibly use TSLOG + * -macros for function logging and finally TSLOG_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. + * TSLOG_CONTEXT( Example, TSLOG_LOCAL ); + * + * // Indicate we are entering the function. + * TSLOG_IN1( "aSomething contains value %d", aSomething ); + * + * // Your buggy code... + * + * // Before leaving, indicate function execution has ended. + * TSLOG_OUT(); + * + * return 0; + * } + * @/code + */ + +#include +#include + +#include "tslogutils.h" + +#define TSLOG_API 0 +#define TSLOG_LOCAL 1 + +#define TSLOG_INFO 0 +#define TSLOG_WARNING 1 +#define TSLOG_ERROR 2 + +#define TSLOG_ASSERT(_assertion) __TSLOG_ASSERT_DBG(_assertion) +#define TSLOG_TRACE_ASSERT(_assertion) __ASSERT_DEBUG((_assertion), User::Invariant() ) + +#ifdef _DEBUG + +/***************************************************************************** + LOGGING MACROS - LOGGING ON +*****************************************************************************/ + + /** + * Context initialization + * NOTE: TSLOG_STATIC_CONTEXT is meant for static methods. + * + * @param _fn Name of the function. + * @param _vis Visibility for the client, use values TSLOG_API or TSLOG_LOCAL + * @param _thdId For static functions, thread id can be given here. + */ + #define TSLOG_CONTEXT(_fn, _vis ) _TTsLogContext _dc((TText*)L ## #_fn, _TSLOG_LOG_COMPONENT_ID, _vis, (TUint)this, RProcess().SecureId().iId ) + #define TSLOG_STATIC_CONTEXT(_fn, _vis, _thdId) _TTsLogContext _dc((TText*)L ## #_fn, _TSLOG_LOG_COMPONENT_ID, _vis, _thdId, RProcess().SecureId().iId ) + + /** + * Entering function + * + * @param string Custom text. Example: TSLOG_IN0( "Yeah!!!" ); + * @param p1 - p5 For multiple variables in same string. + */ + #define TSLOG_IN() do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG0_IN(string) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG1_IN(string, p1) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG2_IN(string, p1, p2) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG3_IN(string, p1, p2, p3) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG4_IN(string, p1, p2, p3, p4) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG5_IN(string, p1, p2, p3, p4, p5) do { _CHK_MULTIIN(); _TSLOGPRINTER(_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 TSLOG_OUT() do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG0_OUT(string) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG1_OUT(string, p1) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG2_OUT(string, p1, p2) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG3_OUT(string, p1, p2, p3) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG4_OUT(string, p1, p2, p3, p4) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG5_OUT(string, p1, p2, p3, p4, p5) do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG0_RET(val, fmtstr) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG1_RET(val, fmtstr, p1) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG2_RET(val, fmtstr, p1, p2) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG3_RET(val, fmtstr, p1, p2, p3) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG4_RET(val, fmtstr, p1, p2, p3, p4) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) do { do { _DOINCHK(); _CHK_MULTIOUT(); _TSLOGPRINTER(_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 TSLOG0(level, string) do { _DOINCHK(); _TSLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); } while(0) + #define TSLOG1(level, string, p1) do { _DOINCHK(); _TSLOGPRINTER(_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 TSLOG2(level, string, p1, p2) do { _DOINCHK(); _TSLOGPRINTER(_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 TSLOG3(level, string, p1, p2, p3) do { _DOINCHK(); _TSLOGPRINTER(_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 TSLOG4(level, string, p1, p2, p3, p4) do { _DOINCHK(); _TSLOGPRINTER(_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 TSLOG5(level, string, p1, p2, p3, p4, p5) do { _DOINCHK(); _TSLOGPRINTER(_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 __TSLOG_ASSERT_DBG( _assertion ) do { if( _assertion ) { break; } TFileName file; file.Copy( _L8( __FILE__ ) ); _TSLOGPRINTER(_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 __TSLOG_TRACE_ASSERT_DBG(_assertion, _textToPrint, _panicCode) do { if (_assertion) { break; } _TSLOGPRINTER(_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 TSLOG_TRAPHANDLER() _TTsLogTrapHandler _traceTrapHandler; _traceTrapHandler.oldHandler = User::SetTrapHandler(&_traceTrapHandler) + +/***************************************************************************** + LOGGING MACROS - NO LOGGING +*****************************************************************************/ +#else // _DEBUG + + #define TSLOG_CONTEXT(_fn, _vis ) + #define TSLOG_STATIC_CONTEXT(_fn, _vis, _thdId) + + #define TSLOG_IN() + #define TSLOG0_IN(string) + #define TSLOG1_IN(string, p1) + #define TSLOG2_IN(string, p1, p2) + #define TSLOG3_IN(string, p1, p2, p3) + #define TSLOG4_IN(string, p1, p2, p3, p4) + #define TSLOG5_IN(string, p1, p2, p3, p4, p5) + + #define TSLOG_OUT() + #define TSLOG0_OUT(string) + #define TSLOG1_OUT(string, p1) + #define TSLOG2_OUT(string, p1, p2) + #define TSLOG3_OUT(string, p1, p2, p3) + #define TSLOG4_OUT(string, p1, p2, p3, p4) + #define TSLOG5_OUT(string, p1, p2, p3, p4, p5) + + #define TSLOG0_RET(val, fmtstr) return val + #define TSLOG1_RET(val, fmtstr, p1) return val + #define TSLOG2_RET(val, fmtstr, p1, p2) return val + #define TSLOG3_RET(val, fmtstr, p1, p2, p3) return val + #define TSLOG4_RET(val, fmtstr, p1, p2, p3, p4) return val + #define TSLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) return val + + #define TSLOG0(level, string) + #define TSLOG1(level, string, p1) + #define TSLOG2(level, string, p1, p2) + #define TSLOG3(level, string, p1, p2, p3) + #define TSLOG4(level, string, p1, p2, p3, p4) + #define TSLOG5(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 __TSLOG_ASSERT_DBG(_assertion) + #define __TRACE_ASSERT_DBG(_assertion, _message, _panicCode ) + +#endif // _DEBUG + +#endif // TSLOGLOGUTILS_H + +// End of File diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/taskswitcherui/trace/tslogutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskswitcher/taskswitcherui/trace/tslogutils.h Tue Jan 26 11:48:23 2010 +0200 @@ -0,0 +1,211 @@ +/* +* 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: Logging behavior +* +*/ + + +#ifndef TSLOGUTILS_H +#define TSLOGUTILS_H + +/** + * NOTE: This file contains the logic related to logging. Change only if you + * know what you're doing. + */ + + + + + + + + + + +#ifdef _DEBUG + +#include +#include + +static const TUint TSLOGERR = 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 _TSLOG_UNCONTROLLED_INPUT_MSG L"%s%d[%x:%x:%x]>%s UNCONTROLLED ENTRY!" +#define _TSLOG_MULTIPLE_ENTRY_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL ENTRY!" +#define _TSLOG_UNCONTROLLER_EXIT_MSG L"%s%d[%x:%x:%x]<%s UNCONTROLLED EXIT!" +#define _TSLOG_MULTIPLE_EXIT_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL EXIT!" +#define _TSLOG_TRAP_HARNESS_ENTRY L"_D%d[%x:%x:%x]TraceFramework: Entering trap harness" +#define _TSLOG_TRAP_HARNESS_EXIT L"_D%d[%x:%x:%x]TraceFramework: Exiting trap harness" +#define _TSLOG_TRAP_HARNESS_LEAVE L"_D%d[%x:%x:%x]TraceFramework: ---------- LEAVE OCCURRED !!! ---------- " +#define _TSLOG_API_PREFIX L"_A" +#define _TSLOG_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: +* - _DEBUG +* - With this flag undefined, all traces are disabled +* - __KERNEL_MODE__ +* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) +* - DISABLE_SYNTAX_CHECK +* - 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 _TSLOG_RDEBUG + #define _IT(a) (TPtrC((const TText *)(a))) + #define _TSLOGPRINTER RDebug::Print + +/** For filedebug */ +#else // _TSLOG_RDEBUG + + /** Includes */ + #include + #include + #include + #include + +// both of headers defines KLogBufferSize +#ifndef __COMMSDEBUGUTILITY_H__ + #include +#endif + + #define _IT(a) KTsLogPath, KTsLogFile, EFileLoggingModeAppend, (TPtrC((const TText *)(a))) + #define _TSLOGPRINTER RFileLogger::WriteFormat +#endif // _TSLOG_RDEBUG + +class _TTsLogContext + { + public: + _TTsLogContext( + 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*)_TSLOG_API_PREFIX : (TText*)_TSLOG_LOCAL_PREFIX)), + iCategory(_category) + #ifndef DISABLE_SYNTAX_CHECK + ,outOk(EFalse), inOk(EFalse) + #endif + { + } + ~_TTsLogContext() + { + #ifndef DISABLE_SYNTAX_CHECK + do + { + DoInChk(); + if (!outOk) + { + _TSLOGPRINTER(_IT(_TSLOG_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) + { + _TSLOGPRINTER(_IT(_TSLOG_UNCONTROLLED_INPUT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + inOk = ETrue; + } + } + + inline void ChkMultiIn() + { + if (inOk) + { + _TSLOGPRINTER(_IT(_TSLOG_MULTIPLE_ENTRY_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + inline void ChkMultiOut() + { + if (outOk) + { + _TSLOGPRINTER(_IT(_TSLOG_MULTIPLE_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + TBool inOk; + TBool outOk; + #endif // DISABLE_SYNTAX_CHECK + }; + +class _TTsLogTrapHandler: public TTrapHandler + { + public: + + _TTsLogTrapHandler(_TTsLogContext& _context) : _dc( _context ) + { + RThread me; + iThdId = (TInt)me.Id(); + } + void Trap() + { + _TSLOGPRINTER(_IT(_TSLOG_TRAP_HARNESS_ENTRY), 0, TSLOGERR, iThdId, this); + oldHandler->Trap(); + } + void UnTrap() + { + _TSLOGPRINTER(_IT(_TSLOG_TRAP_HARNESS_EXIT), 0, TSLOGERR, iThdId, this); + oldHandler->UnTrap(); + } + void Leave(TInt aValue) + { + _TSLOGPRINTER(_IT(_TSLOG_TRAP_HARNESS_LEAVE), 0, TSLOGERR, iThdId, this); + oldHandler->Leave(aValue); + } + TTrapHandler* oldHandler; + private: + _TTsLogContext& _dc; + TInt iThdId; + }; + +#endif // _DEBUG + +#endif // TSLOGUTILS_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/group/bld.inf --- a/taskswitcher/teleportui/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* ============================================================================ -* 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/data/hgteleport.rss --- a/taskswitcher/teleportui/hgteleportapp/data/hgteleport.rss Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,283 +0,0 @@ -/* -* ============================================================================ -* 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 -#include -#include -#include -#include - -#include -#include - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/data/hgteleport_reg.rss --- a/taskswitcher/teleportui/hgteleportapp/data/hgteleport_reg.rss Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* ============================================================================ -* 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 -#include - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/group/backup_registration.xml --- a/taskswitcher/teleportui/hgteleportapp/group/backup_registration.xml Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/group/bld.inf --- a/taskswitcher/teleportui/hgteleportapp/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* ============================================================================ -* 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/group/hgteleportapp.mmp --- a/taskswitcher/teleportui/hgteleportapp/group/hgteleportapp.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* ============================================================================ -* 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 -#include -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportapplication.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportapplication.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportapplogging.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportapplogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportappui.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportappui.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -#include -#include - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportappview.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportappview.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -/* - * ============================================================================ - * 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 -#include -#include -#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& 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportcommands.hrh --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportcommands.hrh Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* ============================================================================== -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportdatachangeobserver.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportdatachangeobserver.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* - * ============================================================================ - * 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 - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportdevicestate.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportdevicestate.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,228 +0,0 @@ -/* - * ============================================================================ - * 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 -#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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportdocument.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportdocument.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleporteventcontroler.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleporteventcontroler.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleporteventcontrolerobserver.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleporteventcontrolerobserver.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -/** - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportfastswaparea.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportfastswaparea.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,459 +0,0 @@ -/* - * ============================================================================ - * 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 -#include -#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& 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& 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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportfastswapgrid.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportfastswapgrid.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,274 +0,0 @@ -/* - * ============================================================================ - * 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 -#include -#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& 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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysics.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysics.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -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 iAnimationSteps; - - }; - -#endif // HGTELEPORTPHYSICS_H diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysicsengine.h --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysicsengine.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* - * ============================================================================ - * 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 -#include -// 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/inc/hgteleportuid.hrh --- a/taskswitcher/teleportui/hgteleportapp/inc/hgteleportuid.hrh Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* - * ============================================================================ - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/loc/taskswitcher.loc --- a/taskswitcher/teleportui/hgteleportapp/loc/taskswitcher.loc Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleport.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleport.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * ============================================================================ - * 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 - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportapplication.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportapplication.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * ============================================================================ - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportappui.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportappui.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,582 +0,0 @@ -/* - * ============================================================================ - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// 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(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(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* 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( 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportappview.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportappview.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,734 +0,0 @@ - /* - * ============================================================================ - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#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( 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 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& 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 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( 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportdevicestate.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportdevicestate.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,274 +0,0 @@ -/* - * ============================================================================ - * 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 -#include - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportdocument.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportdocument.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* - * ============================================================================ - * 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 - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleporteventcontroler.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleporteventcontroler.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* - * ============================================================================ - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportfastswaparea.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportfastswaparea.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1642 +0,0 @@ -/* - * ============================================================================ - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#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 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& 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( 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* iconArray = new ( ELeave ) CAknIconArray( iArray.Count() ); - CleanupStack::PushL( iconArray ); - CDesCArrayFlat* textArray = new ( ELeave ) CDesCArrayFlat( iArray.Count() ); - CleanupStack::PushL( textArray ); - RArray closeItemArray; - CleanupClosePushL(closeItemArray); - - TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; - RArray 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* 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& 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 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportfastswapgrid.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportfastswapgrid.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,625 +0,0 @@ -/* - * ============================================================================ - * 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 -#include -#include -#include -#include - -#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( 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& 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(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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportphysics.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportphysics.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ -/* - * ============================================================================ - * 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 - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportapp/src/hgteleportphysicsengine.cpp --- a/taskswitcher/teleportui/hgteleportapp/src/hgteleportphysicsengine.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* - * ============================================================================ - * 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 - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportappecom/data/hgteleportappecom.rss --- a/taskswitcher/teleportui/hgteleportappecom/data/hgteleportappecom.rss Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* ============================================================================ -* 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 -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportappecom/group/bld.inf --- a/taskswitcher/teleportui/hgteleportappecom/group/bld.inf Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* ============================================================================ -* 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 - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -PRJ_MMPFILES -hgteleportappecom.mmp - -PRJ_TESTMMPFILES diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportappecom/group/hgteleportappecom.mmp --- a/taskswitcher/teleportui/hgteleportappecom/group/hgteleportappecom.mmp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* ============================================================================ -* 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 -#include -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecom.h --- a/taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecom.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* ============================================================================ -* 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 -#include - -/** - * 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecomconst.hrh --- a/taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecomconst.hrh Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecomlogging.h --- a/taskswitcher/teleportui/hgteleportappecom/inc/hgteleportappecomlogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportappecom/src/hgteleportappecom.cpp --- a/taskswitcher/teleportui/hgteleportappecom/src/hgteleportappecom.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,253 +0,0 @@ -/* - * =========================================================================== - * 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 -#include -#include - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/hgteleportappecom/src/proxy.cpp --- a/taskswitcher/teleportui/hgteleportappecom/src/proxy.cpp Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* ============================================================================== -* 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 -#include - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/inc/hggraphicids.h --- a/taskswitcher/teleportui/inc/hggraphicids.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* ============================================================================== -* 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 - -/** - * Logical IDs for all icons used in Teleport. - */ -enum THgGraphicId - { - EHgGraphicIdLAST - }; - -#endif // __HGGRAPHICIDS_H__ diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/inc/hggraphictab.h --- a/taskswitcher/teleportui/inc/hggraphictab.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* ============================================================================== -* 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 - -#include -#include // skinned icons -#include // 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/rom/hgteleport.iby --- a/taskswitcher/teleportui/rom/hgteleport.iby Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/rom/hgteleportresources.iby --- a/taskswitcher/teleportui/rom/hgteleportresources.iby Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* ============================================================================ -* 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/sis/stubs/createstubs.bat --- a/taskswitcher/teleportui/sis/stubs/createstubs.bat Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -for %%f in (*.pkg) do makesis -s %%f diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/sis/stubs/teleport_stub.pkg --- a/taskswitcher/teleportui/sis/stubs/teleport_stub.pkg Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -; ------------------------------------------------------------------------------ -; 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/sis/stubs/teleport_stub.sis Binary file taskswitcher/teleportui/sis/stubs/teleport_stub.sis has changed diff -r fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/sis/teleport.pkg --- a/taskswitcher/teleportui/sis/teleport.pkg Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -; ------------------------------------------------------------------------------ -; 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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/trace/hglogging.h --- a/taskswitcher/teleportui/trace/hglogging.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ -/* -* ============================================================================== -* 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 - * - * #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 -#include - -#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 fb3763350a08 -r 4d54b72983ae taskswitcher/teleportui/trace/hglogutils.h --- a/taskswitcher/teleportui/trace/hglogutils.h Fri Jan 22 09:35:14 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +0,0 @@ -/* -* ============================================================================== -* 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 -#include - -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: -* - _DEBUG -* - With this flag undefined, all traces are disabled -* - __KERNEL_MODE__ -* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) -* - DISABLE_SYNTAX_CHECK -* - 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 - #include - #include - #include - #include - - #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